@highcharts/grid-pro 2.0.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/README.md +35 -0
- package/css/grid-pro.css +1756 -0
- package/es-modules/Accessibility/A11yI18n.d.ts +95 -0
- package/es-modules/Accessibility/A11yI18n.js +290 -0
- package/es-modules/Accessibility/Accessibility.d.ts +116 -0
- package/es-modules/Accessibility/Accessibility.js +402 -0
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +97 -0
- package/es-modules/Accessibility/AccessibilityComponent.js +147 -0
- package/es-modules/Accessibility/Components/AnnotationsA11y.d.ts +43 -0
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +160 -0
- package/es-modules/Accessibility/Components/ContainerComponent.d.ts +48 -0
- package/es-modules/Accessibility/Components/ContainerComponent.js +142 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.d.ts +144 -0
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +555 -0
- package/es-modules/Accessibility/Components/LegendComponent.d.ts +124 -0
- package/es-modules/Accessibility/Components/LegendComponent.js +474 -0
- package/es-modules/Accessibility/Components/MenuComponent.d.ts +93 -0
- package/es-modules/Accessibility/Components/MenuComponent.js +430 -0
- package/es-modules/Accessibility/Components/NavigatorComponent.d.ts +57 -0
- package/es-modules/Accessibility/Components/NavigatorComponent.js +235 -0
- package/es-modules/Accessibility/Components/RangeSelectorComponent.d.ts +126 -0
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +473 -0
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.d.ts +18 -0
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +234 -0
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.d.ts +87 -0
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +309 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.d.ts +53 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +130 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.d.ts +28 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +415 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.d.ts +114 -0
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +721 -0
- package/es-modules/Accessibility/Components/ZoomComponent.d.ts +96 -0
- package/es-modules/Accessibility/Components/ZoomComponent.js +314 -0
- package/es-modules/Accessibility/FocusBorder.d.ts +40 -0
- package/es-modules/Accessibility/FocusBorder.js +301 -0
- package/es-modules/Accessibility/HighContrastMode.d.ts +35 -0
- package/es-modules/Accessibility/HighContrastMode.js +100 -0
- package/es-modules/Accessibility/HighContrastTheme.d.ts +11 -0
- package/es-modules/Accessibility/HighContrastTheme.js +212 -0
- package/es-modules/Accessibility/KeyboardNavigation.d.ts +133 -0
- package/es-modules/Accessibility/KeyboardNavigation.js +450 -0
- package/es-modules/Accessibility/KeyboardNavigationHandler.d.ts +48 -0
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +126 -0
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +68 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +971 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +22 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +265 -0
- package/es-modules/Accessibility/Options/LangDefaults.d.ts +4 -0
- package/es-modules/Accessibility/Options/LangDefaults.js +440 -0
- package/es-modules/Accessibility/ProxyElement.d.ts +78 -0
- package/es-modules/Accessibility/ProxyElement.js +223 -0
- package/es-modules/Accessibility/ProxyProvider.d.ts +90 -0
- package/es-modules/Accessibility/ProxyProvider.js +315 -0
- package/es-modules/Accessibility/Utils/Announcer.d.ts +26 -0
- package/es-modules/Accessibility/Utils/Announcer.js +90 -0
- package/es-modules/Accessibility/Utils/ChartUtilities.d.ts +90 -0
- package/es-modules/Accessibility/Utils/ChartUtilities.js +298 -0
- package/es-modules/Accessibility/Utils/DOMElementProvider.d.ts +20 -0
- package/es-modules/Accessibility/Utils/DOMElementProvider.js +69 -0
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +26 -0
- package/es-modules/Accessibility/Utils/EventProvider.js +65 -0
- package/es-modules/Accessibility/Utils/HTMLUtilities.d.ts +108 -0
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +319 -0
- package/es-modules/Core/Animation/AnimationUtilities.d.ts +107 -0
- package/es-modules/Core/Animation/AnimationUtilities.js +200 -0
- package/es-modules/Core/Animation/Fx.d.ts +130 -0
- package/es-modules/Core/Animation/Fx.js +388 -0
- package/es-modules/Core/Chart/Chart.d.ts +1009 -0
- package/es-modules/Core/Chart/Chart.js +3008 -0
- package/es-modules/Core/Chart/Chart3D.d.ts +276 -0
- package/es-modules/Core/Chart/Chart3D.js +1686 -0
- package/es-modules/Core/Chart/ChartDefaults.d.ts +8 -0
- package/es-modules/Core/Chart/ChartDefaults.js +1304 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.d.ts +55 -0
- package/es-modules/Core/Chart/ChartNavigationComposition.js +90 -0
- package/es-modules/Core/Chart/GanttChart.d.ts +74 -0
- package/es-modules/Core/Chart/GanttChart.js +189 -0
- package/es-modules/Core/Chart/MapChart.d.ts +132 -0
- package/es-modules/Core/Chart/MapChart.js +232 -0
- package/es-modules/Core/Chart/StockChart.d.ts +117 -0
- package/es-modules/Core/Chart/StockChart.js +641 -0
- package/es-modules/Core/Color/Color.d.ts +112 -0
- package/es-modules/Core/Color/Color.js +418 -0
- package/es-modules/Core/Color/Palettes.d.ts +84 -0
- package/es-modules/Core/Color/Palettes.js +23 -0
- package/es-modules/Core/Defaults.d.ts +42 -0
- package/es-modules/Core/Defaults.js +2977 -0
- package/es-modules/Core/Foundation.d.ts +19 -0
- package/es-modules/Core/Foundation.js +63 -0
- package/es-modules/Core/Geometry/CircleUtilities.d.ts +189 -0
- package/es-modules/Core/Geometry/CircleUtilities.js +388 -0
- package/es-modules/Core/Geometry/GeometryUtilities.d.ts +48 -0
- package/es-modules/Core/Geometry/GeometryUtilities.js +105 -0
- package/es-modules/Core/Geometry/PolygonClip.d.ts +19 -0
- package/es-modules/Core/Geometry/PolygonClip.js +96 -0
- package/es-modules/Core/Globals.d.ts +110 -0
- package/es-modules/Core/Globals.js +127 -0
- package/es-modules/Core/HttpUtilities.d.ts +61 -0
- package/es-modules/Core/HttpUtilities.js +214 -0
- package/es-modules/Core/MSPointer.d.ts +74 -0
- package/es-modules/Core/MSPointer.js +218 -0
- package/es-modules/Core/Math3D.d.ts +117 -0
- package/es-modules/Core/Math3D.js +250 -0
- package/es-modules/Core/Pointer.d.ts +590 -0
- package/es-modules/Core/Pointer.js +1631 -0
- package/es-modules/Core/Renderer/HTML/AST.d.ts +163 -0
- package/es-modules/Core/Renderer/HTML/AST.js +562 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.d.ts +76 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +471 -0
- package/es-modules/Core/Renderer/RendererRegistry.d.ts +29 -0
- package/es-modules/Core/Renderer/RendererRegistry.js +76 -0
- package/es-modules/Core/Renderer/RendererUtilities.d.ts +26 -0
- package/es-modules/Core/Renderer/RendererUtilities.js +172 -0
- package/es-modules/Core/Responsive.d.ts +55 -0
- package/es-modules/Core/Responsive.js +260 -0
- package/es-modules/Core/Templating.d.ts +125 -0
- package/es-modules/Core/Templating.js +428 -0
- package/es-modules/Core/Time.d.ts +69 -0
- package/es-modules/Core/Time.js +172 -0
- package/es-modules/Core/Tooltip.d.ts +297 -0
- package/es-modules/Core/Tooltip.js +1377 -0
- package/es-modules/Core/Utilities.d.ts +770 -0
- package/es-modules/Core/Utilities.js +1989 -0
- package/es-modules/Data/ColumnUtils.d.ts +87 -0
- package/es-modules/Data/ColumnUtils.js +140 -0
- package/es-modules/Data/Connectors/CSVConnector.d.ts +63 -0
- package/es-modules/Data/Connectors/CSVConnector.js +149 -0
- package/es-modules/Data/Connectors/CSVConnectorOptions.d.ts +149 -0
- package/es-modules/Data/Connectors/DataConnector.d.ts +204 -0
- package/es-modules/Data/Connectors/DataConnector.js +345 -0
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +87 -0
- package/es-modules/Data/Connectors/DataConnectorType.d.ts +45 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +65 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +226 -0
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +167 -0
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +77 -0
- package/es-modules/Data/Connectors/HTMLTableConnector.js +119 -0
- package/es-modules/Data/Connectors/HTMLTableConnectorOptions.d.ts +49 -0
- package/es-modules/Data/Connectors/JSONConnector.d.ts +64 -0
- package/es-modules/Data/Connectors/JSONConnector.js +156 -0
- package/es-modules/Data/Connectors/JSONConnectorOptions.d.ts +185 -0
- package/es-modules/Data/Converters/CSVConverter.d.ts +64 -0
- package/es-modules/Data/Converters/CSVConverter.js +374 -0
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +53 -0
- package/es-modules/Data/Converters/DataConverter.d.ts +168 -0
- package/es-modules/Data/Converters/DataConverter.js +387 -0
- package/es-modules/Data/Converters/DataConverterType.d.ts +40 -0
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +82 -0
- package/es-modules/Data/Converters/DataConverterUtils.js +216 -0
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +46 -0
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +135 -0
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +52 -0
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +72 -0
- package/es-modules/Data/Converters/HTMLTableConverter.js +362 -0
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +51 -0
- package/es-modules/Data/Converters/JSONConverter.d.ts +99 -0
- package/es-modules/Data/Converters/JSONConverter.js +239 -0
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +52 -0
- package/es-modules/Data/DataCursor.d.ts +176 -0
- package/es-modules/Data/DataCursor.js +379 -0
- package/es-modules/Data/DataEvent.d.ts +81 -0
- package/es-modules/Data/DataEvent.js +14 -0
- package/es-modules/Data/DataPool.d.ts +130 -0
- package/es-modules/Data/DataPool.js +257 -0
- package/es-modules/Data/DataPoolOptions.d.ts +66 -0
- package/es-modules/Data/DataTable.d.ts +563 -0
- package/es-modules/Data/DataTable.js +930 -0
- package/es-modules/Data/DataTableCore.d.ts +165 -0
- package/es-modules/Data/DataTableCore.js +316 -0
- package/es-modules/Data/DataTableOptions.d.ts +25 -0
- package/es-modules/Data/DataTableOptions.js +15 -0
- package/es-modules/Data/Formula/Formula.d.ts +21 -0
- package/es-modules/Data/Formula/Formula.js +54 -0
- package/es-modules/Data/Formula/FormulaParser.d.ts +31 -0
- package/es-modules/Data/Formula/FormulaParser.js +488 -0
- package/es-modules/Data/Formula/FormulaProcessor.d.ts +155 -0
- package/es-modules/Data/Formula/FormulaProcessor.js +529 -0
- package/es-modules/Data/Formula/FormulaTypes.d.ts +138 -0
- package/es-modules/Data/Formula/FormulaTypes.js +135 -0
- package/es-modules/Data/Formula/Functions/ABS.d.ts +19 -0
- package/es-modules/Data/Formula/Functions/ABS.js +67 -0
- package/es-modules/Data/Formula/Functions/AND.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AND.js +59 -0
- package/es-modules/Data/Formula/Functions/AVERAGE.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AVERAGE.js +74 -0
- package/es-modules/Data/Formula/Functions/AVERAGEA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/AVERAGEA.js +90 -0
- package/es-modules/Data/Formula/Functions/COUNT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/COUNT.js +65 -0
- package/es-modules/Data/Formula/Functions/COUNTA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/COUNTA.js +71 -0
- package/es-modules/Data/Formula/Functions/IF.d.ts +21 -0
- package/es-modules/Data/Formula/Functions/IF.js +54 -0
- package/es-modules/Data/Formula/Functions/ISNA.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/ISNA.js +52 -0
- package/es-modules/Data/Formula/Functions/MAX.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MAX.js +69 -0
- package/es-modules/Data/Formula/Functions/MEDIAN.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MEDIAN.js +78 -0
- package/es-modules/Data/Formula/Functions/MIN.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MIN.js +69 -0
- package/es-modules/Data/Formula/Functions/MOD.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/MOD.js +63 -0
- package/es-modules/Data/Formula/Functions/MODE.d.ts +41 -0
- package/es-modules/Data/Formula/Functions/MODE.js +149 -0
- package/es-modules/Data/Formula/Functions/NOT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/NOT.js +60 -0
- package/es-modules/Data/Formula/Functions/OR.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/OR.js +62 -0
- package/es-modules/Data/Formula/Functions/PRODUCT.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/PRODUCT.js +68 -0
- package/es-modules/Data/Formula/Functions/SUM.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/SUM.js +65 -0
- package/es-modules/Data/Formula/Functions/XOR.d.ts +20 -0
- package/es-modules/Data/Formula/Functions/XOR.js +81 -0
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +128 -0
- package/es-modules/Data/Modifiers/ChainModifier.js +231 -0
- package/es-modules/Data/Modifiers/ChainModifierOptions.d.ts +20 -0
- package/es-modules/Data/Modifiers/ChainModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/DataModifier.d.ts +117 -0
- package/es-modules/Data/Modifiers/DataModifier.js +202 -0
- package/es-modules/Data/Modifiers/DataModifierEvent.d.ts +28 -0
- package/es-modules/Data/Modifiers/DataModifierEvent.js +15 -0
- package/es-modules/Data/Modifiers/DataModifierOptions.d.ts +11 -0
- package/es-modules/Data/Modifiers/DataModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/DataModifierType.d.ts +44 -0
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +53 -0
- package/es-modules/Data/Modifiers/FilterModifier.js +172 -0
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +110 -0
- package/es-modules/Data/Modifiers/FilterModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +48 -0
- package/es-modules/Data/Modifiers/InvertModifier.js +116 -0
- package/es-modules/Data/Modifiers/InvertModifierOptions.d.ts +11 -0
- package/es-modules/Data/Modifiers/InvertModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/MathModifier.d.ts +68 -0
- package/es-modules/Data/Modifiers/MathModifier.js +165 -0
- package/es-modules/Data/Modifiers/MathModifierOptions.d.ts +50 -0
- package/es-modules/Data/Modifiers/MathModifierOptions.js +14 -0
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +46 -0
- package/es-modules/Data/Modifiers/RangeModifier.js +96 -0
- package/es-modules/Data/Modifiers/RangeModifierOptions.d.ts +22 -0
- package/es-modules/Data/Modifiers/RangeModifierOptions.js +15 -0
- package/es-modules/Data/Modifiers/SortModifier.d.ts +54 -0
- package/es-modules/Data/Modifiers/SortModifier.js +144 -0
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +44 -0
- package/es-modules/Data/Modifiers/SortModifierOptions.js +14 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.d.ts +148 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.js +17 -0
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +115 -0
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +231 -0
- package/es-modules/Grid/Core/Credits.d.ts +57 -0
- package/es-modules/Grid/Core/Credits.js +125 -0
- package/es-modules/Grid/Core/Defaults.d.ts +20 -0
- package/es-modules/Grid/Core/Defaults.js +148 -0
- package/es-modules/Grid/Core/Globals.d.ts +103 -0
- package/es-modules/Grid/Core/Globals.js +134 -0
- package/es-modules/Grid/Core/Grid.d.ts +295 -0
- package/es-modules/Grid/Core/Grid.js +730 -0
- package/es-modules/Grid/Core/GridUtils.d.ts +110 -0
- package/es-modules/Grid/Core/GridUtils.js +191 -0
- package/es-modules/Grid/Core/Options.d.ts +599 -0
- package/es-modules/Grid/Core/Options.js +16 -0
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +7 -0
- package/es-modules/Grid/Core/Pagination/Icons.js +7 -0
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +278 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +842 -0
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +228 -0
- package/es-modules/Grid/Core/Querying/FilteringController.d.ts +66 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +256 -0
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +50 -0
- package/es-modules/Grid/Core/Querying/PaginationController.js +101 -0
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +58 -0
- package/es-modules/Grid/Core/Querying/QueryingController.js +127 -0
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +67 -0
- package/es-modules/Grid/Core/Querying/SortingController.js +136 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.d.ts +114 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +351 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +14 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +86 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +19 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +80 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.d.ts +52 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.js +81 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +56 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +170 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.d.ts +55 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +182 -0
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +87 -0
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +346 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +88 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.js +231 -0
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +79 -0
- package/es-modules/Grid/Core/Table/Body/TableRow.js +177 -0
- package/es-modules/Grid/Core/Table/Cell.d.ts +92 -0
- package/es-modules/Grid/Core/Table/Cell.js +223 -0
- package/es-modules/Grid/Core/Table/CellContent/CellContent.d.ts +30 -0
- package/es-modules/Grid/Core/Table/CellContent/CellContent.js +40 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.d.ts +19 -0
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +98 -0
- package/es-modules/Grid/Core/Table/Column.d.ts +136 -0
- package/es-modules/Grid/Core/Table/Column.js +230 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +62 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.d.ts +32 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +68 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +53 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.d.ts +7 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +63 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.d.ts +92 -0
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +194 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +68 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +187 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.d.ts +29 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +77 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.d.ts +13 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +79 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +71 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.js +66 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.d.ts +25 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +65 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +81 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.d.ts +12 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +80 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +81 -0
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +70 -0
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +225 -0
- package/es-modules/Grid/Core/Table/Header/HeaderRow.d.ts +53 -0
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +182 -0
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +65 -0
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +159 -0
- package/es-modules/Grid/Core/Table/Row.d.ts +76 -0
- package/es-modules/Grid/Core/Table/Row.js +131 -0
- package/es-modules/Grid/Core/Table/Table.d.ts +181 -0
- package/es-modules/Grid/Core/Table/Table.js +399 -0
- package/es-modules/Grid/Core/UI/Button.d.ts +31 -0
- package/es-modules/Grid/Core/UI/Button.js +16 -0
- package/es-modules/Grid/Core/UI/ContextMenu.d.ts +38 -0
- package/es-modules/Grid/Core/UI/ContextMenu.js +132 -0
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +126 -0
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +183 -0
- package/es-modules/Grid/Core/UI/Popup.d.ts +149 -0
- package/es-modules/Grid/Core/UI/Popup.js +271 -0
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +53 -0
- package/es-modules/Grid/Core/UI/SvgIcons.js +158 -0
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +16 -0
- package/es-modules/Grid/Core/UI/Toolbar.js +16 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +135 -0
- package/es-modules/Grid/Core/UI/ToolbarButton.js +191 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +112 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.d.ts +80 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +211 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.d.ts +123 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +198 -0
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.d.ts +23 -0
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.js +45 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.d.ts +50 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +41 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.d.ts +18 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +58 -0
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.d.ts +48 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +18 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +79 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +30 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +122 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.d.ts +12 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.js +39 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.d.ts +66 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +145 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.d.ts +12 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.js +38 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +158 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +173 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +28 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +157 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +58 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +168 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.d.ts +13 -0
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.js +41 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.d.ts +50 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.d.ts +26 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.js +16 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.d.ts +52 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.d.ts +74 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +66 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +45 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +89 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.d.ts +54 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +65 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.d.ts +43 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +74 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.d.ts +37 -0
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +64 -0
- package/es-modules/Grid/Pro/ColumnTypes/ColumnDataType.d.ts +29 -0
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +118 -0
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +270 -0
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +32 -0
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +63 -0
- package/es-modules/Grid/Pro/Credits/CreditsPro.d.ts +35 -0
- package/es-modules/Grid/Pro/Credits/CreditsPro.js +112 -0
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.d.ts +28 -0
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +61 -0
- package/es-modules/Grid/Pro/Export/Exporting.d.ts +68 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +202 -0
- package/es-modules/Grid/Pro/Export/ExportingComposition.d.ts +68 -0
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +55 -0
- package/es-modules/Grid/Pro/GridEvents.d.ts +119 -0
- package/es-modules/Grid/Pro/GridEvents.js +107 -0
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +75 -0
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +76 -0
- package/es-modules/Grid/Pro/highcharts.d.ts +7 -0
- package/es-modules/Grid/index.d.ts +5 -0
- package/es-modules/Grid/index.js +19 -0
- package/es-modules/Shared/BaseForm.d.ts +49 -0
- package/es-modules/Shared/BaseForm.js +126 -0
- package/es-modules/Shared/DownloadURL.d.ts +85 -0
- package/es-modules/Shared/DownloadURL.js +198 -0
- package/es-modules/Shared/LangOptionsCore.d.ts +27 -0
- package/es-modules/Shared/TimeBase.d.ts +353 -0
- package/es-modules/Shared/TimeBase.js +830 -0
- package/es-modules/Shared/Types.d.ts +48 -0
- package/es-modules/masters/grid-pro.src.d.ts +99 -0
- package/es-modules/masters/grid-pro.src.js +129 -0
- package/grid-pro.d.ts +50 -0
- package/grid-pro.js +12 -0
- package/grid-pro.js.map +1 -0
- package/grid-pro.src.d.ts +50 -0
- package/grid-pro.src.js +26623 -0
- package/package.json +21 -0
|
@@ -0,0 +1,930 @@
|
|
|
1
|
+
/* *
|
|
2
|
+
*
|
|
3
|
+
* (c) 2009-2025 Highsoft AS
|
|
4
|
+
*
|
|
5
|
+
* License: www.highcharts.com/license
|
|
6
|
+
*
|
|
7
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
8
|
+
*
|
|
9
|
+
* Authors:
|
|
10
|
+
* - Sophie Bremer
|
|
11
|
+
* - Gøran Slettemark
|
|
12
|
+
* - Jomar Hønsi
|
|
13
|
+
* - Dawid Dragula
|
|
14
|
+
*
|
|
15
|
+
* */
|
|
16
|
+
'use strict';
|
|
17
|
+
import DataTableCore from './DataTableCore.js';
|
|
18
|
+
import ColumnUtils from './ColumnUtils.js';
|
|
19
|
+
const { splice, setLength } = ColumnUtils;
|
|
20
|
+
import U from '../Core/Utilities.js';
|
|
21
|
+
const { addEvent, defined, extend, fireEvent, isNumber, uniqueKey } = U;
|
|
22
|
+
/* *
|
|
23
|
+
*
|
|
24
|
+
* Class
|
|
25
|
+
*
|
|
26
|
+
* */
|
|
27
|
+
/**
|
|
28
|
+
* Class to manage columns and rows in a table structure. It provides methods
|
|
29
|
+
* to add, remove, and manipulate columns and rows, as well as to retrieve data
|
|
30
|
+
* from specific cells.
|
|
31
|
+
*
|
|
32
|
+
* @class
|
|
33
|
+
* @name Highcharts.DataTable
|
|
34
|
+
*
|
|
35
|
+
* @param {Highcharts.DataTableOptions} [options]
|
|
36
|
+
* Options to initialize the new DataTable instance.
|
|
37
|
+
*/
|
|
38
|
+
class DataTable extends DataTableCore {
|
|
39
|
+
/* *
|
|
40
|
+
*
|
|
41
|
+
* Constructor
|
|
42
|
+
*
|
|
43
|
+
* */
|
|
44
|
+
constructor(options = {}) {
|
|
45
|
+
super(options);
|
|
46
|
+
this.metadata = options.metadata;
|
|
47
|
+
}
|
|
48
|
+
/* *
|
|
49
|
+
*
|
|
50
|
+
* Functions
|
|
51
|
+
*
|
|
52
|
+
* */
|
|
53
|
+
/**
|
|
54
|
+
* Returns a clone of this table. The cloned table is completely independent
|
|
55
|
+
* of the original, and any changes made to the clone will not affect
|
|
56
|
+
* the original table.
|
|
57
|
+
*
|
|
58
|
+
* @function Highcharts.DataTable#clone
|
|
59
|
+
*
|
|
60
|
+
* @param {boolean} [skipColumns]
|
|
61
|
+
* Whether to clone columns or not.
|
|
62
|
+
*
|
|
63
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
64
|
+
* Custom information for pending events.
|
|
65
|
+
*
|
|
66
|
+
* @return {Highcharts.DataTable}
|
|
67
|
+
* Clone of this data table.
|
|
68
|
+
*
|
|
69
|
+
* @emits #cloneTable
|
|
70
|
+
* @emits #afterCloneTable
|
|
71
|
+
*/
|
|
72
|
+
clone(skipColumns, eventDetail) {
|
|
73
|
+
const table = this, tableOptions = {};
|
|
74
|
+
table.emit({ type: 'cloneTable', detail: eventDetail });
|
|
75
|
+
if (!skipColumns) {
|
|
76
|
+
tableOptions.columns = table.columns;
|
|
77
|
+
}
|
|
78
|
+
if (!table.autoId) {
|
|
79
|
+
tableOptions.id = table.id;
|
|
80
|
+
}
|
|
81
|
+
const tableClone = new DataTable(tableOptions);
|
|
82
|
+
if (!skipColumns) {
|
|
83
|
+
tableClone.versionTag = table.versionTag;
|
|
84
|
+
tableClone.originalRowIndexes = table.originalRowIndexes;
|
|
85
|
+
tableClone.localRowIndexes = table.localRowIndexes;
|
|
86
|
+
}
|
|
87
|
+
table.emit({
|
|
88
|
+
type: 'afterCloneTable',
|
|
89
|
+
detail: eventDetail,
|
|
90
|
+
tableClone
|
|
91
|
+
});
|
|
92
|
+
return tableClone;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Deletes columns from the table.
|
|
96
|
+
*
|
|
97
|
+
* @function Highcharts.DataTable#deleteColumns
|
|
98
|
+
*
|
|
99
|
+
* @param {Array<string>} [columnIds]
|
|
100
|
+
* Names of columns to delete. If no array is provided, all
|
|
101
|
+
* columns will be deleted.
|
|
102
|
+
*
|
|
103
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
104
|
+
* Custom information for pending events.
|
|
105
|
+
*
|
|
106
|
+
* @return {Highcharts.DataTableColumnCollection|undefined}
|
|
107
|
+
* Returns the deleted columns, if found.
|
|
108
|
+
*
|
|
109
|
+
* @emits #deleteColumns
|
|
110
|
+
* @emits #afterDeleteColumns
|
|
111
|
+
*/
|
|
112
|
+
deleteColumns(columnIds, eventDetail) {
|
|
113
|
+
const table = this, columns = table.columns, deletedColumns = {}, modifiedColumns = {}, modifier = table.modifier, rowCount = table.rowCount;
|
|
114
|
+
columnIds = (columnIds || Object.keys(columns));
|
|
115
|
+
if (columnIds.length) {
|
|
116
|
+
table.emit({
|
|
117
|
+
type: 'deleteColumns',
|
|
118
|
+
columnIds,
|
|
119
|
+
detail: eventDetail
|
|
120
|
+
});
|
|
121
|
+
for (let i = 0, iEnd = columnIds.length, column, columnId; i < iEnd; ++i) {
|
|
122
|
+
columnId = columnIds[i];
|
|
123
|
+
column = columns[columnId];
|
|
124
|
+
if (column) {
|
|
125
|
+
deletedColumns[columnId] = column;
|
|
126
|
+
modifiedColumns[columnId] = new Array(rowCount);
|
|
127
|
+
}
|
|
128
|
+
delete columns[columnId];
|
|
129
|
+
}
|
|
130
|
+
if (!Object.keys(columns).length) {
|
|
131
|
+
table.rowCount = 0;
|
|
132
|
+
this.deleteRowIndexReferences();
|
|
133
|
+
}
|
|
134
|
+
if (modifier) {
|
|
135
|
+
modifier.modifyTable(table);
|
|
136
|
+
}
|
|
137
|
+
table.emit({
|
|
138
|
+
type: 'afterDeleteColumns',
|
|
139
|
+
columns: deletedColumns,
|
|
140
|
+
columnIds,
|
|
141
|
+
detail: eventDetail
|
|
142
|
+
});
|
|
143
|
+
return deletedColumns;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Deletes the row index references. This is useful when the original table
|
|
148
|
+
* is deleted, and the references are no longer needed. This table is
|
|
149
|
+
* then considered an original table or a table that has the same rows
|
|
150
|
+
* order as the original table.
|
|
151
|
+
*/
|
|
152
|
+
deleteRowIndexReferences() {
|
|
153
|
+
delete this.originalRowIndexes;
|
|
154
|
+
delete this.localRowIndexes;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Deletes rows in this table.
|
|
158
|
+
*
|
|
159
|
+
* @function Highcharts.DataTable#deleteRows
|
|
160
|
+
*
|
|
161
|
+
* @param {number} [rowIndex]
|
|
162
|
+
* Index to start delete of rows. If not specified, all rows will be
|
|
163
|
+
* deleted.
|
|
164
|
+
*
|
|
165
|
+
* @param {number} [rowCount=1]
|
|
166
|
+
* Number of rows to delete.
|
|
167
|
+
*
|
|
168
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
169
|
+
* Custom information for pending events.
|
|
170
|
+
*
|
|
171
|
+
* @return {Array<Highcharts.DataTableRow>}
|
|
172
|
+
* Returns the deleted rows, if found.
|
|
173
|
+
*
|
|
174
|
+
* @emits #deleteRows
|
|
175
|
+
* @emits #afterDeleteRows
|
|
176
|
+
*/
|
|
177
|
+
deleteRows(rowIndex, rowCount = 1, eventDetail) {
|
|
178
|
+
const table = this, deletedRows = [], modifiedRows = [], modifier = table.modifier;
|
|
179
|
+
table.emit({
|
|
180
|
+
type: 'deleteRows',
|
|
181
|
+
detail: eventDetail,
|
|
182
|
+
rowCount,
|
|
183
|
+
rowIndex: (rowIndex || 0)
|
|
184
|
+
});
|
|
185
|
+
if (typeof rowIndex === 'undefined') {
|
|
186
|
+
rowIndex = 0;
|
|
187
|
+
rowCount = table.rowCount;
|
|
188
|
+
}
|
|
189
|
+
if (rowCount > 0 && rowIndex < table.rowCount) {
|
|
190
|
+
const columns = table.columns, columnIds = Object.keys(columns);
|
|
191
|
+
for (let i = 0, iEnd = columnIds.length, column, deletedCells, columnId; i < iEnd; ++i) {
|
|
192
|
+
columnId = columnIds[i];
|
|
193
|
+
column = columns[columnId];
|
|
194
|
+
const result = splice(column, rowIndex, rowCount);
|
|
195
|
+
deletedCells = result.removed;
|
|
196
|
+
columns[columnId] = column = result.array;
|
|
197
|
+
if (!i) {
|
|
198
|
+
table.rowCount = column.length;
|
|
199
|
+
}
|
|
200
|
+
for (let j = 0, jEnd = deletedCells.length; j < jEnd; ++j) {
|
|
201
|
+
deletedRows[j] = (deletedRows[j] || []);
|
|
202
|
+
deletedRows[j][i] = deletedCells[j];
|
|
203
|
+
}
|
|
204
|
+
modifiedRows.push(new Array(iEnd));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (modifier) {
|
|
208
|
+
modifier.modifyTable(table);
|
|
209
|
+
}
|
|
210
|
+
table.emit({
|
|
211
|
+
type: 'afterDeleteRows',
|
|
212
|
+
detail: eventDetail,
|
|
213
|
+
rowCount,
|
|
214
|
+
rowIndex: (rowIndex || 0),
|
|
215
|
+
rows: deletedRows
|
|
216
|
+
});
|
|
217
|
+
return deletedRows;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Emits an event on this table to all registered callbacks of the given
|
|
221
|
+
* event.
|
|
222
|
+
* @private
|
|
223
|
+
*
|
|
224
|
+
* @param {DataTable.Event} e
|
|
225
|
+
* Event object with event information.
|
|
226
|
+
*/
|
|
227
|
+
emit(e) {
|
|
228
|
+
if ([
|
|
229
|
+
'afterDeleteColumns',
|
|
230
|
+
'afterDeleteRows',
|
|
231
|
+
'afterSetCell',
|
|
232
|
+
'afterSetColumns',
|
|
233
|
+
'afterSetRows'
|
|
234
|
+
].includes(e.type)) {
|
|
235
|
+
this.versionTag = uniqueKey();
|
|
236
|
+
}
|
|
237
|
+
fireEvent(this, e.type, e);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Fetches a single cell value.
|
|
241
|
+
*
|
|
242
|
+
* @function Highcharts.DataTable#getCell
|
|
243
|
+
*
|
|
244
|
+
* @param {string} columnId
|
|
245
|
+
* Column name of the cell to retrieve.
|
|
246
|
+
*
|
|
247
|
+
* @param {number} rowIndex
|
|
248
|
+
* Row index of the cell to retrieve.
|
|
249
|
+
*
|
|
250
|
+
* @return {Highcharts.DataTableCellType|undefined}
|
|
251
|
+
* Returns the cell value or `undefined`.
|
|
252
|
+
*/
|
|
253
|
+
getCell(columnId, rowIndex) {
|
|
254
|
+
const table = this;
|
|
255
|
+
const column = table.columns[columnId];
|
|
256
|
+
if (column) {
|
|
257
|
+
return column[rowIndex];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Fetches the given column by the canonical column name.
|
|
262
|
+
* This function is a simplified wrap of {@link getColumns}.
|
|
263
|
+
*
|
|
264
|
+
* @function Highcharts.DataTable#getColumn
|
|
265
|
+
*
|
|
266
|
+
* @param {string} columnId
|
|
267
|
+
* Name of the column to get.
|
|
268
|
+
*
|
|
269
|
+
* @param {boolean} [asReference]
|
|
270
|
+
* Whether to return the column as a readonly reference.
|
|
271
|
+
*
|
|
272
|
+
* @return {Highcharts.DataTableColumn|undefined}
|
|
273
|
+
* A copy of the column, or `undefined` if not found.
|
|
274
|
+
*/
|
|
275
|
+
getColumn(columnId, asReference) {
|
|
276
|
+
return this.getColumns([columnId], asReference)[columnId];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Fetches all column IDs.
|
|
280
|
+
*
|
|
281
|
+
* @function Highcharts.DataTable#getColumnIds
|
|
282
|
+
*
|
|
283
|
+
* @return {Array<string>}
|
|
284
|
+
* Returns all column IDs.
|
|
285
|
+
*/
|
|
286
|
+
getColumnIds() {
|
|
287
|
+
return Object.keys(this.columns);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Retrieves all or the given columns.
|
|
291
|
+
*
|
|
292
|
+
* @function Highcharts.DataTable#getColumns
|
|
293
|
+
*
|
|
294
|
+
* @param {Array<string>} [columnIds]
|
|
295
|
+
* Column names to retrieve.
|
|
296
|
+
*
|
|
297
|
+
* @param {boolean} [asReference]
|
|
298
|
+
* Whether to return columns as a readonly reference.
|
|
299
|
+
*
|
|
300
|
+
* @param {boolean} [asBasicColumns]
|
|
301
|
+
* Whether to transform all typed array columns to normal arrays.
|
|
302
|
+
*
|
|
303
|
+
* @return {Highcharts.DataTableColumnCollection}
|
|
304
|
+
* Collection of columns. If a requested column was not found, it is
|
|
305
|
+
* `undefined`.
|
|
306
|
+
*/
|
|
307
|
+
getColumns(columnIds, asReference, asBasicColumns) {
|
|
308
|
+
const table = this, tableColumns = table.columns, columns = {};
|
|
309
|
+
columnIds = (columnIds || Object.keys(tableColumns));
|
|
310
|
+
for (let i = 0, iEnd = columnIds.length, column, columnId; i < iEnd; ++i) {
|
|
311
|
+
columnId = columnIds[i];
|
|
312
|
+
column = tableColumns[columnId];
|
|
313
|
+
if (column) {
|
|
314
|
+
if (asReference) {
|
|
315
|
+
columns[columnId] = column;
|
|
316
|
+
}
|
|
317
|
+
else if (asBasicColumns && !Array.isArray(column)) {
|
|
318
|
+
columns[columnId] = Array.from(column);
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
columns[columnId] = column.slice();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return columns;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Takes the original row index and returns the local row index in the
|
|
329
|
+
* modified table for which this function is called.
|
|
330
|
+
*
|
|
331
|
+
* @param {number} originalRowIndex
|
|
332
|
+
* Original row index to get the local row index for.
|
|
333
|
+
*
|
|
334
|
+
* @return {number|undefined}
|
|
335
|
+
* Returns the local row index or `undefined` if not found.
|
|
336
|
+
*/
|
|
337
|
+
getLocalRowIndex(originalRowIndex) {
|
|
338
|
+
const { localRowIndexes } = this;
|
|
339
|
+
if (localRowIndexes) {
|
|
340
|
+
return localRowIndexes[originalRowIndex];
|
|
341
|
+
}
|
|
342
|
+
return originalRowIndex;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Returns the modifier associated with this table, if any.
|
|
346
|
+
*
|
|
347
|
+
* @return {Highcharts.DataModifier|undefined}
|
|
348
|
+
* Returns the modifier or `undefined`.
|
|
349
|
+
*
|
|
350
|
+
* @private
|
|
351
|
+
*/
|
|
352
|
+
getModifier() {
|
|
353
|
+
return this.modifier;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Takes the local row index and returns the index of the corresponding row
|
|
357
|
+
* in the original table.
|
|
358
|
+
*
|
|
359
|
+
* @param {number} rowIndex
|
|
360
|
+
* Local row index to get the original row index for.
|
|
361
|
+
*
|
|
362
|
+
* @return {number|undefined}
|
|
363
|
+
* Returns the original row index or `undefined` if not found.
|
|
364
|
+
*/
|
|
365
|
+
getOriginalRowIndex(rowIndex) {
|
|
366
|
+
const { originalRowIndexes } = this;
|
|
367
|
+
if (originalRowIndexes) {
|
|
368
|
+
return originalRowIndexes[rowIndex];
|
|
369
|
+
}
|
|
370
|
+
return rowIndex;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Retrieves the row at a given index. This function is a simplified wrap of
|
|
374
|
+
* {@link getRows}.
|
|
375
|
+
*
|
|
376
|
+
* @function Highcharts.DataTable#getRow
|
|
377
|
+
*
|
|
378
|
+
* @param {number} rowIndex
|
|
379
|
+
* Row index to retrieve. First row has index 0.
|
|
380
|
+
*
|
|
381
|
+
* @param {Array<string>} [columnIds]
|
|
382
|
+
* Column names in order to retrieve.
|
|
383
|
+
*
|
|
384
|
+
* @return {Highcharts.DataTableRow}
|
|
385
|
+
* Returns the row values, or `undefined` if not found.
|
|
386
|
+
*/
|
|
387
|
+
getRow(rowIndex, columnIds) {
|
|
388
|
+
return this.getRows(rowIndex, 1, columnIds)[0];
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Returns the number of rows in this table.
|
|
392
|
+
*
|
|
393
|
+
* @function Highcharts.DataTable#getRowCount
|
|
394
|
+
*
|
|
395
|
+
* @return {number}
|
|
396
|
+
* Number of rows in this table.
|
|
397
|
+
*/
|
|
398
|
+
getRowCount() {
|
|
399
|
+
// @todo Implement via property getter `.length` browsers supported
|
|
400
|
+
return this.rowCount;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Retrieves the index of the first row matching a specific cell value.
|
|
404
|
+
*
|
|
405
|
+
* @function Highcharts.DataTable#getRowIndexBy
|
|
406
|
+
*
|
|
407
|
+
* @param {string} columnId
|
|
408
|
+
* Column to search in.
|
|
409
|
+
*
|
|
410
|
+
* @param {Highcharts.DataTableCellType} cellValue
|
|
411
|
+
* Cell value to search for. `NaN` and `undefined` are not supported.
|
|
412
|
+
*
|
|
413
|
+
* @param {number} [rowIndexOffset]
|
|
414
|
+
* Index offset to start searching.
|
|
415
|
+
*
|
|
416
|
+
* @return {number|undefined}
|
|
417
|
+
* Index of the first row matching the cell value.
|
|
418
|
+
*/
|
|
419
|
+
getRowIndexBy(columnId, cellValue, rowIndexOffset) {
|
|
420
|
+
const table = this;
|
|
421
|
+
const column = table.columns[columnId];
|
|
422
|
+
if (column) {
|
|
423
|
+
let rowIndex = -1;
|
|
424
|
+
if (Array.isArray(column)) {
|
|
425
|
+
// Normal array
|
|
426
|
+
rowIndex = column.indexOf(cellValue, rowIndexOffset);
|
|
427
|
+
}
|
|
428
|
+
else if (isNumber(cellValue)) {
|
|
429
|
+
// Typed array
|
|
430
|
+
rowIndex = column.indexOf(cellValue, rowIndexOffset);
|
|
431
|
+
}
|
|
432
|
+
if (rowIndex !== -1) {
|
|
433
|
+
return rowIndex;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Retrieves the row at a given index. This function is a simplified wrap of
|
|
439
|
+
* {@link getRowObjects}.
|
|
440
|
+
*
|
|
441
|
+
* @function Highcharts.DataTable#getRowObject
|
|
442
|
+
*
|
|
443
|
+
* @param {number} rowIndex
|
|
444
|
+
* Row index.
|
|
445
|
+
*
|
|
446
|
+
* @param {Array<string>} [columnIds]
|
|
447
|
+
* Column names and their order to retrieve.
|
|
448
|
+
*
|
|
449
|
+
* @return {Highcharts.DataTableRowObject}
|
|
450
|
+
* Returns the row values, or `undefined` if not found.
|
|
451
|
+
*/
|
|
452
|
+
getRowObject(rowIndex, columnIds) {
|
|
453
|
+
return this.getRowObjects(rowIndex, 1, columnIds)[0];
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Fetches all or a number of rows as an object.
|
|
457
|
+
*
|
|
458
|
+
* @function Highcharts.DataTable#getRowObjects
|
|
459
|
+
*
|
|
460
|
+
* @param {number} [rowIndex]
|
|
461
|
+
* Index of the first row to fetch. Defaults to first row at index `0`.
|
|
462
|
+
*
|
|
463
|
+
* @param {number} [rowCount]
|
|
464
|
+
* Number of rows to fetch. Defaults to maximal number of rows.
|
|
465
|
+
*
|
|
466
|
+
* @param {Array<string>} [columnIds]
|
|
467
|
+
* Column names and their order to retrieve.
|
|
468
|
+
*
|
|
469
|
+
* @return {Highcharts.DataTableRowObject}
|
|
470
|
+
* Returns retrieved rows.
|
|
471
|
+
*/
|
|
472
|
+
getRowObjects(rowIndex = 0, rowCount = (this.rowCount - rowIndex), columnIds) {
|
|
473
|
+
const table = this, columns = table.columns, rows = new Array(rowCount);
|
|
474
|
+
columnIds = (columnIds || Object.keys(columns));
|
|
475
|
+
for (let i = rowIndex, i2 = 0, iEnd = Math.min(table.rowCount, (rowIndex + rowCount)), column, row; i < iEnd; ++i, ++i2) {
|
|
476
|
+
row = rows[i2] = {};
|
|
477
|
+
for (const columnId of columnIds) {
|
|
478
|
+
column = columns[columnId];
|
|
479
|
+
row[columnId] = (column ? column[i] : void 0);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return rows;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Fetches all or a number of rows as an array.
|
|
486
|
+
*
|
|
487
|
+
* @function Highcharts.DataTable#getRows
|
|
488
|
+
*
|
|
489
|
+
* @param {number} [rowIndex]
|
|
490
|
+
* Index of the first row to fetch. Defaults to first row at index `0`.
|
|
491
|
+
*
|
|
492
|
+
* @param {number} [rowCount]
|
|
493
|
+
* Number of rows to fetch. Defaults to maximal number of rows.
|
|
494
|
+
*
|
|
495
|
+
* @param {Array<string>} [columnIds]
|
|
496
|
+
* Column names and their order to retrieve.
|
|
497
|
+
*
|
|
498
|
+
* @return {Highcharts.DataTableRow}
|
|
499
|
+
* Returns retrieved rows.
|
|
500
|
+
*/
|
|
501
|
+
getRows(rowIndex = 0, rowCount = (this.rowCount - rowIndex), columnIds) {
|
|
502
|
+
const table = this, columns = table.columns, rows = new Array(rowCount);
|
|
503
|
+
columnIds = (columnIds || Object.keys(columns));
|
|
504
|
+
for (let i = rowIndex, i2 = 0, iEnd = Math.min(table.rowCount, (rowIndex + rowCount)), column, row; i < iEnd; ++i, ++i2) {
|
|
505
|
+
row = rows[i2] = [];
|
|
506
|
+
for (const columnId of columnIds) {
|
|
507
|
+
column = columns[columnId];
|
|
508
|
+
row.push(column ? column[i] : void 0);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return rows;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Returns the unique version tag of the current state of the table.
|
|
515
|
+
*
|
|
516
|
+
* @function Highcharts.DataTable#getVersionTag
|
|
517
|
+
*
|
|
518
|
+
* @return {string}
|
|
519
|
+
* Unique version tag.
|
|
520
|
+
*/
|
|
521
|
+
getVersionTag() {
|
|
522
|
+
return this.versionTag;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Determines whether all specified column names exist in the table.
|
|
526
|
+
*
|
|
527
|
+
* @function Highcharts.DataTable#hasColumns
|
|
528
|
+
*
|
|
529
|
+
* @param {Array<string>} columnIds
|
|
530
|
+
* Column names to check.
|
|
531
|
+
*
|
|
532
|
+
* @return {boolean}
|
|
533
|
+
* Returns `true` if all columns have been found, otherwise `false`.
|
|
534
|
+
*/
|
|
535
|
+
hasColumns(columnIds) {
|
|
536
|
+
const table = this, columns = table.columns;
|
|
537
|
+
for (let i = 0, iEnd = columnIds.length, columnId; i < iEnd; ++i) {
|
|
538
|
+
columnId = columnIds[i];
|
|
539
|
+
if (!columns[columnId]) {
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Checks if any row in the specified column contains the given cell value.
|
|
547
|
+
*
|
|
548
|
+
* @function Highcharts.DataTable#hasRowWith
|
|
549
|
+
*
|
|
550
|
+
* @param {string} columnId
|
|
551
|
+
* Column to search in.
|
|
552
|
+
*
|
|
553
|
+
* @param {Highcharts.DataTableCellType} cellValue
|
|
554
|
+
* Cell value to search for. `NaN` and `undefined` are not supported.
|
|
555
|
+
*
|
|
556
|
+
* @return {boolean}
|
|
557
|
+
* True, if a row has been found, otherwise false.
|
|
558
|
+
*/
|
|
559
|
+
hasRowWith(columnId, cellValue) {
|
|
560
|
+
const table = this;
|
|
561
|
+
const column = table.columns[columnId];
|
|
562
|
+
// Normal array
|
|
563
|
+
if (Array.isArray(column)) {
|
|
564
|
+
return (column.indexOf(cellValue) !== -1);
|
|
565
|
+
}
|
|
566
|
+
// Typed array
|
|
567
|
+
if (defined(cellValue) && Number.isFinite(cellValue)) {
|
|
568
|
+
return (column.indexOf(+cellValue) !== -1);
|
|
569
|
+
}
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Registers a callback function to be executed when a specific event is
|
|
574
|
+
* emitted. To stop listening to the event, call the function returned by
|
|
575
|
+
* this method.
|
|
576
|
+
*
|
|
577
|
+
* @function Highcharts.DataTable#on
|
|
578
|
+
*
|
|
579
|
+
* @param {string} type
|
|
580
|
+
* Event type as a string.
|
|
581
|
+
*
|
|
582
|
+
* @param {Highcharts.EventCallbackFunction<Highcharts.DataTable>} callback
|
|
583
|
+
* Function to register for an event callback.
|
|
584
|
+
*
|
|
585
|
+
* @return {Function}
|
|
586
|
+
* Function to unregister callback from the event.
|
|
587
|
+
*/
|
|
588
|
+
on(type, callback) {
|
|
589
|
+
return addEvent(this, type, callback);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Changes the ID of an existing column to a new ID, effectively renaming
|
|
593
|
+
* the column.
|
|
594
|
+
*
|
|
595
|
+
* @function Highcharts.DataTable#changeColumnId
|
|
596
|
+
*
|
|
597
|
+
* @param {string} columnId
|
|
598
|
+
* Id of the column to be changed.
|
|
599
|
+
*
|
|
600
|
+
* @param {string} newColumnId
|
|
601
|
+
* New id of the column.
|
|
602
|
+
*
|
|
603
|
+
* @return {boolean}
|
|
604
|
+
* Returns `true` if successful, `false` if the column was not found.
|
|
605
|
+
*/
|
|
606
|
+
changeColumnId(columnId, newColumnId) {
|
|
607
|
+
const table = this, columns = table.columns;
|
|
608
|
+
if (columns[columnId]) {
|
|
609
|
+
if (columnId !== newColumnId) {
|
|
610
|
+
columns[newColumnId] = columns[columnId];
|
|
611
|
+
delete columns[columnId];
|
|
612
|
+
}
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
return false;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Sets the value of a specific cell identified by column ID and row index.
|
|
619
|
+
* If the column does not exist, it will be created. If the row index is
|
|
620
|
+
* beyond the current row count, the table will be expanded to accommodate
|
|
621
|
+
* the new cell.
|
|
622
|
+
*
|
|
623
|
+
* @function Highcharts.DataTable#setCell
|
|
624
|
+
*
|
|
625
|
+
* @param {string} columnId
|
|
626
|
+
* Column name to set.
|
|
627
|
+
*
|
|
628
|
+
* @param {number|undefined} rowIndex
|
|
629
|
+
* Row index to set.
|
|
630
|
+
*
|
|
631
|
+
* @param {Highcharts.DataTableCellType} cellValue
|
|
632
|
+
* Cell value to set.
|
|
633
|
+
*
|
|
634
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
635
|
+
* Custom information for pending events.
|
|
636
|
+
*
|
|
637
|
+
* @emits #setCell
|
|
638
|
+
* @emits #afterSetCell
|
|
639
|
+
*/
|
|
640
|
+
setCell(columnId, rowIndex, cellValue, eventDetail) {
|
|
641
|
+
const table = this, columns = table.columns, modifier = table.modifier;
|
|
642
|
+
let column = columns[columnId];
|
|
643
|
+
if (column && column[rowIndex] === cellValue) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
table.emit({
|
|
647
|
+
type: 'setCell',
|
|
648
|
+
cellValue,
|
|
649
|
+
columnId: columnId,
|
|
650
|
+
detail: eventDetail,
|
|
651
|
+
rowIndex
|
|
652
|
+
});
|
|
653
|
+
if (!column) {
|
|
654
|
+
column = columns[columnId] = new Array(table.rowCount);
|
|
655
|
+
}
|
|
656
|
+
if (rowIndex >= table.rowCount) {
|
|
657
|
+
table.rowCount = (rowIndex + 1);
|
|
658
|
+
}
|
|
659
|
+
column[rowIndex] = cellValue;
|
|
660
|
+
if (modifier) {
|
|
661
|
+
modifier.modifyTable(table);
|
|
662
|
+
}
|
|
663
|
+
table.emit({
|
|
664
|
+
type: 'afterSetCell',
|
|
665
|
+
cellValue,
|
|
666
|
+
columnId: columnId,
|
|
667
|
+
detail: eventDetail,
|
|
668
|
+
rowIndex
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
/**
|
|
672
|
+
* Replaces or updates multiple columns in the table with new data. If a
|
|
673
|
+
* column does not exist, it will be created and added to the table.
|
|
674
|
+
*
|
|
675
|
+
* @function Highcharts.DataTable#setColumns
|
|
676
|
+
*
|
|
677
|
+
* @param {Highcharts.DataTableColumnCollection} columns
|
|
678
|
+
* Columns as a collection, where the keys are the column names.
|
|
679
|
+
*
|
|
680
|
+
* @param {number} [rowIndex]
|
|
681
|
+
* Index of the first row to change. Keep undefined to reset.
|
|
682
|
+
*
|
|
683
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
684
|
+
* Custom information for pending events.
|
|
685
|
+
*
|
|
686
|
+
* @param {boolean} [typeAsOriginal=false]
|
|
687
|
+
* Determines whether the original column retains its type when data
|
|
688
|
+
* replaced. If `true`, the original column keeps its type. If not
|
|
689
|
+
* (default), the original column will adopt the type of the replacement
|
|
690
|
+
* column.
|
|
691
|
+
*
|
|
692
|
+
* @emits #setColumns
|
|
693
|
+
* @emits #afterSetColumns
|
|
694
|
+
*/
|
|
695
|
+
setColumns(columns, rowIndex, eventDetail, typeAsOriginal) {
|
|
696
|
+
const table = this, tableColumns = table.columns, tableModifier = table.modifier, columnIds = Object.keys(columns);
|
|
697
|
+
let rowCount = table.rowCount;
|
|
698
|
+
table.emit({
|
|
699
|
+
type: 'setColumns',
|
|
700
|
+
columns,
|
|
701
|
+
columnIds,
|
|
702
|
+
detail: eventDetail,
|
|
703
|
+
rowIndex
|
|
704
|
+
});
|
|
705
|
+
if (!defined(rowIndex) && !typeAsOriginal) {
|
|
706
|
+
super.setColumns(columns, rowIndex, extend(eventDetail, { silent: true }));
|
|
707
|
+
}
|
|
708
|
+
else {
|
|
709
|
+
for (let i = 0, iEnd = columnIds.length, column, tableColumn, columnId, ArrayConstructor; i < iEnd; ++i) {
|
|
710
|
+
columnId = columnIds[i];
|
|
711
|
+
column = columns[columnId];
|
|
712
|
+
tableColumn = tableColumns[columnId];
|
|
713
|
+
ArrayConstructor = Object.getPrototypeOf((tableColumn && typeAsOriginal) ? tableColumn : column).constructor;
|
|
714
|
+
if (!tableColumn) {
|
|
715
|
+
tableColumn = new ArrayConstructor(rowCount);
|
|
716
|
+
}
|
|
717
|
+
else if (ArrayConstructor === Array) {
|
|
718
|
+
if (!Array.isArray(tableColumn)) {
|
|
719
|
+
tableColumn = Array.from(tableColumn);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
else if (tableColumn.length < rowCount) {
|
|
723
|
+
tableColumn =
|
|
724
|
+
new ArrayConstructor(rowCount);
|
|
725
|
+
tableColumn.set(tableColumns[columnId]);
|
|
726
|
+
}
|
|
727
|
+
tableColumns[columnId] = tableColumn;
|
|
728
|
+
for (let i = (rowIndex || 0), iEnd = column.length; i < iEnd; ++i) {
|
|
729
|
+
tableColumn[i] = column[i];
|
|
730
|
+
}
|
|
731
|
+
rowCount = Math.max(rowCount, column.length);
|
|
732
|
+
}
|
|
733
|
+
this.applyRowCount(rowCount);
|
|
734
|
+
}
|
|
735
|
+
if (tableModifier) {
|
|
736
|
+
tableModifier.modifyTable(table);
|
|
737
|
+
}
|
|
738
|
+
table.emit({
|
|
739
|
+
type: 'afterSetColumns',
|
|
740
|
+
columns,
|
|
741
|
+
columnIds,
|
|
742
|
+
detail: eventDetail,
|
|
743
|
+
rowIndex
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Assigns a new data modifier to the table.
|
|
748
|
+
*
|
|
749
|
+
* This method does not modify the table directly. Instead, it sets the
|
|
750
|
+
* `.modified` property of the table with a modified copy of this table,
|
|
751
|
+
* as produced by the modifier.
|
|
752
|
+
*
|
|
753
|
+
* @param {Highcharts.DataModifier} [modifier]
|
|
754
|
+
* Modifier to set, or `undefined` to unset.
|
|
755
|
+
*
|
|
756
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
757
|
+
* Custom information for pending events.
|
|
758
|
+
*
|
|
759
|
+
* @return {Promise<Highcharts.DataTable>}
|
|
760
|
+
* Resolves to this table if successful, or rejects on failure.
|
|
761
|
+
*
|
|
762
|
+
* @emits #setModifier
|
|
763
|
+
* @emits #afterSetModifier
|
|
764
|
+
*/
|
|
765
|
+
setModifier(modifier, eventDetail) {
|
|
766
|
+
const table = this;
|
|
767
|
+
let promise;
|
|
768
|
+
table.emit({
|
|
769
|
+
type: 'setModifier',
|
|
770
|
+
detail: eventDetail,
|
|
771
|
+
modifier,
|
|
772
|
+
modified: table.getModified()
|
|
773
|
+
});
|
|
774
|
+
table.modifier = modifier;
|
|
775
|
+
if (modifier) {
|
|
776
|
+
promise = modifier.modify(table);
|
|
777
|
+
}
|
|
778
|
+
else {
|
|
779
|
+
promise = Promise.resolve(table);
|
|
780
|
+
}
|
|
781
|
+
return promise
|
|
782
|
+
.then((table) => {
|
|
783
|
+
table.emit({
|
|
784
|
+
type: 'afterSetModifier',
|
|
785
|
+
detail: eventDetail,
|
|
786
|
+
modifier,
|
|
787
|
+
modified: table.getModified()
|
|
788
|
+
});
|
|
789
|
+
return table;
|
|
790
|
+
})['catch']((error) => {
|
|
791
|
+
table.emit({
|
|
792
|
+
type: 'setModifierError',
|
|
793
|
+
error,
|
|
794
|
+
modifier,
|
|
795
|
+
modified: table.getModified()
|
|
796
|
+
});
|
|
797
|
+
throw error;
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* Sets the original row indexes for the table. It is used to keep the
|
|
802
|
+
* reference to the original rows when modifying the table.
|
|
803
|
+
*
|
|
804
|
+
* @param {Array<number|undefined>} originalRowIndexes
|
|
805
|
+
* Original row indexes array.
|
|
806
|
+
*
|
|
807
|
+
* @param {boolean} omitLocalRowIndexes
|
|
808
|
+
* Whether to omit the local row indexes calculation. Defaults to `false`.
|
|
809
|
+
*/
|
|
810
|
+
setOriginalRowIndexes(originalRowIndexes, omitLocalRowIndexes = false) {
|
|
811
|
+
this.originalRowIndexes = originalRowIndexes;
|
|
812
|
+
if (omitLocalRowIndexes) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
const modifiedIndexes = this.localRowIndexes = [];
|
|
816
|
+
for (let i = 0, iEnd = originalRowIndexes.length, originalIndex; i < iEnd; ++i) {
|
|
817
|
+
originalIndex = originalRowIndexes[i];
|
|
818
|
+
if (defined(originalIndex)) {
|
|
819
|
+
modifiedIndexes[originalIndex] = i;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Sets cell values of a row. Will insert a new row, if no index was
|
|
825
|
+
* provided, or if the index is higher than the total number of table rows.
|
|
826
|
+
*
|
|
827
|
+
* Note: This function is just a simplified wrap of
|
|
828
|
+
* {@link Highcharts.DataTable#setRows}.
|
|
829
|
+
*
|
|
830
|
+
* @function Highcharts.DataTable#setRow
|
|
831
|
+
*
|
|
832
|
+
* @param {Highcharts.DataTableRow|Highcharts.DataTableRowObject} row
|
|
833
|
+
* Cell values to set.
|
|
834
|
+
*
|
|
835
|
+
* @param {number} [rowIndex]
|
|
836
|
+
* Index of the row to set. Leave `undefind` to add as a new row.
|
|
837
|
+
*
|
|
838
|
+
* @param {boolean} [insert]
|
|
839
|
+
* Whether to insert the row at the given index, or to overwrite the row.
|
|
840
|
+
*
|
|
841
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
842
|
+
* Custom information for pending events.
|
|
843
|
+
*
|
|
844
|
+
* @emits #setRows
|
|
845
|
+
* @emits #afterSetRows
|
|
846
|
+
*/
|
|
847
|
+
setRow(row, rowIndex, insert, eventDetail) {
|
|
848
|
+
this.setRows([row], rowIndex, insert, eventDetail);
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Sets cell values for multiple rows. Will insert new rows, if no index was
|
|
852
|
+
* was provided, or if the index is higher than the total number of table
|
|
853
|
+
* rows.
|
|
854
|
+
*
|
|
855
|
+
* @function Highcharts.DataTable#setRows
|
|
856
|
+
*
|
|
857
|
+
* @param {Array<(Highcharts.DataTableRow|Highcharts.DataTableRowObject)>} rows
|
|
858
|
+
* Row values to set.
|
|
859
|
+
*
|
|
860
|
+
* @param {number} [rowIndex]
|
|
861
|
+
* Index of the first row to set. Leave `undefined` to add as new rows.
|
|
862
|
+
*
|
|
863
|
+
* @param {boolean} [insert]
|
|
864
|
+
* Whether to insert the row at the given index, or to overwrite the row.
|
|
865
|
+
*
|
|
866
|
+
* @param {Highcharts.DataTableEventDetail} [eventDetail]
|
|
867
|
+
* Custom information for pending events.
|
|
868
|
+
*
|
|
869
|
+
* @emits #setRows
|
|
870
|
+
* @emits #afterSetRows
|
|
871
|
+
*/
|
|
872
|
+
setRows(rows, rowIndex = this.rowCount, insert, eventDetail) {
|
|
873
|
+
const table = this, columns = table.columns, columnIds = Object.keys(columns), modifier = table.modifier, rowCount = rows.length;
|
|
874
|
+
table.emit({
|
|
875
|
+
type: 'setRows',
|
|
876
|
+
detail: eventDetail,
|
|
877
|
+
rowCount,
|
|
878
|
+
rowIndex,
|
|
879
|
+
rows
|
|
880
|
+
});
|
|
881
|
+
for (let i = 0, i2 = rowIndex, row; i < rowCount; ++i, ++i2) {
|
|
882
|
+
row = rows[i];
|
|
883
|
+
if (Object.keys(row).length === 0) { // Is empty Object
|
|
884
|
+
for (let j = 0, jEnd = columnIds.length; j < jEnd; ++j) {
|
|
885
|
+
const column = columns[columnIds[j]];
|
|
886
|
+
if (insert) {
|
|
887
|
+
columns[columnIds[j]] = splice(column, i2, 0, true, [null]).array;
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
column[i2] = null;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
else if (Array.isArray(row)) {
|
|
895
|
+
for (let j = 0, jEnd = columnIds.length; j < jEnd; ++j) {
|
|
896
|
+
columns[columnIds[j]][i2] = row[j];
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
super.setRow(row, i2, void 0, { silent: true });
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
const indexRowCount = insert ?
|
|
904
|
+
rowCount + rows.length :
|
|
905
|
+
rowIndex + rowCount;
|
|
906
|
+
if (indexRowCount > table.rowCount) {
|
|
907
|
+
table.rowCount = indexRowCount;
|
|
908
|
+
for (let i = 0, iEnd = columnIds.length; i < iEnd; ++i) {
|
|
909
|
+
const columnId = columnIds[i];
|
|
910
|
+
columns[columnId] = setLength(columns[columnId], indexRowCount);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
if (modifier) {
|
|
914
|
+
modifier.modifyTable(table);
|
|
915
|
+
}
|
|
916
|
+
table.emit({
|
|
917
|
+
type: 'afterSetRows',
|
|
918
|
+
detail: eventDetail,
|
|
919
|
+
rowCount,
|
|
920
|
+
rowIndex,
|
|
921
|
+
rows
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
/* *
|
|
926
|
+
*
|
|
927
|
+
* Default Export
|
|
928
|
+
*
|
|
929
|
+
* */
|
|
930
|
+
export default DataTable;
|