@highcharts/grid-pro 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +6 -0
- package/README.md +15 -9
- package/css/grid-pro.css +1289 -1153
- package/css/modules/grid-base-variables.css +131 -0
- package/css/modules/grid-button-variables.css +140 -0
- package/css/modules/grid-caption-variables.css +11 -0
- package/css/modules/grid-description-variables.css +11 -0
- package/css/modules/grid-input-variables.css +114 -0
- package/css/modules/grid-link-variables.css +18 -0
- package/css/modules/grid-menu-variables.css +50 -0
- package/css/modules/grid-pagination-variables.css +12 -0
- package/css/modules/grid-popup-variables.css +24 -0
- package/css/modules/grid-pro.css +234 -0
- package/css/modules/grid-table-variables.css +385 -0
- package/css/modules/grid-theme-default.css +55 -0
- package/es-modules/Accessibility/A11yI18n.js +4 -5
- package/es-modules/Accessibility/Accessibility.js +5 -5
- package/es-modules/Accessibility/AccessibilityComponent.d.ts +3 -3
- package/es-modules/Accessibility/AccessibilityComponent.js +4 -3
- package/es-modules/Accessibility/Components/AnnotationsA11y.js +4 -3
- package/es-modules/Accessibility/Components/ContainerComponent.js +4 -3
- package/es-modules/Accessibility/Components/InfoRegionsComponent.js +9 -9
- package/es-modules/Accessibility/Components/LegendComponent.js +5 -5
- package/es-modules/Accessibility/Components/MenuComponent.js +5 -5
- package/es-modules/Accessibility/Components/NavigatorComponent.js +6 -7
- package/es-modules/Accessibility/Components/RangeSelectorComponent.js +5 -5
- package/es-modules/Accessibility/Components/SeriesComponent/ForcedMarkers.js +15 -5
- package/es-modules/Accessibility/Components/SeriesComponent/NewDataAnnouncer.js +7 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesComponent.js +4 -3
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesDescriber.js +7 -7
- package/es-modules/Accessibility/Components/SeriesComponent/SeriesKeyboardNavigation.js +5 -5
- package/es-modules/Accessibility/Components/ZoomComponent.js +5 -5
- package/es-modules/Accessibility/FocusBorder.js +5 -5
- package/es-modules/Accessibility/HighContrastMode.js +4 -3
- package/es-modules/Accessibility/HighContrastTheme.js +4 -3
- package/es-modules/Accessibility/KeyboardNavigation.js +5 -5
- package/es-modules/Accessibility/KeyboardNavigationHandler.js +5 -5
- package/es-modules/Accessibility/Options/A11yDefaults.d.ts +11 -0
- package/es-modules/Accessibility/Options/A11yDefaults.js +15 -3
- package/es-modules/Accessibility/Options/DeprecatedOptions.d.ts +58 -0
- package/es-modules/Accessibility/Options/DeprecatedOptions.js +11 -5
- package/es-modules/Accessibility/Options/LangDefaults.js +13 -3
- package/es-modules/Accessibility/ProxyElement.js +6 -8
- package/es-modules/Accessibility/ProxyProvider.js +5 -5
- package/es-modules/Accessibility/Utils/Announcer.js +6 -6
- package/es-modules/Accessibility/Utils/ChartUtilities.js +5 -5
- package/es-modules/Accessibility/Utils/DOMElementProvider.js +4 -3
- package/es-modules/Accessibility/Utils/EventProvider.d.ts +3 -3
- package/es-modules/Accessibility/Utils/EventProvider.js +10 -5
- package/es-modules/Accessibility/Utils/HTMLUtilities.js +5 -5
- package/es-modules/Core/Animation/AnimationOptions.d.ts +42 -0
- package/es-modules/Core/Animation/AnimationOptions.js +10 -0
- package/es-modules/Core/Animation/AnimationUtilities.js +40 -5
- package/es-modules/Core/Animation/Fx.d.ts +1 -130
- package/es-modules/Core/Animation/Fx.js +14 -8
- package/es-modules/Core/Animation/FxBase.d.ts +1 -0
- package/es-modules/Core/Animation/FxBase.js +11 -0
- package/es-modules/Core/Callback.d.ts +56 -0
- package/es-modules/Core/Callback.js +10 -0
- package/es-modules/Core/Chart/Chart.d.ts +659 -400
- package/es-modules/Core/Chart/Chart.js +112 -95
- package/es-modules/Core/Chart/Chart3D.d.ts +123 -233
- package/es-modules/Core/Chart/Chart3D.js +23 -37
- package/es-modules/Core/Chart/ChartBase.d.ts +3 -0
- package/es-modules/Core/Chart/ChartBase.js +11 -0
- package/es-modules/Core/Chart/ChartDefaults.js +18 -12
- package/es-modules/Core/Chart/ChartNavigationComposition.d.ts +1 -55
- package/es-modules/Core/Chart/ChartNavigationComposition.js +13 -13
- package/es-modules/Core/Chart/ChartOptions.d.ts +1225 -0
- package/es-modules/Core/Chart/ChartOptions.js +10 -0
- package/es-modules/Core/Chart/GanttChart.d.ts +0 -38
- package/es-modules/Core/Chart/GanttChart.js +5 -5
- package/es-modules/Core/Chart/MapChart.d.ts +9 -4
- package/es-modules/Core/Chart/MapChart.js +14 -5
- package/es-modules/Core/Chart/StockChart.d.ts +0 -85
- package/es-modules/Core/Chart/StockChart.js +35 -18
- package/es-modules/Core/Color/Color.d.ts +16 -24
- package/es-modules/Core/Color/Color.js +27 -10
- package/es-modules/Core/Color/ColorString.d.ts +0 -23
- package/es-modules/Core/Color/ColorString.js +11 -0
- package/es-modules/Core/Color/ColorType.d.ts +0 -33
- package/es-modules/Core/Color/ColorType.js +11 -0
- package/es-modules/Core/Color/GradientColor.d.ts +0 -33
- package/es-modules/Core/Color/GradientColor.js +11 -0
- package/es-modules/Core/Color/Palettes.d.ts +1 -84
- package/es-modules/Core/Color/Palettes.js +2 -1
- package/es-modules/Core/Defaults.d.ts +6 -0
- package/es-modules/Core/Defaults.js +66 -75
- package/es-modules/Core/Delaunay.d.ts +52 -0
- package/es-modules/Core/Delaunay.js +310 -0
- package/es-modules/Core/Foundation.d.ts +1 -19
- package/es-modules/Core/Foundation.js +8 -6
- package/es-modules/Core/Geometry/CircleObject.d.ts +5 -0
- package/es-modules/Core/Geometry/CircleObject.js +10 -0
- package/es-modules/Core/Geometry/CircleUtilities.d.ts +1 -189
- package/es-modules/Core/Geometry/CircleUtilities.js +18 -17
- package/es-modules/Core/Geometry/GeometryObject.d.ts +7 -0
- package/es-modules/Core/Geometry/GeometryObject.js +10 -0
- package/es-modules/Core/Geometry/GeometryUtilities.d.ts +1 -48
- package/es-modules/Core/Geometry/GeometryUtilities.js +9 -7
- package/es-modules/Core/Geometry/IntersectionObject.d.ts +7 -0
- package/es-modules/Core/Geometry/IntersectionObject.js +10 -0
- package/es-modules/Core/Geometry/PolygonClip.d.ts +1 -19
- package/es-modules/Core/Geometry/PolygonClip.js +9 -7
- package/es-modules/Core/Globals.d.ts +9 -31
- package/es-modules/Core/Globals.js +9 -10
- package/es-modules/Core/GlobalsBase.d.ts +35 -0
- package/es-modules/Core/GlobalsBase.js +11 -0
- package/es-modules/Core/HttpUtilities.d.ts +54 -17
- package/es-modules/Core/HttpUtilities.js +16 -16
- package/es-modules/Core/JSON.d.ts +29 -0
- package/es-modules/Core/JSON.js +13 -0
- package/es-modules/Core/KeyboardEvent.d.ts +1 -0
- package/es-modules/Core/KeyboardEvent.js +11 -0
- package/es-modules/Core/MSPointer.d.ts +1 -74
- package/es-modules/Core/MSPointer.js +24 -15
- package/es-modules/Core/Math3D.d.ts +1 -117
- package/es-modules/Core/Math3D.js +14 -12
- package/es-modules/Core/Options.d.ts +338 -0
- package/es-modules/Core/Options.js +10 -0
- package/es-modules/Core/Pointer.d.ts +71 -445
- package/es-modules/Core/Pointer.js +74 -69
- package/es-modules/Core/PointerEvent.d.ts +20 -0
- package/es-modules/Core/PointerEvent.js +11 -0
- package/es-modules/Core/Renderer/AlignObject.d.ts +25 -27
- package/es-modules/Core/Renderer/AlignObject.js +11 -0
- package/es-modules/Core/Renderer/BBoxObject.d.ts +20 -31
- package/es-modules/Core/Renderer/BBoxObject.js +11 -0
- package/es-modules/Core/Renderer/CSSObject.d.ts +268 -59
- package/es-modules/Core/Renderer/CSSObject.js +10 -0
- package/es-modules/Core/Renderer/DOMElementType.d.ts +1 -33
- package/es-modules/Core/Renderer/DOMElementType.js +11 -0
- package/es-modules/Core/Renderer/DashStyleValue.d.ts +1 -27
- package/es-modules/Core/Renderer/DashStyleValue.js +11 -0
- package/es-modules/Core/Renderer/FontMetricsObject.d.ts +6 -26
- package/es-modules/Core/Renderer/FontMetricsObject.js +11 -0
- package/es-modules/Core/Renderer/HTML/AST.d.ts +3 -15
- package/es-modules/Core/Renderer/HTML/AST.js +24 -15
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.d.ts +1 -25
- package/es-modules/Core/Renderer/HTML/HTMLAttributes.js +11 -0
- package/es-modules/Core/Renderer/HTML/HTMLElement.d.ts +0 -54
- package/es-modules/Core/Renderer/HTML/HTMLElement.js +28 -24
- package/es-modules/Core/Renderer/PolygonBoxObject.d.ts +15 -12
- package/es-modules/Core/Renderer/PolygonBoxObject.js +11 -0
- package/es-modules/Core/Renderer/Position3DObject.d.ts +6 -30
- package/es-modules/Core/Renderer/Position3DObject.js +11 -0
- package/es-modules/Core/Renderer/PositionObject.d.ts +9 -23
- package/es-modules/Core/Renderer/PositionObject.js +11 -0
- package/es-modules/Core/Renderer/RectangleObject.d.ts +6 -30
- package/es-modules/Core/Renderer/RectangleObject.js +11 -0
- package/es-modules/Core/Renderer/RendererRegistry.d.ts +1 -29
- package/es-modules/Core/Renderer/RendererRegistry.js +6 -3
- package/es-modules/Core/Renderer/RendererType.d.ts +1 -53
- package/es-modules/Core/Renderer/RendererType.js +11 -0
- package/es-modules/Core/Renderer/RendererUtilities.d.ts +1 -26
- package/es-modules/Core/Renderer/RendererUtilities.js +41 -23
- package/es-modules/Core/Renderer/SVG/ButtonThemeObject.d.ts +26 -31
- package/es-modules/Core/Renderer/SVG/SVGArc3D.d.ts +1 -44
- package/es-modules/Core/Renderer/SVG/SVGAttributes.d.ts +15 -51
- package/es-modules/Core/Renderer/SVG/SVGAttributes3D.d.ts +1 -42
- package/es-modules/Core/Renderer/SVG/SVGCuboid.d.ts +1 -42
- package/es-modules/Core/Renderer/SVG/SVGElement.d.ts +459 -0
- package/es-modules/Core/Renderer/SVG/SVGElement3D.d.ts +1 -0
- package/es-modules/Core/Renderer/SVG/SVGElementBase.d.ts +0 -23
- package/es-modules/Core/Renderer/SVG/SVGLabel.d.ts +14 -0
- package/es-modules/Core/Renderer/SVG/SVGPath.d.ts +18 -56
- package/es-modules/Core/Renderer/SVG/SVGPath3D.d.ts +0 -30
- package/es-modules/Core/Renderer/SVG/SVGRenderer.d.ts +652 -0
- package/es-modules/Core/Renderer/SVG/SVGRenderer3D.d.ts +1 -0
- package/es-modules/Core/Renderer/SVG/SVGRendererBase.d.ts +0 -24
- package/es-modules/Core/Renderer/SVG/SymbolOptions.d.ts +3 -26
- package/es-modules/Core/Renderer/SVG/SymbolType.d.ts +1 -41
- package/es-modules/Core/Renderer/SVG/Symbols.d.ts +146 -0
- package/es-modules/Core/Renderer/SVG/TextBuilder.d.ts +1 -0
- package/es-modules/Core/Renderer/ShadowOptionsObject.d.ts +21 -30
- package/es-modules/Core/Renderer/ShadowOptionsObject.js +11 -0
- package/es-modules/Core/Renderer/SizeObject.d.ts +0 -23
- package/es-modules/Core/Renderer/SizeObject.js +11 -0
- package/es-modules/Core/Responsive.d.ts +94 -29
- package/es-modules/Core/Responsive.js +17 -12
- package/es-modules/Core/Templating.d.ts +17 -1
- package/es-modules/Core/Templating.js +12 -8
- package/es-modules/Core/Time.d.ts +18 -1
- package/es-modules/Core/Time.js +6 -5
- package/es-modules/Core/Tooltip.d.ts +67 -123
- package/es-modules/Core/Tooltip.js +161 -108
- package/es-modules/Core/TooltipOptions.d.ts +724 -0
- package/es-modules/Core/TooltipOptions.js +10 -0
- package/es-modules/Core/Utilities.d.ts +32 -703
- package/es-modules/Core/Utilities.js +28 -1443
- package/es-modules/Data/ColumnUtils.d.ts +83 -80
- package/es-modules/Data/ColumnUtils.js +106 -116
- package/es-modules/Data/Connectors/CSVConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/CSVConnector.js +6 -7
- package/es-modules/Data/Connectors/CSVConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/DataConnector.d.ts +63 -54
- package/es-modules/Data/Connectors/DataConnector.js +67 -56
- package/es-modules/Data/Connectors/DataConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/DataConnectorType.d.ts +3 -3
- package/es-modules/Data/Connectors/GoogleSheetsConnector.d.ts +40 -42
- package/es-modules/Data/Connectors/GoogleSheetsConnector.js +76 -91
- package/es-modules/Data/Connectors/GoogleSheetsConnectorOptions.d.ts +7 -5
- package/es-modules/Data/Connectors/HTMLTableConnector.d.ts +23 -28
- package/es-modules/Data/Connectors/HTMLTableConnector.js +6 -7
- package/es-modules/Data/Connectors/HTMLTableConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Connectors/JSONConnector.d.ts +9 -14
- package/es-modules/Data/Connectors/JSONConnector.js +6 -7
- package/es-modules/Data/Connectors/JSONConnectorOptions.d.ts +3 -3
- package/es-modules/Data/Converters/CSVConverter.d.ts +5 -5
- package/es-modules/Data/Converters/CSVConverter.js +6 -7
- package/es-modules/Data/Converters/CSVConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/DataConverter.d.ts +76 -78
- package/es-modules/Data/Converters/DataConverter.js +29 -56
- package/es-modules/Data/Converters/DataConverterType.d.ts +3 -3
- package/es-modules/Data/Converters/DataConverterUtils.d.ts +88 -81
- package/es-modules/Data/Converters/DataConverterUtils.js +172 -184
- package/es-modules/Data/Converters/GoogleSheetsConverter.d.ts +4 -4
- package/es-modules/Data/Converters/GoogleSheetsConverter.js +6 -6
- package/es-modules/Data/Converters/GoogleSheetsConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/HTMLTableConverter.d.ts +4 -4
- package/es-modules/Data/Converters/HTMLTableConverter.js +5 -6
- package/es-modules/Data/Converters/HTMLTableConverterOptions.d.ts +5 -5
- package/es-modules/Data/Converters/JSONConverter.d.ts +7 -7
- package/es-modules/Data/Converters/JSONConverter.js +9 -9
- package/es-modules/Data/Converters/JSONConverterOptions.d.ts +5 -5
- package/es-modules/Data/DataCursor.d.ts +65 -70
- package/es-modules/Data/DataCursor.js +122 -142
- package/es-modules/Data/DataEvent.d.ts +55 -57
- package/es-modules/Data/DataEvent.js +3 -3
- package/es-modules/Data/DataPool.d.ts +10 -17
- package/es-modules/Data/DataPool.js +23 -12
- package/es-modules/Data/DataPoolOptions.d.ts +3 -3
- package/es-modules/Data/DataTable.d.ts +115 -117
- package/es-modules/Data/DataTable.js +67 -33
- package/es-modules/Data/DataTableCore.d.ts +11 -11
- package/es-modules/Data/DataTableCore.js +7 -7
- package/es-modules/Data/DataTableOptions.js +3 -3
- package/es-modules/Data/Formula/Formula.js +3 -3
- package/es-modules/Data/Formula/FormulaParser.js +4 -5
- package/es-modules/Data/Formula/FormulaProcessor.js +4 -5
- package/es-modules/Data/Formula/FormulaTypes.js +3 -3
- package/es-modules/Data/Formula/Functions/ABS.js +3 -3
- package/es-modules/Data/Formula/Functions/AND.js +3 -3
- package/es-modules/Data/Formula/Functions/AVERAGE.js +3 -3
- package/es-modules/Data/Formula/Functions/AVERAGEA.js +3 -3
- package/es-modules/Data/Formula/Functions/COUNT.js +3 -3
- package/es-modules/Data/Formula/Functions/COUNTA.js +3 -3
- package/es-modules/Data/Formula/Functions/IF.js +3 -3
- package/es-modules/Data/Formula/Functions/ISNA.js +3 -3
- package/es-modules/Data/Formula/Functions/MAX.js +3 -3
- package/es-modules/Data/Formula/Functions/MEDIAN.js +3 -3
- package/es-modules/Data/Formula/Functions/MIN.js +3 -3
- package/es-modules/Data/Formula/Functions/MOD.js +3 -3
- package/es-modules/Data/Formula/Functions/MODE.js +3 -3
- package/es-modules/Data/Formula/Functions/NOT.js +3 -3
- package/es-modules/Data/Formula/Functions/OR.js +3 -3
- package/es-modules/Data/Formula/Functions/PRODUCT.js +3 -3
- package/es-modules/Data/Formula/Functions/SUM.js +3 -3
- package/es-modules/Data/Formula/Functions/XOR.js +3 -3
- package/es-modules/Data/Modifiers/ChainModifier.d.ts +29 -34
- package/es-modules/Data/Modifiers/ChainModifier.js +10 -11
- package/es-modules/Data/Modifiers/ChainModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/DataModifier.d.ts +36 -41
- package/es-modules/Data/Modifiers/DataModifier.js +34 -56
- package/es-modules/Data/Modifiers/DataModifierEvent.js +3 -3
- package/es-modules/Data/Modifiers/DataModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/DataModifierType.d.ts +3 -3
- package/es-modules/Data/Modifiers/FilterModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/FilterModifier.js +6 -7
- package/es-modules/Data/Modifiers/FilterModifierOptions.d.ts +3 -2
- package/es-modules/Data/Modifiers/FilterModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/InvertModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/InvertModifier.js +6 -7
- package/es-modules/Data/Modifiers/InvertModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/MathModifier.d.ts +5 -4
- package/es-modules/Data/Modifiers/MathModifier.js +3 -3
- package/es-modules/Data/Modifiers/MathModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/RangeModifier.d.ts +4 -4
- package/es-modules/Data/Modifiers/RangeModifier.js +6 -7
- package/es-modules/Data/Modifiers/RangeModifierOptions.js +3 -3
- package/es-modules/Data/Modifiers/SortModifier.d.ts +6 -11
- package/es-modules/Data/Modifiers/SortModifier.js +35 -10
- package/es-modules/Data/Modifiers/SortModifierOptions.d.ts +43 -6
- package/es-modules/Data/Modifiers/SortModifierOptions.js +3 -3
- package/es-modules/Grid/Core/Accessibility/A11yOptions.d.ts +77 -0
- package/es-modules/Grid/Core/Accessibility/A11yOptions.js +4 -3
- package/es-modules/Grid/Core/Accessibility/Accessibility.d.ts +68 -1
- package/es-modules/Grid/Core/Accessibility/Accessibility.js +179 -7
- package/es-modules/Grid/Core/Credits.js +3 -3
- package/es-modules/Grid/Core/Data/DataProvider.d.ts +97 -0
- package/es-modules/Grid/Core/Data/DataProvider.js +89 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.d.ts +20 -0
- package/es-modules/Grid/Core/Data/DataProviderRegistry.js +52 -0
- package/es-modules/Grid/Core/Data/DataProviderType.d.ts +19 -0
- package/es-modules/Grid/Core/Data/DataProviderType.js +15 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.d.ts +165 -0
- package/es-modules/Grid/Core/Data/LocalDataProvider.js +341 -0
- package/es-modules/Grid/Core/Defaults.js +21 -7
- package/es-modules/Grid/Core/Globals.d.ts +20 -16
- package/es-modules/Grid/Core/Globals.js +13 -11
- package/es-modules/Grid/Core/Grid.d.ts +43 -23
- package/es-modules/Grid/Core/Grid.js +316 -136
- package/es-modules/Grid/Core/GridUtils.d.ts +33 -0
- package/es-modules/Grid/Core/GridUtils.js +53 -6
- package/es-modules/Grid/Core/Options.d.ts +162 -5
- package/es-modules/Grid/Core/Options.js +3 -3
- package/es-modules/Grid/Core/Pagination/Pagination.d.ts +3 -0
- package/es-modules/Grid/Core/Pagination/Pagination.js +66 -26
- package/es-modules/Grid/Core/Pagination/PaginationOptions.d.ts +4 -40
- package/es-modules/Grid/Core/Pagination/PaginationOptions.js +11 -0
- package/es-modules/Grid/Core/Querying/FilteringController.js +4 -5
- package/es-modules/Grid/Core/Querying/PaginationController.d.ts +2 -2
- package/es-modules/Grid/Core/Querying/PaginationController.js +6 -6
- package/es-modules/Grid/Core/Querying/QueryingController.d.ts +1 -1
- package/es-modules/Grid/Core/Querying/QueryingController.js +5 -29
- package/es-modules/Grid/Core/Querying/SortingController.d.ts +15 -0
- package/es-modules/Grid/Core/Querying/SortingController.js +89 -51
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.d.ts +53 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveComposition.js +229 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.d.ts +58 -0
- package/es-modules/Grid/Core/Responsive/ResponsiveOptions.js +15 -0
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/ColumnFiltering.js +5 -6
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.d.ts +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterCell.js +6 -7
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilterRow.js +5 -5
- package/es-modules/Grid/Core/Table/Actions/ColumnFiltering/FilteringTypes.js +3 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.d.ts +29 -3
- package/es-modules/Grid/Core/Table/Actions/ColumnSorting.js +136 -26
- package/es-modules/Grid/Core/Table/Actions/ColumnsResizer.js +4 -6
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.d.ts +94 -3
- package/es-modules/Grid/Core/Table/Actions/RowsVirtualizer.js +481 -91
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.d.ts +11 -0
- package/es-modules/Grid/Core/Table/Body/CellContextMenu.js +84 -0
- package/es-modules/Grid/Core/Table/Body/TableCell.d.ts +36 -15
- package/es-modules/Grid/Core/Table/Body/TableCell.js +89 -33
- package/es-modules/Grid/Core/Table/Body/TableRow.d.ts +15 -5
- package/es-modules/Grid/Core/Table/Body/TableRow.js +70 -19
- package/es-modules/Grid/Core/Table/Cell.d.ts +16 -10
- package/es-modules/Grid/Core/Table/Cell.js +41 -6
- package/es-modules/Grid/Core/Table/CellContent/CellContent.js +3 -3
- package/es-modules/Grid/Core/Table/CellContent/TextContent.js +7 -12
- package/es-modules/Grid/Core/Table/Column.d.ts +11 -5
- package/es-modules/Grid/Core/Table/Column.js +26 -37
- package/es-modules/Grid/Core/Table/ColumnResizing/AdjacentResizingMode.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/ColumnResizing.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/DistributedResizingMode.js +3 -3
- package/es-modules/Grid/Core/Table/ColumnResizing/IndependentResizingMode.js +12 -11
- package/es-modules/Grid/Core/Table/ColumnResizing/ResizingMode.js +7 -6
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.d.ts +5 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ColumnToolbar.js +21 -7
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/FilterPopup.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/FilterMenuButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.d.ts +9 -0
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuButtons/SortMenuButton.js +37 -9
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/MenuPopup.js +5 -4
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/StateHelpers.js +11 -7
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/FilterToolbarButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/MenuToolbarButton.js +4 -5
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.d.ts +4 -1
- package/es-modules/Grid/Core/Table/Header/ColumnToolbar/ToolbarButtons/SortToolbarButton.js +88 -15
- package/es-modules/Grid/Core/Table/Header/HeaderCell.d.ts +8 -3
- package/es-modules/Grid/Core/Table/Header/HeaderCell.js +36 -15
- package/es-modules/Grid/Core/Table/Header/HeaderRow.js +7 -8
- package/es-modules/Grid/Core/Table/Header/TableHeader.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Header/TableHeader.js +6 -6
- package/es-modules/Grid/Core/Table/Row.d.ts +1 -1
- package/es-modules/Grid/Core/Table/Row.js +5 -5
- package/es-modules/Grid/Core/Table/Table.d.ts +68 -12
- package/es-modules/Grid/Core/Table/Table.js +296 -92
- package/es-modules/Grid/Core/UI/Button.js +3 -3
- package/es-modules/Grid/Core/UI/ContextMenu.js +3 -3
- package/es-modules/Grid/Core/UI/ContextMenuButton.d.ts +6 -7
- package/es-modules/Grid/Core/UI/ContextMenuButton.js +8 -6
- package/es-modules/Grid/Core/UI/Popup.js +10 -12
- package/es-modules/Grid/Core/UI/SvgIcons.d.ts +42 -7
- package/es-modules/Grid/Core/UI/SvgIcons.js +209 -36
- package/es-modules/Grid/Core/UI/Toolbar.d.ts +5 -0
- package/es-modules/Grid/Core/UI/Toolbar.js +3 -3
- package/es-modules/Grid/Core/UI/ToolbarButton.d.ts +4 -12
- package/es-modules/Grid/Core/UI/ToolbarButton.js +11 -29
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.d.ts +4 -45
- package/es-modules/Grid/Pro/CellEditing/CellEditMode.js +16 -0
- package/es-modules/Grid/Pro/CellEditing/CellEditing.js +13 -13
- package/es-modules/Grid/Pro/CellEditing/CellEditingComposition.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/CellContentPro.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRenderer.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRendererRegistry.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.d.ts +1 -34
- package/es-modules/Grid/Pro/CellRendering/CellRendererType.js +15 -0
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/CellRendering/CellRenderersComposition.js +7 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/CheckboxContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateInputContentBase.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/DateTimeInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/NumberInputContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SelectContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.d.ts +7 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/SparklineContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.d.ts +2 -2
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TextInputContent.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/ContentTypes/TimeInputContent.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/CheckboxRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateInputRendererBase.js +3 -3
- package/es-modules/Grid/Pro/CellRendering/Renderers/DateTimeInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/NumberInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/SelectRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.d.ts +4 -4
- package/es-modules/Grid/Pro/CellRendering/Renderers/SparklineRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TextRenderer.js +4 -5
- package/es-modules/Grid/Pro/CellRendering/Renderers/TimeInputRenderer.js +4 -5
- package/es-modules/Grid/Pro/ColumnTypes/Validator.d.ts +10 -1
- package/es-modules/Grid/Pro/ColumnTypes/Validator.js +56 -12
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.d.ts +1 -1
- package/es-modules/Grid/Pro/ColumnTypes/ValidatorComposition.js +6 -7
- package/es-modules/Grid/Pro/Credits/CreditsPro.js +3 -3
- package/es-modules/Grid/Pro/Credits/CreditsProComposition.js +4 -6
- package/es-modules/Grid/Pro/Data/DataSourceHelper.d.ts +74 -0
- package/es-modules/Grid/Pro/Data/DataSourceHelper.js +246 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.d.ts +46 -0
- package/es-modules/Grid/Pro/Data/QuerySerializer.js +169 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.d.ts +187 -0
- package/es-modules/Grid/Pro/Data/RemoteDataProvider.js +500 -0
- package/es-modules/Grid/Pro/Export/Exporting.js +5 -7
- package/es-modules/Grid/Pro/Export/ExportingComposition.js +4 -5
- package/es-modules/Grid/Pro/GridEvents.d.ts +1 -0
- package/es-modules/Grid/Pro/GridEvents.js +4 -5
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.d.ts +0 -1
- package/es-modules/Grid/Pro/Pagination/PaginationComposition.js +4 -5
- package/es-modules/Grid/index.js +3 -3
- package/es-modules/Shared/BaseForm.js +4 -5
- package/es-modules/Shared/DownloadURL.d.ts +1 -85
- package/es-modules/Shared/DownloadURL.js +15 -13
- package/es-modules/Shared/LangOptionsCore.d.ts +4 -3
- package/es-modules/Shared/TimeBase.d.ts +1 -46
- package/es-modules/Shared/TimeBase.js +11 -10
- package/es-modules/Shared/Types.d.ts +11 -3
- package/es-modules/Shared/Utilities.d.ts +576 -0
- package/es-modules/Shared/Utilities.js +1368 -0
- package/es-modules/masters/grid-pro.src.d.ts +18 -19
- package/es-modules/masters/grid-pro.src.js +24 -9
- package/grid-pro.d.ts +18 -19
- package/grid-pro.js +6 -5
- package/grid-pro.js.map +1 -1
- package/grid-pro.src.d.ts +18 -19
- package/grid-pro.src.js +8132 -4531
- package/package.json +1 -1
- package/es-modules/Grid/Core/Pagination/Icons.d.ts +0 -7
- package/es-modules/Grid/Core/Pagination/Icons.js +0 -7
- package/es-modules/Grid/Pro/highcharts.d.ts +0 -7
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Highcharts Grid class
|
|
4
4
|
*
|
|
5
|
-
* (c) 2020-
|
|
5
|
+
* (c) 2020-2026 Highsoft AS
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* A commercial license may be required depending on use.
|
|
8
|
+
* See www.highcharts.com/license
|
|
8
9
|
*
|
|
9
|
-
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
|
|
10
10
|
*
|
|
11
11
|
* Authors:
|
|
12
12
|
* - Dawid Dragula
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
'use strict';
|
|
17
17
|
import Accessibility from './Accessibility/Accessibility.js';
|
|
18
18
|
import AST from '../../Core/Renderer/HTML/AST.js';
|
|
19
|
-
import
|
|
20
|
-
import GridUtils from './GridUtils.js';
|
|
19
|
+
import DataProviderRegistry from './Data/DataProviderRegistry.js';
|
|
21
20
|
import DataTable from '../../Data/DataTable.js';
|
|
21
|
+
import { defaultOptions } from './Defaults.js';
|
|
22
|
+
import { makeHTMLElement, setHTMLContent, createOptionsProxy } from './GridUtils.js';
|
|
22
23
|
import Table from './Table/Table.js';
|
|
23
|
-
import U from '../../Core/Utilities.js';
|
|
24
24
|
import QueryingController from './Querying/QueryingController.js';
|
|
25
25
|
import Globals from './Globals.js';
|
|
26
26
|
import TimeBase from '../../Shared/TimeBase.js';
|
|
27
27
|
import Pagination from './Pagination/Pagination.js';
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
import { defined, diffObjects, extend, fireEvent, merge, pick } from '../../Shared/Utilities.js';
|
|
29
|
+
import { uniqueKey } from '../../Core/Utilities.js';
|
|
30
30
|
/* *
|
|
31
31
|
*
|
|
32
32
|
* Class
|
|
@@ -85,11 +85,6 @@ export class Grid {
|
|
|
85
85
|
* The list of currently shown popups.
|
|
86
86
|
*/
|
|
87
87
|
this.popups = new Set();
|
|
88
|
-
/**
|
|
89
|
-
* Functions that unregister events attached to the grid's data table,
|
|
90
|
-
* that need to be removed when the grid is destroyed.
|
|
91
|
-
*/
|
|
92
|
-
this.dataTableEventDestructors = [];
|
|
93
88
|
/**
|
|
94
89
|
* Whether the Grid is rendered.
|
|
95
90
|
*/
|
|
@@ -100,9 +95,16 @@ export class Grid {
|
|
|
100
95
|
* @internal
|
|
101
96
|
*/
|
|
102
97
|
this.dirtyFlags = new Set();
|
|
98
|
+
/**
|
|
99
|
+
* Internal redraw queue used to prevent concurrent `redraw()` calls from
|
|
100
|
+
* interleaving async DOM work and corrupting the state (for example
|
|
101
|
+
* rendering duplicate pagination controls when `update()` is called
|
|
102
|
+
* multiple times without awaiting).
|
|
103
|
+
*/
|
|
104
|
+
this.redrawQueue = Promise.resolve();
|
|
103
105
|
this.renderTo = renderTo;
|
|
104
106
|
this.loadUserOptions(options);
|
|
105
|
-
this.id = this.options?.id ||
|
|
107
|
+
this.id = this.options?.id || uniqueKey();
|
|
106
108
|
this.querying = new QueryingController(this);
|
|
107
109
|
this.locale = this.options?.lang?.locale || (this.container?.closest('[lang]')?.lang);
|
|
108
110
|
this.time = new TimeBase(extend(this.options?.time, { locale: this.locale }), this.options?.lang);
|
|
@@ -118,6 +120,31 @@ export class Grid {
|
|
|
118
120
|
* Methods
|
|
119
121
|
*
|
|
120
122
|
* */
|
|
123
|
+
/**
|
|
124
|
+
* The data source of the Grid. It contains the original data table
|
|
125
|
+
* that was passed to the Grid.
|
|
126
|
+
*
|
|
127
|
+
* @deprecated Use `dataProvider` instead.
|
|
128
|
+
*/
|
|
129
|
+
get dataTable() {
|
|
130
|
+
const dp = this.dataProvider;
|
|
131
|
+
if (dp && 'getDataTable' in dp) {
|
|
132
|
+
return dp.getDataTable();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The presentation table of the Grid. It contains a modified version
|
|
137
|
+
* of the data table that is used for rendering the Grid content. If
|
|
138
|
+
* not modified, just a reference to the original data table.
|
|
139
|
+
*
|
|
140
|
+
* @deprecated Use `dataProvider` instead.
|
|
141
|
+
*/
|
|
142
|
+
get presentationTable() {
|
|
143
|
+
const dp = this.dataProvider;
|
|
144
|
+
if (dp && 'getDataTable' in dp) {
|
|
145
|
+
return dp.getDataTable(true);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
121
148
|
/*
|
|
122
149
|
* Initializes the accessibility controller.
|
|
123
150
|
*/
|
|
@@ -153,8 +180,8 @@ export class Grid {
|
|
|
153
180
|
throw new Error('Rendering div not found. It is unable to find the HTML ' +
|
|
154
181
|
'element to render the Grid in.');
|
|
155
182
|
}
|
|
156
|
-
this.initialContainerHeight = getStyle(container, 'height', true) || 0;
|
|
157
183
|
this.container = container;
|
|
184
|
+
this.container.style.minHeight = 0 + 'px';
|
|
158
185
|
this.container.innerHTML = AST.emptyHTML;
|
|
159
186
|
this.contentWrapper = makeHTMLElement('div', {
|
|
160
187
|
className: Globals.getClassName('container')
|
|
@@ -195,6 +222,9 @@ export class Grid {
|
|
|
195
222
|
merge(true, diff, diffObjects(newOptions, this.userOptions));
|
|
196
223
|
this.userOptions = merge(this.userOptions, newOptions);
|
|
197
224
|
this.options = merge(this.options ?? defaultOptions, this.userOptions);
|
|
225
|
+
this.viewport?.columns.forEach((column) => {
|
|
226
|
+
column.options = createOptionsProxy(this.columnOptionsMap?.[column.id]?.options ?? {}, this.options?.columnDefaults);
|
|
227
|
+
});
|
|
198
228
|
return diff;
|
|
199
229
|
}
|
|
200
230
|
/**
|
|
@@ -330,7 +360,7 @@ export class Grid {
|
|
|
330
360
|
* the ones that are currently defined in the user options. When `true`,
|
|
331
361
|
* the columns not defined in the new options will be removed.
|
|
332
362
|
*/
|
|
333
|
-
|
|
363
|
+
update(options = {}, redraw = true, oneToOne = false) {
|
|
334
364
|
fireEvent(this, 'beforeUpdate', {
|
|
335
365
|
scope: 'grid',
|
|
336
366
|
options,
|
|
@@ -341,20 +371,28 @@ export class Grid {
|
|
|
341
371
|
const diff = this.loadUserOptions(options, oneToOne);
|
|
342
372
|
const flags = this.dirtyFlags;
|
|
343
373
|
if (viewport) {
|
|
344
|
-
if (!this.
|
|
345
|
-
|
|
346
|
-
(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
374
|
+
if (!this.dataProvider ||
|
|
375
|
+
('data' in diff) ||
|
|
376
|
+
('dataTable' in diff)) {
|
|
377
|
+
if ( // Handle backward compatibility
|
|
378
|
+
diff.dataTable &&
|
|
379
|
+
this.options?.dataTable &&
|
|
380
|
+
this.options?.data?.providerType === 'local') {
|
|
381
|
+
const userDT = this.options.dataTable;
|
|
382
|
+
this.options.data.dataTable = 'clone' in userDT ?
|
|
383
|
+
userDT : new DataTable(userDT);
|
|
384
|
+
}
|
|
385
|
+
this.loadDataProvider(); // Rebuild the data provider
|
|
386
|
+
// TODO(update): Sometimes it can be too much, so we need to
|
|
387
|
+
// check if the columns have changed or just their data. If
|
|
388
|
+
// just their data, we can just mark the grid.table as dirty
|
|
389
|
+
// instead of the whole grid.
|
|
352
390
|
flags.add('grid');
|
|
353
391
|
}
|
|
354
392
|
if ('columns' in diff) {
|
|
355
393
|
const ids = Object.keys(diff.columns ?? {});
|
|
356
394
|
for (const id of ids) {
|
|
357
|
-
// TODO: Move this to the column update method.
|
|
395
|
+
// TODO(update): Move this to the column update method.
|
|
358
396
|
this.loadColumnOptionDiffs(viewport, id, diff.columns?.[id]);
|
|
359
397
|
delete diff.columns?.[id];
|
|
360
398
|
}
|
|
@@ -371,7 +409,7 @@ export class Grid {
|
|
|
371
409
|
this.time.update({ locale: this.locale });
|
|
372
410
|
}
|
|
373
411
|
delete langDiff.locale;
|
|
374
|
-
// TODO: Add more lang diff checks here.
|
|
412
|
+
// TODO(update): Add more lang diff checks here.
|
|
375
413
|
if (Object.keys(langDiff).length > 0) {
|
|
376
414
|
flags.add('grid');
|
|
377
415
|
}
|
|
@@ -391,7 +429,7 @@ export class Grid {
|
|
|
391
429
|
this.pagination?.update(paginationDiff);
|
|
392
430
|
}
|
|
393
431
|
delete diff.pagination;
|
|
394
|
-
// TODO: Add more options that can be optimized here.
|
|
432
|
+
// TODO(update): Add more options that can be optimized here.
|
|
395
433
|
if (Object.keys(diff).length > 0) {
|
|
396
434
|
flags.add('grid');
|
|
397
435
|
}
|
|
@@ -399,15 +437,18 @@ export class Grid {
|
|
|
399
437
|
else {
|
|
400
438
|
flags.add('grid');
|
|
401
439
|
}
|
|
440
|
+
const finish = () => {
|
|
441
|
+
fireEvent(this, 'afterUpdate', {
|
|
442
|
+
scope: 'grid',
|
|
443
|
+
options,
|
|
444
|
+
redraw,
|
|
445
|
+
oneToOne
|
|
446
|
+
});
|
|
447
|
+
};
|
|
402
448
|
if (redraw) {
|
|
403
|
-
|
|
449
|
+
return this.redraw().then(finish);
|
|
404
450
|
}
|
|
405
|
-
|
|
406
|
-
scope: 'grid',
|
|
407
|
-
options,
|
|
408
|
-
redraw,
|
|
409
|
-
oneToOne
|
|
410
|
-
});
|
|
451
|
+
finish();
|
|
411
452
|
}
|
|
412
453
|
/**
|
|
413
454
|
* Loads the column option diffs by updating the dirty flags.
|
|
@@ -439,8 +480,7 @@ export class Grid {
|
|
|
439
480
|
const cellsDiff = columnDiff.cells ?? {};
|
|
440
481
|
if ('format' in cellsDiff ||
|
|
441
482
|
'formatter' in cellsDiff ||
|
|
442
|
-
'className' in cellsDiff
|
|
443
|
-
) {
|
|
483
|
+
'className' in cellsDiff) {
|
|
444
484
|
// Optimization idea: list of columns to update
|
|
445
485
|
flags.add('rows');
|
|
446
486
|
}
|
|
@@ -464,6 +504,7 @@ export class Grid {
|
|
|
464
504
|
}
|
|
465
505
|
delete sortingDiff.compare;
|
|
466
506
|
delete sortingDiff.order;
|
|
507
|
+
delete sortingDiff.orderSequence;
|
|
467
508
|
// Idea: sortable - redraw only header cell
|
|
468
509
|
if (Object.keys(sortingDiff).length > 0) {
|
|
469
510
|
flags.add('grid');
|
|
@@ -493,50 +534,64 @@ export class Grid {
|
|
|
493
534
|
* them minimizing the number of DOM operations.
|
|
494
535
|
*/
|
|
495
536
|
async redraw() {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (flags.has('rows') ||
|
|
512
|
-
flags.has('sorting') ||
|
|
513
|
-
flags.has('filtering') ||
|
|
514
|
-
pagination?.isDirtyQuerying) {
|
|
515
|
-
await vp?.updateRows();
|
|
516
|
-
}
|
|
517
|
-
else if (flags.has('reflow') ||
|
|
518
|
-
colResizing?.isDirty) {
|
|
519
|
-
vp?.reflow();
|
|
520
|
-
}
|
|
521
|
-
const columns = vp?.columns ?? [];
|
|
522
|
-
if (flags.has('sorting') ||
|
|
523
|
-
flags.has('filtering')) {
|
|
524
|
-
for (const column of columns) {
|
|
525
|
-
column.header?.toolbar?.refreshState();
|
|
537
|
+
const run = async () => {
|
|
538
|
+
fireEvent(this, 'beforeRedraw');
|
|
539
|
+
const flags = this.dirtyFlags;
|
|
540
|
+
const flagsToProcess = new Set(flags);
|
|
541
|
+
const { viewport: vp, pagination } = this;
|
|
542
|
+
const colResizing = vp?.columnResizing;
|
|
543
|
+
const paginationWasDirty = !!pagination?.isDirtyQuerying;
|
|
544
|
+
const colResizingWasDirty = !!colResizing?.isDirty;
|
|
545
|
+
if (flagsToProcess.has('grid')) {
|
|
546
|
+
await this.render(false);
|
|
547
|
+
for (const flag of flagsToProcess) {
|
|
548
|
+
flags.delete(flag);
|
|
549
|
+
}
|
|
550
|
+
fireEvent(this, 'afterRedraw');
|
|
551
|
+
return;
|
|
526
552
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
553
|
+
await this.dataProvider?.init();
|
|
554
|
+
if (flagsToProcess.has('sorting') ||
|
|
555
|
+
flagsToProcess.has('filtering') ||
|
|
556
|
+
paginationWasDirty) {
|
|
557
|
+
this.querying.loadOptions();
|
|
531
558
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
559
|
+
if (colResizingWasDirty) {
|
|
560
|
+
colResizing?.loadColumns();
|
|
561
|
+
}
|
|
562
|
+
if (flagsToProcess.has('rows') ||
|
|
563
|
+
flagsToProcess.has('sorting') ||
|
|
564
|
+
flagsToProcess.has('filtering') ||
|
|
565
|
+
paginationWasDirty) {
|
|
566
|
+
await vp?.updateRows();
|
|
567
|
+
}
|
|
568
|
+
else if (flagsToProcess.has('reflow') ||
|
|
569
|
+
colResizingWasDirty) {
|
|
570
|
+
vp?.reflow();
|
|
571
|
+
}
|
|
572
|
+
const columns = vp?.columns ?? [];
|
|
573
|
+
if (flagsToProcess.has('sorting') ||
|
|
574
|
+
flagsToProcess.has('filtering')) {
|
|
575
|
+
for (const column of columns) {
|
|
576
|
+
column.header?.toolbar?.refreshState();
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
if (flagsToProcess.has('filtering')) {
|
|
580
|
+
for (const column of columns) {
|
|
581
|
+
column.filtering?.refreshState();
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
pagination?.redraw();
|
|
585
|
+
delete colResizing?.isDirty;
|
|
586
|
+
for (const flag of ['sorting', 'filtering']) {
|
|
587
|
+
flags.delete(flag);
|
|
588
|
+
}
|
|
589
|
+
fireEvent(this, 'afterRedraw');
|
|
590
|
+
};
|
|
591
|
+
const queued = this.redrawQueue.then(run, run);
|
|
592
|
+
// Keep the queue progressing even if one redraw fails.
|
|
593
|
+
this.redrawQueue = queued['catch'](() => void 0);
|
|
594
|
+
return queued;
|
|
540
595
|
}
|
|
541
596
|
/**
|
|
542
597
|
* Updates the column of the Grid with new options.
|
|
@@ -583,19 +638,105 @@ export class Grid {
|
|
|
583
638
|
columnId
|
|
584
639
|
});
|
|
585
640
|
}
|
|
586
|
-
|
|
641
|
+
/**
|
|
642
|
+
* Sets the sorting order for one or more columns. Provide the sortings
|
|
643
|
+
* in priority order. Use `null` to clear sorting.
|
|
644
|
+
*
|
|
645
|
+
* @param sortings
|
|
646
|
+
* The sorting definition in priority order.
|
|
647
|
+
*/
|
|
648
|
+
async setSorting(sortings) {
|
|
649
|
+
const viewport = this.viewport;
|
|
650
|
+
if (!viewport) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (viewport.validator?.errorCell) {
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
const normalized = (sortings || []).filter((sorting) => !!(sorting.columnId && sorting.order));
|
|
657
|
+
const sortingController = this.querying.sorting;
|
|
658
|
+
const previousSortings = sortingController.currentSortings || [];
|
|
659
|
+
const eventColumnIds = new Set();
|
|
660
|
+
for (const sorting of previousSortings) {
|
|
661
|
+
if (sorting.columnId) {
|
|
662
|
+
eventColumnIds.add(sorting.columnId);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
for (const sorting of normalized) {
|
|
666
|
+
eventColumnIds.add(sorting.columnId);
|
|
667
|
+
}
|
|
668
|
+
const eventColumns = Array.from(eventColumnIds)
|
|
669
|
+
.map((columnId) => {
|
|
670
|
+
const column = viewport.getColumn(columnId);
|
|
671
|
+
if (!column) {
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
const order = normalized.find((sorting) => sorting.columnId === columnId)?.order || null;
|
|
675
|
+
return { column, order };
|
|
676
|
+
})
|
|
677
|
+
.filter((item) => !!item);
|
|
678
|
+
for (const { column, order } of eventColumns) {
|
|
679
|
+
[column, this].forEach((source) => {
|
|
680
|
+
fireEvent(source, 'beforeSort', {
|
|
681
|
+
target: column,
|
|
682
|
+
order
|
|
683
|
+
});
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
sortingController.setSorting(normalized);
|
|
687
|
+
await viewport.updateRows();
|
|
688
|
+
const currentSortings = sortingController.currentSortings || [];
|
|
689
|
+
const hasMultiple = currentSortings.length > 1;
|
|
690
|
+
for (const column of viewport.columns) {
|
|
691
|
+
const sortingIndex = currentSortings.findIndex((sorting) => sorting.columnId === column.id);
|
|
692
|
+
if (sortingIndex !== -1 && currentSortings[sortingIndex].order) {
|
|
693
|
+
const sorting = currentSortings[sortingIndex];
|
|
694
|
+
const sortingOptions = {
|
|
695
|
+
order: sorting.order
|
|
696
|
+
};
|
|
697
|
+
if (hasMultiple) {
|
|
698
|
+
sortingOptions.priority = sortingIndex + 1;
|
|
699
|
+
}
|
|
700
|
+
column.setOptions({ sorting: sortingOptions });
|
|
701
|
+
if (!hasMultiple) {
|
|
702
|
+
delete column.options.sorting?.priority;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
else {
|
|
706
|
+
delete column.options.sorting?.order;
|
|
707
|
+
delete column.options.sorting?.priority;
|
|
708
|
+
if (column.options.sorting &&
|
|
709
|
+
Object.keys(column.options.sorting).length < 1) {
|
|
710
|
+
delete column.options.sorting;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
column.sorting?.refreshHeaderAttributes();
|
|
714
|
+
}
|
|
715
|
+
this.accessibility?.userSortedColumn(currentSortings[0]?.order || null);
|
|
716
|
+
for (const { column, order } of eventColumns) {
|
|
717
|
+
[column, this].forEach((source) => {
|
|
718
|
+
fireEvent(source, 'afterSort', {
|
|
719
|
+
target: column,
|
|
720
|
+
order
|
|
721
|
+
});
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
async render(clearDirtyFlags = true) {
|
|
587
726
|
if (this.isRendered) {
|
|
588
727
|
this.destroy(true);
|
|
589
728
|
}
|
|
590
|
-
this.
|
|
729
|
+
await this.loadDataProvider().init();
|
|
591
730
|
this.initContainer(this.renderTo);
|
|
592
731
|
this.initAccessibility();
|
|
593
732
|
this.initPagination();
|
|
594
733
|
this.querying.loadOptions();
|
|
595
734
|
await this.querying.proceed();
|
|
596
|
-
this.renderViewport();
|
|
735
|
+
await this.renderViewport();
|
|
597
736
|
this.isRendered = true;
|
|
598
|
-
|
|
737
|
+
if (clearDirtyFlags) {
|
|
738
|
+
this.dirtyFlags.clear();
|
|
739
|
+
}
|
|
599
740
|
}
|
|
600
741
|
/**
|
|
601
742
|
* Hovers the row with the provided index. It removes the hover effect from
|
|
@@ -685,20 +826,19 @@ export class Grid {
|
|
|
685
826
|
*/
|
|
686
827
|
renderCaption() {
|
|
687
828
|
const captionOptions = this.options?.caption;
|
|
688
|
-
|
|
689
|
-
if (!captionText) {
|
|
829
|
+
if (!captionOptions?.text || !this.contentWrapper) {
|
|
690
830
|
return;
|
|
691
831
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
832
|
+
const tag = captionOptions.htmlTag?.toLowerCase();
|
|
833
|
+
const tagName = tag && AST.allowedTags.includes(tag) ? tag : 'div';
|
|
834
|
+
const defaultClass = Globals.getClassName('captionElement');
|
|
835
|
+
const className = captionOptions.className ?
|
|
836
|
+
`${defaultClass} ${captionOptions.className}` : defaultClass;
|
|
837
|
+
this.captionElement = new AST([{
|
|
838
|
+
tagName,
|
|
839
|
+
attributes: { 'class': className, id: this.id + '-caption' },
|
|
840
|
+
textContent: captionOptions.text
|
|
841
|
+
}]).addToDOM(this.contentWrapper);
|
|
702
842
|
}
|
|
703
843
|
/**
|
|
704
844
|
* Render description under the grid.
|
|
@@ -741,11 +881,11 @@ export class Grid {
|
|
|
741
881
|
* rendered, it will be destroyed and re-rendered with the new data.
|
|
742
882
|
* @internal
|
|
743
883
|
*/
|
|
744
|
-
renderViewport() {
|
|
884
|
+
async renderViewport() {
|
|
745
885
|
const viewportMeta = this.viewport?.getStateMeta();
|
|
746
886
|
const pagination = this.pagination;
|
|
747
887
|
const paginationPosition = pagination?.options?.position;
|
|
748
|
-
this.enabledColumns = this.getEnabledColumnIDs();
|
|
888
|
+
this.enabledColumns = await this.getEnabledColumnIDs();
|
|
749
889
|
this.credits?.destroy();
|
|
750
890
|
this.viewport?.destroy();
|
|
751
891
|
delete this.viewport;
|
|
@@ -757,7 +897,8 @@ export class Grid {
|
|
|
757
897
|
pagination?.render();
|
|
758
898
|
}
|
|
759
899
|
if (this.enabledColumns.length > 0) {
|
|
760
|
-
this.viewport = this.renderTable();
|
|
900
|
+
this.viewport = await this.renderTable();
|
|
901
|
+
this.viewport.tableElement.setAttribute('id', this.id);
|
|
761
902
|
if (viewportMeta && this.viewport) {
|
|
762
903
|
this.viewport.applyStateMeta(viewportMeta);
|
|
763
904
|
}
|
|
@@ -765,7 +906,7 @@ export class Grid {
|
|
|
765
906
|
else {
|
|
766
907
|
this.renderNoData();
|
|
767
908
|
}
|
|
768
|
-
this.
|
|
909
|
+
await this.renderAccessibility();
|
|
769
910
|
// Render bottom pagination, footer pagination,
|
|
770
911
|
// or custom container pagination (after table).
|
|
771
912
|
if (paginationPosition !== 'top') {
|
|
@@ -775,18 +916,33 @@ export class Grid {
|
|
|
775
916
|
fireEvent(this, 'afterRenderViewport');
|
|
776
917
|
this.viewport?.reflow();
|
|
777
918
|
}
|
|
919
|
+
/**
|
|
920
|
+
* Renders the Grid accessibility.
|
|
921
|
+
* @internal
|
|
922
|
+
*/
|
|
923
|
+
async renderAccessibility() {
|
|
924
|
+
const accessibility = this.accessibility;
|
|
925
|
+
if (!accessibility) {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
await accessibility.setA11yOptions();
|
|
929
|
+
accessibility.addScreenReaderSection('before');
|
|
930
|
+
accessibility.addScreenReaderSection('after');
|
|
931
|
+
}
|
|
778
932
|
/**
|
|
779
933
|
* Renders the table (viewport) of the Grid.
|
|
780
934
|
*
|
|
781
935
|
* @returns
|
|
782
936
|
* The newly rendered table (viewport) of the Grid.
|
|
783
937
|
*/
|
|
784
|
-
renderTable() {
|
|
938
|
+
async renderTable() {
|
|
785
939
|
this.tableElement = makeHTMLElement('table', {
|
|
786
940
|
className: Globals.getClassName('tableElement')
|
|
787
941
|
}, this.contentWrapper);
|
|
788
942
|
this.tableElement.setAttribute('role', 'grid');
|
|
789
|
-
|
|
943
|
+
const table = new Table(this, this.tableElement);
|
|
944
|
+
await table.init();
|
|
945
|
+
return table;
|
|
790
946
|
}
|
|
791
947
|
/**
|
|
792
948
|
* Renders a message that there is no data to display.
|
|
@@ -801,12 +957,12 @@ export class Grid {
|
|
|
801
957
|
* Returns the array of IDs of columns that should be displayed in the data
|
|
802
958
|
* grid, in the correct order.
|
|
803
959
|
*/
|
|
804
|
-
getEnabledColumnIDs() {
|
|
960
|
+
async getEnabledColumnIDs() {
|
|
805
961
|
const { columnOptionsMap } = this;
|
|
806
962
|
const header = this.options?.header;
|
|
807
963
|
const headerColumns = this.getColumnIds(header || [], false);
|
|
808
964
|
const columnsIncluded = this.options?.rendering?.columns?.included || (headerColumns && headerColumns.length > 0 ?
|
|
809
|
-
headerColumns : this.
|
|
965
|
+
headerColumns : await this.dataProvider?.getColumnIds());
|
|
810
966
|
if (!columnsIncluded?.length) {
|
|
811
967
|
return [];
|
|
812
968
|
}
|
|
@@ -823,37 +979,25 @@ export class Grid {
|
|
|
823
979
|
}
|
|
824
980
|
return result;
|
|
825
981
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
* reference, it should be used instead of creating a new one.
|
|
829
|
-
*/
|
|
830
|
-
loadDataTable() {
|
|
982
|
+
loadDataProvider() {
|
|
983
|
+
this.dataProvider?.destroy();
|
|
831
984
|
this.querying.shouldBeUpdated = true;
|
|
832
|
-
|
|
833
|
-
this.
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
'afterDeleteRows',
|
|
849
|
-
'afterSetCell',
|
|
850
|
-
'afterSetColumns',
|
|
851
|
-
'afterSetRows'
|
|
852
|
-
].forEach((eventName) => {
|
|
853
|
-
this.dataTableEventDestructors.push(dt.on(eventName, () => {
|
|
854
|
-
this.querying.shouldBeUpdated = true;
|
|
855
|
-
}));
|
|
856
|
-
});
|
|
985
|
+
const userDT = this.options?.dataTable;
|
|
986
|
+
const dataOptions = this.options?.data ?? {
|
|
987
|
+
providerType: 'local',
|
|
988
|
+
dataTable: userDT ?? {}
|
|
989
|
+
};
|
|
990
|
+
// Just for the backward compatibility, remove in the future
|
|
991
|
+
if (dataOptions.providerType === 'local' &&
|
|
992
|
+
!dataOptions.dataTable && userDT) {
|
|
993
|
+
dataOptions.dataTable = 'clone' in userDT ?
|
|
994
|
+
userDT : new DataTable(userDT);
|
|
995
|
+
}
|
|
996
|
+
// End of backward compatibility snippet
|
|
997
|
+
const DataProviderConstructor = DataProviderRegistry.types[dataOptions.providerType ?? 'local'] ??
|
|
998
|
+
DataProviderRegistry.types.local;
|
|
999
|
+
this.dataProvider = new DataProviderConstructor(this.querying, dataOptions);
|
|
1000
|
+
return this.dataProvider;
|
|
857
1001
|
}
|
|
858
1002
|
/**
|
|
859
1003
|
* Extracts all references to columnIds on all levels below defined level
|
|
@@ -890,9 +1034,10 @@ export class Grid {
|
|
|
890
1034
|
* after destruction by calling the `render` method.
|
|
891
1035
|
*/
|
|
892
1036
|
destroy(onlyDOM = false) {
|
|
1037
|
+
fireEvent(this, 'beforeDestroy');
|
|
893
1038
|
this.isRendered = false;
|
|
894
1039
|
const dgIndex = Grid.grids.findIndex((dg) => dg === this);
|
|
895
|
-
this.
|
|
1040
|
+
this.dataProvider?.destroy();
|
|
896
1041
|
this.accessibility?.destroy();
|
|
897
1042
|
this.pagination?.destroy();
|
|
898
1043
|
this.viewport?.destroy();
|
|
@@ -943,6 +1088,11 @@ export class Grid {
|
|
|
943
1088
|
/**
|
|
944
1089
|
* Returns the grid data as a JSON string.
|
|
945
1090
|
*
|
|
1091
|
+
* **Note:** This method only works with `LocalDataProvider`.
|
|
1092
|
+
* For other data providers, use your data source directly.
|
|
1093
|
+
*
|
|
1094
|
+
* @deprecated
|
|
1095
|
+
*
|
|
946
1096
|
* @param modified
|
|
947
1097
|
* Whether to return the modified data table (after filtering/sorting/etc.)
|
|
948
1098
|
* or the unmodified, original one. Default value is set to `true`.
|
|
@@ -951,7 +1101,14 @@ export class Grid {
|
|
|
951
1101
|
* JSON representation of the data
|
|
952
1102
|
*/
|
|
953
1103
|
getData(modified = true) {
|
|
954
|
-
|
|
1104
|
+
if (!this.dataProvider || !('getDataTable' in this.dataProvider)) {
|
|
1105
|
+
// eslint-disable-next-line no-console
|
|
1106
|
+
console.warn('getData() works only with LocalDataProvider.');
|
|
1107
|
+
return JSON.stringify({
|
|
1108
|
+
error: 'getData() works only with LocalDataProvider.'
|
|
1109
|
+
}, null, 2);
|
|
1110
|
+
}
|
|
1111
|
+
const dataTable = this.dataProvider.getDataTable(modified);
|
|
955
1112
|
const tableColumns = dataTable?.columns;
|
|
956
1113
|
const outputColumns = {};
|
|
957
1114
|
if (!this.enabledColumns || !tableColumns) {
|
|
@@ -993,12 +1150,35 @@ export class Grid {
|
|
|
993
1150
|
* Grid options.
|
|
994
1151
|
*/
|
|
995
1152
|
getOptions(onlyUserOptions = true) {
|
|
996
|
-
const options = onlyUserOptions ?
|
|
997
|
-
|
|
1153
|
+
const options = onlyUserOptions ?
|
|
1154
|
+
merge(this.userOptions) :
|
|
1155
|
+
merge(this.options);
|
|
1156
|
+
// Keep `getOptions()` serializable:
|
|
1157
|
+
if (options.dataTable && 'clone' in options.dataTable) {
|
|
998
1158
|
options.dataTable = {
|
|
999
1159
|
columns: options.dataTable.columns
|
|
1000
1160
|
};
|
|
1001
1161
|
}
|
|
1162
|
+
if (options.data?.providerType === 'local') {
|
|
1163
|
+
if (options.data?.dataTable && 'clone' in options.data.dataTable) {
|
|
1164
|
+
options.data.columns = options.data.dataTable.columns;
|
|
1165
|
+
}
|
|
1166
|
+
if (options.data?.connector &&
|
|
1167
|
+
'initConverters' in options.data.connector) {
|
|
1168
|
+
options.data.connector = options.data.connector.options;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
// Clean up the column options by removing the ones that have no other
|
|
1172
|
+
// options than `id`:
|
|
1173
|
+
const oldColumnOptions = options.columns;
|
|
1174
|
+
if (oldColumnOptions) {
|
|
1175
|
+
options.columns = [];
|
|
1176
|
+
for (const columnOption of oldColumnOptions) {
|
|
1177
|
+
if (Object.keys(columnOption).length > 1) {
|
|
1178
|
+
options.columns.push(columnOption);
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1002
1182
|
return options;
|
|
1003
1183
|
}
|
|
1004
1184
|
}
|