@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,830 @@
|
|
|
1
|
+
/* *
|
|
2
|
+
*
|
|
3
|
+
* (c) 2010-2025 Torstein Honsi
|
|
4
|
+
*
|
|
5
|
+
* License: www.highcharts.com/license
|
|
6
|
+
*
|
|
7
|
+
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
8
|
+
*
|
|
9
|
+
* */
|
|
10
|
+
'use strict';
|
|
11
|
+
import H from '../Core/Globals.js';
|
|
12
|
+
const { pageLang, win } = H;
|
|
13
|
+
import U from '../Core/Utilities.js';
|
|
14
|
+
const { defined, error, extend, isNumber, isObject, isString, merge, objectEach, pad, splat, timeUnits, ucfirst } = U;
|
|
15
|
+
/* *
|
|
16
|
+
*
|
|
17
|
+
* Constants
|
|
18
|
+
*
|
|
19
|
+
* */
|
|
20
|
+
// To do: Remove this when we no longer need support for Safari < v14.1
|
|
21
|
+
const hasOldSafariBug = H.isSafari &&
|
|
22
|
+
win.Intl &&
|
|
23
|
+
!win.Intl.DateTimeFormat.prototype.formatRange;
|
|
24
|
+
const isDateTimeFormatOptions = (obj) => obj.main === void 0;
|
|
25
|
+
/* *
|
|
26
|
+
*
|
|
27
|
+
* Class
|
|
28
|
+
*
|
|
29
|
+
* */
|
|
30
|
+
/* eslint-disable no-invalid-this, valid-jsdoc */
|
|
31
|
+
/**
|
|
32
|
+
* The Time class. Time settings are applied in general for each page using
|
|
33
|
+
* `Highcharts.setOptions`, or individually for each Chart item through the
|
|
34
|
+
* [time](https://api.highcharts.com/highcharts/time) options set.
|
|
35
|
+
*
|
|
36
|
+
* The Time object is available from {@link Highcharts.Chart#time}, which refers
|
|
37
|
+
* to `Highcharts.time` unless individual time settings are applied for each
|
|
38
|
+
* chart.
|
|
39
|
+
*
|
|
40
|
+
* When configuring time settings for individual chart instances, be aware that
|
|
41
|
+
* using `Highcharts.dateFormat` or `Highcharts.time.dateFormat` within
|
|
42
|
+
* formatter callbacks relies on the global time object, which applies the
|
|
43
|
+
* global language and time zone settings. To ensure charts with local time
|
|
44
|
+
* settings function correctly, use `chart.time.dateFormat? instead. However,
|
|
45
|
+
* the recommended best practice is to use `setOptions` to define global time
|
|
46
|
+
* settings unless specific configurations are needed for each chart.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Apply time settings globally
|
|
50
|
+
* Highcharts.setOptions({
|
|
51
|
+
* time: {
|
|
52
|
+
* timezone: 'Europe/London'
|
|
53
|
+
* }
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* // Apply time settings by instance
|
|
57
|
+
* const chart = Highcharts.chart('container', {
|
|
58
|
+
* time: {
|
|
59
|
+
* timezone: 'America/New_York'
|
|
60
|
+
* },
|
|
61
|
+
* series: [{
|
|
62
|
+
* data: [1, 4, 3, 5]
|
|
63
|
+
* }]
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* // Use the Time object of a chart instance
|
|
67
|
+
* console.log(
|
|
68
|
+
* 'Current time in New York',
|
|
69
|
+
* chart.time.dateFormat('%Y-%m-%d %H:%M:%S', Date.now())
|
|
70
|
+
* );
|
|
71
|
+
*
|
|
72
|
+
* // Standalone use
|
|
73
|
+
* const time = new Highcharts.Time({
|
|
74
|
+
* timezone: 'America/New_York'
|
|
75
|
+
* });
|
|
76
|
+
* const s = time.dateFormat('%Y-%m-%d %H:%M:%S', Date.UTC(2020, 0, 1));
|
|
77
|
+
* console.log(s); // => 2019-12-31 19:00:00
|
|
78
|
+
*
|
|
79
|
+
* @since 6.0.5
|
|
80
|
+
*
|
|
81
|
+
* @class
|
|
82
|
+
* @name Highcharts.Time
|
|
83
|
+
*
|
|
84
|
+
* @param {Highcharts.TimeOptions} [options] Time options as defined in
|
|
85
|
+
* [chart.options.time](/highcharts/time).
|
|
86
|
+
*/
|
|
87
|
+
class TimeBase {
|
|
88
|
+
/* *
|
|
89
|
+
*
|
|
90
|
+
* Constructors
|
|
91
|
+
*
|
|
92
|
+
* */
|
|
93
|
+
constructor(options, lang) {
|
|
94
|
+
/* *
|
|
95
|
+
*
|
|
96
|
+
* Properties
|
|
97
|
+
*
|
|
98
|
+
* */
|
|
99
|
+
this.options = {
|
|
100
|
+
timezone: 'UTC'
|
|
101
|
+
};
|
|
102
|
+
this.variableTimezone = false;
|
|
103
|
+
this.Date = win.Date;
|
|
104
|
+
this.update(options);
|
|
105
|
+
this.lang = lang;
|
|
106
|
+
}
|
|
107
|
+
/* *
|
|
108
|
+
*
|
|
109
|
+
* Functions
|
|
110
|
+
*
|
|
111
|
+
* */
|
|
112
|
+
/**
|
|
113
|
+
* Update the Time object with current options. It is called internally on
|
|
114
|
+
* initializing Highcharts, after running `Highcharts.setOptions` and on
|
|
115
|
+
* `Chart.update`.
|
|
116
|
+
*
|
|
117
|
+
* @private
|
|
118
|
+
* @function Highcharts.Time#update
|
|
119
|
+
*
|
|
120
|
+
* @param {Highcharts.TimeOptions} [options]
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
update(options = {}) {
|
|
124
|
+
this.dTLCache = {};
|
|
125
|
+
this.options = options = merge(true, this.options, options);
|
|
126
|
+
const { timezoneOffset, useUTC, locale } = options;
|
|
127
|
+
// Allow using a different Date class
|
|
128
|
+
this.Date = options.Date || win.Date || Date;
|
|
129
|
+
// Assign the time zone. Handle the legacy, deprecated `useUTC` option.
|
|
130
|
+
let timezone = options.timezone;
|
|
131
|
+
if (defined(useUTC)) {
|
|
132
|
+
timezone = useUTC ? 'UTC' : void 0;
|
|
133
|
+
}
|
|
134
|
+
// The Etc/GMT time zones do not support offsets with half-hour
|
|
135
|
+
// resolutions
|
|
136
|
+
if (timezoneOffset && timezoneOffset % 60 === 0) {
|
|
137
|
+
timezone = 'Etc/GMT' + ((timezoneOffset > 0 ? '+' : '')) + timezoneOffset / 60;
|
|
138
|
+
}
|
|
139
|
+
/*
|
|
140
|
+
* The time object has options allowing for variable time zones, meaning
|
|
141
|
+
* the axis ticks or series data needs to consider this.
|
|
142
|
+
*/
|
|
143
|
+
this.variableTimezone = timezone !== 'UTC' &&
|
|
144
|
+
timezone?.indexOf('Etc/GMT') !== 0;
|
|
145
|
+
this.timezone = timezone;
|
|
146
|
+
// Update locale.
|
|
147
|
+
if (this.lang && locale) {
|
|
148
|
+
this.lang.locale = locale;
|
|
149
|
+
}
|
|
150
|
+
// Assign default time formats from locale strings
|
|
151
|
+
['months', 'shortMonths', 'weekdays', 'shortWeekdays'].forEach((name) => {
|
|
152
|
+
const isMonth = /months/i.test(name), isShort = /short/.test(name), options = {
|
|
153
|
+
timeZone: 'UTC'
|
|
154
|
+
};
|
|
155
|
+
options[isMonth ? 'month' : 'weekday'] = isShort ? 'short' : 'long';
|
|
156
|
+
this[name] = (isMonth ?
|
|
157
|
+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] :
|
|
158
|
+
[3, 4, 5, 6, 7, 8, 9]).map((position) => this.dateFormat(options, (isMonth ? 31 : 1) * 24 * 36e5 * position));
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get a date in terms of numbers (year, month, day etc) for further
|
|
163
|
+
* processing. Takes the current `timezone` setting into account. Inverse of
|
|
164
|
+
* `makeTime` and the native `Date` constructor and `Date.UTC`.
|
|
165
|
+
*
|
|
166
|
+
* The date is returned in array format with the following indices:
|
|
167
|
+
*
|
|
168
|
+
* 0: year,
|
|
169
|
+
* 1: month (zero based),
|
|
170
|
+
* 2: day,
|
|
171
|
+
* 3: hours,
|
|
172
|
+
* 4: minutes,
|
|
173
|
+
* 5: seconds,
|
|
174
|
+
* 6: milliseconds,
|
|
175
|
+
* 7: weekday (Sunday as 0)
|
|
176
|
+
*
|
|
177
|
+
* @function Highcharts.Time#toParts
|
|
178
|
+
*
|
|
179
|
+
* @param {number|Date} [timestamp]
|
|
180
|
+
* The timestamp in milliseconds since January 1st 1970.
|
|
181
|
+
* A Date object is also accepted.
|
|
182
|
+
*
|
|
183
|
+
* @return {Array<number>} The date parts in array format.
|
|
184
|
+
*/
|
|
185
|
+
toParts(timestamp) {
|
|
186
|
+
const [weekday, dayOfMonth, month, year, hours, minutes, seconds] = this.dateTimeFormat({
|
|
187
|
+
weekday: 'narrow',
|
|
188
|
+
day: 'numeric',
|
|
189
|
+
month: 'numeric',
|
|
190
|
+
year: 'numeric',
|
|
191
|
+
hour: 'numeric',
|
|
192
|
+
minute: 'numeric',
|
|
193
|
+
second: 'numeric'
|
|
194
|
+
}, timestamp, 'es')
|
|
195
|
+
// The ', ' splitter is for all modern browsers:
|
|
196
|
+
// L, 6/3/2023, 14:30:00
|
|
197
|
+
// The ' ' splitter is for legacy Safari with no comma between date
|
|
198
|
+
// and time (#22445):
|
|
199
|
+
// L, 6/3/2023 14:30:00
|
|
200
|
+
.split(/(?:, | |\/|:)/g);
|
|
201
|
+
return [
|
|
202
|
+
year,
|
|
203
|
+
+month - 1,
|
|
204
|
+
dayOfMonth,
|
|
205
|
+
hours,
|
|
206
|
+
minutes,
|
|
207
|
+
seconds,
|
|
208
|
+
// Milliseconds
|
|
209
|
+
Math.floor(Number(timestamp) || 0) % 1000,
|
|
210
|
+
// Spanish weekday index
|
|
211
|
+
'DLMXJVS'.indexOf(weekday)
|
|
212
|
+
].map(Number);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Shorthand to get a cached `Intl.DateTimeFormat` instance.
|
|
216
|
+
*/
|
|
217
|
+
dateTimeFormat(options, timestamp, locale = this.options.locale || pageLang) {
|
|
218
|
+
const cacheKey = JSON.stringify(options) + locale;
|
|
219
|
+
if (isString(options)) {
|
|
220
|
+
options = this.str2dtf(options);
|
|
221
|
+
}
|
|
222
|
+
let dTL = this.dTLCache[cacheKey];
|
|
223
|
+
if (!dTL) {
|
|
224
|
+
options.timeZone ?? (options.timeZone = this.timezone);
|
|
225
|
+
try {
|
|
226
|
+
dTL = new Intl.DateTimeFormat(locale, options);
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
if (/Invalid time zone/i.test(e.message)) {
|
|
230
|
+
error(34);
|
|
231
|
+
options.timeZone = 'UTC';
|
|
232
|
+
dTL = new Intl.DateTimeFormat(locale, options);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
error(e.message, false);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
this.dTLCache[cacheKey] = dTL;
|
|
240
|
+
return dTL?.format(timestamp) || '';
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Take a locale-aware string format and return a full DateTimeFormat in
|
|
244
|
+
* object form.
|
|
245
|
+
*/
|
|
246
|
+
str2dtf(s, dtf = {}) {
|
|
247
|
+
const mapping = {
|
|
248
|
+
L: { fractionalSecondDigits: 3 },
|
|
249
|
+
S: { second: '2-digit' },
|
|
250
|
+
M: { minute: 'numeric' },
|
|
251
|
+
H: { hour: '2-digit' },
|
|
252
|
+
k: { hour: 'numeric' },
|
|
253
|
+
E: { weekday: 'narrow' },
|
|
254
|
+
a: { weekday: 'short' },
|
|
255
|
+
A: { weekday: 'long' },
|
|
256
|
+
d: { day: '2-digit' },
|
|
257
|
+
e: { day: 'numeric' },
|
|
258
|
+
b: { month: 'short' },
|
|
259
|
+
B: { month: 'long' },
|
|
260
|
+
m: { month: '2-digit' },
|
|
261
|
+
o: { month: 'numeric' },
|
|
262
|
+
y: { year: '2-digit' },
|
|
263
|
+
Y: { year: 'numeric' }
|
|
264
|
+
};
|
|
265
|
+
Object.keys(mapping).forEach((key) => {
|
|
266
|
+
if (s.indexOf(key) !== -1) {
|
|
267
|
+
extend(dtf, mapping[key]);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
return dtf;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Make a time and returns milliseconds. Similar to `Date.UTC`, but takes
|
|
274
|
+
* the current `timezone` setting into account.
|
|
275
|
+
*
|
|
276
|
+
* @function Highcharts.Time#makeTime
|
|
277
|
+
*
|
|
278
|
+
* @param {number} year
|
|
279
|
+
* The year
|
|
280
|
+
*
|
|
281
|
+
* @param {number} month
|
|
282
|
+
* The month. Zero-based, so January is 0.
|
|
283
|
+
*
|
|
284
|
+
* @param {number} [date=1]
|
|
285
|
+
* The day of the month
|
|
286
|
+
*
|
|
287
|
+
* @param {number} [hours=0]
|
|
288
|
+
* The hour of the day, 0-23.
|
|
289
|
+
*
|
|
290
|
+
* @param {number} [minutes=0]
|
|
291
|
+
* The minutes
|
|
292
|
+
*
|
|
293
|
+
* @param {number} [seconds=0]
|
|
294
|
+
* The seconds
|
|
295
|
+
*
|
|
296
|
+
* @return {number}
|
|
297
|
+
* The time in milliseconds since January 1st 1970.
|
|
298
|
+
*/
|
|
299
|
+
makeTime(year, month, date = 1, hours = 0, minutes, seconds, milliseconds) {
|
|
300
|
+
// eslint-disable-next-line new-cap
|
|
301
|
+
let d = this.Date.UTC(year, month, date, hours, minutes || 0, seconds || 0, milliseconds || 0);
|
|
302
|
+
if (this.timezone !== 'UTC') {
|
|
303
|
+
const offset = this.getTimezoneOffset(d);
|
|
304
|
+
d += offset;
|
|
305
|
+
// Adjustments close to DST transitions
|
|
306
|
+
if (
|
|
307
|
+
// Optimize for speed by limiting the number of calls to
|
|
308
|
+
// `getTimezoneOffset`. According to
|
|
309
|
+
// https://en.wikipedia.org/wiki/Daylight_saving_time_by_country,
|
|
310
|
+
// DST change may only occur in these months.
|
|
311
|
+
[2, 3, 8, 9, 10, 11].indexOf(month) !== -1 &&
|
|
312
|
+
// DST transitions occur only in the night-time
|
|
313
|
+
(hours < 5 || hours > 20)) {
|
|
314
|
+
const newOffset = this.getTimezoneOffset(d);
|
|
315
|
+
if (offset !== newOffset) {
|
|
316
|
+
d += newOffset - offset;
|
|
317
|
+
// A special case for transitioning from summer time to winter
|
|
318
|
+
// time. When the clock is set back, the same time is repeated
|
|
319
|
+
// twice, i.e. 02:30 am is repeated since the clock is set back
|
|
320
|
+
// from 3 am to 2 am. We need to make the same time as local
|
|
321
|
+
// Date does.
|
|
322
|
+
}
|
|
323
|
+
else if (offset - 36e5 === this.getTimezoneOffset(d - 36e5) &&
|
|
324
|
+
!hasOldSafariBug) {
|
|
325
|
+
d -= 36e5;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
return d;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Parse a datetime string. Unless the string contains time zone
|
|
333
|
+
* information, apply the current `timezone` from options. If the argument
|
|
334
|
+
* is a number, return it.
|
|
335
|
+
*
|
|
336
|
+
* @function Highcharts.Time#parse
|
|
337
|
+
* @param {string|number|undefined} s The datetime string to parse
|
|
338
|
+
* @return {number|undefined} Parsed JavaScript timestamp
|
|
339
|
+
*/
|
|
340
|
+
parse(s) {
|
|
341
|
+
if (!isString(s)) {
|
|
342
|
+
return s ?? void 0;
|
|
343
|
+
}
|
|
344
|
+
s = s
|
|
345
|
+
// Firefox fails on YYYY/MM/DD
|
|
346
|
+
.replace(/\//g, '-')
|
|
347
|
+
// Replace some non-standard notations
|
|
348
|
+
.replace(/(GMT|UTC)/, '');
|
|
349
|
+
// Extend shorthand hour timezone offset like +02
|
|
350
|
+
// .replace(/([+-][0-9]{2})$/, '$1:00');
|
|
351
|
+
// Check if the string has time zone information
|
|
352
|
+
const hasTimezone = s.indexOf('Z') > -1 ||
|
|
353
|
+
/([+-][0-9]{2}):?[0-9]{2}$/.test(s),
|
|
354
|
+
// YYYY-MM-DD and YYYY-MM are always UTC
|
|
355
|
+
isYYYYMMDD = /^[0-9]{4}-[0-9]{2}(-[0-9]{2}|)$/.test(s);
|
|
356
|
+
if (!hasTimezone && !isYYYYMMDD) {
|
|
357
|
+
s += 'Z';
|
|
358
|
+
}
|
|
359
|
+
const ts = Date.parse(s);
|
|
360
|
+
if (isNumber(ts)) {
|
|
361
|
+
// Unless the string contains time zone information, convert from
|
|
362
|
+
// the local time result of `Date.parse` via UTC into the current
|
|
363
|
+
// timezone of the time object.
|
|
364
|
+
return ts + ((!hasTimezone || isYYYYMMDD) ?
|
|
365
|
+
this.getTimezoneOffset(ts) :
|
|
366
|
+
0);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Get the time zone offset based on the current timezone information as
|
|
371
|
+
* set in the global options.
|
|
372
|
+
*
|
|
373
|
+
* @function Highcharts.Time#getTimezoneOffset
|
|
374
|
+
*
|
|
375
|
+
* @param {number} timestamp
|
|
376
|
+
* The JavaScript timestamp to inspect.
|
|
377
|
+
*
|
|
378
|
+
* @return {number}
|
|
379
|
+
* The timezone offset in minutes compared to UTC.
|
|
380
|
+
*/
|
|
381
|
+
getTimezoneOffset(timestamp) {
|
|
382
|
+
if (this.timezone !== 'UTC') {
|
|
383
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
384
|
+
const [date, gmt, hours, colon, minutes = 0] = this.dateTimeFormat({ timeZoneName: 'shortOffset' }, timestamp, 'en')
|
|
385
|
+
.split(/(GMT|:)/)
|
|
386
|
+
.map(Number), offset = -(hours + minutes / 60) * 60 * 60000;
|
|
387
|
+
// Possible future NaNs stop here
|
|
388
|
+
if (isNumber(offset)) {
|
|
389
|
+
return offset;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return 0;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Formats a JavaScript date timestamp (milliseconds since January 1 1970)
|
|
396
|
+
* into a human readable date string.
|
|
397
|
+
*
|
|
398
|
+
* The `format` parameter accepts two types of values:
|
|
399
|
+
* - An object containing settings that are passed directly on to
|
|
400
|
+
* [Intl.DateTimeFormat.prototype.format](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/format).
|
|
401
|
+
* - A format string containing either individual or locale-aware format
|
|
402
|
+
* keys. **Individual keys**, for example `%Y-%m-%d`, are listed below.
|
|
403
|
+
* **Locale-aware keys** are grouped by square brackets, for example
|
|
404
|
+
* `%[Ymd]`. The order of keys within the square bracket doesn't affect
|
|
405
|
+
* the output, which is determined by the locale. See example below.
|
|
406
|
+
* Internally, the locale-aware format keys are just a shorthand for the
|
|
407
|
+
* full object formats, but are particularly practical in
|
|
408
|
+
* [templating](https://www.highcharts.com/docs/chart-concepts/templating)
|
|
409
|
+
* where full object definitions are not an option.
|
|
410
|
+
*
|
|
411
|
+
* The available string format keys are listed below. Additional formats can
|
|
412
|
+
* be given in the {@link Highcharts.dateFormats} hook.
|
|
413
|
+
*
|
|
414
|
+
* Supported format keys:
|
|
415
|
+
* | Key | Description | Notes on locale-aware format |
|
|
416
|
+
* -------|----------------------------------------------|-------|
|
|
417
|
+
* | `%A` | Long weekday, like 'Monday' | |
|
|
418
|
+
* | `%a` | Short weekday, like 'Mon' | |
|
|
419
|
+
* | `%E` | Narrow weekday, single character | |
|
|
420
|
+
* | `%d` | Two digit day of the month, 01 to 31 | |
|
|
421
|
+
* | `%e` | Day of the month, 1 through 31 | |
|
|
422
|
+
* | `%w` | Day of the week, 0 through 6 | N/A |
|
|
423
|
+
* | `%v` | The prefix "week from", read from `lang.weekFrom` | N/A |
|
|
424
|
+
* | `%b` | Short month, like 'Jan' | |
|
|
425
|
+
* | `%B` | Long month, like 'January' | |
|
|
426
|
+
* | `%m` | Two digit month number, 01 through 12 | |
|
|
427
|
+
* | `%o` | Month number, 1 through 12 | |
|
|
428
|
+
* | `%y` | Two digits year, like 24 for 2024 | |
|
|
429
|
+
* | `%Y` | Four digits year, like 2024 | |
|
|
430
|
+
* | `%H` | Two digits hours in 24h format, 00 through 23 | Depending on the locale, 12h format may be instered. |
|
|
431
|
+
* | `%k` | Hours in 24h format, 0 through 23 | Depending on the locale, 12h format may be instered. |
|
|
432
|
+
* | `%I` | Two digits hours in 12h format, 00 through 11 | N/A. The locale determines the hour format. |
|
|
433
|
+
* | `%l` | Hours in 12h format, 1 through 12 | N/A. The locale determines the hour format. |
|
|
434
|
+
* | `%M` | Two digits minutes, 00 through 59 | |
|
|
435
|
+
* | `%p` | Upper case AM or PM | N/A. The locale determines whether to add AM and PM. |
|
|
436
|
+
* | `%P` | Lower case AM or PM | N/A. The locale determines whether to add AM and PM. |
|
|
437
|
+
* | `%S` | Two digits seconds, 00 through 59 | |
|
|
438
|
+
* | `%L` | Milliseconds (naming from Ruby) | |
|
|
439
|
+
*
|
|
440
|
+
* @example
|
|
441
|
+
* // Object format, US English
|
|
442
|
+
* const time1 = new Highcharts.Time({ locale: 'en-US' });
|
|
443
|
+
* console.log(
|
|
444
|
+
* time1.dateFormat({
|
|
445
|
+
* day: 'numeric',
|
|
446
|
+
* month: 'short',
|
|
447
|
+
* year: 'numeric',
|
|
448
|
+
* hour: 'numeric',
|
|
449
|
+
* minute: 'numeric'
|
|
450
|
+
* }, Date.UTC(2024, 11, 31))
|
|
451
|
+
* ); // => Dec 31, 2024, 12:00 AM
|
|
452
|
+
*
|
|
453
|
+
* // Object format, British English
|
|
454
|
+
* const time2 = new Highcharts.Time({ locale: 'en-GB' });
|
|
455
|
+
* console.log(
|
|
456
|
+
* time2.dateFormat({
|
|
457
|
+
* day: 'numeric',
|
|
458
|
+
* month: 'short',
|
|
459
|
+
* year: 'numeric',
|
|
460
|
+
* hour: 'numeric',
|
|
461
|
+
* minute: 'numeric'
|
|
462
|
+
* }, Date.UTC(2024, 11, 31))
|
|
463
|
+
* ); // => 31 Dec 2024, 00:00
|
|
464
|
+
*
|
|
465
|
+
* // Individual key string replacement
|
|
466
|
+
* const time3 = new Highcharts.Time();
|
|
467
|
+
* console.log(
|
|
468
|
+
* time3.dateFormat('%Y-%m-%d %H:%M:%S', Date.UTC(2024, 11, 31))
|
|
469
|
+
* ); // => 2024-12-31 00:00:00
|
|
470
|
+
*
|
|
471
|
+
* // Locale-aware keys, US English
|
|
472
|
+
* const time4 = new Highcharts.Time({ locale: 'en-US' });
|
|
473
|
+
* console.log(
|
|
474
|
+
* time4.dateFormat('%[YebHM]', Date.UTC(2024, 11, 31))
|
|
475
|
+
* ); // => Dec 31, 2024, 12:00 AM
|
|
476
|
+
*
|
|
477
|
+
* // Locale-aware keys, British English
|
|
478
|
+
* const time5 = new Highcharts.Time({ locale: 'en-GB' });
|
|
479
|
+
* console.log(
|
|
480
|
+
* time5.dateFormat('%[YebHM]', Date.UTC(2024, 11, 31))
|
|
481
|
+
* ); // => 31 Dec 2024, 00:00
|
|
482
|
+
*
|
|
483
|
+
* // Mixed locale-aware and individual keys
|
|
484
|
+
* console.log(
|
|
485
|
+
* time5.dateFormat('%[Yeb], %H:%M', Date.UTC(2024, 11, 31))
|
|
486
|
+
* ); // => 31 Dec 2024, 00:00
|
|
487
|
+
*
|
|
488
|
+
* @function Highcharts.Time#dateFormat
|
|
489
|
+
*
|
|
490
|
+
* @param {string|Highcharts.DateTimeFormatOptions} format
|
|
491
|
+
* The desired string format where various time representations are
|
|
492
|
+
* prefixed with %, or an object representing the locale-aware format
|
|
493
|
+
* options.
|
|
494
|
+
*
|
|
495
|
+
* @param {number} [timestamp]
|
|
496
|
+
* The JavaScript timestamp.
|
|
497
|
+
*
|
|
498
|
+
* @param {boolean} [upperCaseFirst=false]
|
|
499
|
+
* Upper case first letter in the return.
|
|
500
|
+
*
|
|
501
|
+
* @return {string}
|
|
502
|
+
* The formatted date.
|
|
503
|
+
*/
|
|
504
|
+
dateFormat(format, timestamp, upperCaseFirst) {
|
|
505
|
+
const lang = this.lang;
|
|
506
|
+
if (!defined(timestamp) || isNaN(timestamp)) {
|
|
507
|
+
return lang?.invalidDate || '';
|
|
508
|
+
}
|
|
509
|
+
format = format ?? '%Y-%m-%d %H:%M:%S';
|
|
510
|
+
// First, identify and replace locale-aware formats like %[Ymd]
|
|
511
|
+
if (isString(format)) {
|
|
512
|
+
const localeAwareRegex = /%\[([a-zA-Z]+)\]/g;
|
|
513
|
+
let match;
|
|
514
|
+
while ((match = localeAwareRegex.exec(format))) {
|
|
515
|
+
format = format.replace(match[0], this.dateTimeFormat(match[1], timestamp, lang?.locale));
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
// Then, replace static formats like %Y, %m, %d etc.
|
|
519
|
+
if (isString(format) && format.indexOf('%') !== -1) {
|
|
520
|
+
const time = this, [fullYear, month, dayOfMonth, hours, minutes, seconds, milliseconds, weekday] = this.toParts(timestamp), langWeekdays = lang?.weekdays || this.weekdays, shortWeekdays = lang?.shortWeekdays || this.shortWeekdays, months = lang?.months || this.months, shortMonths = lang?.shortMonths || this.shortMonths,
|
|
521
|
+
// List all format keys. Custom formats can be added from the
|
|
522
|
+
// outside.
|
|
523
|
+
replacements = extend({
|
|
524
|
+
// Day
|
|
525
|
+
// Short weekday, like 'Mon'
|
|
526
|
+
a: shortWeekdays ?
|
|
527
|
+
shortWeekdays[weekday] :
|
|
528
|
+
langWeekdays[weekday].substr(0, 3),
|
|
529
|
+
// Long weekday, like 'Monday'
|
|
530
|
+
A: langWeekdays[weekday],
|
|
531
|
+
// Two digit day of the month, 01 to 31
|
|
532
|
+
d: pad(dayOfMonth),
|
|
533
|
+
// Day of the month, 1 through 31
|
|
534
|
+
e: pad(dayOfMonth, 2, ' '),
|
|
535
|
+
// Day of the week, 0 through 6
|
|
536
|
+
w: weekday,
|
|
537
|
+
// Week (none implemented)
|
|
538
|
+
// 'W': weekNumber(),
|
|
539
|
+
v: lang?.weekFrom ?? '',
|
|
540
|
+
// Month
|
|
541
|
+
// Short month, like 'Jan'
|
|
542
|
+
b: shortMonths[month],
|
|
543
|
+
// Long month, like 'January'
|
|
544
|
+
B: months[month],
|
|
545
|
+
// Two digit month number, 01 through 12
|
|
546
|
+
m: pad(month + 1),
|
|
547
|
+
// Month number, 1 through 12 (#8150)
|
|
548
|
+
o: month + 1,
|
|
549
|
+
// Year
|
|
550
|
+
// Two digits year, like 09 for 2009
|
|
551
|
+
y: fullYear.toString().substr(2, 2),
|
|
552
|
+
// Four digits year, like 2009
|
|
553
|
+
Y: fullYear,
|
|
554
|
+
// Time
|
|
555
|
+
// Two digits hours in 24h format, 00 through 23
|
|
556
|
+
H: pad(hours),
|
|
557
|
+
// Hours in 24h format, 0 through 23
|
|
558
|
+
k: hours,
|
|
559
|
+
// Two digits hours in 12h format, 00 through 11
|
|
560
|
+
I: pad((hours % 12) || 12),
|
|
561
|
+
// Hours in 12h format, 1 through 12
|
|
562
|
+
l: (hours % 12) || 12,
|
|
563
|
+
// Two digits minutes, 00 through 59
|
|
564
|
+
M: pad(minutes),
|
|
565
|
+
// Upper case AM or PM
|
|
566
|
+
p: hours < 12 ? 'AM' : 'PM',
|
|
567
|
+
// Lower case AM or PM
|
|
568
|
+
P: hours < 12 ? 'am' : 'pm',
|
|
569
|
+
// Two digits seconds, 00 through 59
|
|
570
|
+
S: pad(seconds),
|
|
571
|
+
// Milliseconds (naming from Ruby)
|
|
572
|
+
L: pad(milliseconds, 3)
|
|
573
|
+
}, H.dateFormats);
|
|
574
|
+
// Do the replaces
|
|
575
|
+
objectEach(replacements, function (val, key) {
|
|
576
|
+
if (isString(format)) {
|
|
577
|
+
// Regex would do it in one line, but this is faster
|
|
578
|
+
while (format.indexOf('%' + key) !== -1) {
|
|
579
|
+
format = format.replace('%' + key, typeof val === 'function' ?
|
|
580
|
+
val.call(time, timestamp) :
|
|
581
|
+
val);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
else if (isObject(format)) {
|
|
587
|
+
const tzHours = (this.getTimezoneOffset(timestamp) || 0) /
|
|
588
|
+
(60000 * 60), timeZone = this.timezone || ('Etc/GMT' + (tzHours >= 0 ? '+' : '') + tzHours), { prefix = '', suffix = '' } = format;
|
|
589
|
+
format = prefix + this.dateTimeFormat(extend({ timeZone }, format), timestamp) + suffix;
|
|
590
|
+
}
|
|
591
|
+
// Optionally sentence-case the string and return
|
|
592
|
+
return upperCaseFirst ? ucfirst(format) : format;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Resolve legacy formats of dateTimeLabelFormats (strings and arrays) into
|
|
596
|
+
* an object.
|
|
597
|
+
* @private
|
|
598
|
+
* @param {string|Array<T>|Highcharts.Dictionary<T>} f
|
|
599
|
+
* General format description
|
|
600
|
+
* @return {Highcharts.Dictionary<T>}
|
|
601
|
+
* The object definition
|
|
602
|
+
*/
|
|
603
|
+
resolveDTLFormat(f) {
|
|
604
|
+
if (!isObject(f, true)) { // Check for string or array
|
|
605
|
+
f = splat(f);
|
|
606
|
+
return {
|
|
607
|
+
main: f[0],
|
|
608
|
+
from: f[1],
|
|
609
|
+
to: f[2]
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
// Type-check DateTimeFormatOptions against DateTimeLabelFormatObject
|
|
613
|
+
if (isObject(f, true) && isDateTimeFormatOptions(f)) {
|
|
614
|
+
return { main: f };
|
|
615
|
+
}
|
|
616
|
+
return f;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Get the optimal date format for a point, based on a range.
|
|
620
|
+
*
|
|
621
|
+
* @private
|
|
622
|
+
* @function Highcharts.Time#getDateFormat
|
|
623
|
+
*
|
|
624
|
+
* @param {number} range
|
|
625
|
+
* The time range
|
|
626
|
+
*
|
|
627
|
+
* @param {number} timestamp
|
|
628
|
+
* The timestamp of the date
|
|
629
|
+
*
|
|
630
|
+
* @param {number} startOfWeek
|
|
631
|
+
* An integer representing the first day of the week, where 0 is
|
|
632
|
+
* Sunday.
|
|
633
|
+
*
|
|
634
|
+
* @param {Highcharts.Dictionary<string>} dateTimeLabelFormats
|
|
635
|
+
* A map of time units to formats.
|
|
636
|
+
*
|
|
637
|
+
* @return {string}
|
|
638
|
+
* The optimal date format for a point.
|
|
639
|
+
*/
|
|
640
|
+
getDateFormat(range, timestamp, startOfWeek, dateTimeLabelFormats) {
|
|
641
|
+
const dateStr = this.dateFormat('%m-%d %H:%M:%S.%L', timestamp), blank = '01-01 00:00:00.000', strpos = {
|
|
642
|
+
millisecond: 15,
|
|
643
|
+
second: 12,
|
|
644
|
+
minute: 9,
|
|
645
|
+
hour: 6,
|
|
646
|
+
day: 3
|
|
647
|
+
};
|
|
648
|
+
let n = 'millisecond',
|
|
649
|
+
// For sub-millisecond data, #4223
|
|
650
|
+
lastN = n;
|
|
651
|
+
for (n in timeUnits) { // eslint-disable-line guard-for-in
|
|
652
|
+
// If the range is exactly one week and we're looking at a
|
|
653
|
+
// Sunday/Monday, go for the week format
|
|
654
|
+
if (range &&
|
|
655
|
+
range === timeUnits.week &&
|
|
656
|
+
+this.dateFormat('%w', timestamp) === startOfWeek &&
|
|
657
|
+
dateStr.substr(6) === blank.substr(6)) {
|
|
658
|
+
n = 'week';
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
// The first format that is too great for the range
|
|
662
|
+
if (range && timeUnits[n] > range) {
|
|
663
|
+
n = lastN;
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
// If the point is placed every day at 23:59, we need to show
|
|
667
|
+
// the minutes as well. #2637.
|
|
668
|
+
if (strpos[n] &&
|
|
669
|
+
dateStr.substr(strpos[n]) !== blank.substr(strpos[n])) {
|
|
670
|
+
break;
|
|
671
|
+
}
|
|
672
|
+
// Weeks are outside the hierarchy, only apply them on
|
|
673
|
+
// Mondays/Sundays like in the first condition
|
|
674
|
+
if (n !== 'week') {
|
|
675
|
+
lastN = n;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
return this.resolveDTLFormat(dateTimeLabelFormats[n]).main;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
/* *
|
|
682
|
+
*
|
|
683
|
+
* Default export
|
|
684
|
+
*
|
|
685
|
+
* */
|
|
686
|
+
export default TimeBase;
|
|
687
|
+
/* *
|
|
688
|
+
*
|
|
689
|
+
* API Declarations
|
|
690
|
+
*
|
|
691
|
+
* */
|
|
692
|
+
/**
|
|
693
|
+
* Normalized interval.
|
|
694
|
+
*
|
|
695
|
+
* @interface Highcharts.TimeNormalizedObject
|
|
696
|
+
*/ /**
|
|
697
|
+
* The count.
|
|
698
|
+
*
|
|
699
|
+
* @name Highcharts.TimeNormalizedObject#count
|
|
700
|
+
* @type {number|undefined}
|
|
701
|
+
*/ /**
|
|
702
|
+
* The interval in axis values (ms).
|
|
703
|
+
*
|
|
704
|
+
* @name Highcharts.TimeNormalizedObject#unitRange
|
|
705
|
+
* @type {number}
|
|
706
|
+
*/
|
|
707
|
+
/**
|
|
708
|
+
* Function of an additional date format specifier.
|
|
709
|
+
*
|
|
710
|
+
* @callback Highcharts.TimeFormatCallbackFunction
|
|
711
|
+
*
|
|
712
|
+
* @param {number} timestamp
|
|
713
|
+
* The time to format.
|
|
714
|
+
*
|
|
715
|
+
* @return {string}
|
|
716
|
+
* The formatted portion of the date.
|
|
717
|
+
*/
|
|
718
|
+
/**
|
|
719
|
+
* Time ticks.
|
|
720
|
+
*
|
|
721
|
+
* @interface Highcharts.AxisTickPositionsArray
|
|
722
|
+
* @extends global.Array<number>
|
|
723
|
+
*/ /**
|
|
724
|
+
* @name Highcharts.AxisTickPositionsArray#info
|
|
725
|
+
* @type {Highcharts.TimeTicksInfoObject|undefined}
|
|
726
|
+
*/
|
|
727
|
+
/**
|
|
728
|
+
* A callback to return the time zone offset for a given datetime. It
|
|
729
|
+
* takes the timestamp in terms of milliseconds since January 1 1970,
|
|
730
|
+
* and returns the timezone offset in minutes. This provides a hook
|
|
731
|
+
* for drawing time based charts in specific time zones using their
|
|
732
|
+
* local DST crossover dates, with the help of external libraries.
|
|
733
|
+
*
|
|
734
|
+
* @callback Highcharts.TimezoneOffsetCallbackFunction
|
|
735
|
+
*
|
|
736
|
+
* @param {number} timestamp
|
|
737
|
+
* Timestamp in terms of milliseconds since January 1 1970.
|
|
738
|
+
*
|
|
739
|
+
* @return {number}
|
|
740
|
+
* Timezone offset in minutes.
|
|
741
|
+
*/
|
|
742
|
+
/**
|
|
743
|
+
* Options for formatting dates and times using the [Intl.DateTimeFormat](
|
|
744
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat
|
|
745
|
+
* ) API, and extended with some custom options for Highcharts.
|
|
746
|
+
*
|
|
747
|
+
* @interface Highcharts.DateTimeFormatOptions
|
|
748
|
+
*/ /**
|
|
749
|
+
* The locale matching algorithm to use.
|
|
750
|
+
*
|
|
751
|
+
* @name Highcharts.DateTimeFormatOptions#localeMatcher
|
|
752
|
+
* @type {string|undefined}
|
|
753
|
+
*/ /**
|
|
754
|
+
* The time zone to use. The default is the browser's default time zone.
|
|
755
|
+
*
|
|
756
|
+
* @name Highcharts.DateTimeFormatOptions#timeZone
|
|
757
|
+
* @type {string|undefined}
|
|
758
|
+
*/ /**
|
|
759
|
+
* Whether to use 12-hour time (as opposed to 24-hour time).
|
|
760
|
+
*
|
|
761
|
+
* @name Highcharts.DateTimeFormatOptions#hour12
|
|
762
|
+
* @type {'auto'|'always'|'never'|undefined}
|
|
763
|
+
*/ /**
|
|
764
|
+
* The format matching algorithm to use.
|
|
765
|
+
*
|
|
766
|
+
* @name Highcharts.DateTimeFormatOptions#formatMatcher
|
|
767
|
+
* @type {string|undefined}
|
|
768
|
+
*/ /**
|
|
769
|
+
* The representation of the weekday.
|
|
770
|
+
*
|
|
771
|
+
* @name Highcharts.DateTimeFormatOptions#weekday
|
|
772
|
+
* @type {'narrow'|'short'|'long'|undefined}
|
|
773
|
+
*/ /**
|
|
774
|
+
* The representation of the era.
|
|
775
|
+
*
|
|
776
|
+
* @name Highcharts.DateTimeFormatOptions#era
|
|
777
|
+
* @type {'narrow'|'short'|'long'|undefined}
|
|
778
|
+
*/ /**
|
|
779
|
+
* The representation of the year.
|
|
780
|
+
*
|
|
781
|
+
* @name Highcharts.DateTimeFormatOptions#year
|
|
782
|
+
* @type {'numeric'|'2-digit'|undefined}
|
|
783
|
+
*/ /**
|
|
784
|
+
* The representation of the month.
|
|
785
|
+
* "narrow", "short", "long".
|
|
786
|
+
*
|
|
787
|
+
* @name Highcharts.DateTimeFormatOptions#month
|
|
788
|
+
* @type {'numeric'|'2-digit'|'narrow'|'short'|'long'|undefined}
|
|
789
|
+
*/ /**
|
|
790
|
+
* The representation of the day.
|
|
791
|
+
*
|
|
792
|
+
* @name Highcharts.DateTimeFormatOptions#day
|
|
793
|
+
* @type {'numeric'|'2-digit'|undefined}
|
|
794
|
+
*/ /**
|
|
795
|
+
* The representation of the hour.
|
|
796
|
+
*
|
|
797
|
+
* @name Highcharts.DateTimeFormatOptions#hour
|
|
798
|
+
* @type {'numeric'|'2-digit'|undefined}
|
|
799
|
+
*/ /**
|
|
800
|
+
* The representation of the minute.
|
|
801
|
+
*
|
|
802
|
+
* @name Highcharts.DateTimeFormatOptions#minute
|
|
803
|
+
* @type {'numeric'|'2-digit'|undefined}
|
|
804
|
+
*/ /**
|
|
805
|
+
* The representation of the second.
|
|
806
|
+
*
|
|
807
|
+
* @name Highcharts.DateTimeFormatOptions#second
|
|
808
|
+
* @type {'numeric'|'2-digit'|undefined}
|
|
809
|
+
*/ /**
|
|
810
|
+
* The number of fractional digits to use. 3 means milliseconds.
|
|
811
|
+
*
|
|
812
|
+
* @name Highcharts.DateTimeFormatOptions#fractionalSecondDigits
|
|
813
|
+
* @type {number|undefined}
|
|
814
|
+
*/ /**
|
|
815
|
+
* The representation of the time zone name.
|
|
816
|
+
*
|
|
817
|
+
* @name Highcharts.DateTimeFormatOptions#timeZoneName
|
|
818
|
+
* @type {'short'|'long'|undefined}
|
|
819
|
+
*/ /**
|
|
820
|
+
* A prefix for the time string. Custom Highcharts option.
|
|
821
|
+
*
|
|
822
|
+
* @name Highcharts.DateTimeFormatOptions#prefix
|
|
823
|
+
* @type {'string'|undefined}
|
|
824
|
+
*/ /**
|
|
825
|
+
* A suffix for the time string. Custom Highcharts option.
|
|
826
|
+
*
|
|
827
|
+
* @name Highcharts.DateTimeFormatOptions#suffix
|
|
828
|
+
* @type {'string'|undefined}
|
|
829
|
+
*/
|
|
830
|
+
''; // Keeps doclets above in JS file
|