@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,529 @@
|
|
|
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
|
+
*
|
|
12
|
+
* */
|
|
13
|
+
'use strict';
|
|
14
|
+
import FormulaTypes from './FormulaTypes.js';
|
|
15
|
+
const { isFormula, isFunction, isOperator, isRange, isReference, isValue } = FormulaTypes;
|
|
16
|
+
import U from '../../Core/Utilities.js';
|
|
17
|
+
const { defined } = U;
|
|
18
|
+
/* *
|
|
19
|
+
*
|
|
20
|
+
* Constants
|
|
21
|
+
*
|
|
22
|
+
* */
|
|
23
|
+
const asLogicalStringRegExp = / */;
|
|
24
|
+
const MAX_FALSE = Number.MAX_VALUE / 1.000000000001;
|
|
25
|
+
const MAX_STRING = Number.MAX_VALUE / 1.000000000002;
|
|
26
|
+
const MAX_TRUE = Number.MAX_VALUE;
|
|
27
|
+
const operatorPriority = {
|
|
28
|
+
'^': 3,
|
|
29
|
+
'*': 2,
|
|
30
|
+
'/': 2,
|
|
31
|
+
'+': 1,
|
|
32
|
+
'-': 1,
|
|
33
|
+
'=': 0,
|
|
34
|
+
'<': 0,
|
|
35
|
+
'<=': 0,
|
|
36
|
+
'>': 0,
|
|
37
|
+
'>=': 0
|
|
38
|
+
};
|
|
39
|
+
const processorFunctions = {};
|
|
40
|
+
const processorFunctionNameRegExp = /^[A-Z][A-Z\.]*$/;
|
|
41
|
+
/* *
|
|
42
|
+
*
|
|
43
|
+
* Functions
|
|
44
|
+
*
|
|
45
|
+
* */
|
|
46
|
+
/**
|
|
47
|
+
* Converts non-number types to logical numbers.
|
|
48
|
+
*
|
|
49
|
+
* @param {Highcharts.FormulaValue} value
|
|
50
|
+
* Value to convert.
|
|
51
|
+
*
|
|
52
|
+
* @return {number}
|
|
53
|
+
* Logical number value. `NaN` if not convertable.
|
|
54
|
+
*/
|
|
55
|
+
function asLogicalNumber(value) {
|
|
56
|
+
switch (typeof value) {
|
|
57
|
+
case 'boolean':
|
|
58
|
+
return value ? MAX_TRUE : MAX_FALSE;
|
|
59
|
+
case 'string':
|
|
60
|
+
return MAX_STRING;
|
|
61
|
+
case 'number':
|
|
62
|
+
return value;
|
|
63
|
+
default:
|
|
64
|
+
return NaN;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Converts strings to logical strings, while other types get passed through. In
|
|
69
|
+
* logical strings the space character is the lowest value and letters are case
|
|
70
|
+
* insensitive.
|
|
71
|
+
*
|
|
72
|
+
* @param {Highcharts.FormulaValue} value
|
|
73
|
+
* Value to convert.
|
|
74
|
+
*
|
|
75
|
+
* @return {Highcharts.FormulaValue}
|
|
76
|
+
* Logical string value or passed through value.
|
|
77
|
+
*/
|
|
78
|
+
function asLogicalString(value) {
|
|
79
|
+
if (typeof value === 'string') {
|
|
80
|
+
return value.toLowerCase().replace(asLogicalStringRegExp, '\0');
|
|
81
|
+
}
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Converts non-number types to a logic number.
|
|
86
|
+
*
|
|
87
|
+
* @param {Highcharts.FormulaValue} value
|
|
88
|
+
* Value to convert.
|
|
89
|
+
*
|
|
90
|
+
* @return {number}
|
|
91
|
+
* Number value. `NaN` if not convertable.
|
|
92
|
+
*/
|
|
93
|
+
function asNumber(value) {
|
|
94
|
+
switch (typeof value) {
|
|
95
|
+
case 'boolean':
|
|
96
|
+
return value ? 1 : 0;
|
|
97
|
+
case 'string':
|
|
98
|
+
return parseFloat(value.replace(',', '.'));
|
|
99
|
+
case 'number':
|
|
100
|
+
return value;
|
|
101
|
+
default:
|
|
102
|
+
return NaN;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Process a basic operation of two given values.
|
|
107
|
+
*
|
|
108
|
+
* @private
|
|
109
|
+
*
|
|
110
|
+
* @param {Highcharts.FormulaOperator} operator
|
|
111
|
+
* Operator between values.
|
|
112
|
+
*
|
|
113
|
+
* @param {Highcharts.FormulaValue} x
|
|
114
|
+
* First value for operation.
|
|
115
|
+
*
|
|
116
|
+
* @param {Highcharts.FormulaValue} y
|
|
117
|
+
* Second value for operation.
|
|
118
|
+
*
|
|
119
|
+
* @return {Highcharts.FormulaValue}
|
|
120
|
+
* Operation result. `NaN` if operation is not support.
|
|
121
|
+
*/
|
|
122
|
+
function basicOperation(operator, x, y) {
|
|
123
|
+
switch (operator) {
|
|
124
|
+
case '=':
|
|
125
|
+
return asLogicalString(x) === asLogicalString(y);
|
|
126
|
+
case '<':
|
|
127
|
+
if (typeof x === typeof y) {
|
|
128
|
+
return asLogicalString(x) < asLogicalString(y);
|
|
129
|
+
}
|
|
130
|
+
return asLogicalNumber(x) < asLogicalNumber(y);
|
|
131
|
+
case '<=':
|
|
132
|
+
if (typeof x === typeof y) {
|
|
133
|
+
return asLogicalString(x) <= asLogicalString(y);
|
|
134
|
+
}
|
|
135
|
+
return asLogicalNumber(x) <= asLogicalNumber(y);
|
|
136
|
+
case '>':
|
|
137
|
+
if (typeof x === typeof y) {
|
|
138
|
+
return asLogicalString(x) > asLogicalString(y);
|
|
139
|
+
}
|
|
140
|
+
return asLogicalNumber(x) > asLogicalNumber(y);
|
|
141
|
+
case '>=':
|
|
142
|
+
if (typeof x === typeof y) {
|
|
143
|
+
return asLogicalString(x) >= asLogicalString(y);
|
|
144
|
+
}
|
|
145
|
+
return asLogicalNumber(x) >= asLogicalNumber(y);
|
|
146
|
+
}
|
|
147
|
+
x = asNumber(x);
|
|
148
|
+
y = asNumber(y);
|
|
149
|
+
let result;
|
|
150
|
+
switch (operator) {
|
|
151
|
+
case '+':
|
|
152
|
+
result = x + y;
|
|
153
|
+
break;
|
|
154
|
+
case '-':
|
|
155
|
+
result = x - y;
|
|
156
|
+
break;
|
|
157
|
+
case '*':
|
|
158
|
+
result = x * y;
|
|
159
|
+
break;
|
|
160
|
+
case '/':
|
|
161
|
+
result = x / y;
|
|
162
|
+
break;
|
|
163
|
+
case '^':
|
|
164
|
+
result = Math.pow(x, y);
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
return NaN;
|
|
168
|
+
}
|
|
169
|
+
// Limit decimal to 9 digits
|
|
170
|
+
return (result % 1 ?
|
|
171
|
+
Math.round(result * 1000000000) / 1000000000 :
|
|
172
|
+
result);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Converts an argument to Value and in case of a range to an array of Values.
|
|
176
|
+
*
|
|
177
|
+
* @function Highcharts.Formula.getArgumentValue
|
|
178
|
+
*
|
|
179
|
+
* @param {Highcharts.FormulaRange|Highcharts.FormulaTerm} arg
|
|
180
|
+
* Formula range or term to convert.
|
|
181
|
+
*
|
|
182
|
+
* @param {Highcharts.DataTable} [table]
|
|
183
|
+
* Table to use for references and ranges.
|
|
184
|
+
*
|
|
185
|
+
* @return {Highcharts.FormulaValue|Array<Highcharts.FormulaValue>}
|
|
186
|
+
* Converted value.
|
|
187
|
+
*/
|
|
188
|
+
function getArgumentValue(arg, table) {
|
|
189
|
+
// Add value
|
|
190
|
+
if (isValue(arg)) {
|
|
191
|
+
return arg;
|
|
192
|
+
}
|
|
193
|
+
// Add values of a range
|
|
194
|
+
if (isRange(arg)) {
|
|
195
|
+
return (table && getRangeValues(arg, table) || []);
|
|
196
|
+
}
|
|
197
|
+
// Add values of a function
|
|
198
|
+
if (isFunction(arg)) {
|
|
199
|
+
return processFunction(arg, table);
|
|
200
|
+
}
|
|
201
|
+
// Process functions, operations, references with formula processor
|
|
202
|
+
return processFormula((isFormula(arg) ? arg : [arg]), table);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Converts all arguments to Values and in case of ranges to arrays of Values.
|
|
206
|
+
*
|
|
207
|
+
* @function Highcharts.Formula.getArgumentsValues
|
|
208
|
+
*
|
|
209
|
+
* @param {Highcharts.FormulaArguments} args
|
|
210
|
+
* Formula arguments to convert.
|
|
211
|
+
*
|
|
212
|
+
* @param {Highcharts.DataTable} [table]
|
|
213
|
+
* Table to use for references and ranges.
|
|
214
|
+
*
|
|
215
|
+
* @return {Array<(Highcharts.FormulaValue|Array<Highcharts.FormulaValue>)>}
|
|
216
|
+
* Converted values.
|
|
217
|
+
*/
|
|
218
|
+
function getArgumentsValues(args, table) {
|
|
219
|
+
const values = [];
|
|
220
|
+
for (let i = 0, iEnd = args.length; i < iEnd; ++i) {
|
|
221
|
+
values.push(getArgumentValue(args[i], table));
|
|
222
|
+
}
|
|
223
|
+
return values;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Extracts cell values from a table for a given range.
|
|
227
|
+
*
|
|
228
|
+
* @function Highcharts.Formula.getRangeValues
|
|
229
|
+
*
|
|
230
|
+
* @param {Highcharts.FormulaRange} range
|
|
231
|
+
* Formula range to use.
|
|
232
|
+
*
|
|
233
|
+
* @param {Highcharts.DataTable} table
|
|
234
|
+
* Table to extract from.
|
|
235
|
+
*
|
|
236
|
+
* @return {Array<Highcharts.FormulaValue>}
|
|
237
|
+
* Extracted values.
|
|
238
|
+
*/
|
|
239
|
+
function getRangeValues(range, table) {
|
|
240
|
+
const columnIds = table
|
|
241
|
+
.getColumnIds()
|
|
242
|
+
.slice(range.beginColumn, range.endColumn + 1), values = [];
|
|
243
|
+
for (let i = 0, iEnd = columnIds.length, cell; i < iEnd; ++i) {
|
|
244
|
+
const cells = table.getColumn(columnIds[i], true) || [];
|
|
245
|
+
for (let j = range.beginRow, jEnd = range.endRow + 1; j < jEnd; ++j) {
|
|
246
|
+
cell = cells[j];
|
|
247
|
+
if (typeof cell === 'string' &&
|
|
248
|
+
cell[0] === '=' &&
|
|
249
|
+
table !== table.getModified()) {
|
|
250
|
+
// Look in the modified table for formula result
|
|
251
|
+
cell = table.getModified().getCell(columnIds[i], j);
|
|
252
|
+
}
|
|
253
|
+
values.push(isValue(cell) ? cell : NaN);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return values;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Extracts the cell value from a table for a given reference.
|
|
260
|
+
*
|
|
261
|
+
* @private
|
|
262
|
+
*
|
|
263
|
+
* @param {Highcharts.FormulaReference} reference
|
|
264
|
+
* Formula reference to use.
|
|
265
|
+
*
|
|
266
|
+
* @param {Highcharts.DataTable} table
|
|
267
|
+
* Table to extract from.
|
|
268
|
+
*
|
|
269
|
+
* @return {Highcharts.FormulaValue}
|
|
270
|
+
* Extracted value. 'undefined' might also indicate that the cell was not found.
|
|
271
|
+
*/
|
|
272
|
+
function getReferenceValue(reference, table) {
|
|
273
|
+
const columnId = table.getColumnIds()[reference.column];
|
|
274
|
+
if (columnId) {
|
|
275
|
+
const cell = table.getCell(columnId, reference.row);
|
|
276
|
+
if (typeof cell === 'string' &&
|
|
277
|
+
cell[0] === '=' &&
|
|
278
|
+
table !== table.getModified()) {
|
|
279
|
+
// Look in the modified table for formula result
|
|
280
|
+
const result = table.getModified().getCell(columnId, reference.row);
|
|
281
|
+
return isValue(result) ? result : NaN;
|
|
282
|
+
}
|
|
283
|
+
if (isValue(cell)) {
|
|
284
|
+
return reference.isNegative ? -cell : cell;
|
|
285
|
+
}
|
|
286
|
+
return NaN;
|
|
287
|
+
}
|
|
288
|
+
return NaN;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Calculates a value based on the two top values and the related operator.
|
|
292
|
+
*
|
|
293
|
+
* Used to properly process the formula's values based on its operators.
|
|
294
|
+
*
|
|
295
|
+
* @private
|
|
296
|
+
* @function Highcharts.applyOperator
|
|
297
|
+
*
|
|
298
|
+
* @param {Array<Highcharts.Value>} values
|
|
299
|
+
* Processed formula values.
|
|
300
|
+
*
|
|
301
|
+
* @param {Array<Highcharts.Operator>} operators
|
|
302
|
+
* Processed formula operators.
|
|
303
|
+
*/
|
|
304
|
+
function applyOperator(values, operators) {
|
|
305
|
+
if (values.length < 2 || operators.length < 1) {
|
|
306
|
+
values.push(NaN);
|
|
307
|
+
}
|
|
308
|
+
const secondValue = values.pop();
|
|
309
|
+
const firstValue = values.pop();
|
|
310
|
+
const operator = operators.pop();
|
|
311
|
+
if (!defined(secondValue) || !defined(firstValue) || !defined(operator)) {
|
|
312
|
+
values.push(NaN);
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
values.push(basicOperation(operator, firstValue, secondValue));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Processes a formula array on the given table. If the formula does not contain
|
|
320
|
+
* references or ranges, then no table has to be provided.
|
|
321
|
+
*
|
|
322
|
+
* Performs formulas considering the operators precedence.
|
|
323
|
+
*
|
|
324
|
+
* // Example of the `2 * 3 + 4` formula:
|
|
325
|
+
* 2 -> values: [2], operators: []
|
|
326
|
+
* * -> values: [2], operators: [*]
|
|
327
|
+
* 3 -> values: [2, 3], operators: [*]
|
|
328
|
+
* // Since the higher precedence operator exists (* > +), perform it first.
|
|
329
|
+
* + -> values: [6], operators: [+]
|
|
330
|
+
* 4 -> values: [6, 4], operators: [+]
|
|
331
|
+
* // When non-higher precedence operators remain, perform rest calculations.
|
|
332
|
+
* -> values: [10], operators: []
|
|
333
|
+
*
|
|
334
|
+
* @private
|
|
335
|
+
* @function Highcharts.processFormula
|
|
336
|
+
*
|
|
337
|
+
* @param {Highcharts.Formula} formula
|
|
338
|
+
* Formula array to process.
|
|
339
|
+
*
|
|
340
|
+
* @param {Highcharts.DataTable} [table]
|
|
341
|
+
* Table to use for references and ranges.
|
|
342
|
+
*
|
|
343
|
+
* @return {Highcharts.FormulaValue}
|
|
344
|
+
* Result value of the process. `NaN` indicates an error.
|
|
345
|
+
*/
|
|
346
|
+
function processFormula(formula, table) {
|
|
347
|
+
// Keeps all the values to calculate them in a proper priority, based on the
|
|
348
|
+
// given operators.
|
|
349
|
+
const values = [];
|
|
350
|
+
// Keeps all the operators to calculate the values above, following the
|
|
351
|
+
// proper priority.
|
|
352
|
+
const operators = [];
|
|
353
|
+
// Indicates if the next item is a value (not an operator).
|
|
354
|
+
let expectingValue = true;
|
|
355
|
+
for (let i = 0, iEnd = formula.length; i < iEnd; ++i) {
|
|
356
|
+
const item = formula[i];
|
|
357
|
+
if (isOperator(item)) {
|
|
358
|
+
if (expectingValue && item === '-') {
|
|
359
|
+
// Split the negative values to be handled as a binary
|
|
360
|
+
// operation if the next item is a value.
|
|
361
|
+
values.push(0);
|
|
362
|
+
operators.push('-');
|
|
363
|
+
expectingValue = true;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
// Perform if the higher precedence operator exist.
|
|
367
|
+
while (operators.length &&
|
|
368
|
+
operatorPriority[operators[operators.length - 1]] >=
|
|
369
|
+
operatorPriority[item]) {
|
|
370
|
+
applyOperator(values, operators);
|
|
371
|
+
}
|
|
372
|
+
operators.push(item);
|
|
373
|
+
expectingValue = true;
|
|
374
|
+
}
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
let value;
|
|
378
|
+
// Assign the proper value, starting from the most common types.
|
|
379
|
+
if (isValue(item)) {
|
|
380
|
+
value = item;
|
|
381
|
+
}
|
|
382
|
+
else if (isReference(item)) {
|
|
383
|
+
value = table ? getReferenceValue(item, table) : NaN;
|
|
384
|
+
}
|
|
385
|
+
else if (isFunction(item)) {
|
|
386
|
+
const result = processFunction(item, table);
|
|
387
|
+
value = isValue(result) ? result : NaN;
|
|
388
|
+
}
|
|
389
|
+
else if (isFormula(item)) {
|
|
390
|
+
value = processFormula(item, table);
|
|
391
|
+
}
|
|
392
|
+
if (typeof value !== 'undefined') {
|
|
393
|
+
values.push(value);
|
|
394
|
+
expectingValue = false;
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
return NaN;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
// Handle the remaining operators that weren't taken into consideration, due
|
|
401
|
+
// to non-higher precedence.
|
|
402
|
+
while (operators.length) {
|
|
403
|
+
applyOperator(values, operators);
|
|
404
|
+
}
|
|
405
|
+
if (values.length !== 1) {
|
|
406
|
+
return NaN;
|
|
407
|
+
}
|
|
408
|
+
return values[0];
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Process a function on the given table. If the arguments do not contain
|
|
412
|
+
* references or ranges, then no table has to be provided.
|
|
413
|
+
*
|
|
414
|
+
* @private
|
|
415
|
+
*
|
|
416
|
+
* @param {Highcharts.FormulaFunction} formulaFunction
|
|
417
|
+
* Formula function to process.
|
|
418
|
+
*
|
|
419
|
+
* @param {Highcharts.DataTable} [table]
|
|
420
|
+
* Table to use for references and ranges.
|
|
421
|
+
*
|
|
422
|
+
* @param {Highcharts.FormulaReference} [reference]
|
|
423
|
+
* Table cell reference to use for relative references and ranges.
|
|
424
|
+
*
|
|
425
|
+
* @return {Highcharts.FormulaValue|Array<Highcharts.FormulaValue>}
|
|
426
|
+
* Result value (or values) of the process. `NaN` indicates an error.
|
|
427
|
+
*/
|
|
428
|
+
function processFunction(formulaFunction, table,
|
|
429
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
430
|
+
reference // @todo
|
|
431
|
+
) {
|
|
432
|
+
const processor = processorFunctions[formulaFunction.name];
|
|
433
|
+
if (processor) {
|
|
434
|
+
try {
|
|
435
|
+
return processor(formulaFunction.args, table);
|
|
436
|
+
}
|
|
437
|
+
catch {
|
|
438
|
+
return NaN;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
const error = new Error(`Function "${formulaFunction.name}" not found.`);
|
|
442
|
+
error.name = 'FormulaProcessError';
|
|
443
|
+
throw error;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Registers a function for the FormulaProcessor.
|
|
447
|
+
*
|
|
448
|
+
* @param {string} name
|
|
449
|
+
* Name of the function in spreadsheets notation with upper case.
|
|
450
|
+
*
|
|
451
|
+
* @param {Highcharts.FormulaFunction} processorFunction
|
|
452
|
+
* ProcessorFunction for the FormulaProcessor. This is an object so that it
|
|
453
|
+
* can take additional parameter for future validation routines.
|
|
454
|
+
*
|
|
455
|
+
* @return {boolean}
|
|
456
|
+
* Return true, if the ProcessorFunction has been registered.
|
|
457
|
+
*/
|
|
458
|
+
function registerProcessorFunction(name, processorFunction) {
|
|
459
|
+
return (processorFunctionNameRegExp.test(name) &&
|
|
460
|
+
!processorFunctions[name] &&
|
|
461
|
+
!!(processorFunctions[name] = processorFunction));
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Translates relative references and ranges in-place.
|
|
465
|
+
*
|
|
466
|
+
* @param {Highcharts.Formula} formula
|
|
467
|
+
* Formula to translate references and ranges in.
|
|
468
|
+
*
|
|
469
|
+
* @param {number} [columnDelta=0]
|
|
470
|
+
* Column delta to translate to. Negative translate back.
|
|
471
|
+
*
|
|
472
|
+
* @param {number} [rowDelta=0]
|
|
473
|
+
* Row delta to translate to. Negative numbers translate back.
|
|
474
|
+
*
|
|
475
|
+
* @return {Highcharts.Formula}
|
|
476
|
+
* Formula with translated reference and ranges. This formula is equal to the
|
|
477
|
+
* first argument.
|
|
478
|
+
*/
|
|
479
|
+
function translateReferences(formula, columnDelta = 0, rowDelta = 0) {
|
|
480
|
+
for (let i = 0, iEnd = formula.length, item; i < iEnd; ++i) {
|
|
481
|
+
item = formula[i];
|
|
482
|
+
if (Array.isArray(item)) {
|
|
483
|
+
translateReferences(item, columnDelta, rowDelta);
|
|
484
|
+
}
|
|
485
|
+
else if (isFunction(item)) {
|
|
486
|
+
translateReferences(item.args, columnDelta, rowDelta);
|
|
487
|
+
}
|
|
488
|
+
else if (isRange(item)) {
|
|
489
|
+
if (item.beginColumnRelative) {
|
|
490
|
+
item.beginColumn += columnDelta;
|
|
491
|
+
}
|
|
492
|
+
if (item.beginRowRelative) {
|
|
493
|
+
item.beginRow += rowDelta;
|
|
494
|
+
}
|
|
495
|
+
if (item.endColumnRelative) {
|
|
496
|
+
item.endColumn += columnDelta;
|
|
497
|
+
}
|
|
498
|
+
if (item.endRowRelative) {
|
|
499
|
+
item.endRow += rowDelta;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
else if (isReference(item)) {
|
|
503
|
+
if (item.columnRelative) {
|
|
504
|
+
item.column += columnDelta;
|
|
505
|
+
}
|
|
506
|
+
if (item.rowRelative) {
|
|
507
|
+
item.row += rowDelta;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return formula;
|
|
512
|
+
}
|
|
513
|
+
/* *
|
|
514
|
+
*
|
|
515
|
+
* Default Export
|
|
516
|
+
*
|
|
517
|
+
* */
|
|
518
|
+
const FormulaProcessor = {
|
|
519
|
+
asNumber,
|
|
520
|
+
getArgumentValue,
|
|
521
|
+
getArgumentsValues,
|
|
522
|
+
getRangeValues,
|
|
523
|
+
getReferenceValue,
|
|
524
|
+
processFormula,
|
|
525
|
+
processorFunctions,
|
|
526
|
+
registerProcessorFunction,
|
|
527
|
+
translateReferences
|
|
528
|
+
};
|
|
529
|
+
export default FormulaProcessor;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments array of a formula function with terms and ranges.
|
|
3
|
+
*/
|
|
4
|
+
export type Arguments = Array<(Range | Term)>;
|
|
5
|
+
/**
|
|
6
|
+
* Formula array with terms and operators.
|
|
7
|
+
*/
|
|
8
|
+
export type Formula = Array<(Operator | Term)>;
|
|
9
|
+
/**
|
|
10
|
+
* Formula function with an arguments array.
|
|
11
|
+
*/
|
|
12
|
+
export interface Function {
|
|
13
|
+
args: Arguments;
|
|
14
|
+
name: string;
|
|
15
|
+
type: 'function';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Item in arguments and formulas.
|
|
19
|
+
*/
|
|
20
|
+
export type Item = (Operator | Range | Term);
|
|
21
|
+
/**
|
|
22
|
+
* Formula operators, either basic arithmetic, or basic logic.
|
|
23
|
+
*/
|
|
24
|
+
export type Operator = ('+' | '-' | '*' | '/' | '^' | '=' | '<' | '<=' | '>' | '>=');
|
|
25
|
+
/**
|
|
26
|
+
* Represents a range to cells of a table.
|
|
27
|
+
*/
|
|
28
|
+
export interface Range {
|
|
29
|
+
beginColumn: number;
|
|
30
|
+
beginColumnRelative?: true;
|
|
31
|
+
beginRow: number;
|
|
32
|
+
beginRowRelative?: true;
|
|
33
|
+
endColumn: number;
|
|
34
|
+
endColumnRelative?: true;
|
|
35
|
+
endRow: number;
|
|
36
|
+
endRowRelative?: true;
|
|
37
|
+
type: 'range';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Represents a reference to a table cell.
|
|
41
|
+
*/
|
|
42
|
+
export interface Reference {
|
|
43
|
+
column: number;
|
|
44
|
+
columnRelative?: true;
|
|
45
|
+
row: number;
|
|
46
|
+
rowRelative?: true;
|
|
47
|
+
type: 'reference';
|
|
48
|
+
isNegative?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A term represents some form of processing into a value or is already a value.
|
|
52
|
+
*/
|
|
53
|
+
export type Term = (Formula | Function | Reference | Value);
|
|
54
|
+
/**
|
|
55
|
+
* A value to use in a operation or process.
|
|
56
|
+
*/
|
|
57
|
+
export type Value = (boolean | number | string);
|
|
58
|
+
/**
|
|
59
|
+
* Tests an item for a Formula array.
|
|
60
|
+
*
|
|
61
|
+
* @private
|
|
62
|
+
*
|
|
63
|
+
* @param {Highcharts.FormulaItem} item
|
|
64
|
+
* Item to test.
|
|
65
|
+
*
|
|
66
|
+
* @return {boolean}
|
|
67
|
+
* `true`, if the item is a formula (or argument) array.
|
|
68
|
+
*/
|
|
69
|
+
declare function isFormula(item: Item): item is Formula;
|
|
70
|
+
/**
|
|
71
|
+
* Tests an item for a Function structure.
|
|
72
|
+
*
|
|
73
|
+
* @private
|
|
74
|
+
*
|
|
75
|
+
* @param {Highcharts.FormulaItem} item
|
|
76
|
+
* Item to test.
|
|
77
|
+
*
|
|
78
|
+
* @return {boolean}
|
|
79
|
+
* `true`, if the item is a formula function.
|
|
80
|
+
*/
|
|
81
|
+
declare function isFunction(item: Item): item is Function;
|
|
82
|
+
/**
|
|
83
|
+
* Tests an item for an Operator string.
|
|
84
|
+
*
|
|
85
|
+
* @private
|
|
86
|
+
*
|
|
87
|
+
* @param {Highcharts.FormulaItem} item
|
|
88
|
+
* Item to test.
|
|
89
|
+
*
|
|
90
|
+
* @return {boolean}
|
|
91
|
+
* `true`, if the item is an operator string.
|
|
92
|
+
*/
|
|
93
|
+
declare function isOperator(item: Item): item is Operator;
|
|
94
|
+
/**
|
|
95
|
+
* Tests an item for a Range structure.
|
|
96
|
+
*
|
|
97
|
+
* @private
|
|
98
|
+
*
|
|
99
|
+
* @param {Highcharts.FormulaItem} item
|
|
100
|
+
* Item to test.
|
|
101
|
+
*
|
|
102
|
+
* @return {boolean}
|
|
103
|
+
* `true`, if the item is a range.
|
|
104
|
+
*/
|
|
105
|
+
declare function isRange(item: Item): item is Range;
|
|
106
|
+
/**
|
|
107
|
+
* Tests an item for a Reference structure.
|
|
108
|
+
*
|
|
109
|
+
* @private
|
|
110
|
+
*
|
|
111
|
+
* @param {Highcharts.FormulaItem} item
|
|
112
|
+
* Item to test.
|
|
113
|
+
*
|
|
114
|
+
* @return {boolean}
|
|
115
|
+
* `true`, if the item is a reference.
|
|
116
|
+
*/
|
|
117
|
+
declare function isReference(item: Item): item is Reference;
|
|
118
|
+
/**
|
|
119
|
+
* Tests an item for a Value structure.
|
|
120
|
+
*
|
|
121
|
+
* @private
|
|
122
|
+
*
|
|
123
|
+
* @param {Highcharts.FormulaItem|null|undefined} item
|
|
124
|
+
* Item to test.
|
|
125
|
+
*
|
|
126
|
+
* @return {boolean}
|
|
127
|
+
* `true`, if the item is a value.
|
|
128
|
+
*/
|
|
129
|
+
declare function isValue(item: (Item | null | undefined)): item is Value;
|
|
130
|
+
declare const MathFormula: {
|
|
131
|
+
isFormula: typeof isFormula;
|
|
132
|
+
isFunction: typeof isFunction;
|
|
133
|
+
isOperator: typeof isOperator;
|
|
134
|
+
isRange: typeof isRange;
|
|
135
|
+
isReference: typeof isReference;
|
|
136
|
+
isValue: typeof isValue;
|
|
137
|
+
};
|
|
138
|
+
export default MathFormula;
|