@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
@@ -1,7 +1,7 @@
1
- import type DataEvent from '../DataEvent';
1
+ import type { DataEventDetail } from '../DataEvent';
2
2
  import type CSVConverterOptions from './CSVConverterOptions';
3
3
  import DataConverter from './DataConverter.js';
4
- import DataTable from '../DataTable.js';
4
+ import type { ColumnCollection as DataTableColumnCollection } from '../DataTable.js';
5
5
  /**
6
6
  * Handles parsing and transforming CSV to a table.
7
7
  *
@@ -34,15 +34,15 @@ declare class CSVConverter extends DataConverter {
34
34
  *
35
35
  * @param {Partial<CSVConverterOptions>} [options]
36
36
  * Options for the parser.
37
- * @param {DataEvent.Detail} [eventDetail]
37
+ * @param {DataEventDetail} [eventDetail]
38
38
  * Custom information for pending events.
39
- * @return {DataTable.ColumnCollection}
39
+ * @return {DataTableColumnCollection}
40
40
  * The parsed column collection.
41
41
  *
42
42
  * @emits CSVDataParser#parse
43
43
  * @emits CSVDataParser#afterParse
44
44
  */
45
- parse(options: Partial<CSVConverterOptions>, eventDetail?: DataEvent.Detail): DataTable.ColumnCollection;
45
+ parse(options: Partial<CSVConverterOptions>, eventDetail?: DataEventDetail): DataTableColumnCollection;
46
46
  /**
47
47
  * Parses a single CSV row string into columns, handling delimiters,
48
48
  * quoted values, data type inference, and column range selection.
@@ -17,8 +17,7 @@
17
17
  'use strict';
18
18
  import DataConverter from './DataConverter.js';
19
19
  import DataConverterUtils from './DataConverterUtils.js';
20
- import U from '../../Core/Utilities.js';
21
- const { merge } = U;
20
+ import { merge } from '../../Shared/Utilities.js';
22
21
  /* *
23
22
  *
24
23
  * Class
@@ -65,9 +64,9 @@ class CSVConverter extends DataConverter {
65
64
  *
66
65
  * @param {Partial<CSVConverterOptions>} [options]
67
66
  * Options for the parser.
68
- * @param {DataEvent.Detail} [eventDetail]
67
+ * @param {DataEventDetail} [eventDetail]
69
68
  * Custom information for pending events.
70
- * @return {DataTable.ColumnCollection}
69
+ * @return {DataTableColumnCollection}
71
70
  * The parsed column collection.
72
71
  *
73
72
  * @emits CSVDataParser#parse
@@ -19,7 +19,7 @@
19
19
 
20
20
  import type { CSVBeforeParseCallbackFunction } from '../Connectors/CSVConnectorOptions';
21
21
 
22
- import DataConverter from './DataConverter';
22
+ import type { Options as DataConverterOptions } from './DataConverter';
23
23
 
24
24
  /* *
25
25
  *
@@ -30,7 +30,7 @@ import DataConverter from './DataConverter';
30
30
  /**
31
31
  * Options of the CSVConverter.
32
32
  */
