@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
@@ -14,13 +14,12 @@
14
14
  *
15
15
  * */
16
16
  'use strict';
17
- import Utils from '../../../Core/Utilities.js';
18
17
  import ColumnFiltering from './Actions/ColumnFiltering/ColumnFiltering.js';
19
18
  import Templating from '../../../Core/Templating.js';
20
19
  import TextContent from './CellContent/TextContent.js';
21
20
  import Globals from '../Globals.js';
22
21
  import GridUtils from '../GridUtils.js';
23
- const { defined, fireEvent } = Utils;
22
+ import { fireEvent } from '../../../Shared/Utilities.js';
24
23
  const { createOptionsProxy } = GridUtils;
25
24
  /* *
26
25
  *
@@ -50,6 +49,10 @@ export class Column {
50
49
  */
51
50
  constructor(viewport, id, index) {
52
51
  var _a;
52
+ /**
53
+ * Type of the data in the column.
54
+ */
55
+ this.dataType = 'string';
53
56
  /**
54
57
  * The cells of the column.
55
58
  */
@@ -58,8 +61,6 @@ export class Column {
58
61
  this.id = id;
59
62
  this.index = index;
60
63
  this.viewport = viewport;
61
- this.loadData();
62
- this.dataType = this.assumeDataType();
63
64
  // Populate column options map if not exists, to prepare option
64
65
  // references for each column.
65
66
  if (grid.options && !grid.columnOptionsMap?.[id]) {
@@ -74,18 +75,31 @@ export class Column {
74
75
  if (this.options.filtering?.enabled) {
75
76
  this.filtering = new ColumnFiltering(this);
76
77
  }
77
- fireEvent(this, 'afterInit');
78
78
  }
79
79
  /* *
80
80
  *
81
81
  * Methods
82
82
  *
83
83
  * */
84
+ /**
85
+ * Initializes the column data-related properties.
86
+ */
87
+ async init() {
88
+ this.loadData();
89
+ this.dataType = await this.assumeDataType();
90
+ fireEvent(this, 'afterInit');
91
+ }
84
92
  /**
85
93
  * Loads the data of the column from the viewport's data table.
86
94
  */
87
95
  loadData() {
88
- this.data = this.viewport.dataTable.getColumn(this.id, true);
96
+ const dp = this.viewport.grid.dataProvider;
97
+ if (dp && 'getDataTable' in dp) {
98
+ this.data = dp.getDataTable(true)?.getColumn(this.id, true);
99
+ }
100
+ else {
101
+ delete this.data;
102
+ }
89
103
  }
90
104
  /**
91
105
  * Creates a cell content instance.
@@ -101,40 +115,15 @@ export class Column {
101
115
  * Assumes the data type of the column based on the options or data in the
102
116
  * column if not specified.
103
117
  */
104
- assumeDataType() {
118
+ async assumeDataType() {
105
119
  const { grid } = this.viewport;
120
+ const dp = grid.dataProvider;
106
121
  const type = grid.columnOptionsMap?.[this.id]?.options.dataType ??
107
122
  grid.options?.columnDefaults?.dataType;
108
123
  if (type) {
109
124
  return type;
110
125
  }
111
- if (!this.data) {
112
- return 'string';
113
- }
114
- if (!Array.isArray(this.data)) {
115
- // Typed array
116
- return 'number';
117
- }
118
- for (let i = 0, iEnd = Math.min(this.data.length, 30); i < iEnd; ++i) {
119
- if (!defined(this.data[i])) {
120
- // If the data is null or undefined, we should look
121
- // at the next value to determine the type.
122
- continue;
123
- }
124
- switch (typeof this.data[i]) {
125
- case 'number':
126
- return 'number';
127
- case 'boolean':
128
- return 'boolean';
129
- default:
130
- return 'string';
131
- }
132
- }
133
- // eslint-disable-next-line no-console
134
- console.warn(`Column "${this.id}" contains too few data points with ` +
135
- 'unambiguous types to correctly determine its dataType. It\'s ' +
136
- 'recommended to set the `dataType` option for it.');
137
- return 'string';
126
+ return (await dp?.getColumnDataType(this.id)) ?? 'string';
138
127
  }
139
128
  /**
140
129
  * Registers a cell in the column.
@@ -42,15 +42,16 @@ class IndependentResizingMode extends ResizingMode {
42
42
  // Set the width of the resized column.
43
43
  const width = this.columnWidths[column.id] = Math.round(Math.max((resizer.columnStartWidth || 0) + diff, ResizingMode.getMinWidth(column)) * 10) / 10;
44
44
  this.columnWidthUnits[column.id] = 0; // Set to px
45
- // Change width units of all columns on the right to px.
45
+ // Change width units of all columns to px.
46
46
  const vp = this.viewport;
47
- const colIndex = column.index;
48
- for (let i = colIndex; i < vp.columns.length; ++i) {
49
- const rightCol = vp.columns[i];
50
- const rcWidth = this.columnWidths[rightCol.id] =
51
- rightCol.getWidth();
52
- this.columnWidthUnits[rightCol.id] = 0; // Set to px
53
- rightCol.setOptions({ width: rcWidth });
47
+ for (let i = 0; i < vp.columns.length; ++i) {
48
+ const col = vp.columns[i];
49
+ if (col.id === column.id) {
50
+ continue;
51
+ }
52
+ const colWidth = this.columnWidths[col.id] = col.getWidth();
53
+ this.columnWidthUnits[col.id] = 0; // Set to px
54
+ col.setOptions({ width: colWidth });
54
55
  }
55
56
  column.setOptions({ width });
56
57
  }
@@ -13,8 +13,7 @@
13
13
  *
14
14
  * */
15
15
  'use strict';
16
- import U from '../../../../Core/Utilities.js';
17
- const { getStyle, defined } = U;
16
+ import { defined, getStyle } from '../../../../Shared/Utilities.js';
18
17
  /* *
19
18
  *
20
19
  * Class
@@ -86,7 +85,9 @@ class ResizingMode {
86
85
  */
87
86
  loadColumn(column) {
88
87
  const rawWidth = column.options.width;
89
- if (!rawWidth) {
88
+ if (!defined(rawWidth) || rawWidth === 'auto') {
89
+ delete this.columnWidths[column.id];
90
+ delete this.columnWidthUnits[column.id];
90
91
  return;
91
92
  }
92
93
  let value;
@@ -1,3 +1,4 @@
1
+ import type Grid from '../../../Grid';
1
2
  import type Toolbar from '../../../UI/Toolbar';
2
3
  import type Column from '../../Column';
3
4
  import ToolbarButton from '../../../UI/ToolbarButton.js';
@@ -10,6 +11,10 @@ declare class HeaderCellToolbar implements Toolbar {
10
11
  * The column that this toolbar belongs to.
11
12
  */
12
13
  column: Column;
14
+ /**
15
+ * Reference to the Grid instance for icon registry and options.
16
+ */
17
+ get grid(): Grid;
13
18
  buttons: ToolbarButton[];
14
19
  container?: HTMLDivElement;
15
20
  focusCursor: number;
@@ -18,15 +18,20 @@ import Globals from '../../../Globals.js';
18
18
  import SortToolbarButton from './ToolbarButtons/SortToolbarButton.js';
19
19
  import FilterToolbarButton from './ToolbarButtons/FilterToolbarButton.js';
20
20
  import MenuToolbarButton from './ToolbarButtons/MenuToolbarButton.js';
21
- import U from '../../../../../Core/Utilities.js';
21
+ import { getStyle } from '../../../../../Shared/Utilities.js';
22
22
  const { makeHTMLElement } = GridUtils;
23
- const { getStyle } = U;
24
23
  /* *
25
24
  *
26
25
  * Class
27
26
  *
28
27
  * */
29
28
  class HeaderCellToolbar {
29
+ /**
30
+ * Reference to the Grid instance for icon registry and options.
31
+ */
32
+ get grid() {
33
+ return this.column.viewport.grid;
34
+ }
30
35
  /* *
31
36
  *
32
37
  * Constructor
@@ -14,8 +14,7 @@
14
14
  * */
15
15
  'use strict';
16
16
  import Popup from '../../../UI/Popup.js';
17
- import U from '../../../../../Core/Utilities.js';
18
- const { merge } = U;
17
+ import { merge } from '../../../../../Shared/Utilities.js';
19
18
  /* *
20
19
  *
21
20
  * Class
@@ -16,8 +16,7 @@
16
16
  import FilterPopup from '../FilterPopup.js';
17
17
  import StateHelpers from '../StateHelpers.js';
18
18
  import ContextMenuButton from '../../../../UI/ContextMenuButton.js';
19
- import U from '../../../../../../Core/Utilities.js';
20
- const { addEvent } = U;
19
+ import { addEvent } from '../../../../../../Shared/Utilities.js';
21
20
  /* *
22
21
  *
23
22
  * Class
@@ -15,8 +15,7 @@
15
15
  'use strict';
16
16
  import ContextMenuButton from '../../../../UI/ContextMenuButton.js';
17
17
  import StateHelpers from '../StateHelpers.js';
18
- import U from '../../../../../../Core/Utilities.js';
19
- const { addEvent } = U;
18
+ import { addEvent } from '../../../../../../Shared/Utilities.js';
20
19
  /* *
21
20
  *
22
21
  * Class
@@ -29,7 +28,7 @@ class SortMenuButton extends ContextMenuButton {
29
28
  *
30
29
  * */
31
30
  constructor(langOptions, direction) {
32
- super({ icon: direction === 'asc' ? 'sortAsc' : 'sortDesc' });
31
+ super({ icon: direction === 'asc' ? 'arrowUp' : 'arrowDown' });
33
32
  this.direction = direction;
34
33
  this.baseLabel = langOptions[direction === 'asc' ? 'sortAscending' : 'sortDescending'] || '';
35
34
  this.options.label = this.baseLabel;
@@ -16,8 +16,7 @@
16
16
  import FilterPopup from '../FilterPopup.js';
17
17
  import ToolbarButton from '../../../../UI/ToolbarButton.js';
18
18
  import StateHelpers from '../StateHelpers.js';
19
- import U from '../../../../../../Core/Utilities.js';
20
- const { addEvent } = U;
19
+ import { addEvent } from '../../../../../../Shared/Utilities.js';
21
20
  /* *
22
21
  *
23
22
  * Class
@@ -16,8 +16,7 @@
16
16
  import ToolbarButton from '../../../../UI/ToolbarButton.js';
17
17
  import StateHelpers from '../StateHelpers.js';
18
18
  import MenuPopup from '../MenuPopup.js';
19
- import U from '../../../../../../Core/Utilities.js';
20
- const { addEvent } = U;
19
+ import { addEvent } from '../../../../../../Shared/Utilities.js';
21
20
  /* *
22
21
  *
23
22
  * Class
@@ -10,6 +10,5 @@ declare class SortToolbarButton extends ToolbarButton {
10
10
  private renderSortPriorityIndicator;
11
11
  refreshState(): void;
12
12
  protected addEventListeners(): void;
13
- protected renderActiveIndicator(render: boolean): void;
14
13
  }
15
14
  export default SortToolbarButton;
@@ -15,11 +15,9 @@
15
15
  'use strict';
16
16
  import ToolbarButton from '../../../../UI/ToolbarButton.js';
17
17
  import GridUtils from '../../../../GridUtils.js';
18
- import Globals from '../../../../Globals.js';
19
18
  import StateHelpers from '../StateHelpers.js';
20
- import U from '../../../../../../Core/Utilities.js';
19
+ import { addEvent } from '../../../../../../Shared/Utilities.js';
21
20
  const { formatText } = GridUtils;
22
- const { addEvent } = U;
23
21
  /* *
24
22
  *
25
23
  * Class
@@ -75,8 +73,7 @@ class SortToolbarButton extends ToolbarButton {
75
73
  * */
76
74
  constructor() {
77
75
  super({
78
- icon: 'upDownArrows',
79
- classNameKey: 'headerCellSortIcon',
76
+ icon: 'arrowUpDown',
80
77
  accessibility: {
81
78
  ariaLabel: 'sort'
82
79
  }
@@ -107,7 +104,6 @@ class SortToolbarButton extends ToolbarButton {
107
104
  }
108
105
  if (!this.sortPriorityIndicator) {
109
106
  this.sortPriorityIndicator = document.createElement('span');
110
- this.sortPriorityIndicator.className = Globals.getClassName('sortPriorityIndicator');
111
107
  }
112
108
  // Ensure the indicator is rendered to the right of the icon.
113
109
  button.appendChild(this.sortPriorityIndicator);
@@ -126,13 +122,13 @@ class SortToolbarButton extends ToolbarButton {
126
122
  void 0));
127
123
  if (!StateHelpers.isSorted(column) || !columnSorting?.order) {
128
124
  this.setActive(false);
129
- this.setIcon('upDownArrows');
125
+ this.setIcon('arrowUpDown');
130
126
  this.renderSortPriorityIndicator();
131
127
  this.updateA11yLabel(null);
132
128
  return;
133
129
  }
134
130
  this.setActive(true);
135
- this.setIcon(columnSorting.order === 'asc' ? 'sortAsc' : 'sortDesc');
131
+ this.setIcon(columnSorting.order === 'asc' ? 'arrowUp' : 'arrowDown');
136
132
  const sortIndex = sortings.findIndex((sorting) => sorting.columnId === column.id);
137
133
  const priority = (sortings.length > 1 && sortIndex !== -1 ?
138
134
  sortIndex + 1 :
@@ -149,12 +145,6 @@ class SortToolbarButton extends ToolbarButton {
149
145
  // If this grid is currently sorted, update the state
150
146
  this.eventListenerDestroyers.push(addEvent(column.viewport.grid, 'afterSort', () => this.refreshState()));
151
147
  }
152
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
153
- renderActiveIndicator(render) {
154
- // Sorting uses directional icons + priority indicators
155
- // (for multi-sort), not the generic active dot indicator
156
- // (reserved for filtering).
157
- }
158
148
  }
159
149
  /* *
160
150
  *
@@ -53,7 +53,12 @@ declare class HeaderCell extends Cell {
53
53
  /**
54
54
  * Render the cell container.
55
55
  */
56
- render(): void;
56
+ render(): Promise<void>;
57
+ /**
58
+ * Returns merged header styles from defaults and current column options.
59
+ *
60
+ */
61
+ private getColumnStyles;
57
62
  reflow(): void;
58
63
  onKeyDown(e: KeyboardEvent): void;
59
64
  onClick(e: MouseEvent): void;
@@ -15,13 +15,11 @@
15
15
  * */
16
16
  'use strict';
17
17
  import Cell from '../Cell.js';
18
- import GridUtils from '../../GridUtils.js';
18
+ import { makeHTMLElement, setHTMLContent, createOptionsProxy, resolveStyleValue, mergeStyleValues } from '../../GridUtils.js';
19
19
  import ColumnSorting from '../Actions/ColumnSorting.js';
20
20
  import Globals from '../../Globals.js';
21
- import Utilities from '../../../../Core/Utilities.js';
22
21
  import ColumnToolbar from './ColumnToolbar/ColumnToolbar.js';
23
- const { makeHTMLElement, setHTMLContent, createOptionsProxy } = GridUtils;
24
- const { fireEvent, isString } = Utilities;
22
+ import { fireEvent, isString } from '../../../../Shared/Utilities.js';
25
23
  /* *
26
24
  *
27
25
  * Class
@@ -102,12 +100,14 @@ class HeaderCell extends Cell {
102
100
  /**
103
101
  * Render the cell container.
104
102
  */
105
- render() {
103
+ async render() {
106
104
  const { column } = this;
107
105
  const options = createOptionsProxy(this.superColumnOptions, column?.options);
108
106
  const headerCellOptions = options.header || {};
109
- if (column && headerCellOptions.formatter) {
110
- this.value = headerCellOptions.formatter.call(column).toString();
107
+ const headerValue = column ?
108
+ headerCellOptions.formatter?.call(column) : void 0;
109
+ if (headerValue) {
110
+ this.value = headerValue.toString();
111
111
  }
112
112
  else if (isString(headerCellOptions.format)) {
113
113
  this.value = column ?
@@ -151,7 +151,25 @@ class HeaderCell extends Cell {
151
151
  this.htmlElement.classList[column?.dataType === 'number' ? 'add' : 'remove'](Globals.getClassName('rightAlign'));
152
152
  // Add custom class name from column options
153
153
  this.setCustomClassName(options.header?.className);
154
+ this.setCustomStyles(this.getColumnStyles());
154
155
  fireEvent(this, 'afterRender', { column });
156
+ return Promise.resolve();
157
+ }
158
+ /**
159
+ * Returns merged header styles from defaults and current column options.
160
+ *
161
+ */
162
+ getColumnStyles() {
163
+ const { column } = this;
164
+ if (!column) {
165
+ return resolveStyleValue(this.superColumnOptions.header?.style);
166
+ }
167
+ const { grid } = this.row.viewport;
168
+ const rawColumnOptions = grid.columnOptionsMap?.[column.id]?.options;
169
+ return {
170
+ ...mergeStyleValues(column, grid.options?.columnDefaults?.style, rawColumnOptions?.style),
171
+ ...mergeStyleValues(column, grid.options?.columnDefaults?.header?.style, rawColumnOptions?.header?.style)
172
+ };
155
173
  }
156
174
  reflow() {
157
175
  const th = this.htmlElement;
@@ -179,14 +197,16 @@ class HeaderCell extends Cell {
179
197
  super.onKeyDown(e);
180
198
  }
181
199
  onClick(e) {
182
- const column = this.column;
183
- if (!column || (e.target !== this.htmlElement &&
184
- e.target !== column.header?.headerContent) || column.viewport.columnsResizer?.isResizing) {
200
+ if (!this.column ||
201
+ !this.htmlElement.contains(e.target) ||
202
+ this.column.viewport.columnsResizer?.isResizing) {
185
203
  return;
186
204
  }
187
- if ((column.options.sorting?.enabled ??
188
- column.options.sorting?.sortable)) {
189
- column.sorting?.toggle(e);
205
+ // Toggle sort only when clicking header text/area, not toolbar icons
206
+ if (!this.toolbar?.container?.contains(e.target) &&
207
+ (this.column.options.sorting?.enabled ??
208
+ this.column.options.sorting?.sortable)) {
209
+ this.column.sorting?.toggle(e);
190
210
  }
191
211
  fireEvent(this, 'click', {
192
212
  originalEvent: e,
@@ -17,8 +17,7 @@
17
17
  import Row from '../Row.js';
18
18
  import HeaderCell from './HeaderCell.js';
19
19
  import Globals from '../../Globals.js';
20
- import Utils from '../../../../Core/Utilities.js';
21
- const { isString } = Utils;
20
+ import { isString } from '../../../../Shared/Utilities.js';
22
21
  /* *
23
22
  *
24
23
  * Class
@@ -63,7 +62,7 @@ class HeaderRow extends Row {
63
62
  *
64
63
  * @internal
65
64
  */
66
- renderContent(level) {
65
+ async renderContent(level) {
67
66
  const headerOpt = this.viewport.grid.options?.header;
68
67
  const vp = this.viewport;
69
68
  const enabledColumns = vp.grid.enabledColumns || [];
@@ -71,7 +70,7 @@ class HeaderRow extends Row {
71
70
  vp.theadElement?.appendChild(this.htmlElement);
72
71
  this.htmlElement.classList.add(Globals.getClassName('headerRow'));
73
72
  if (!headerOpt) {
74
- super.render();
73
+ await super.render();
75
74
  }
76
75
  else {
77
76
  const columnsOnLevel = this.getColumnsAtLevel(headerOpt, level);
@@ -110,7 +109,7 @@ class HeaderRow extends Row {
110
109
  if (dataColumn?.index === 0 && i === 0) {
111
110
  headerCell.htmlElement.classList.add(Globals.getClassName('columnFirst'));
112
111
  }
113
- headerCell.render();
112
+ await headerCell.render();
114
113
  if (columnId) {
115
114
  headerCell.htmlElement.setAttribute('rowSpan', (this.viewport.header?.levels || 1) - level);
116
115
  }
@@ -33,7 +33,7 @@ declare class TableHeader {
33
33
  /**
34
34
  * Renders the table head content.
35
35
  */
36
- render(): void;
36
+ render(): Promise<void>;
37
37
  /**
38
38
  * Reflows the table head's content dimensions.
39
39
  */
@@ -70,7 +70,7 @@ class TableHeader {
70
70
  /**
71
71
  * Renders the table head content.
72
72
  */
73
- render() {
73
+ async render() {
74
74
  const vp = this.viewport;
75
75
  if (!vp.grid.enabledColumns) {
76
76
  return;
@@ -78,14 +78,14 @@ class TableHeader {
78
78
  // Render regular, multiple level rows.
79
79
  for (let i = 0, iEnd = this.levels; i < iEnd; i++) {
80
80
  const row = new HeaderRow(vp, i + 1); // Avoid indexing from 0
81
- row.renderContent(i);
81
+ await row.renderContent(i);
82
82
  this.rows.push(row);
83
83
  }
84
84
  // Render an extra row for inline filtering.
85
85
  if (vp.columns.some((column) => (column.options.filtering?.enabled &&
86
86
  column.options.filtering.inline) || false)) {
87
87
  const row = new FilterRow(vp);
88
- row.renderContent();
88
+ await row.renderContent();
89
89
  this.rows.push(row);
90
90
  }
91
91
  }
@@ -39,7 +39,7 @@ declare abstract class Row {
39
39
  * Renders the row's content. It does not attach the row element to the
40
40
  * viewport nor pushes the rows to the viewport.rows array.
41
41
  */
42
- render(): void;
42
+ render(): Promise<void>;
43
43
  /**
44
44
  * Reflows the row's content dimensions.
45
45
  */
@@ -54,11 +54,11 @@ class Row {
54
54
  * Renders the row's content. It does not attach the row element to the
55
55
  * viewport nor pushes the rows to the viewport.rows array.
56
56
  */
57
- render() {
57
+ async render() {
58
58
  const columns = this.viewport.columns;
59
59
  for (let i = 0, iEnd = columns.length; i < iEnd; i++) {
60
60
  const cell = this.createCell(columns[i]);
61
- cell.render();
61
+ await cell.render();
62
62
  }
63
63
  this.rendered = true;
64
64
  if (this.viewport.virtualRows) {
@@ -1,5 +1,6 @@
1
1
  import type TableRow from './Body/TableRow';
2
- import DataTable from '../../../Data/DataTable.js';
2
+ import type DataTable from '../../../Data/DataTable';
3
+ import type { RowId } from '../Data/DataProvider';
3
4
  import ColumnResizingMode from './ColumnResizing/ResizingMode.js';
4
5
  import Column from './Column.js';
5
6
  import TableHeader from './Header/TableHeader.js';
@@ -13,14 +14,6 @@ declare class Table {
13
14
  * The data grid instance which the table (viewport) belongs to.
14
15
  */
15
16
  readonly grid: Grid;
16
- /**
17
- * The presentation version of the data table. It has applied modifiers
18
- * and is ready to be rendered.
19
- *
20
- * If you want to modify the data table, you should use the original
21
- * instance that is stored in the `grid.dataTable` property.
22
- */
23
- dataTable: DataTable;
24
17
  /**
25
18
  * The HTML element of the table.
26
19
  */
@@ -63,6 +56,10 @@ declare class Table {
63
56
  * The flag that indicates if the table rows are virtualized.
64
57
  */
65
58
  virtualRows: boolean;
59
+ /**
60
+ * Cell context menu instance (lazy created).
61
+ */
62
+ private cellContextMenu?;
66
63
  /**
67
64
  * Constructs a new data grid table.
68
65
  *
@@ -74,9 +71,17 @@ declare class Table {
74
71
  */
75
72
  constructor(grid: Grid, tableElement: HTMLTableElement);
76
73
  /**
77
- * Initializes the data grid table.
74
+ * The presentation version of the data table. It has applied modifiers
75
+ * and is ready to be rendered.
76
+ *
77
+ * @deprecated Use `grid.dataProvider` instead.
78
+ */
79
+ get dataTable(): DataTable | undefined;
80
+ /**
81
+ * Initializes the table. Should be called after creation so that the table
82
+ * can be asynchronously initialized.
78
83
  */
79
- private init;
84
+ init(): Promise<void>;
80
85
  /**
81
86
  * Sets the minimum height of the table body.
82
87
  */
@@ -125,6 +130,11 @@ declare class Table {
125
130
  * @param e Mouse event
126
131
  */
127
132
  private onCellDblClick;
133
+ /**
134
+ * Delegated context menu handler for cells.
135
+ * @param e Mouse event
136
+ */
137
+ private onCellContextMenu;
128
138
  /**
129
139
  * Delegated mousedown handler for cells.
130
140
  * @param e Mouse event
@@ -145,6 +155,22 @@ declare class Table {
145
155
  * @param e Keyboard event
146
156
  */
147
157
  private onCellKeyDown;
158
+ /**
159
+ * Opens a cell context menu if configured and enabled.
160
+ *
161
+ * @param tableCell
162
+ * The target cell.
163
+ *
164
+ * @param clientX
165
+ * The viewport X coordinate for anchoring.
166
+ *
167
+ * @param clientY
168
+ * The viewport Y coordinate for anchoring.
169
+ *
170
+ * @returns
171
+ * True if the menu was opened.
172
+ */
173
+ private openCellContextMenu;
148
174
  /**
149
175
  * Scrolls the table to the specified row.
150
176
  *
@@ -194,7 +220,7 @@ declare class Table {
194
220
  * @param id
195
221
  * The ID of the row.
196
222
  */
197
- getRow(id: number): TableRow | undefined;
223
+ getRow(id: RowId): TableRow | undefined;
198
224
  }
199
225
  /**
200
226
  * Represents the metadata of the viewport state. It is used to save the