@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
|
* Grid Rows Renderer 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
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
'use strict';
|
|
16
16
|
import TableRow from '../Body/TableRow.js';
|
|
17
17
|
import Globals from '../../Globals.js';
|
|
18
|
+
import { defined } from '../../../../Shared/Utilities.js';
|
|
18
19
|
/* *
|
|
19
20
|
*
|
|
20
21
|
* Class
|
|
@@ -24,6 +25,40 @@ import Globals from '../../Globals.js';
|
|
|
24
25
|
* Represents a virtualized rows renderer for the data grid.
|
|
25
26
|
*/
|
|
26
27
|
class RowsVirtualizer {
|
|
28
|
+
/**
|
|
29
|
+
* The maximum height of a HTML element in most browsers.
|
|
30
|
+
* Firefox has a lower limit than other browsers.
|
|
31
|
+
*/
|
|
32
|
+
static getMaxElementHeight() {
|
|
33
|
+
if (RowsVirtualizer.maxElementHeight !== void 0) {
|
|
34
|
+
return RowsVirtualizer.maxElementHeight;
|
|
35
|
+
}
|
|
36
|
+
const isFirefox = Globals.userAgent.indexOf('Firefox') > -1;
|
|
37
|
+
const fallbackMax = ((isFirefox ? 6000000 : 31000000) /
|
|
38
|
+
(window.devicePixelRatio || 1));
|
|
39
|
+
if (!document.body) {
|
|
40
|
+
RowsVirtualizer.maxElementHeight = fallbackMax;
|
|
41
|
+
return RowsVirtualizer.maxElementHeight;
|
|
42
|
+
}
|
|
43
|
+
let res = 1000000;
|
|
44
|
+
const testUpTo = isFirefox ? 6000000 : 1000000000;
|
|
45
|
+
const div = document.createElement('div');
|
|
46
|
+
document.body.appendChild(div);
|
|
47
|
+
let done = false;
|
|
48
|
+
while (!done) {
|
|
49
|
+
const test = res * 2;
|
|
50
|
+
div.style.height = test + 'px';
|
|
51
|
+
if (test > testUpTo || div.clientHeight !== test) {
|
|
52
|
+
done = true;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
res = test;
|
|
56
|
+
}
|
|
57
|
+
div.remove();
|
|
58
|
+
const safeMax = 16000000;
|
|
59
|
+
RowsVirtualizer.maxElementHeight = Math.min(res || fallbackMax, safeMax);
|
|
60
|
+
return RowsVirtualizer.maxElementHeight;
|
|
61
|
+
}
|
|
27
62
|
/* *
|
|
28
63
|
*
|
|
29
64
|
* Constructor
|
|
@@ -36,6 +71,15 @@ class RowsVirtualizer {
|
|
|
36
71
|
* The viewport of the data grid to render rows in.
|
|
37
72
|
*/
|
|
38
73
|
constructor(viewport) {
|
|
74
|
+
/* *
|
|
75
|
+
*
|
|
76
|
+
* Properties
|
|
77
|
+
*
|
|
78
|
+
* */
|
|
79
|
+
/**
|
|
80
|
+
* The default height of a row.
|
|
81
|
+
*/
|
|
82
|
+
this.defaultRowHeight = 49;
|
|
39
83
|
/**
|
|
40
84
|
* The index of the first visible row.
|
|
41
85
|
*/
|
|
@@ -45,12 +89,47 @@ class RowsVirtualizer {
|
|
|
45
89
|
* flickering loops when scrolling to the last row.
|
|
46
90
|
*/
|
|
47
91
|
this.preventScroll = false;
|
|
92
|
+
/**
|
|
93
|
+
* The total height of the grid, used when the Grid height
|
|
94
|
+
* exceeds the max element height.
|
|
95
|
+
*/
|
|
96
|
+
this.totalGridHeight = 0;
|
|
97
|
+
/**
|
|
98
|
+
* The overflow height of the grid, used when the Grid height
|
|
99
|
+
* exceeds the max element height.
|
|
100
|
+
*/
|
|
101
|
+
this.gridHeightOverflow = 0;
|
|
102
|
+
/**
|
|
103
|
+
* The scroll offset in pixels used to adjust the row positions when
|
|
104
|
+
* the Grid height exceeds the max element height.
|
|
105
|
+
*/
|
|
106
|
+
this.scrollOffset = 0;
|
|
107
|
+
/**
|
|
108
|
+
* Reuse pool for rows that are currently out of viewport.
|
|
109
|
+
*/
|
|
110
|
+
this.rowPool = [];
|
|
111
|
+
/**
|
|
112
|
+
* Flag indicating if a scroll update is queued for the next animation
|
|
113
|
+
* frame.
|
|
114
|
+
*/
|
|
115
|
+
this.scrollQueued = false;
|
|
116
|
+
/**
|
|
117
|
+
* Flag indicating if rows are currently being rendered to prevent
|
|
118
|
+
* concurrent render operations.
|
|
119
|
+
*/
|
|
120
|
+
this.isRendering = false;
|
|
121
|
+
/**
|
|
122
|
+
* Pending row cursor to render after current render completes.
|
|
123
|
+
* Used to ensure the final scroll position is rendered.
|
|
124
|
+
*/
|
|
125
|
+
this.pendingRowCursor = null;
|
|
48
126
|
this.rowSettings =
|
|
49
127
|
viewport.grid.options?.rendering?.rows;
|
|
50
128
|
this.viewport = viewport;
|
|
129
|
+
this.rowCount = 0;
|
|
51
130
|
this.strictRowHeights = this.rowSettings.strictHeights;
|
|
52
131
|
this.buffer = Math.max(this.rowSettings.bufferSize, 0);
|
|
53
|
-
this.
|
|
132
|
+
this.maxElementHeight = RowsVirtualizer.getMaxElementHeight();
|
|
54
133
|
if (this.strictRowHeights) {
|
|
55
134
|
viewport.tbodyElement.classList.add(Globals.getClassName('rowsContentNowrap'));
|
|
56
135
|
}
|
|
@@ -63,24 +142,36 @@ class RowsVirtualizer {
|
|
|
63
142
|
/**
|
|
64
143
|
* Renders the rows in the viewport for the first time.
|
|
65
144
|
*/
|
|
66
|
-
initialRender() {
|
|
145
|
+
async initialRender() {
|
|
146
|
+
this.defaultRowHeight = await this.getDefaultRowHeight();
|
|
67
147
|
// Initial reflow to set the viewport height
|
|
68
148
|
if (this.viewport.virtualRows) {
|
|
69
149
|
this.viewport.reflow();
|
|
70
150
|
}
|
|
151
|
+
await this.updateGridMetrics();
|
|
71
152
|
// Load & render rows
|
|
72
|
-
this.renderRows(this.rowCursor);
|
|
153
|
+
await this.renderRows(this.rowCursor);
|
|
73
154
|
this.adjustRowHeights();
|
|
155
|
+
if (this.viewport.virtualRows) {
|
|
156
|
+
this.adjustRowOffsets();
|
|
157
|
+
}
|
|
74
158
|
}
|
|
75
159
|
/**
|
|
76
160
|
* Renders the rows in the viewport. It is called when the rows need to be
|
|
77
161
|
* re-rendered, e.g., after a sort or filter operation.
|
|
78
162
|
*/
|
|
79
|
-
rerender() {
|
|
163
|
+
async rerender() {
|
|
164
|
+
await this.updateGridMetrics();
|
|
80
165
|
const tbody = this.viewport.tbodyElement;
|
|
81
166
|
let rows = this.viewport.rows;
|
|
82
167
|
const oldScrollLeft = tbody.scrollLeft;
|
|
83
168
|
let oldScrollTop;
|
|
169
|
+
if (this.rowPool.length) {
|
|
170
|
+
for (let i = this.rowPool.length - 1; i >= 0; --i) {
|
|
171
|
+
this.rowPool[i].destroy();
|
|
172
|
+
}
|
|
173
|
+
this.rowPool.length = 0;
|
|
174
|
+
}
|
|
84
175
|
if (rows.length) {
|
|
85
176
|
oldScrollTop = tbody.scrollTop;
|
|
86
177
|
for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
|
|
@@ -88,12 +179,11 @@ class RowsVirtualizer {
|
|
|
88
179
|
}
|
|
89
180
|
rows.length = 0;
|
|
90
181
|
}
|
|
91
|
-
this.renderRows(this.rowCursor);
|
|
182
|
+
await this.renderRows(this.rowCursor);
|
|
92
183
|
if (this.viewport.virtualRows) {
|
|
93
|
-
if (oldScrollTop
|
|
184
|
+
if (defined(oldScrollTop)) {
|
|
94
185
|
tbody.scrollTop = oldScrollTop;
|
|
95
186
|
}
|
|
96
|
-
this.scroll();
|
|
97
187
|
}
|
|
98
188
|
rows = this.viewport.rows;
|
|
99
189
|
// Reflow the rendered row cells widths (check redundancy)
|
|
@@ -102,14 +192,60 @@ class RowsVirtualizer {
|
|
|
102
192
|
}
|
|
103
193
|
tbody.scrollLeft = oldScrollLeft;
|
|
104
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Refreshes the rendered rows without a full teardown.
|
|
197
|
+
* It updates the row range and reuses existing rows when possible.
|
|
198
|
+
*/
|
|
199
|
+
async refreshRows() {
|
|
200
|
+
await this.updateGridMetrics();
|
|
201
|
+
const tbody = this.viewport.tbodyElement;
|
|
202
|
+
const oldScrollLeft = tbody.scrollLeft;
|
|
203
|
+
const oldScrollTop = this.viewport.virtualRows ?
|
|
204
|
+
tbody.scrollTop :
|
|
205
|
+
void 0;
|
|
206
|
+
const maxRowCursor = Math.max(0, this.rowCount - 1);
|
|
207
|
+
if (this.rowCursor > maxRowCursor) {
|
|
208
|
+
this.rowCursor = maxRowCursor;
|
|
209
|
+
}
|
|
210
|
+
// Render missing rows, drop out-of-range ones, and ensure last row.
|
|
211
|
+
await this.renderRows(this.rowCursor);
|
|
212
|
+
const rows = this.viewport.rows;
|
|
213
|
+
for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
|
|
214
|
+
// Update row data so indices map to fresh provider values.
|
|
215
|
+
await rows[i].update();
|
|
216
|
+
}
|
|
217
|
+
if (this.viewport.virtualRows && defined(oldScrollTop)) {
|
|
218
|
+
tbody.scrollTop = oldScrollTop;
|
|
219
|
+
}
|
|
220
|
+
tbody.scrollLeft = oldScrollLeft;
|
|
221
|
+
}
|
|
105
222
|
/**
|
|
106
223
|
* Method called on the viewport scroll event, only when the virtualization
|
|
107
224
|
* is enabled.
|
|
108
225
|
*/
|
|
109
226
|
scroll() {
|
|
227
|
+
if (this.scrollQueued) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this.scrollQueued = true;
|
|
231
|
+
requestAnimationFrame(() => {
|
|
232
|
+
this.scrollQueued = false;
|
|
233
|
+
void this.applyScroll();
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Applies the scroll logic for virtualized rows.
|
|
238
|
+
*/
|
|
239
|
+
async applyScroll() {
|
|
110
240
|
const target = this.viewport.tbodyElement;
|
|
111
241
|
const { defaultRowHeight: rowHeight } = this;
|
|
112
242
|
const lastScrollTop = target.scrollTop;
|
|
243
|
+
const scrollDenominator = this.maxElementHeight -
|
|
244
|
+
target.clientHeight;
|
|
245
|
+
const scrollPercentage = scrollDenominator > 0 ?
|
|
246
|
+
lastScrollTop / scrollDenominator :
|
|
247
|
+
0;
|
|
248
|
+
this.scrollOffset = Math.floor(scrollPercentage * this.gridHeightOverflow);
|
|
113
249
|
if (this.preventScroll) {
|
|
114
250
|
if (lastScrollTop <= target.scrollTop) {
|
|
115
251
|
this.preventScroll = false;
|
|
@@ -118,12 +254,16 @@ class RowsVirtualizer {
|
|
|
118
254
|
return;
|
|
119
255
|
}
|
|
120
256
|
// Do vertical virtual scrolling
|
|
121
|
-
|
|
257
|
+
let rowCursor = Math.floor((target.scrollTop / rowHeight) +
|
|
258
|
+
(this.scrollOffset / rowHeight));
|
|
259
|
+
const maxRowCursor = Math.max(0, this.rowCount - 1);
|
|
260
|
+
rowCursor = Math.min(rowCursor, maxRowCursor);
|
|
122
261
|
if (this.rowCursor !== rowCursor) {
|
|
123
|
-
this.renderRows(rowCursor);
|
|
262
|
+
await this.renderRows(rowCursor);
|
|
124
263
|
}
|
|
125
264
|
this.rowCursor = rowCursor;
|
|
126
265
|
this.adjustRowHeights();
|
|
266
|
+
this.adjustRowOffsets();
|
|
127
267
|
if (!this.strictRowHeights &&
|
|
128
268
|
lastScrollTop > target.scrollTop &&
|
|
129
269
|
!this.preventScroll) {
|
|
@@ -137,7 +277,16 @@ class RowsVirtualizer {
|
|
|
137
277
|
adjustBottomRowHeights() {
|
|
138
278
|
const rows = this.viewport.rows;
|
|
139
279
|
const rowsLn = rows.length;
|
|
280
|
+
if (rowsLn < 1) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
140
283
|
const lastRow = rows[rowsLn - 1];
|
|
284
|
+
// Skip if row is not fully rendered or has no cells
|
|
285
|
+
if (!lastRow.rendered ||
|
|
286
|
+
!lastRow.cells.length ||
|
|
287
|
+
!lastRow.cells[0]?.htmlElement) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
141
290
|
let rowTop = lastRow.translateY;
|
|
142
291
|
const rowBottom = rowTop + lastRow.htmlElement.offsetHeight;
|
|
143
292
|
let newHeight = lastRow.cells[0].htmlElement.offsetHeight;
|
|
@@ -145,16 +294,28 @@ class RowsVirtualizer {
|
|
|
145
294
|
lastRow.htmlElement.style.height = newHeight + 'px';
|
|
146
295
|
lastRow.setTranslateY(rowTop);
|
|
147
296
|
for (let j = 0, jEnd = lastRow.cells.length; j < jEnd; ++j) {
|
|
148
|
-
lastRow.cells[j]
|
|
297
|
+
const cell = lastRow.cells[j];
|
|
298
|
+
if (cell?.htmlElement) {
|
|
299
|
+
cell.htmlElement.style.transform = '';
|
|
300
|
+
}
|
|
149
301
|
}
|
|
150
302
|
for (let i = rowsLn - 2; i >= 0; i--) {
|
|
151
303
|
const row = rows[i];
|
|
304
|
+
// Skip if row is not fully rendered or has no cells
|
|
305
|
+
if (!row.rendered ||
|
|
306
|
+
!row.cells.length ||
|
|
307
|
+
!row.cells[0]?.htmlElement) {
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
152
310
|
newHeight = row.cells[0].htmlElement.offsetHeight;
|
|
153
311
|
rowTop -= newHeight;
|
|
154
312
|
row.htmlElement.style.height = newHeight + 'px';
|
|
155
313
|
row.setTranslateY(rowTop);
|
|
156
314
|
for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
|
|
157
|
-
row.cells[j]
|
|
315
|
+
const cell = row.cells[j];
|
|
316
|
+
if (cell?.htmlElement) {
|
|
317
|
+
cell.htmlElement.style.transform = '';
|
|
318
|
+
}
|
|
158
319
|
}
|
|
159
320
|
}
|
|
160
321
|
}
|
|
@@ -165,87 +326,197 @@ class RowsVirtualizer {
|
|
|
165
326
|
* @param rowCursor
|
|
166
327
|
* The index of the first visible row.
|
|
167
328
|
*/
|
|
168
|
-
renderRows(rowCursor) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
if (rowCount < 1) {
|
|
329
|
+
async renderRows(rowCursor) {
|
|
330
|
+
// Prevent concurrent render operations - queue the latest cursor
|
|
331
|
+
if (this.isRendering) {
|
|
332
|
+
this.pendingRowCursor = rowCursor;
|
|
173
333
|
return;
|
|
174
334
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
'virtualization is disabled. Consider enabling ' +
|
|
183
|
-
'virtualization in the rows settings.');
|
|
184
|
-
}
|
|
185
|
-
if (!rows.length) {
|
|
186
|
-
const last = new TableRow(vp, rowCount - 1);
|
|
187
|
-
vp.tbodyElement.appendChild(last.htmlElement);
|
|
188
|
-
last.render();
|
|
189
|
-
rows.push(last);
|
|
190
|
-
if (isVirtualization) {
|
|
191
|
-
last.setTranslateY(last.getDefaultTopOffset());
|
|
335
|
+
this.isRendering = true;
|
|
336
|
+
try {
|
|
337
|
+
const { viewport: vp, buffer } = this;
|
|
338
|
+
await this.updateGridMetrics();
|
|
339
|
+
const rowCount = this.rowCount;
|
|
340
|
+
if (!defined(rowCount)) {
|
|
341
|
+
return;
|
|
192
342
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
row.destroy();
|
|
343
|
+
if (rowCount === 0) {
|
|
344
|
+
if (vp.rows.length) {
|
|
345
|
+
for (let i = 0, iEnd = vp.rows.length; i < iEnd; ++i) {
|
|
346
|
+
vp.rows[i].destroy();
|
|
347
|
+
}
|
|
348
|
+
vp.rows.length = 0;
|
|
349
|
+
}
|
|
350
|
+
vp.tbodyElement.innerHTML = '';
|
|
351
|
+
this.rowCursor = 0;
|
|
352
|
+
return;
|
|
204
353
|
}
|
|
205
|
-
|
|
206
|
-
|
|
354
|
+
// Stop rendering if there are no rows to render.
|
|
355
|
+
if (rowCount < 1) {
|
|
356
|
+
return;
|
|
207
357
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
358
|
+
const isVirtualization = this.viewport.virtualRows;
|
|
359
|
+
const rowsPerPage = isVirtualization ? Math.ceil((vp.grid.tableElement?.clientHeight || 0) /
|
|
360
|
+
this.defaultRowHeight) : Infinity; // Need to be refactored when add pagination
|
|
361
|
+
let rows = vp.rows;
|
|
362
|
+
if (!isVirtualization && rows.length > 50) {
|
|
363
|
+
// eslint-disable-next-line no-console
|
|
364
|
+
console.warn('Grid: a large dataset can cause performance issues when ' +
|
|
365
|
+
'virtualization is disabled. Consider enabling ' +
|
|
366
|
+
'virtualization in the rows settings.');
|
|
367
|
+
}
|
|
368
|
+
if (!rows.length && rowCount > 0) {
|
|
369
|
+
const last = new TableRow(vp, rowCount - 1);
|
|
370
|
+
await last.init();
|
|
371
|
+
vp.tbodyElement.appendChild(last.htmlElement);
|
|
372
|
+
await last.render();
|
|
373
|
+
rows.push(last);
|
|
218
374
|
if (isVirtualization) {
|
|
219
|
-
|
|
375
|
+
const topOffset = Math.min(last.getDefaultTopOffset(), this.maxElementHeight -
|
|
376
|
+
last.htmlElement.offsetHeight);
|
|
377
|
+
last.setTranslateY(topOffset);
|
|
220
378
|
}
|
|
221
379
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
rows[i].render();
|
|
380
|
+
// The last row is always kept rendered for bottom alignment
|
|
381
|
+
let alwaysLastRow = rows.length > 0 ? rows.pop() : void 0;
|
|
382
|
+
if (alwaysLastRow && alwaysLastRow.index !== rowCount - 1) {
|
|
383
|
+
this.poolRow(alwaysLastRow);
|
|
384
|
+
alwaysLastRow = void 0;
|
|
228
385
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
386
|
+
const from = Math.max(0, Math.min(rowCursor - buffer, rowCount - rowsPerPage));
|
|
387
|
+
// `to` should not include the alwaysLastRow index (rowCount - 1)
|
|
388
|
+
const to = Math.min(rowCursor + rowsPerPage + buffer, rowCount - 2 // -2 because alwaysLastRow is at rowCount - 1
|
|
389
|
+
);
|
|
390
|
+
const tempRows = [];
|
|
391
|
+
const currentFrom = rows[0]?.index;
|
|
392
|
+
const currentTo = rows[rows.length - 1]?.index;
|
|
393
|
+
const hasOverlap = (rows.length > 0 &&
|
|
394
|
+
defined(currentFrom) &&
|
|
395
|
+
defined(currentTo) &&
|
|
396
|
+
!(to < currentFrom || from > currentTo));
|
|
397
|
+
if (!hasOverlap) {
|
|
398
|
+
// Remove rows that are out of the range except the last row.
|
|
399
|
+
for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
|
|
400
|
+
const row = rows[i];
|
|
401
|
+
const rowIndex = row.index;
|
|
402
|
+
if (rowIndex < from || rowIndex > to) {
|
|
403
|
+
this.poolRow(row);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
tempRows.push(row);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
rows = tempRows;
|
|
410
|
+
vp.rows = rows;
|
|
411
|
+
for (let i = from; i <= to; ++i) {
|
|
412
|
+
const firstRowIndex = rows.length > 0 ? rows[0].index : from;
|
|
413
|
+
const row = rows[i - firstRowIndex];
|
|
414
|
+
// Recreate row when it is destroyed and it is in the range.
|
|
415
|
+
if (!row) {
|
|
416
|
+
const newRow = await this.getOrCreateRow(i);
|
|
417
|
+
rows.push(newRow);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
rows.sort((a, b) => a.index - b.index);
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
// Remove rows outside the range from the start.
|
|
424
|
+
while (rows.length && rows[0].index < from) {
|
|
425
|
+
this.poolRow(rows.shift());
|
|
426
|
+
}
|
|
427
|
+
// Remove rows outside the range from the end.
|
|
428
|
+
while (rows.length && rows[rows.length - 1].index > to) {
|
|
429
|
+
this.poolRow(rows.pop());
|
|
430
|
+
}
|
|
431
|
+
if (!rows.length) {
|
|
432
|
+
for (let i = from; i <= to; ++i) {
|
|
433
|
+
rows.push(await this.getOrCreateRow(i));
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
// Add rows before the current range.
|
|
438
|
+
for (let i = rows[0].index - 1; i >= from; --i) {
|
|
439
|
+
rows.unshift(await this.getOrCreateRow(i));
|
|
440
|
+
}
|
|
441
|
+
// Add rows after the current range.
|
|
442
|
+
const lastRowIndex = rows[rows.length - 1].index + 1;
|
|
443
|
+
for (let i = lastRowIndex; i <= to; ++i) {
|
|
444
|
+
rows.push(await this.getOrCreateRow(i));
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
vp.rows = rows;
|
|
448
|
+
}
|
|
449
|
+
for (let i = 0, iEnd = rows.length; i < iEnd; ++i) {
|
|
450
|
+
const row = rows[i];
|
|
451
|
+
if (!row.rendered) {
|
|
452
|
+
// Ensure row is initialized before rendering
|
|
453
|
+
if (!row.htmlElement.hasAttribute('data-row-index')) {
|
|
454
|
+
await row.init();
|
|
455
|
+
}
|
|
456
|
+
vp.tbodyElement.insertBefore(row.htmlElement, vp.tbodyElement.lastChild);
|
|
457
|
+
await row.render();
|
|
458
|
+
if (isVirtualization) {
|
|
459
|
+
const topOffset = Math.min(row.getDefaultTopOffset(), this.maxElementHeight -
|
|
460
|
+
row.htmlElement.offsetHeight);
|
|
461
|
+
row.setTranslateY(topOffset);
|
|
462
|
+
}
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
if (!row.htmlElement.isConnected) {
|
|
466
|
+
vp.tbodyElement.insertBefore(row.htmlElement, vp.tbodyElement.lastChild);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (!alwaysLastRow && rowCount > 0) {
|
|
470
|
+
alwaysLastRow = await this.getOrCreateRow(rowCount - 1);
|
|
471
|
+
}
|
|
472
|
+
if (alwaysLastRow) {
|
|
473
|
+
if (!alwaysLastRow.rendered) {
|
|
474
|
+
if (!alwaysLastRow.htmlElement
|
|
475
|
+
.hasAttribute('data-row-index')) {
|
|
476
|
+
await alwaysLastRow.init();
|
|
477
|
+
}
|
|
478
|
+
vp.tbodyElement.appendChild(alwaysLastRow.htmlElement);
|
|
479
|
+
await alwaysLastRow.render();
|
|
480
|
+
if (isVirtualization) {
|
|
481
|
+
const topOffset = Math.min(alwaysLastRow.getDefaultTopOffset(), this.maxElementHeight -
|
|
482
|
+
alwaysLastRow.htmlElement.offsetHeight);
|
|
483
|
+
alwaysLastRow.setTranslateY(topOffset);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
else if (!alwaysLastRow.htmlElement.isConnected) {
|
|
487
|
+
vp.tbodyElement.appendChild(alwaysLastRow.htmlElement);
|
|
488
|
+
}
|
|
489
|
+
rows.push(alwaysLastRow);
|
|
490
|
+
}
|
|
491
|
+
// Focus the cell if the focus cursor is set
|
|
492
|
+
if (vp.focusCursor) {
|
|
493
|
+
const [rowIndex, columnIndex] = vp.focusCursor;
|
|
494
|
+
const row = rows.find((row) => row.index === rowIndex);
|
|
495
|
+
if (row) {
|
|
496
|
+
row.cells[columnIndex]?.htmlElement.focus({
|
|
497
|
+
preventScroll: true
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
// Set the focus anchor cell
|
|
502
|
+
if ((!vp.focusCursor || !vp.focusAnchorCell?.row.rendered) &&
|
|
503
|
+
rows.length > 0) {
|
|
504
|
+
const rowIndex = rowCursor - rows[0].index;
|
|
505
|
+
const targetRow = rows[rowIndex];
|
|
506
|
+
if (targetRow &&
|
|
507
|
+
targetRow.cells.length > 0 &&
|
|
508
|
+
targetRow.cells[0]) {
|
|
509
|
+
vp.setFocusAnchorCell(targetRow.cells[0]);
|
|
510
|
+
}
|
|
241
511
|
}
|
|
242
512
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
513
|
+
finally {
|
|
514
|
+
this.isRendering = false;
|
|
515
|
+
// If there's a pending render request, process it
|
|
516
|
+
if (this.pendingRowCursor !== null) {
|
|
517
|
+
const pendingCursor = this.pendingRowCursor;
|
|
518
|
+
this.pendingRowCursor = null;
|
|
519
|
+
await this.renderRows(pendingCursor);
|
|
249
520
|
}
|
|
250
521
|
}
|
|
251
522
|
}
|
|
@@ -262,18 +533,27 @@ class RowsVirtualizer {
|
|
|
262
533
|
const { rowCursor: cursor, defaultRowHeight: defaultH } = this;
|
|
263
534
|
const { rows, tbodyElement } = this.viewport;
|
|
264
535
|
const rowsLn = rows.length;
|
|
265
|
-
if (rowsLn < 1) {
|
|
536
|
+
if (rowsLn < 1 || !defaultH) {
|
|
266
537
|
return;
|
|
267
538
|
}
|
|
268
539
|
let translateBuffer = rows[0].getDefaultTopOffset();
|
|
269
540
|
for (let i = 0; i < rowsLn; ++i) {
|
|
270
541
|
const row = rows[i];
|
|
542
|
+
// Skip if row is not fully rendered or has no cells
|
|
543
|
+
if (!row.rendered ||
|
|
544
|
+
!row.cells.length ||
|
|
545
|
+
!row.cells[0]?.htmlElement) {
|
|
546
|
+
row.htmlElement.style.height = defaultH + 'px';
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
271
549
|
// Reset row height and cell transforms
|
|
272
550
|
row.htmlElement.style.height = '';
|
|
273
551
|
if (row.cells[0].htmlElement.style.transform) {
|
|
274
552
|
for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
|
|
275
553
|
const cell = row.cells[j];
|
|
276
|
-
cell
|
|
554
|
+
if (cell?.htmlElement) {
|
|
555
|
+
cell.htmlElement.style.transform = '';
|
|
556
|
+
}
|
|
277
557
|
}
|
|
278
558
|
}
|
|
279
559
|
// Rows above the first visible row
|
|
@@ -289,11 +569,13 @@ class RowsVirtualizer {
|
|
|
289
569
|
}
|
|
290
570
|
// First visible row
|
|
291
571
|
if (row.htmlElement.offsetHeight > defaultH) {
|
|
292
|
-
const newHeight = Math.floor(cellHeight - (cellHeight - defaultH) * (tbodyElement.scrollTop / defaultH - cursor));
|
|
572
|
+
const newHeight = Math.floor(cellHeight - (cellHeight - defaultH) * (tbodyElement.scrollTop / defaultH - Math.floor(cursor - this.scrollOffset / defaultH)));
|
|
293
573
|
row.htmlElement.style.height = newHeight + 'px';
|
|
294
574
|
for (let j = 0, jEnd = row.cells.length; j < jEnd; ++j) {
|
|
295
575
|
const cell = row.cells[j];
|
|
296
|
-
cell
|
|
576
|
+
if (cell?.htmlElement) {
|
|
577
|
+
cell.htmlElement.style.transform = `translateY(${newHeight - cellHeight}px)`;
|
|
578
|
+
}
|
|
297
579
|
}
|
|
298
580
|
}
|
|
299
581
|
}
|
|
@@ -321,23 +603,131 @@ class RowsVirtualizer {
|
|
|
321
603
|
rows[i].reflow();
|
|
322
604
|
}
|
|
323
605
|
this.adjustRowHeights();
|
|
606
|
+
if (this.viewport.virtualRows) {
|
|
607
|
+
this.adjustRowOffsets();
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Gets a row from the pool or creates a new one for the given index.
|
|
612
|
+
*
|
|
613
|
+
* @param index
|
|
614
|
+
* The row index in the data table.
|
|
615
|
+
*
|
|
616
|
+
* @returns
|
|
617
|
+
* A TableRow instance ready for use.
|
|
618
|
+
*/
|
|
619
|
+
async getOrCreateRow(index) {
|
|
620
|
+
const vp = this.viewport;
|
|
621
|
+
const isVirtualization = vp.virtualRows;
|
|
622
|
+
const pooledRow = this.rowPool.pop();
|
|
623
|
+
if (pooledRow) {
|
|
624
|
+
await pooledRow.reuse(index);
|
|
625
|
+
if (isVirtualization) {
|
|
626
|
+
pooledRow.setTranslateY(pooledRow.getDefaultTopOffset());
|
|
627
|
+
}
|
|
628
|
+
return pooledRow;
|
|
629
|
+
}
|
|
630
|
+
const newRow = new TableRow(vp, index);
|
|
631
|
+
newRow.rendered = false;
|
|
632
|
+
await newRow.init();
|
|
633
|
+
if (isVirtualization) {
|
|
634
|
+
newRow.setTranslateY(newRow.getDefaultTopOffset());
|
|
635
|
+
}
|
|
636
|
+
return newRow;
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Adds a row to the reuse pool, or destroys it if the pool is full.
|
|
640
|
+
*
|
|
641
|
+
* @param row
|
|
642
|
+
* The row to pool.
|
|
643
|
+
*/
|
|
644
|
+
poolRow(row) {
|
|
645
|
+
row.htmlElement.remove();
|
|
646
|
+
if (this.rowPool.length < RowsVirtualizer.MAX_POOL_SIZE) {
|
|
647
|
+
this.rowPool.push(row);
|
|
648
|
+
}
|
|
649
|
+
else {
|
|
650
|
+
row.destroy();
|
|
651
|
+
}
|
|
324
652
|
}
|
|
325
653
|
/**
|
|
326
654
|
* Returns the default height of a row. This method should be called only
|
|
327
655
|
* once on initialization.
|
|
656
|
+
*
|
|
657
|
+
* @returns
|
|
658
|
+
* The default height of a row.
|
|
328
659
|
*/
|
|
329
|
-
getDefaultRowHeight() {
|
|
660
|
+
async getDefaultRowHeight() {
|
|
330
661
|
const vp = this.viewport;
|
|
331
662
|
const mockRow = new TableRow(vp, 0);
|
|
663
|
+
await mockRow.init();
|
|
332
664
|
mockRow.htmlElement.style.position = 'absolute';
|
|
333
665
|
mockRow.htmlElement.classList.add(Globals.getClassName('mockedRow'));
|
|
334
|
-
|
|
335
|
-
mockRow.render();
|
|
666
|
+
vp.tbodyElement.appendChild(mockRow.htmlElement);
|
|
667
|
+
await mockRow.render();
|
|
336
668
|
const defaultRowHeight = mockRow.htmlElement.offsetHeight;
|
|
337
669
|
mockRow.destroy();
|
|
338
670
|
return defaultRowHeight;
|
|
339
671
|
}
|
|
672
|
+
/**
|
|
673
|
+
* Updates cached row count and derived grid height metrics used for
|
|
674
|
+
* overflow-aware scrolling.
|
|
675
|
+
*/
|
|
676
|
+
async updateGridMetrics() {
|
|
677
|
+
const rowCount = await this.viewport.grid.dataProvider?.getRowCount();
|
|
678
|
+
if (!defined(rowCount)) {
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
this.rowCount = rowCount;
|
|
682
|
+
this.totalGridHeight = this.rowCount * this.defaultRowHeight;
|
|
683
|
+
this.gridHeightOverflow = Math.max(this.totalGridHeight - this.maxElementHeight, 0);
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Updates row translate offsets based on scroll scaling. When the grid
|
|
687
|
+
* exceeds the max element height, it keeps the bottom rows aligned to the
|
|
688
|
+
* maximum scrollable height.
|
|
689
|
+
*/
|
|
690
|
+
adjustRowOffsets() {
|
|
691
|
+
const { rows } = this.viewport;
|
|
692
|
+
const rowsLn = rows.length;
|
|
693
|
+
if (rowsLn < 2) {
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
const lastRow = rows[rowsLn - 1];
|
|
697
|
+
const preLastRow = rows[rowsLn - 2];
|
|
698
|
+
const isSecondToLastRowVisible = preLastRow &&
|
|
699
|
+
preLastRow.index === lastRow.index - 1;
|
|
700
|
+
let translateBuffer = rows[0].getDefaultTopOffset();
|
|
701
|
+
translateBuffer = Math.floor(translateBuffer - this.scrollOffset);
|
|
702
|
+
if (isSecondToLastRowVisible && this.gridHeightOverflow > 0) {
|
|
703
|
+
lastRow.setTranslateY(this.maxElementHeight -
|
|
704
|
+
lastRow.htmlElement.offsetHeight);
|
|
705
|
+
let bottomOffset = this.maxElementHeight -
|
|
706
|
+
lastRow.htmlElement.offsetHeight;
|
|
707
|
+
for (let i = rowsLn - 2; i >= 0; i--) {
|
|
708
|
+
bottomOffset -= rows[i].htmlElement.offsetHeight;
|
|
709
|
+
rows[i].setTranslateY(bottomOffset);
|
|
710
|
+
}
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
rows[0].setTranslateY(translateBuffer);
|
|
714
|
+
for (let i = 1, iEnd = rowsLn - 1; i < iEnd; ++i) {
|
|
715
|
+
translateBuffer += rows[i - 1].htmlElement.offsetHeight;
|
|
716
|
+
rows[i].setTranslateY(translateBuffer);
|
|
717
|
+
}
|
|
718
|
+
if (this.gridHeightOverflow > 0) {
|
|
719
|
+
lastRow.setTranslateY(this.maxElementHeight);
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
if (preLastRow && preLastRow.index === lastRow.index - 1) {
|
|
723
|
+
lastRow.setTranslateY(preLastRow.htmlElement.offsetHeight + translateBuffer);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
340
726
|
}
|
|
727
|
+
/**
|
|
728
|
+
* Maximum number of rows to keep in the reuse pool.
|
|
729
|
+
*/
|
|
730
|
+
RowsVirtualizer.MAX_POOL_SIZE = 100;
|
|
341
731
|
/* *
|
|
342
732
|
*
|
|
343
733
|
* Default Export
|