@difizen/libro-virtualized 0.1.2

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.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/es/auto-sizer/auto-sizer.d.ts +56 -0
  4. package/es/auto-sizer/auto-sizer.d.ts.map +1 -0
  5. package/es/auto-sizer/auto-sizer.js +157 -0
  6. package/es/auto-sizer/index.d.ts +3 -0
  7. package/es/auto-sizer/index.d.ts.map +1 -0
  8. package/es/auto-sizer/index.js +2 -0
  9. package/es/cell-measurer/cell-measurer-cache.d.ts +52 -0
  10. package/es/cell-measurer/cell-measurer-cache.d.ts.map +1 -0
  11. package/es/cell-measurer/cell-measurer-cache.js +176 -0
  12. package/es/cell-measurer/cell-measurer.d.ts +39 -0
  13. package/es/cell-measurer/cell-measurer.d.ts.map +1 -0
  14. package/es/cell-measurer/cell-measurer.js +154 -0
  15. package/es/cell-measurer/index.d.ts +5 -0
  16. package/es/cell-measurer/index.d.ts.map +1 -0
  17. package/es/cell-measurer/index.js +4 -0
  18. package/es/cell-measurer/types.d.ts +9 -0
  19. package/es/cell-measurer/types.d.ts.map +1 -0
  20. package/es/cell-measurer/types.js +0 -0
  21. package/es/grid/accessibility-overscanIndices-getter.d.ts +11 -0
  22. package/es/grid/accessibility-overscanIndices-getter.d.ts.map +1 -0
  23. package/es/grid/accessibility-overscanIndices-getter.js +33 -0
  24. package/es/grid/default-cell-range-renderer.d.ts +10 -0
  25. package/es/grid/default-cell-range-renderer.d.ts.map +1 -0
  26. package/es/grid/default-cell-range-renderer.js +135 -0
  27. package/es/grid/default-overscanIndices-getter.d.ts +11 -0
  28. package/es/grid/default-overscanIndices-getter.d.ts.map +1 -0
  29. package/es/grid/default-overscanIndices-getter.js +28 -0
  30. package/es/grid/grid.d.ts +359 -0
  31. package/es/grid/grid.d.ts.map +1 -0
  32. package/es/grid/grid.js +1287 -0
  33. package/es/grid/index.d.ts +6 -0
  34. package/es/grid/index.d.ts.map +1 -0
  35. package/es/grid/index.js +4 -0
  36. package/es/grid/types.d.ts +87 -0
  37. package/es/grid/types.d.ts.map +1 -0
  38. package/es/grid/types.js +1 -0
  39. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.d.ts +17 -0
  40. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.d.ts.map +1 -0
  41. package/es/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.js +25 -0
  42. package/es/grid/utils/cell-size-and-position-manager-row.d.ts +97 -0
  43. package/es/grid/utils/cell-size-and-position-manager-row.d.ts.map +1 -0
  44. package/es/grid/utils/cell-size-and-position-manager-row.js +297 -0
  45. package/es/grid/utils/cell-size-and-position-manager.d.ts +85 -0
  46. package/es/grid/utils/cell-size-and-position-manager.d.ts.map +1 -0
  47. package/es/grid/utils/cell-size-and-position-manager.js +268 -0
  48. package/es/grid/utils/max-element-size.d.ts +2 -0
  49. package/es/grid/utils/max-element-size.d.ts.map +1 -0
  50. package/es/grid/utils/max-element-size.js +17 -0
  51. package/es/grid/utils/scaling-cell-size-and-position-manager-row.d.ts +78 -0
  52. package/es/grid/utils/scaling-cell-size-and-position-manager-row.d.ts.map +1 -0
  53. package/es/grid/utils/scaling-cell-size-and-position-manager-row.js +187 -0
  54. package/es/grid/utils/scaling-cell-size-and-position-manager.d.ts +70 -0
  55. package/es/grid/utils/scaling-cell-size-and-position-manager.d.ts.map +1 -0
  56. package/es/grid/utils/scaling-cell-size-and-position-manager.js +187 -0
  57. package/es/grid/utils/update-scroll-index-helper.d.ts +24 -0
  58. package/es/grid/utils/update-scroll-index-helper.d.ts.map +1 -0
  59. package/es/grid/utils/update-scroll-index-helper.js +40 -0
  60. package/es/index.d.ts +5 -0
  61. package/es/index.d.ts.map +1 -0
  62. package/es/index.js +4 -0
  63. package/es/list/index.d.ts +3 -0
  64. package/es/list/index.d.ts.map +1 -0
  65. package/es/list/index.js +1 -0
  66. package/es/list/list.d.ts +109 -0
  67. package/es/list/list.d.ts.map +1 -0
  68. package/es/list/list.js +261 -0
  69. package/es/list/types.d.ts +22 -0
  70. package/es/list/types.d.ts.map +1 -0
  71. package/es/list/types.js +1 -0
  72. package/es/utils/animation-frame.d.ts +7 -0
  73. package/es/utils/animation-frame.d.ts.map +1 -0
  74. package/es/utils/animation-frame.js +20 -0
  75. package/es/utils/create-callback-memoizer.d.ts +5 -0
  76. package/es/utils/create-callback-memoizer.d.ts.map +1 -0
  77. package/es/utils/create-callback-memoizer.js +25 -0
  78. package/es/utils/get-updated-offset-for-index.d.ts +14 -0
  79. package/es/utils/get-updated-offset-for-index.d.ts.map +1 -0
  80. package/es/utils/get-updated-offset-for-index.js +32 -0
  81. package/es/utils/init-cell-metadata.d.ts +13 -0
  82. package/es/utils/init-cell-metadata.d.ts.map +1 -0
  83. package/es/utils/init-cell-metadata.js +32 -0
  84. package/es/utils/request-animation-timeout.d.ts +12 -0
  85. package/es/utils/request-animation-timeout.d.ts.map +1 -0
  86. package/es/utils/request-animation-timeout.js +33 -0
  87. package/es/utils/test-helper.d.ts +5 -0
  88. package/es/utils/test-helper.d.ts.map +1 -0
  89. package/es/utils/test-helper.js +31 -0
  90. package/es/vendor/binary-search-bounds.d.ts +22 -0
  91. package/es/vendor/binary-search-bounds.d.ts.map +1 -0
  92. package/es/vendor/binary-search-bounds.js +198 -0
  93. package/es/vendor/detect-element-resize.d.ts +16 -0
  94. package/es/vendor/detect-element-resize.d.ts.map +1 -0
  95. package/es/vendor/detect-element-resize.js +184 -0
  96. package/es/vendor/interval-tree.d.ts +10 -0
  97. package/es/vendor/interval-tree.d.ts.map +1 -0
  98. package/es/vendor/interval-tree.js +359 -0
  99. package/package.json +59 -0
  100. package/src/auto-sizer/auto-sizer.tsx +187 -0
  101. package/src/auto-sizer/index.ts +4 -0
  102. package/src/cell-measurer/cell-measurer-cache.ts +220 -0
  103. package/src/cell-measurer/cell-measurer.ts +151 -0
  104. package/src/cell-measurer/index.ts +5 -0
  105. package/src/cell-measurer/types.ts +8 -0
  106. package/src/grid/accessibility-overscanIndices-getter.ts +38 -0
  107. package/src/grid/default-cell-range-renderer.ts +166 -0
  108. package/src/grid/default-overscanIndices-getter.ts +32 -0
  109. package/src/grid/grid.tsx +1672 -0
  110. package/src/grid/index.ts +14 -0
  111. package/src/grid/types.ts +112 -0
  112. package/src/grid/utils/calculate-size-and-position-data-and-update-scroll-offset.ts +62 -0
  113. package/src/grid/utils/cell-size-and-position-manager-row.ts +365 -0
  114. package/src/grid/utils/cell-size-and-position-manager.ts +309 -0
  115. package/src/grid/utils/max-element-size.ts +18 -0
  116. package/src/grid/utils/scaling-cell-size-and-position-manager-row.ts +206 -0
  117. package/src/grid/utils/scaling-cell-size-and-position-manager.ts +198 -0
  118. package/src/grid/utils/update-scroll-index-helper.ts +96 -0
  119. package/src/index.spec.ts +10 -0
  120. package/src/index.ts +4 -0
  121. package/src/list/index.ts +2 -0
  122. package/src/list/list.tsx +292 -0
  123. package/src/list/types.ts +25 -0
  124. package/src/utils/animation-frame.ts +38 -0
  125. package/src/utils/create-callback-memoizer.ts +32 -0
  126. package/src/utils/get-updated-offset-for-index.ts +33 -0
  127. package/src/utils/init-cell-metadata.ts +32 -0
  128. package/src/utils/request-animation-timeout.ts +44 -0
  129. package/src/utils/test-helper.ts +20 -0
  130. package/src/vendor/binary-search-bounds.ts +203 -0
  131. package/src/vendor/detect-element-resize.ts +241 -0
  132. package/src/vendor/interval-tree.ts +406 -0
