@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.
- package/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1262 -1122
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +1 -2
- package/es-modules/Accessibility/Accessibility.js +1 -2
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +2 -2
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +5 -6
- package/es-modules/Accessibility/Components/LegendComponent.js +1 -2
- package/es-modules/Accessibility/Components/MenuComponent.js +1 -2
- package/es-modules/Accessibility/Components/NavigatorComponent.js +3 -4
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +1 -2
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +1 -2
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +3 -4
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +3 -4
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/Components/ZoomComponent.js +1 -2
- package/es-modules/Accessibility/FocusBorder.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigation.js +1 -2
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +1 -2
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +11 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +7 -2
- package/es-modules/Accessibility/Options/LangDefaults.js +9 -0
- package/es-modules/Accessibility/ProxyElement.js +2 -5
- package/es-modules/Accessibility/ProxyProvider.js +1 -2
- package/es-modules/Accessibility/Utils/Announcer.js +2 -3
- package/es-modules/Accessibility/Utils/ChartUtilities.js +1 -2
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +2 -2
- package/es-modules/Accessibility/Utils/EventProvider.js +6 -2
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +1 -2
- package/es-modules/Core/Animation/AnimationUtilities.js +1 -2
- package/es-modules/Core/Animation/Fx.js +1 -2
- package/es-modules/Core/Callback.d.ts +9 -2
- package/es-modules/Core/Chart/Chart.js +48 -41
- package/es-modules/Core/Chart/Chart3D.js +1 -2
- package/es-modules/Core/Chart/ChartDefaults.js +11 -0
- package/es-modules/Core/Chart/ChartOptions.d.ts +8 -0
- package/es-modules/Core/Chart/GanttChart.js +1 -2
- package/es-modules/Core/Chart/MapChart.js +1 -2
- package/es-modules/Core/Chart/StockChart.js +2 -3
- package/es-modules/Core/Color/Color.js +1 -2
- package/es-modules/Core/Defaults.js +36 -9
- package/es-modules/Core/Delaunay.d.ts +52 -0
- package/es-modules/Core/Delaunay.js +310 -0
- package/es-modules/Core/Foundation.js +1 -2
- package/es-modules/Core/Geometry/CircleUtilities.js +1 -2
- package/es-modules/Core/Globals.js +1 -1
- package/es-modules/Core/HttpUtilities.js +1 -2
- package/es-modules/Core/MSPointer.js +1 -2
- package/es-modules/Core/Math3D.js +1 -2
- package/es-modules/Core/Options.d.ts +6 -2
- package/es-modules/Core/Pointer.js +23 -4
- package/es-modules/Core/PointerEvent.d.ts +2 -0
- package/es-modules/Core/Renderer/HTML/AST.js +2 -2
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +1 -2
- package/es-modules/Core/Renderer/RendererUtilities.js +34 -19
- package/es-modules/Core/Responsive.d.ts +4 -2
- package/es-modules/Core/Responsive.js +10 -4
- package/es-modules/Core/Templating.d.ts +1 -1
- package/es-modules/Core/Templating.js +3 -4
- package/es-modules/Core/Time.d.ts +8 -0
- package/es-modules/Core/Time.js +2 -2
- package/es-modules/Core/Tooltip.d.ts +4 -8
- package/es-modules/Core/Tooltip.js +100 -81
- package/es-modules/Core/TooltipOptions.d.ts +44 -1
- package/es-modules/Core/Utilities.d.ts +25 -665
- package/es-modules/Core/Utilities.js +17 -1398
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +103 -113
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +3 -4
- package/es-modules/Data/Connectors/DataConnector.d.ts +52 -54
- package/es-modules/Data/Connectors/DataConnector.js +33 -52
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +73 -88
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +4 -2
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +3 -4
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +3 -4
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +3 -4
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +26 -53
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +169 -181
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +3 -3
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +2 -3
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +2 -2
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +6 -6
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +2 -2
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +119 -139
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +20 -9
- package/es-modules/Data/DataTable.d.ts +111 -113
- package/es-modules/Data/DataTable.js +3 -3
- package/es-modules/Data/DataTableCore.d.ts +9 -9
- package/es-modules/Data/DataTableCore.js +2 -2
- package/es-modules/Data/Formula/FormulaParser.js +1 -2
- package/es-modules/Data/Formula/FormulaProcessor.js +1 -2
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +7 -8
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +31 -53
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +3 -4
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +3 -4
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +3 -4
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +3 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +1 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +5 -6
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +4 -2
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +10 -8
- package/es-modules/Grid/Core/Grid.d.ts +31 -22
- package/es-modules/Grid/Core/Grid.js +214 -136
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +50 -3
- package/es-modules/Grid/Core/Options.d.ts +145 -4
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +63 -23
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +1 -2
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
- package/es-modules/Grid/Core/Querying/PaginationController.js +3 -3
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +2 -26
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +2 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +3 -4
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +2 -2
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +17 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +58 -15
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +1 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +57 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +397 -118
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +27 -13
- package/es-modules/Grid/Core/Table/Body/TableCell.js +74 -25
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +7 -15
- package/es-modules/Grid/Core/Table/Body/TableRow.js +24 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -3
- package/es-modules/Grid/Core/Table/Cell.js +36 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +3 -8
- package/es-modules/Grid/Core/Table/Column.d.ts +10 -4
- package/es-modules/Grid/Core/Table/Column.js +23 -34
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +9 -8
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +4 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +7 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +2 -3
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +1 -2
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +0 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +4 -14
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +6 -1
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +33 -13
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +4 -5
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +3 -3
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +2 -2
- package/es-modules/Grid/Core/Table/Table.d.ts +38 -12
- package/es-modules/Grid/Core/Table/Table.js +184 -91
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +5 -3
- package/es-modules/Grid/Core/UI/Popup.js +7 -9
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +206 -33
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +8 -26
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +2 -2
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +10 -10
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +4 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +1 -2
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +1 -2
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +34 -32
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +3 -4
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +1 -3
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +1 -2
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +1 -2
- package/es-modules/Grid/Pro/GridEvents.js +1 -2
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +1 -2
- package/es-modules/Shared/BaseForm.js +1 -2
- package/es-modules/Shared/DownloadURL.js +1 -2
- package/es-modules/Shared/TimeBase.js +3 -3
- package/es-modules/Shared/Types.d.ts +7 -0
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1368 -0
- package/es-modules/masters/grid-pro.src.d.ts +15 -11
- package/es-modules/masters/grid-pro.src.js +12 -5
- package/grid-pro.d.ts +15 -11
- package/grid-pro.js +3 -3
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +15 -11
- package/grid-pro.src.js +10408 -8009
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { DataEventDetail } from '../DataEvent';
|
|
2
2
|
import type CSVConverterOptions from './CSVConverterOptions';
|
|
3
3
|
import DataConverter from './DataConverter.js';
|
|
4
|
-
import
|
|
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 {
|
|
37
|
+
* @param {DataEventDetail} [eventDetail]
|
|
38
38
|
* Custom information for pending events.
|
|
39
|
-
* @return {
|
|
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?:
|
|
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
|
|
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 {
|
|
67
|
+
* @param {DataEventDetail} [eventDetail]
|
|
69
68
|
* Custom information for pending events.
|
|
70
|
-
* @return {
|
|
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
|
|
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
|
|
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
|
|
10
|
+
declare class DataConverter implements DataEventEmitter<Event> {
|
|
11
11
|
/**
|
|
12
12
|
* Default options
|
|
13
13
|
*/
|
|
14
|
-
protected static readonly defaultOptions:
|
|
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 {
|
|
38
|
+
* @param {UserOptions} [options]
|
|
19
39
|
* Options for the DataConverter.
|
|
20
40
|
*/
|
|
21
|
-
constructor(options?:
|
|
41
|
+
constructor(options?: UserOptions);
|
|
22
42
|
/**
|
|
23
43
|
* A collection of available date formats.
|
|
24
44
|
*/
|
|
25
|
-
dateFormats: Record<string,
|
|
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:
|
|
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:
|
|
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 {
|
|
86
|
+
* @param {Event} [e]
|
|
67
87
|
* Event object containing additional event data
|
|
68
88
|
*/
|
|
69
|
-
emit(e:
|
|
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 {
|
|
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
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
-
*
|
|
352
|
+
* Registry as a record object with converter names and their class.
|
|
339
353
|
*/
|
|
340
|
-
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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;
|