33
- export interface CSVConverterOptions extends DataConverter.Options {
33
+ export interface CSVConverterOptions extends DataConverterOptions {
34
34
  startRow: number;
35
35
  endRow: number;
36
36
  startColumn: number;
@@ -1,28 +1,48 @@
1
1
  import type { DataConverterTypes } from './DataConverterType';
2
- import type DataEvent from '../DataEvent';
2
+ import type { DataEvent, DataEventCallback, DataEventEmitter } from '../DataEvent';
3
3
  import type { ColumnIdsOptions } from '../Connectors/JSONConnectorOptions';
4
- import DataTable from '../DataTable.js';
4
+ import DataTable, { type Column as DataTableColumn } from '../DataTable.js';
5
5
  /**
6
6
  * Base class providing an interface and basic methods for a DataConverter
7
7
  *
8
8
  * @private
9
9
  */
10
- declare class DataConverter implements DataEvent.Emitter<DataConverter.Event> {
10
+ declare class DataConverter implements DataEventEmitter<Event> {
11
11
  /**
12
12
  * Default options
13
13
  */
14
- protected static readonly defaultOptions: DataConverter.Options;
14
+ protected static readonly defaultOptions: Options;
15
+ /**
16
+ * Registry as a record object with converter names and their class.
17
+ */
18
+ static types: DataConverterTypes;
19
+ /**
20
+ * Adds a converter class to the registry.
21
+ *
22
+ * @private
23
+ *
24
+ * @param {string} key
25
+ * Registry key of the converter class.
26
+ *
27
+ * @param {DataConverterTypes} DataConverterClass
28
+ * Connector class (aka class constructor) to register.
29
+ *
30
+ * @return {boolean}
31
+ * Returns true, if the registration was successful. False is returned, if
32
+ * their is already a converter registered with this key.
33
+ */
34
+ static registerType<T extends keyof DataConverterTypes>(key: T, DataConverterClass: DataConverterTypes[T]): boolean;
15
35
  /**
16
36
  * Constructs an instance of the DataConverter.
17
37
  *
18
- * @param {DataConverter.UserOptions} [options]
38
+ * @param {UserOptions} [options]
19
39
  * Options for the DataConverter.
20
40
  */
21
- constructor(options?: DataConverter.UserOptions);
41
+ constructor(options?: UserOptions);
22
42
  /**
23
43
  * A collection of available date formats.
24
44
  */
25
- dateFormats: Record<string, DataConverter.DateFormatObject>;
45
+ dateFormats: Record<string, DateFormatObject>;
26
46
  /**
27
47
  * Regular expression used in the trim method to change a decimal point.
28
48
  */
@@ -30,7 +50,7 @@ declare class DataConverter implements DataEvent.Emitter<DataConverter.Event> {
30
50
  /**
31
51
  * Options for the DataConverter.
32
52
  */
33
- readonly options: DataConverter.Options;
53
+ readonly options: Options;
34
54
  /**
35
55
  * Converts a string value based on its guessed type.
36
56
  *
@@ -40,7 +60,7 @@ declare class DataConverter implements DataEvent.Emitter<DataConverter.Event> {
40
60
  * @return {number | string | Date}
41
61
  * The converted value.
42
62
  */
43
- convertByType(value: DataConverter.Type): number | string | Date;
63
+ convertByType(value: Type): number | string | Date;
44
64
  /**
45
65
  * Tries to guess the date format
46
66
  * - Check if either month candidate exceeds 12
@@ -63,23 +83,23 @@ declare class DataConverter implements DataEvent.Emitter<DataConverter.Event> {
63
83
  /**
64
84
  * Emits an event on the DataConverter instance.
65
85
  *
66
- * @param {DataConverter.Event} [e]
86
+ * @param {Event} [e]
67
87
  * Event object containing additional event data
68
88
  */
69
- emit(e: DataConverter.Event): void;
89
+ emit(e: Event): void;
70
90
  /**
71
91
  * Registers a callback for a specific event.
72
92
  *
73
93
  * @param {string} type
74
94
  * Event type as a string.
75
95
  *
76
- * @param {DataEventEmitter.Callback} callback
96
+ * @param {DataEventCallback} callback
77
97
  * Function to register for an modifier callback.
78
98
  *
79
99
  * @return {Function}
80
100
  * Function to unregister callback from the modifier event.
81
101
  */
82
- on<T extends DataConverter.Event['type']>(type: T, callback: DataEvent.Callback<this, Extract<DataConverter.Event, {
102
+ on<T extends Event['type']>(type: T, callback: DataEventCallback<this, Extract<Event, {
83
103
  type: T;
84
104
  }>>): Function;
85
105
  /**
@@ -97,72 +117,50 @@ declare class DataConverter implements DataEvent.Emitter<DataConverter.Event> {
97
117
  /**
98
118
  * Additionally provided types for events and conversion.
99
119
  */
100
- declare namespace DataConverter {
101
- /**
102
- * The basic event object for a DataConverter instance.
103
- * Valid types are `parse`, `afterParse`, and `parseError`
104
- */
105
- interface Event extends DataEvent {
106
- readonly type: ('export' | 'afterExport' | 'exportError' | 'parse' | 'afterParse' | 'parseError');
107
- readonly columns: DataTable.Column[];
108
- readonly error?: string | Error;
109
- readonly headers: string[] | ColumnIdsOptions;
110
- }
111
- interface DateFormatCallbackFunction {
112
- (match: ReturnType<string['match']>): number;
113
- }
114
- interface DateFormatObject {
115
- alternative?: string;
116
- parser: DateFormatCallbackFunction;
117
- regex: RegExp;
118
- }
119
- /**
120
- * The shared options for all DataConverter instances
121
- */
122
- interface Options {
123
- dateFormat?: string;
124
- decimalPoint?: string;
125
- firstRowAsNames: boolean;
126
- /**
127
- * A function to parse string representations of dates into JavaScript
128
- * timestamps. If not set, the default implementation will be used.
129
- */
130
- parseDate?: DataConverter.ParseDateFunction;
131
- }
132
- /**
133
- * A function to parse string representations of dates
134
- * into JavaScript timestamps.
135
- */
136
- interface ParseDateFunction {
137
- (dateValue: string): number;
138
- }
139
- /**
140
- * Contains supported types to convert values from and to.
141
- */
142
- type Type = (boolean | null | number | string | DataTable | Date | undefined);
143
- /**
144
- * Options of the DataConverter.
145
- */
146
- type UserOptions = Partial<Options>;
147
- /**
148
- * Registry as a record object with connector names and their class.
149
- */
150
- const types: DataConverterTypes;
120
+ /**
121
+ * The basic event object for a DataConverter instance.
122
+ * Valid types are `parse`, `afterParse`, and `parseError`
123
+ */
124
+ export interface Event extends DataEvent {
125
+ readonly type: ('export' | 'afterExport' | 'exportError' | 'parse' | 'afterParse' | 'parseError');
126
+ readonly columns: DataTableColumn[];
127
+ readonly error?: string | Error;
128
+ readonly headers: string[] | ColumnIdsOptions;
129
+ }
130
+ export interface DateFormatCallbackFunction {
131
+ (match: ReturnType<string['match']>): number;
132
+ }
133
+ export interface DateFormatObject {
134
+ alternative?: string;
135
+ parser: DateFormatCallbackFunction;
136
+ regex: RegExp;
137
+ }
138
+ /**
139
+ * The shared options for all DataConverter instances
140
+ */
141
+ export interface Options {
142
+ dateFormat?: string;
143
+ decimalPoint?: string;
144
+ firstRowAsNames: boolean;
151
145
  /**
152
- * Adds a converter class to the registry.
153
- *
154
- * @private
155
- *
156
- * @param {string} key
157
- * Registry key of the converter class.
158
- *
159
- * @param {DataConverterTypes} DataConverterClass
160
- * Connector class (aka class constructor) to register.
161
- *
162
- * @return {boolean}
163
- * Returns true, if the registration was successful. False is returned, if
164
- * their is already a converter registered with this key.
146
+ * A function to parse string representations of dates into JavaScript
147
+ * timestamps. If not set, the default implementation will be used.
165
148
  */
166
- function registerType<T extends keyof DataConverterTypes>(key: T, DataConverterClass: DataConverterTypes[T]): boolean;
149
+ parseDate?: ParseDateFunction;
167
150
  }
151
+ /**
152
+ * A function to parse string representations of dates
153
+ * into JavaScript timestamps.
154
+ */
155
+ export interface ParseDateFunction {
156
+ (dateValue: string): number;
157
+ }
158
+ /**
159
+ * Contains supported types to convert values from and to.
160
+ */
161
+ export type Type = (boolean | null | number | string | DataTable | Date | undefined);
162
+ /**
163
+ * Options of the DataConverter.
164
+ */
165
+ export type UserOptions = Partial<Options>;
168
166
  export default DataConverter;
@@ -18,8 +18,7 @@
18
18
  * */
19
19
  'use strict';
20
20
  import DataConverterUtils from './DataConverterUtils.js';
21
- import U from '../../Core/Utilities.js';
22
- const { addEvent, fireEvent, merge } = U;
21
+ import { addEvent, fireEvent, merge } from '../../Shared/Utilities.js';
23
22
  /* *
24
23
  *
25
24
  * Class
@@ -31,6 +30,26 @@ const { addEvent, fireEvent, merge } = U;
31
30
  * @private
32
31
  */
33
32
  class DataConverter {
33
+ /**
34
+ * Adds a converter class to the registry.
35
+ *
36
+ * @private
37
+ *
38
+ * @param {string} key
39
+ * Registry key of the converter class.
40
+ *
41
+ * @param {DataConverterTypes} DataConverterClass
42
+ * Connector class (aka class constructor) to register.
43
+ *
44
+ * @return {boolean}
45
+ * Returns true, if the registration was successful. False is returned, if
46
+ * their is already a converter registered with this key.
47
+ */
48
+ static registerType(key, DataConverterClass) {
49
+ return (!!key &&
50
+ !DataConverter.types[key] &&
51
+ !!(DataConverter.types[key] = DataConverterClass));
52
+ }
34
53
  /* *
35
54
  *
36
55
  * Constructor
@@ -39,7 +58,7 @@ class DataConverter {
39
58
  /**
40
59
  * Constructs an instance of the DataConverter.
41
60
  *
42
- * @param {DataConverter.UserOptions} [options]
61
+ * @param {UserOptions} [options]
43
62
  * Options for the DataConverter.
44
63
  */
45
64
  constructor(options) {
@@ -237,7 +256,7 @@ class DataConverter {
237
256
  /**
238
257
  * Emits an event on the DataConverter instance.
239
258
  *
240
- * @param {DataConverter.Event} [e]
259
+ * @param {Event} [e]
241
260
  * Event object containing additional event data
242
261
  */
243
262
  emit(e) {
@@ -249,7 +268,7 @@ class DataConverter {
249
268
  * @param {string} type
250
269
  * Event type as a string.
251
270
  *
252
- * @param {DataEventEmitter.Callback} callback
271
+ * @param {DataEventCallback} callback
253
272
  * Function to register for an modifier callback.
254
273
  *
255
274
  * @return {Function}
@@ -329,56 +348,10 @@ DataConverter.defaultOptions = {
329
348
  dateFormat: '',
330
349
  firstRowAsNames: true
331
350
  };
332
- /* *
333
- *
334
- * Class Namespace
335
- *
336
- * */
337
351
  /**
338
- * Additionally provided types for events and conversion.
352
+ * Registry as a record object with converter names and their class.
339
353
  */
340
- (function (DataConverter) {
341
- /* *
342
- *
343
- * Declarations
344
- *
345
- * */
346
- /* *
347
- *
348
- * Constants
349
- *
350
- * */
351
- /**
352
- * Registry as a record object with connector names and their class.
353
- */
354
- DataConverter.types = {};
355
- /* *
356
- *
357
- * Functions
358
- *
359
- * */
360
- /**
361
- * Adds a converter class to the registry.
362
- *
363
- * @private
364
- *
365
- * @param {string} key
366
- * Registry key of the converter class.
367
- *
368
- * @param {DataConverterTypes} DataConverterClass
369
- * Connector class (aka class constructor) to register.
370
- *
371
- * @return {boolean}
372
- * Returns true, if the registration was successful. False is returned, if
373
- * their is already a converter registered with this key.
374
- */
375
- function registerType(key, DataConverterClass) {
376
- return (!!key &&
377
- !DataConverter.types[key] &&
378
- !!(DataConverter.types[key] = DataConverterClass));
379
- }
380
- DataConverter.registerType = registerType;
381
- })(DataConverter || (DataConverter = {}));
354
+ DataConverter.types = {};
382
355
  /* *
383
356
  *
384
357
  * Default Export
@@ -1,82 +1,89 @@
1
- import DataConverter from './DataConverter';
2
- import DataTable from '../DataTable.js';
3
- declare namespace DataConverterUtils {
4
- /**
5
- * Converts a value to a Date.
6
- *
7
- * @param {DataConverter.Type} value
8
- * Value to convert.
9
- *
10
- * @return {globalThis.Date}
11
- * Converted value as a Date.
12
- */
13
- function asDate(value: DataConverter.Type, converter: DataConverter): Date;
14
- /**
15
- * Converts a value to a number.
16
- *
17
- * @param {DataConverter.Type} value
18
- * Value to convert.
19
- *
20
- * @return {number}
21
- * Converted value as a number.
22
- */
23
- function asNumber(value: DataConverter.Type, decimalRegExp?: RegExp): number;
24
- /**
25
- * Converts a value to a string.
26
- *
27
- * @param {DataConverter.Type} value
28
- * Value to convert.
29
- *
30
- * @return {string}
31
- * Converted value as a string.
32
- */
33
- function asString(value: DataConverter.Type): string;
34
- /**
35
- * Converts a value to a boolean.
36
- *
37
- * @param {DataConverter.Type} value
38
- * Value to convert.
39
- *
40
- * @return {boolean}
41
- * Converted value as a boolean.
42
- */
43
- function asBoolean(value: DataConverter.Type): boolean;
44
- /**
45
- * Guesses the potential type of a string value for parsing CSV etc.
46
- *
47
- * @param {*} value
48
- * The value to examine.
49
- *
50
- * @return {'number' | 'string' | 'Date'}
51
- * Type string, either `string`, `Date`, or `number`.
52
- */
53
- function guessType(value: unknown, converter: DataConverter): 'number' | 'string' | 'Date';
54
- /**
55
- * Trim a string from whitespaces.
56
- *
57
- * @param {string} str
58
- * String to trim.
59
- *
60
- * @param {boolean} [inside=false]
61
- * Remove all spaces between numbers.
62
- *
63
- * @return {string}
64
- * Trimed string
65
- */
66
- function trim(str: string, inside?: boolean): string;
67
- /**
68
- * Parses an array of columns to a column collection. If more headers are
69
- * provided, the corresponding, empty columns are added.
70
- *
71
- * @param {DataTable.Column[]} [columnsArray]
72
- * Array of columns.
73
- *
74
- * @param {string[]} [headers]
75
- * Column ids to use.
76
- *
77
- * @return {DataTable.ColumnCollection}
78
- * Parsed columns.
79
- */
80
- function getColumnsCollection(columnsArray: DataTable.Column[] | undefined, headers: string[]): DataTable.ColumnCollection;
81
- }
1
+ import DataConverter, { type Type as DataConverterType } from './DataConverter';
2
+ import type { Column as DataTableColumn, ColumnCollection as DataTableColumnCollection } from '../DataTable';
3
+ /**
4
+ * Converts a value to a Date.
5
+ *
6
+ * @param {DataConverterType} value
7
+ * Value to convert.
8
+ *
9
+ * @return {globalThis.Date}
10
+ * Converted value as a Date.
11
+ */
12
+ export declare function asDate(value: DataConverterType, converter: DataConverter): Date;
13
+ /**
14
+ * Converts a value to a number.
15
+ *
16
+ * @param {DataConverterType} value
17
+ * Value to convert.
18
+ *
19
+ * @return {number}
20
+ * Converted value as a number.
21
+ */
22
+ export declare function asNumber(value: DataConverterType, decimalRegExp?: RegExp): number;
23
+ /**
24
+ * Converts a value to a string.
25
+ *
26
+ * @param {DataConverterType} value
27
+ * Value to convert.
28
+ *
29
+ * @return {string}
30
+ * Converted value as a string.
31
+ */
32
+ export declare function asString(value: DataConverterType): string;
33
+ /**
34
+ * Converts a value to a boolean.
35
+ *
36
+ * @param {DataConverterType} value
37
+ * Value to convert.
38
+ *
39
+ * @return {boolean}
40
+ * Converted value as a boolean.
41
+ */
42
+ export declare function asBoolean(value: DataConverterType): boolean;
43
+ /**
44
+ * Guesses the potential type of a string value for parsing CSV etc.
45
+ *
46
+ * @param {*} value
47
+ * The value to examine.
48
+ *
49
+ * @return {'number' | 'string' | 'Date'}
50
+ * Type string, either `string`, `Date`, or `number`.
51
+ */
52
+ export declare function guessType(value: unknown, converter: DataConverter): 'number' | 'string' | 'Date';
53
+ /**
54
+ * Trim a string from whitespaces.
55
+ *
56
+ * @param {string} str
57
+ * String to trim.
58
+ *
59
+ * @param {boolean} [inside=false]
60
+ * Remove all spaces between numbers.
61
+ *
62
+ * @return {string}
63
+ * Trimed string
64
+ */
65
+ export declare function trim(str: string, inside?: boolean): string;
66
+ /**
67
+ * Parses an array of columns to a column collection. If more headers are
68
+ * provided, the corresponding, empty columns are added.
69
+ *
70
+ * @param {DataTableColumn[]} [columnsArray]
71
+ * Array of columns.
72
+ *
73
+ * @param {string[]} [headers]
74
+ * Column ids to use.
75
+ *
76
+ * @return {DataTableColumnCollection}
77
+ * Parsed columns.
78
+ */
79
+ export declare function getColumnsCollection(columnsArray: DataTableColumn[] | undefined, headers: string[]): DataTableColumnCollection;
80
+ declare const DataConverterUtils: {
81
+ asBoolean: typeof asBoolean;
82
+ asDate: typeof asDate;
83
+ asNumber: typeof asNumber;
84
+ asString: typeof asString;
85
+ getColumnsCollection: typeof getColumnsCollection;
86
+ guessType: typeof guessType;
87
+ trim: typeof trim;
88
+ };
82
89
  export default DataConverterUtils;