@@ -0,0 +1,359 @@
1
+ import { scrollbarSize } from 'dom-helpers';
2
+ import * as React from 'react';
3
+ import type { AnimationTimeoutId } from '../utils/request-animation-timeout.js';
4
+ import defaultCellRangeRenderer from './default-cell-range-renderer.js';
5
+ import defaultOverscanIndicesGetter from './default-overscanIndices-getter.js';
6
+ import type { Alignment, CellCache, CellPosition, CellRangeRenderer, CellRenderer, CellSize, CellSizeGetter, NoContentRenderer, OverscanIndicesGetter, RenderedSection, Scroll, ScrollbarPresenceChange, StyleCache } from './types.js';
7
+ import RowScalingCellSizeAndPositionManager from './utils/scaling-cell-size-and-position-manager-row.js';
8
+ import ScalingCellSizeAndPositionManager from './utils/scaling-cell-size-and-position-manager.js';
9
+ /**
10
+ * Specifies the number of milliseconds during which to disable pointer events while a scroll is in progress.
11
+ * This improves performance and makes scrolling smoother.
12
+ */
13
+ export declare const DEFAULT_SCROLLING_RESET_TIME_INTERVAL = 150;
14
+ type ScrollPosition = {
15
+ scrollTop?: number;
16
+ scrollLeft?: number;
17
+ };
18
+ type Props = {
19
+ 'aria-label': string;
20
+ 'aria-readonly'?: boolean;
21
+ cellsHeight: number[];
22
+ noEditorArea: React.ReactElement;
23
+ editorAreaHeight: number[];
24
+ totalSize: number;
25
+ editorsOffset: number[];
26
+ /**
27
+ * Set the width of the inner scrollable container to 'auto'.
28
+ * This is useful for single-column Grids to ensure that the column doesn't extend below a vertical scrollbar.
29
+ */
30
+ autoContainerWidth: boolean;
31
+ /**
32
+ * Removes fixed height from the scrollingContainer so that the total height of rows can stretch the window.
33
+ * Intended for use with WindowScroller
34
+ */
35
+ autoHeight: boolean;
36
+ /**
37
+ * Removes fixed width from the scrollingContainer so that the total width of rows can stretch the window.
38
+ * Intended for use with WindowScroller
39
+ */
40
+ autoWidth: boolean;
41
+ /** Responsible for rendering a cell given an row and column index. */
42
+ cellRenderer: CellRenderer;
43
+ /** Responsible for rendering a group of cells given their index ranges. */
44
+ cellRangeRenderer: CellRangeRenderer;
45
+ /** Optional custom CSS class name to attach to root Grid element. */
46
+ className?: string;
47
+ /** Number of columns in grid. */
48
+ columnCount: number;
49
+ /** Either a fixed column width (number) or a function that returns the width of a column given its index. */
50
+ columnWidth: CellSize;
51
+ /** Unfiltered props for the Grid container. */
52
+ containerProps?: object;
53
+ /** ARIA role for the cell-container. */
54
+ containerRole: string;
55
+ /** Optional inline style applied to inner cell-container */
56
+ containerStyle: object;
57
+ /**
58
+ * If CellMeasurer is used to measure this Grid's children, this should be a pointer to its CellMeasurerCache.
59
+ * A shared CellMeasurerCache reference enables Grid and CellMeasurer to share measurement data.
60
+ */
61
+ deferredMeasurementCache?: any;
62
+ /**
63
+ * Used to estimate the total width of a Grid before all of its columns have actually been measured.
64
+ * The estimated total width is adjusted as columns are rendered.
65
+ */
66
+ estimatedColumnSize: number;
67
+ /**
68
+ * Used to estimate the total height of a Grid before all of its rows have actually been measured.
69
+ * The estimated total height is adjusted as rows are rendered.
70
+ */
71
+ estimatedRowSize: number;
72
+ /** Exposed for testing purposes only. */
73
+ getScrollbarSize: () => number;
74
+ /** Height of Grid; this property determines the number of visible (vs virtualized) rows. */
75
+ height: number;
76
+ /** Optional custom id to attach to root Grid element. */
77
+ id?: string;
78
+ /**
79
+ * Override internal is-scrolling state tracking.
80
+ * This property is primarily intended for use with the WindowScroller component.
81
+ */
82
+ isScrolling?: boolean;
83
+ /**
84
+ * Opt-out of isScrolling param passed to cellRangeRenderer.
85
+ * To avoid the extra render when scroll stops.
86
+ */
87
+ isScrollingOptOut: boolean;
88
+ /** Optional renderer to be used in place of rows when either :rowCount or :columnCount is 0. */
89
+ noContentRenderer: NoContentRenderer;
90
+ /**
91
+ * Callback invoked whenever the scroll offset changes within the inner scrollable region.
92
+ * This callback can be used to sync scrolling between lists, tables, or grids.
93
+ */
94
+ onScroll: (params: Scroll) => void;
95
+ /**
96
+ * Called whenever a horizontal or vertical scrollbar is added or removed.
97
+ * This prop is not intended for end-user use;
98
+ * It is used by MultiGrid to support fixed-row/fixed-column scroll syncing.
99
+ */
100
+ onScrollbarPresenceChange: (params: ScrollbarPresenceChange) => void;
101
+ /** Callback invoked with information about the section of the Grid that was just rendered. */
102
+ onSectionRendered: (params: RenderedSection) => void;
103
+ /**
104
+ * Number of columns to render before/after the visible section of the grid.
105
+ * These columns can help for smoother scrolling on touch devices or browsers that send scroll events infrequently.
106
+ */
107
+ overscanColumnCount: number;
108
+ /**
109
+ * Calculates the number of cells to overscan before and after a specified range.
110
+ * This function ensures that overscanning doesn't exceed the available cells.
111
+ */
112
+ overscanIndicesGetter: OverscanIndicesGetter;
113
+ /**
114
+ * Number of rows to render above/below the visible section of the grid.
115
+ * These rows can help for smoother scrolling on touch devices or browsers that send scroll events infrequently.
116
+ */
117
+ overscanRowCount: number;
118
+ /** ARIA role for the grid element. */
119
+ role: string;
120
+ /**
121
+ * Either a fixed row height (number) or a function that returns the height of a row given its index.
122
+ * Should implement the following interface: ({ index: number }): number
123
+ */
124
+ rowHeight: CellSize;
125
+ /** Number of rows in grid. */
126
+ rowCount: number;
127
+ /** Wait this amount of time after the last scroll event before resetting Grid `pointer-events`. */
128
+ scrollingResetTimeInterval: number;
129
+ /** Horizontal offset. */
130
+ scrollLeft?: number;
131
+ /**
132
+ * Controls scroll-to-cell behavior of the Grid.
133
+ * The default ("auto") scrolls the least amount possible to ensure that the specified cell is fully visible.
134
+ * Use "start" to align cells to the top/left of the Grid and "end" to align bottom/right.
135
+ */
136
+ scrollToAlignment: Alignment;
137
+ /** Column index to ensure visible (by forcefully scrolling if necessary) */
138
+ scrollToColumn: number;
139
+ /** Vertical offset. */
140
+ scrollTop?: number;
141
+ /** Row index to ensure visible (by forcefully scrolling if necessary) */
142
+ scrollToRow: number;
143
+ /** Optional inline style */
144
+ style: object;
145
+ /** Tab index for focus */
146
+ tabIndex?: number;
147
+ /** Width of Grid; this property determines the number of visible (vs virtualized) columns. */
148
+ width: number;
149
+ resizeObserver: ResizeObserver;
150
+ };
151
+ type InstanceProps = {
152
+ prevColumnWidth: CellSize;
153
+ prevRowHeight: CellSize;
154
+ prevColumnCount: number;
155
+ prevRowCount: number;
156
+ prevIsScrolling: boolean;
157
+ prevScrollToColumn: number;
158
+ prevScrollToRow: number;
159
+ prevScrollLeft?: number;
160
+ prevScrollTop?: number;
161
+ columnSizeAndPositionManager: ScalingCellSizeAndPositionManager;
162
+ rowSizeAndPositionManager: RowScalingCellSizeAndPositionManager;
163
+ scrollbarSize: number;
164
+ scrollbarSizeMeasured: boolean;
165
+ cellsHeight: number[];
166
+ noEditorArea: React.ReactElement;
167
+ editorAreaHeight: number[];
168
+ totalSize: number;
169
+ editorsOffset: number[];
170
+ };
171
+ type State = {
172
+ instanceProps: InstanceProps;
173
+ isScrolling: boolean;
174
+ scrollDirectionHorizontal: -1 | 1;
175
+ scrollDirectionVertical: -1 | 1;
176
+ scrollLeft: number;
177
+ scrollTop: number;
178
+ scrollPositionChangeReason: 'observed' | 'requested' | null;
179
+ needToResetStyleCache: boolean;
180
+ };
181
+ /**
182
+ * Renders tabular data with virtualization along the vertical and horizontal axes.
183
+ * Row heights and column widths must be known ahead of time and specified as properties.
184
+ */
185
+ declare class Grid extends React.PureComponent<Props, State> {
186
+ static defaultProps: {
187
+ 'aria-label': string;
188
+ 'aria-readonly': boolean;
189
+ autoContainerWidth: boolean;
190
+ autoHeight: boolean;
191
+ autoWidth: boolean;
192
+ cellRangeRenderer: typeof defaultCellRangeRenderer;
193
+ containerRole: string;
194
+ containerStyle: {};
195
+ estimatedColumnSize: number;
196
+ estimatedRowSize: number;
197
+ getScrollbarSize: typeof scrollbarSize;
198
+ noContentRenderer: NoContentRenderer;
199
+ onScroll: () => void;
200
+ onScrollbarPresenceChange: () => void;
201
+ onSectionRendered: () => void;
202
+ overscanColumnCount: number;
203
+ overscanIndicesGetter: typeof defaultOverscanIndicesGetter;
204
+ overscanRowCount: number;
205
+ role: string;
206
+ scrollingResetTimeInterval: number;
207
+ scrollToAlignment: string;
208
+ scrollToColumn: number;
209
+ scrollToRow: number;
210
+ style: {};
211
+ tabIndex: number;
212
+ isScrollingOptOut: boolean;
213
+ };
214
+ _onGridRenderedMemoizer: ({ callback, indices }: any) => void;
215
+ _onScrollMemoizer: ({ callback, indices }: any) => void;
216
+ _deferredInvalidateColumnIndex: number | null;
217
+ _deferredInvalidateRowIndex: number | null;
218
+ _recomputeScrollLeftFlag: boolean;
219
+ _recomputeScrollTopFlag: boolean;
220
+ _horizontalScrollBarSize: number;
221
+ _verticalScrollBarSize: number;
222
+ _scrollbarPresenceChanged: boolean;
223
+ _scrollingContainer: Element;
224
+ _childrenToDisplay: React.ReactNode[];
225
+ _columnStartIndex: number;
226
+ _columnStopIndex: number;
227
+ _rowStartIndex: number;
228
+ _rowStopIndex: number;
229
+ _renderedColumnStartIndex?: number;
230
+ _renderedColumnStopIndex?: number;
231
+ _renderedRowStartIndex?: number;
232
+ _renderedRowStopIndex?: number;
233
+ _initialScrollTop: number;
234
+ _initialScrollLeft: number;
235
+ resizeObserver: ResizeObserver;
236
+ _disablePointerEventsTimeoutId?: AnimationTimeoutId | null;
237
+ _styleCache: StyleCache;
238
+ _cellCache: CellCache;
239
+ constructor(props: Props);
240
+ /**
241
+ * Gets offsets for a given cell and alignment.
242
+ */
243
+ getOffsetForCell({ alignment, columnIndex, rowIndex, }?: {
244
+ alignment?: Alignment;
245
+ columnIndex?: number;
246
+ rowIndex?: number;
247
+ }): {
248
+ scrollLeft: number;
249
+ scrollTop: number;
250
+ };
251
+ /**
252
+ * Gets estimated total rows' height.
253
+ */
254
+ getTotalRowsHeight(): number;
255
+ /**
256
+ * Gets estimated total columns' width.
257
+ */
258
+ getTotalColumnsWidth(): number;
259
+ /**
260
+ * This method handles a scroll event originating from an external scroll control.
261
+ * It's an advanced method and should probably not be used unless you're implementing a custom scroll-bar solution.
262
+ */
263
+ handleScrollEvent({ scrollLeft: scrollLeftParam, scrollTop: scrollTopParam, }: ScrollPosition): void;
264
+ /**
265
+ * Invalidate Grid size and recompute visible cells.
266
+ * This is a deferred wrapper for recomputeGridSize().
267
+ * It sets a flag to be evaluated on cDM/cDU to avoid unnecessary renders.
268
+ * This method is intended for advanced use-cases like CellMeasurer.
269
+ */
270
+ invalidateCellSizeAfterRender({ columnIndex, rowIndex }: CellPosition): void;
271
+ /**
272
+ * Pre-measure all columns and rows in a Grid.
273
+ * Typically cells are only measured as needed and estimated sizes are used for cells that have not yet been measured.
274
+ * This method ensures that the next call to getTotalSize() returns an exact size (as opposed to just an estimated one).
275
+ */
276
+ measureAllCells(): void;
277
+ /**
278
+ * Forced recompute of row heights and column widths.
279
+ * This function should be called if dynamic column or row sizes have changed but nothing else has.
280
+ * Since Grid only receives :columnCount and :rowCount it has no way of detecting when the underlying data changes.
281
+ */
282
+ recomputeGridSize({ columnIndex, rowIndex }?: CellPosition): void;
283
+ scrollToLine({ cellIndex, lineIndex }: {
284
+ cellIndex: number;
285
+ lineIndex: number;
286
+ }): void;
287
+ /**
288
+ * Ensure column and row are visible.
289
+ */
290
+ scrollToCell({ columnIndex, rowIndex }: CellPosition): void;
291
+ componentDidMount(): void;
292
+ /**
293
+ * @private
294
+ * This method updates scrollLeft/scrollTop in state for the following conditions:
295
+ * 1) New scroll-to-cell props have been set
296
+ */
297
+ componentDidUpdate(prevProps: Props, prevState: State): void;
298
+ componentWillUnmount(): void;
299
+ /**
300
+ * This method updates scrollLeft/scrollTop in state for the following conditions:
301
+ * 1) Empty content (0 rows or columns)
302
+ * 2) New scroll props overriding the current state
303
+ * 3) Cells-count or cells-size has changed, making previous scroll offsets invalid
304
+ */
305
+ static getDerivedStateFromProps(nextProps: Props, prevState: State): any;
306
+ render(): import("react/jsx-runtime").JSX.Element;
307
+ _calculateChildrenToRender(props?: Props, state?: State): void;
308
+ /**
309
+ * Sets an :isScrolling flag for a small window of time.
310
+ * This flag is used to disable pointer events on the scrollable portion of the Grid.
311
+ * This prevents jerky/stuttery mouse-wheel scrolling.
312
+ */
313
+ _debounceScrollEnded(): void;
314
+ _debounceScrollEndedCallback: () => void;
315
+ static _getEstimatedColumnSize(props: Props): number;
316
+ static _getEstimatedRowSize(props: Props): number;
317
+ /**
318
+ * Check for batched CellMeasurer size invalidations.
319
+ * This will occur the first time one or more previously unmeasured cells are rendered.
320
+ */
321
+ _handleInvalidatedGridSize(): void;
322
+ _invokeOnGridRenderedHelper: () => void;
323
+ _invokeOnScrollMemoizer({ scrollLeft, scrollTop, totalColumnsWidth, totalRowsHeight, }: {
324
+ scrollLeft: number;
325
+ scrollTop: number;
326
+ totalColumnsWidth: number;
327
+ totalRowsHeight: number;
328
+ }): void;
329
+ _isScrolling(props?: Props, state?: State): boolean;
330
+ _maybeCallOnScrollbarPresenceChange(): void;
331
+ _setScrollingContainerRef: (ref: HTMLDivElement) => void;
332
+ /**
333
+ * Get the updated state after scrolling to
334
+ * scrollLeft and scrollTop
335
+ */
336
+ static _getScrollToPositionStateUpdate({ prevState, scrollLeft, scrollTop, }: {
337
+ prevState: State;
338
+ scrollLeft?: number;
339
+ scrollTop?: number;
340
+ }): any;
341
+ /**
342
+ * Scroll to the specified offset(s).
343
+ * Useful for animating position changes.
344
+ */
345
+ scrollToPosition({ scrollLeft, scrollTop }: ScrollPosition): void;
346
+ static _wrapSizeGetter(value: CellSize): CellSizeGetter;
347
+ static _getCalculatedScrollLeft(nextProps: Props, prevState: State): number;
348
+ _getCalculatedScrollLeft(props?: Props, state?: State): number;
349
+ static _getScrollLeftForScrollToColumnStateUpdate(nextProps: Props, prevState: State): any;
350
+ _updateScrollLeftForScrollToColumn(props?: Props, state?: State): void;
351
+ static _getCalculatedScrollTop(nextProps: Props, prevState: State): number;
352
+ _getCalculatedScrollTop(props?: Props, state?: State): number;
353
+ _resetStyleCache(): void;
354
+ static _getScrollTopForScrollToRowStateUpdate(nextProps: Props, prevState: State): any;
355
+ _updateScrollTopForScrollToRow(props?: Props, state?: State): void;
356
+ _onScroll: React.UIEventHandler<HTMLDivElement>;
357
+ }
358
+ export default Grid;
359
+ //# sourceMappingURL=grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/grid/grid.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAMhF,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,4BAGN,MAAM,qCAAqC,CAAC;AAC7C,O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