@deephaven/grid 0.6.3-beta.9 → 0.6.3

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 (38) hide show
  1. package/dist/CellInputField.js +1 -1
  2. package/dist/CellInputField.js.map +1 -1
  3. package/dist/Grid.d.ts +13 -3
  4. package/dist/Grid.d.ts.map +1 -1
  5. package/dist/Grid.js +2 -2
  6. package/dist/GridMetricCalculator.d.ts +165 -448
  7. package/dist/GridMetricCalculator.d.ts.map +1 -1
  8. package/dist/GridMetricCalculator.js +122 -521
  9. package/dist/GridMetricCalculator.js.map +1 -1
  10. package/dist/GridRange.d.ts +111 -186
  11. package/dist/GridRange.d.ts.map +1 -1
  12. package/dist/GridRange.js +87 -185
  13. package/dist/GridRange.js.map +1 -1
  14. package/dist/GridRenderer.js +1 -6
  15. package/dist/GridRenderer.js.map +1 -1
  16. package/dist/GridTheme.d.ts +37 -49
  17. package/dist/GridTheme.d.ts.map +1 -1
  18. package/dist/GridTheme.js +0 -8
  19. package/dist/GridTheme.js.map +1 -1
  20. package/dist/GridUtils.d.ts +97 -236
  21. package/dist/GridUtils.d.ts.map +1 -1
  22. package/dist/GridUtils.js +76 -241
  23. package/dist/GridUtils.js.map +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/memoizeClear.js +1 -1
  29. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts +1 -1
  30. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.d.ts.map +1 -1
  31. package/dist/mouse-handlers/GridSelectionMouseHandler.js +4 -4
  32. package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +4 -4
  35. package/dist/GridMetrics.d.ts +0 -97
  36. package/dist/GridMetrics.d.ts.map +0 -1
  37. package/dist/GridMetrics.js +0 -2
  38. package/dist/GridMetrics.js.map +0 -1
@@ -1,48 +1,4 @@
1
- import GridModel from './GridModel';
2
- import GridMetrics, { BoxCoordinates, Coordinate, CoordinateMap, VisibleIndex, IndexModelMap, ModelIndex, ModelSizeMap, MoveOperation, SizeMap } from './GridMetrics';
3
- import { GridFont, GridTheme } from './GridTheme';
4
- export declare type GridMetricState = {
5
- left: VisibleIndex;
6
- top: VisibleIndex;
7
- leftOffset: Coordinate;
8
- topOffset: Coordinate;
9
- width: number;
10
- height: number;
11
- context: CanvasRenderingContext2D;
12
- theme: GridTheme;
13
- model: GridModel;
14
- movedColumns: MoveOperation[];
15
- movedRows: MoveOperation[];
16
- isDraggingHorizontalScrollBar: boolean;
17
- isDraggingVerticalScrollBar: boolean;
18
- };
19
- /**
20
- * Retrieve a value from a map. If the value is not found and no default value is provided, throw.
21
- * Use when the value _must_ be present
22
- * @param map The map to get the value from
23
- * @param key The key to fetch the value for
24
- * @param defaultValue A default value to set if the key is not present
25
- * @returns The value set for that key
26
- */
27
- export declare function getOrThrow<K, V>(map: Map<K, V>, key: K, defaultValue?: V | undefined): V;
28
- /**
29
- * Trim the provided map in place. Trims oldest inserted items down to the target size if the cache size is exceeded.
30
- * Instead of trimming one item on every tick, we trim half the items so there isn't a cache clear on every new item.
31
- * @param map The map to trim
32
- * @param cacheSize The maximum number of elements to cache
33
- * @param targetSize The number of elements to reduce the cache down to if `cacheSize` is exceeded
34
- */
35
- export declare function trimMap(map: Map<unknown, unknown>, cacheSize?: number, targetSize?: number): void;
36
- /**
37
- * Get the coordinates of floating items in one dimension.
38
- * Can be used for getting the y coordinates of floating rows, or x coordinates of floating columns, calculated using the `sizeMap` passed in.
39
- * @param startCount The number of floating items at the start (ie. `floatingTopRowCount` for rows, `floatingLeftColumnCount` for columns)
40
- * @param endCount The number of floating items at the end (ie. `floatingBottomRowCount` for rows, `floatingRightColumnCount` for columns)
41
- * @param totalCount Total number of items in this dimension (ie. `rowCount` for rows, `columnCount` for columns)
42
- * @param max The max coordinate value (ie. `maxY` for rows, `maxX` for columns)
43
- * @param sizeMap Map from index to size of item (ie. `rowHeightMap` for rows, `columnWidthMap` for columns)
44
- */
45
- export declare function getFloatingCoordinates(startCount: number, endCount: number, totalCount: number, max: number, sizeMap: SizeMap): CoordinateMap;
1
+ export default GridMetricCalculator;
46
2
  /**
47
3
  * Class to calculate all the metrics for drawing a grid.
48
4
  * Call getMetrics() with the state to get the full metrics.
@@ -53,429 +9,190 @@ declare class GridMetricCalculator {
53
9
  static CACHE_SIZE: number;
54
10
  /** The maximum column width as a percentage of the full grid */
55
11
  static MAX_COLUMN_WIDTH: number;
56
- /** User set column widths */
57
- private userColumnWidths;
58
- /** User set row heights */
59
- private userRowHeights;
60
- /** Calculated column widths based on cell contents */
61
- private calculatedColumnWidths;
62
- /** Calculated row heights based on cell contents */
63
- private calculatedRowHeights;
64
- /** Cache of fonts to estimated width of one char */
65
- private fontWidths;
66
- /** Map from visible index to model index for rows (e.g. reversing movedRows operations) */
67
- private modelRows;
68
- /** Map from visible index to model index for columns (e.g. reversing movedColumns operations) */
69
- private modelColumns;
70
- /** List of moved row operations. Need to track the previous value so we know if modelRows needs to be cleared. */
71
- private movedRows;
72
- /** List of moved column operations. Need to track the previous value so we know if modelColumns needs to be cleared. */
73
- private movedColumns;
74
- constructor({ userColumnWidths, userRowHeights, calculatedColumnWidths, calculatedRowHeights, fontWidths, modelRows, modelColumns, movedRows, movedColumns, }?: {
12
+ /**
13
+ * Trim the provided map in place. Trims oldest inserted items down to the target size if the cache size is exceeded.
14
+ * Instead of trimming one item on every tick, we trim half the items so there isn't a cache clear on every new item.
15
+ * @param {Map} map The map to trim
16
+ * @param {number} cacheSize The maximum number of elements to cache
17
+ * @param {number} targetSize The number of elements to reduce the cache down to if `cacheSize` is exceeded
18
+ */
19
+ static trimMap(map: Map<any, any>, cacheSize?: number, targetSize?: number): void;
20
+ /**
21
+ * Get the coordinates of floating items in one dimension.
22
+ * Can be used for getting the y coordinates of floating rows, or x coordinates of floating columns, calculated using the `sizeMap` passed in.
23
+ * @param {number} startCount The number of floating items at the start (ie. `floatingTopRowCount` for rows, `floatingLeftColumnCount` for columns)
24
+ * @param {number} endCount The number of floating items at the end (ie. `floatingBottomRowCount` for rows, `floatingRightColumnCount` for columns)
25
+ * @param {number} totalCount Total number of items in this dimension (ie. `rowCount` for rows, `columnCount` for columns)
26
+ * @param {number} max The max coordinate value (ie. `maxY` for rows, `maxX` for columns)
27
+ * @param {Map<number, number>} sizeMap Map from index to size of item (ie. `rowHeightMap` for rows, `columnWidthMap` for columns)
28
+ */
29
+ static getFloatingCoordinates(startCount: number, endCount: number, totalCount: number, max: number, sizeMap: Map<number, number>): Map<any, any>;
30
+ constructor({ userColumnWidths, userRowHeights, calculatedRowHeights, calculatedColumnWidths, fontWidths, modelRows, modelColumns, movedRows, movedColumns, }?: {
75
31
  userColumnWidths?: Map<any, any> | undefined;
76
32
  userRowHeights?: Map<any, any> | undefined;
77
- calculatedColumnWidths?: Map<any, any> | undefined;
78
33
  calculatedRowHeights?: Map<any, any> | undefined;
34
+ calculatedColumnWidths?: Map<any, any> | undefined;
79
35
  fontWidths?: Map<any, any> | undefined;
80
36
  modelRows?: Map<any, any> | undefined;
81
37
  modelColumns?: Map<any, any> | undefined;
82
- movedRows?: never[] | undefined;
83
- movedColumns?: never[] | undefined;
38
+ movedRows?: any;
39
+ movedColumns?: any;
84
40
  });
85
- /**
86
- * Get the metrics for the provided metric state
87
- * @params state The state to get metrics for
88
- * @returns The full metrics
89
- */
90
- getMetrics(state: GridMetricState): GridMetrics;
91
- /**
92
- * The x offset of the grid
93
- * @param state The current grid state
94
- * @returns x value of the left side of the first cell
95
- */
96
- getGridX(state: GridMetricState): Coordinate;
97
- /**
98
- * The y offset of the grid
99
- * @param state The current grid state
100
- * @returns y value of the top side of the first cell
101
- */
102
- getGridY(state: GridMetricState): Coordinate;
103
- /**
104
- * The height of the "visible" area (excludes floating areas)
105
- * @param state The current grid state
106
- * @param visibleRowHeights All the visible row heights
107
- * @returns The visible height in pixels
108
- */
109
- getVisibleHeight(state: GridMetricState, visibleRowHeights?: SizeMap): number;
110
- /**
111
- * The width of the "visible" area (excludes floating areas)
112
- * @param state The current grid state
113
- * @param visibleColumnWidths All the visible column widths
114
- * @returns The visible width in pixels
115
- */
116
- getVisibleWidth(state: GridMetricState, visibleColumnWidths?: SizeMap): number;
117
- /**
118
- * Retrieve the index of the first non-hidden item
119
- * @param itemSizes The size of the items in this dimension
120
- * @param getModelIndex A function to map from the Index to the ModelIndex
121
- * @param state The current grid state
122
- * @returns The first item that is not hidden
123
- */
124
- getFirstIndex(itemSizes: ModelSizeMap, getModelIndex: (visibleIndex: VisibleIndex, state: GridMetricState) => ModelIndex, state: GridMetricState): VisibleIndex;
125
- /**
126
- * Get the first column index that isn't hidden
127
- * @param state The current grid state
128
- * @returns The first column that is not hidden
129
- */
130
- getFirstColumn(state: GridMetricState): VisibleIndex;
131
- /**
132
- * Get the first row index that isn't hidden
133
- * @param state The current grid state
134
- * @returns The first row that is not hidden
135
- */
136
- getFirstRow(state: GridMetricState): VisibleIndex;
137
- /**
138
- * Get the last column that can be the left most column (e.g. scrolled to the right)
41
+ userColumnWidths: Map<any, any>;
42
+ userRowHeights: Map<any, any>;
43
+ calculatedRowHeights: Map<any, any>;
44
+ calculatedColumnWidths: Map<any, any>;
45
+ fontWidths: Map<any, any>;
46
+ modelRows: Map<any, any>;
47
+ modelColumns: Map<any, any>;
48
+ movedRows: any;
49
+ movedColumns: any;
50
+ /** update the calculated metrics from the model/canvas that are useful for many functions */
51
+ getMetrics(state: any): {
52
+ rowHeight: any;
53
+ rowHeaderWidth: any;
54
+ rowFooterWidth: any;
55
+ rowCount: any;
56
+ columnWidth: any;
57
+ columnCount: any;
58
+ columnHeaderHeight: any;
59
+ floatingTopRowCount: any;
60
+ floatingBottomRowCount: any;
61
+ floatingLeftColumnCount: any;
62
+ floatingRightColumnCount: any;
63
+ gridX: any;
64
+ gridY: any;
65
+ firstRow: number;
66
+ firstColumn: number;
67
+ treePaddingX: number;
68
+ treePaddingY: number;
69
+ left: any;
70
+ top: any;
71
+ bottom: any;
72
+ right: any;
73
+ topOffset: any;
74
+ leftOffset: any;
75
+ topVisible: any;
76
+ leftVisible: any;
77
+ bottomVisible: any;
78
+ rightVisible: any;
79
+ bottomViewport: number;
80
+ rightViewport: number;
81
+ width: any;
82
+ height: any;
83
+ maxX: number;
84
+ maxY: number;
85
+ lastLeft: number;
86
+ lastTop: number;
87
+ barHeight: number;
88
+ barWidth: number;
89
+ handleHeight: number;
90
+ handleWidth: number;
91
+ hasHorizontalBar: boolean;
92
+ hasVerticalBar: boolean;
93
+ verticalBarWidth: any;
94
+ horizontalBarHeight: any;
95
+ scrollX: number;
96
+ scrollY: number;
97
+ visibleRows: any[];
98
+ visibleColumns: any[];
99
+ floatingRows: any[];
100
+ floatingColumns: any[];
101
+ allRows: any[];
102
+ allColumns: any[];
103
+ visibleRowHeights: Map<any, any>;
104
+ visibleColumnWidths: Map<any, any>;
105
+ floatingTopHeight: number;
106
+ floatingBottomHeight: number;
107
+ floatingLeftWidth: number;
108
+ floatingRightWidth: number;
109
+ visibleRowYs: Map<any, any>;
110
+ visibleColumnXs: Map<any, any>;
111
+ visibleRowTreeBoxes: Map<any, any>;
112
+ modelRows: Map<any, any>;
113
+ modelColumns: Map<any, any>;
114
+ fontWidths: Map<any, any>;
115
+ userColumnWidths: Map<any, any>;
116
+ userRowHeights: Map<any, any>;
117
+ calculatedRowHeights: Map<any, any>;
118
+ calculatedColumnWidths: Map<any, any>;
119
+ };
120
+ getGridX(state: any): any;
121
+ getGridY(state: any): any;
122
+ getVisibleHeight(state: any, visibleRowHeights?: Map<any, any>): number;
123
+ getVisibleWidth(state: any, visibleColumnWidths?: Map<any, any>): number;
124
+ getFirstIndex(itemSizes: any, getModelIndex: any, state: any): number;
125
+ /** Get the first column index that isn't hidden */
126
+ getFirstColumn(state: any): number;
127
+ /** Get the first row index that isn't hidden */
128
+ getFirstRow(state: any): number;
129
+ /**
130
+ * Get the last column that can be the left most column (eg. scrolled to the right)
139
131
  * If no right column is provided, then the last column is used.
140
- * @param state The current grid state
141
- * @param right The right-most column to be visible, or null to default to last cell
142
- * @param visibleWidth The width of the "visible" area (excluding floating items)
143
- * @returns The index of the last left visible column
144
132
  */
145
- getLastLeft(state: GridMetricState, right?: VisibleIndex | null, visibleWidth?: number): VisibleIndex;
133
+ getLastLeft(state: any, right?: any, visibleWidth?: number): number;
146
134
  /**
147
- * The last row that can be the top row (e.g. scrolled to the bottom)
135
+ * The last row that can be the top row (eg. scrolled to the bottom)
148
136
  * If no bottom row is provided, then the last row that is not floating is used
149
137
  */
150
- /**
151
- * The last row that can be the top row (e.g. scrolled to the bottom)
152
- * If no bottom row is provided, then the last row that is not floating is used
153
- * @param state The current grid state
154
- * @param bottom The bottom-most row to be visible, or null to default to last cell
155
- * @param visibleHeight The height of the "visible" area (excluding floating items)
156
- * @returns The index of the last left visible column
157
- */
158
- getLastTop(state: GridMetricState, bottom?: VisibleIndex | null, visibleHeight?: number): VisibleIndex;
159
- /**
160
- * Retrieve the top row to scroll to so the passed in `topVisible` is completely visible, taking the floating rows into account.
161
- * The `top` row is at the top underneath any floating rows, whereas `topVisible` is visible below the floating rows.
162
- * If there are no floating rows, they should be the same value.
163
- * @param state The grid metric state
164
- * @param topVisible The top row to be visible
165
- * @returns The index of the top row to scroll to (under the floating top rows)
166
- */
167
- getTopForTopVisible(state: GridMetricState, topVisible: VisibleIndex): VisibleIndex;
168
- /**
169
- * Retrieve the top row to scroll to so the passed in `bottomVisible` is completely visible
170
- * at the bottom of the visible viewport, taking the floating rows into account.
171
- * @param state The grid metric state
172
- * @param bottomVisible The bottom row to be visible
173
- * @returns The index of the top row to scroll to (under the floating top rows)
174
- */
175
- getTopForBottomVisible(state: GridMetricState, bottomVisible: VisibleIndex): VisibleIndex;
176
- /**
177
- * Retrieve the left column to scroll to so the passed in `leftVisible` is completely visible
178
- * at the left of the visible viewport, taking the floating columns into account.
179
- * @param state The grid metric state
180
- * @param leftVisible The left column to be visible
181
- * @returns The index of the left column to scroll to (under the floating left columns)
182
- */
183
- getLeftForLeftVisible(state: GridMetricState, leftVisible: VisibleIndex): VisibleIndex;
184
- /**
185
- * Retrieve the left column to scroll to so the passed in `rightVisible` is completely visible
186
- * at the right of the visible viewport, taking the floating columns into account.
187
- * @param state The grid metric state
188
- * @param rightVisible The right column to be visible
189
- * @returns The index of the left column to scroll to (under the floating left columns)
190
- */
191
- getLeftForRightVisible(state: GridMetricState, rightVisible: VisibleIndex): VisibleIndex;
192
- /**
193
- * Retrieve a map of the height of each floating row
194
- * @param state The grid metric state
195
- * @returns The heights of all the floating rows
196
- */
197
- getFloatingRowHeights(state: GridMetricState): SizeMap;
198
- /**
199
- * Retrieve a map of the height of all the visible rows (non-floating)
200
- * @param state The grid metric state
201
- * @returns The heights of all the visible rows
202
- */
203
- getVisibleRowHeights(state: GridMetricState): SizeMap;
204
- /**
205
- * Retrieve a map of the width of each floating column
206
- * @param state The grid metric state
207
- * @param firstColumn The first non-hidden column
208
- * @param treePaddingX The amount of padding taken up for the tree expansion buttons
209
- * @returns The widths of all the floating columns
210
- */
211
- getFloatingColumnWidths(state: GridMetricState, firstColumn?: VisibleIndex, treePaddingX?: number): SizeMap;
212
- /**
213
- * Retrieve a map of the width of all the visible columns (non-floating)
214
- * @param state The grid metric state
215
- * @returns The widths of all the visible columns
216
- */
217
- getVisibleColumnWidths(state: GridMetricState, firstColumn?: VisibleIndex, treePaddingX?: number): SizeMap;
218
- /**
219
- * Retrieve a map of all the floating columns to their x coordinate
220
- * @param state The grid metric state
221
- * @param columnWidthMap Map from visible index to column width
222
- * @param maxX The maximum X size for the grid
223
- * @returns Map of the x coordinate of all floating columns
224
- */
225
- getFloatingColumnXs(state: GridMetricState, columnWidthMap: SizeMap, maxX: Coordinate): CoordinateMap;
226
- /**
227
- * Retrieve a map of all the visible columns to their x coordinate.
228
- * Starts at leftOffset with the first index in `visibleColumns`, then
229
- * calculates all the coordinates from there
230
- * @param visibleColumnWidths Map of visible column index to widths
231
- * @param visibleColumns All visible columns
232
- * @param leftOffset The left scroll offset
233
- * @returns Map of the x coordinate of all visible columns
234
- */
235
- getVisibleColumnXs(visibleColumnWidths: SizeMap, visibleColumns: VisibleIndex[], leftOffset: number): CoordinateMap;
236
- /**
237
- * Retrieve a map of all the floating rows to their y coordinate
238
- * @param state The grid metric state
239
- * @param rowHeightMap Map of visible index to row height
240
- * @param maxY The maximum Y size for the grid
241
- * @returns Map of the y coordinate of all floating rows
242
- */
243
- getFloatingRowYs(state: GridMetricState, rowHeightMap: SizeMap, maxY: Coordinate): CoordinateMap;
244
- /**
245
- * Retrieve a map of all the visible rows to their y coordinate.
246
- * Starts at topOffset with the first index in `visibleRows`, then
247
- * calculates all the coordinates from there
248
- * @param visibleRowHeights Map of visible row index to heights
249
- * @param visibleRows All visible rows
250
- * @param topOffset The top scroll offset
251
- * @returns Map of the y coordinate of all visible rows
252
- */
253
- getVisibleRowYs(visibleRowHeights: SizeMap, visibleRows: VisibleIndex[], topOffset: number): CoordinateMap;
254
- /**
255
- * Calculates the tree box click areas that are visible. In relation to the columnX/rowY
256
- * @param visibleRowHeights Map of visible index to row height
257
- * @param modelRows Map from visible `Index` to `ModelIndex`
258
- * @param state The grid metric state
259
- * @returns Coordinates of tree boxes for each row
260
- */
261
- getVisibleRowTreeBoxes(visibleRowHeights: SizeMap, modelRows: IndexModelMap, state: GridMetricState): Map<VisibleIndex, BoxCoordinates>;
262
- /**
263
- * Get the total width of the floating columns on the left
264
- * @param state The grid metric state
265
- * @param columnWidths Map of column index to width
266
- * @returns The total width of the floating left section
267
- */
268
- getFloatingLeftWidth(state: GridMetricState, columnWidths?: SizeMap): number;
269
- /**
270
- * Get the total width of the floating columns on the right
271
- * @param state The grid metric state
272
- * @param columnWidths Map of column index to width
273
- * @returns The total width of the floating right section
274
- */
275
- getFloatingRightWidth(state: GridMetricState, columnWidths?: SizeMap): number;
276
- /**
277
- * Get the total height of the floating rows on the top
278
- * @param state The grid metric state
279
- * @param rowHeights Map of row index to height
280
- * @returns The total height of the floating top section
281
- */
282
- getFloatingTopHeight(state: GridMetricState, rowHeights?: SizeMap): number;
283
- /**
284
- * Get the total height of the floating rows on the bottom
285
- * @param state The grid metric state
286
- * @param rowHeights Map of row index to height
287
- * @returns The total height of the floating bottom section
288
- */
289
- getFloatingBottomHeight(state: GridMetricState, rowHeights?: SizeMap): number;
290
- /**
291
- * Retrieve the index of the first fully visible row in the "visible" viewport of the grid.
292
- * E.g. First row visible after the floating rows, provided the visible rows.
293
- * @param state The grid metric state
294
- * @param visibleRowYs Map of row index to y coordinate
295
- * @param visibleRowHeights Map of row index to height
296
- * @param visibleRows Array of visible row indexes
297
- * @returns Index of the top visible row
298
- */
299
- getTopVisible(state: GridMetricState, visibleRowYs: CoordinateMap, visibleRowHeights: SizeMap, visibleRows: VisibleIndex[]): VisibleIndex;
300
- /**
301
- * Retrieve the index of the first fully visible column in the "visible" viewport of the grid.
302
- * E.g. First column visible after the floating columns, provided the visible columns.
303
- * @param state The grid metric state
304
- * @param visibleColumnXs Map of column index to x coordinate
305
- * @param visibleColumnWidths Map of column index to widths
306
- * @param visibleColumns Array of visible row indexes
307
- * @returns Index of the left visible column
308
- */
309
- getLeftVisible(state: GridMetricState, visibleColumnXs: CoordinateMap, visibleColumnWidths: SizeMap, visibleColumns: VisibleIndex[]): VisibleIndex;
310
- /**
311
- * Retrieve the index of the last fully visible row in the "visible" viewport of the grid.
312
- * E.g. Last row visible before the bottom floating rows, provided the visible rows.
313
- * @param state The grid metric state
314
- * @param visibleRowYs Map of row index to y coordinate
315
- * @param visibleRowHeights Map of row index to height
316
- * @param visibleRows Array of visible row indexes
317
- * @param gridY The starting y coordinate of the grid
318
- * @returns Index of the bottom visible row
319
- */
320
- getBottomVisible(state: GridMetricState, visibleRowYs: CoordinateMap, visibleRowHeights: SizeMap, visibleRows: VisibleIndex[], gridY: Coordinate): VisibleIndex;
321
- /**
322
- * Retrieve the index of the last fully visible column in the "visible" viewport of the grid.
323
- * E.g. Last column visible before the floating columns, provided the visible columns.
324
- * @param state The grid metric state
325
- * @param visibleColumnXs Map of column index to x coordinate
326
- * @param visibleColumnWidths Map of column index to widths
327
- * @param visibleColumns Array of visible column indexes
328
- * @returns Index of the right visible column
329
- */
330
- getRightVisible(state: GridMetricState, visibleColumnXs: CoordinateMap, visibleColumnWidths: SizeMap, visibleColumns: VisibleIndex[], gridX: Coordinate): VisibleIndex;
331
- /**
332
- * Retrieve the possible bottom of the visible viewport (not limited by data size)
333
- * @param state The grid metric state
334
- * @param visibleRows Array of visible row indexes
335
- * @param visibleRowYs Map of row index to y coordinate
336
- * @param visibleRowHeights Map of row index to height
337
- * @returns The index of the bottom viewport possible
338
- */
339
- getBottomViewport(state: GridMetricState, visibleRows: VisibleIndex[], visibleRowYs: CoordinateMap, visibleRowHeights: SizeMap): VisibleIndex;
340
- /**
341
- * Retrieve the possible right of the visible viewport (not limited by data size)
342
- * @param state The grid metric state
343
- * @param visibleColumns Array of visible column indexes
344
- * @param visibleColumnXs Map of column index to x coordinate
345
- * @param visibleColumnWidths Map of column index to width
346
- * @returns The index of the right viewport possible
347
- */
348
- getRightViewport(state: GridMetricState, visibleColumns: VisibleIndex[], visibleColumnXs: CoordinateMap, visibleColumnWidths: SizeMap): VisibleIndex;
349
- /**
350
- * Get the Index of the of the last index visible
351
- * @param items Array of visible item indexes
352
- * @param itemXs Map of index to coordinate
353
- * @param itemSizes Map of index to size
354
- * @param maxSize Full size of the grid
355
- * @param defaultItemSize Default size of an item
356
- * @returns The Index of the last index visible
357
- */
358
- getLastIndexViewport(items: VisibleIndex[], itemXs: CoordinateMap, itemSizes: SizeMap, maxSize: number, defaultItemSize: number): VisibleIndex;
359
- /**
360
- * Get the size from the provided size map of the specified item
361
- * @param modelIndex The model index to get the size for
362
- * @param userSizes The user set sizes
363
- * @param calculateSize Method to calculate the size for this item
364
- * @returns The size from the provided size map of the specified item
365
- */
366
- getVisibleItemSize(modelIndex: ModelIndex, userSizes: ModelSizeMap, calculateSize: () => number): number;
367
- /**
368
- * Get the height of the specified row
369
- * @param row Index of the row to get the height of
370
- * @param state The grid metric state
371
- * @returns The height of the row specified
372
- */
373
- getVisibleRowHeight(row: VisibleIndex, state: GridMetricState): number;
374
- /**
375
- * Get the width of the specified column
376
- * @param column Index of the column to get the width of
377
- * @param state The grid metric state
378
- * @param firstColumn Index of first visible column
379
- * @param treePaddingX The amount of tree padding to add to the first visible column
380
- * @returns The width of the column
381
- */
382
- getVisibleColumnWidth(column: VisibleIndex, state: GridMetricState, firstColumn?: VisibleIndex, treePaddingX?: number): number;
383
- /**
384
- * Get a map of ModelIndex to Index
385
- * @param visibleRows Array of visible row indexes
386
- * @param state The grid metric state
387
- * @returns Map of Index to ModelIndex
388
- */
389
- getModelRows(visibleRows: VisibleIndex[], state: GridMetricState): IndexModelMap;
390
- /**
391
- * Get the ModelIndex of the specified row
392
- * @param visibleRow Index of the row
393
- * @param state The grid metric state
394
- * @returns ModelIndex of the row
395
- */
396
- getModelRow(visibleRow: VisibleIndex, state: GridMetricState): ModelIndex;
397
- /**
398
- * Get a map of Index to ModelIndex. Applies the move operations to get the transformation.
399
- * @param visibleColumns Array of visible column indexes
400
- * @param state The grid metric state
401
- * @returns Map of Index to ModelIndex
402
- */
403
- getModelColumns(visibleColumns: VisibleIndex[], state: GridMetricState): IndexModelMap;
404
- /**
405
- * Get the ModelIndex of the specified column
406
- * @param visibleColumn Index of the column
407
- * @param state The grid metric state
408
- * @returns ModelIndex of the column
409
- */
410
- getModelColumn(visibleColumn: VisibleIndex, state: GridMetricState): ModelIndex;
411
- /**
412
- * Calculate the height of the row specified.
413
- * @param row Index of the row to calculate the height for
414
- * @param modelRow ModelIndex of the row to calculate the height
415
- * @param state The grid metric state
416
- * @returns The height of the row
417
- */
418
- calculateRowHeight(row: VisibleIndex, modelRow: ModelIndex, state: GridMetricState): number;
419
- /**
420
- * Calculates the column width based on the provided column model index
421
- * @param column Index of the column to calculate the width for
422
- * @param modelColumn ModelIndex of the column to calculate the width
423
- * @param state The grid metric state
424
- * @param firstColumn The first visible column
425
- * @param treePaddingX Tree padding offset for expandable rows
426
- * @returns The width of the column
427
- */
428
- calculateColumnWidth(column: VisibleIndex, modelColumn: ModelIndex, state: GridMetricState, firstColumn?: VisibleIndex, treePaddingX?: number): number;
429
- /**
430
- * Calculate the width of the specified column's header
431
- * @param modelColumn ModelIndex of the column to get the header width for
432
- * @param state The grid metric state
433
- * @returns The calculated width of the column header
434
- */
435
- calculateColumnHeaderWidth(modelColumn: ModelIndex, state: GridMetricState): number;
436
- /**
437
- * Calculate the width of the specified column's data
438
- * @param modelColumn ModelIndex of the column to get the data width for
439
- * @param state The grid metric state
440
- * @returns The calculated width of the column data
441
- */
442
- calculateColumnDataWidth(modelColumn: ModelIndex, state: GridMetricState): number;
443
- /**
444
- * The coordinate for where the tree padding should be drawn
445
- * @param state The grid metric state
446
- * @returns The coordinate for tree padding
447
- */
448
- calculateTreePaddingX(state: GridMetricState): Coordinate;
449
- /**
450
- * Get the width of the provided font. Exploits the fact that we're
451
- * using tabular figures so every character is same width
452
- * @param font The font to get the width for
453
- * @param state The grid metric state
454
- * @returns Width of the char `8` for the specified font
455
- */
456
- getWidthForFont(font: GridFont, state: GridMetricState): number;
138
+ getLastTop(state: any, bottom?: any, visibleHeight?: number): number;
139
+ getTopForTopVisible(state: any, topVisible: any): any;
140
+ getTopForBottomVisible(state: any, bottomVisible: any): number;
141
+ getLeftForLeftVisible(state: any, leftVisible: any): any;
142
+ getLeftForRightVisible(state: any, rightVisible: any): number;
143
+ getFloatingRowHeights(state: any): Map<any, any>;
144
+ getVisibleRowHeights(state: any): Map<any, any>;
145
+ getFloatingColumnWidths(state: any, firstColumn?: number, treePaddingX?: number): Map<any, any>;
146
+ getVisibleColumnWidths(state: any, firstColumn?: number, treePaddingX?: number): Map<any, any>;
147
+ getFloatingColumnXs(state: any, columnWidthMap: any, maxX: any): Map<any, any>;
148
+ getVisibleColumnXs(visibleColumnWidths: any, visibleColumns: any, leftOffset: any): Map<any, any>;
149
+ getFloatingRowYs(state: any, rowHeightMap: any, maxY: any): Map<any, any>;
150
+ getVisibleRowYs(visibleRowHeights: any, visibleRows: any, topOffset: any): Map<any, any>;
151
+ /** Calculates the tree box click areas that are visible. In relation to the columnX/rowY */
152
+ getVisibleRowTreeBoxes(visibleRowHeights: any, modelRows: any, state: any): Map<any, any>;
153
+ getFloatingLeftWidth(state: any, columnWidths?: Map<any, any>): number;
154
+ getFloatingRightWidth(state: any, columnWidths?: Map<any, any>): number;
155
+ getFloatingTopHeight(state: any, rowHeights?: Map<any, any>): number;
156
+ getFloatingBottomHeight(state: any, rowHeights?: Map<any, any>): number;
157
+ getTopVisible(state: any, visibleRowYs: any, visibleRowHeights: any, visibleRows: any): any;
158
+ getLeftVisible(state: any, visibleColumnXs: any, visibleColumnWidths: any, visibleColumns: any): any;
159
+ getBottomVisible(state: any, visibleRowYs: any, visibleRowHeights: any, visibleRows: any, gridY: any): any;
160
+ getRightVisible(state: any, visibleColumnXs: any, visibleColumnWidths: any, visibleColumns: any, gridX: any): any;
161
+ getBottomViewport(state: any, visibleRows: any, visibleRowYs: any, visibleRowHeights: any): number;
162
+ getRightViewport(state: any, visibleColumns: any, visibleColumnXs: any, visibleColumnWidths: any): number;
163
+ getLastIndexViewport(items: any, itemXs: any, itemSizes: any, maxSize: any, defaultItemSize: any): number;
164
+ getVisibleItemSize(modelIndex: any, userSizes: any, calculateSize: any): any;
165
+ getVisibleRowHeight(row: any, state: any): any;
166
+ getVisibleColumnWidth(column: any, state: any, firstColumn?: number, treePaddingX?: number): any;
167
+ getModelRows(visibleRows: any, state: any): Map<any, any>;
168
+ getModelRow(visibleRow: any, state: any): any;
169
+ getModelColumns(visibleColumns: any, state: any): Map<any, any>;
170
+ getModelColumn(visibleColumn: any, state: any): any;
171
+ calculateRowHeight(row: any, modelRow: any, state: any): any;
172
+ /** Calculates the column width based on the provided column model index */
173
+ calculateColumnWidth(column: any, modelColumn: any, state: any, firstColumn?: number, treePaddingX?: number): any;
174
+ calculateColumnHeaderWidth(modelColumn: any, state: any): number;
175
+ calculateColumnDataWidth(modelColumn: any, state: any): number;
176
+ calculateTreePaddingX(state: any): number;
177
+ /** Get the width of the provided font. Exploits the fact that we're using tabular figures so every character is same width */
178
+ getWidthForFont(font: any, state: any): any;
457
179
  /**
458
180
  * Sets the width for the specified column
459
- * @param column The column model index to set
460
- * @param size The size to set it to
181
+ * @param {Number} column The column model index to set
182
+ * @param {Number} size The size to set it to, or null to reset the column size
461
183
  */
462
- setColumnWidth(column: ModelIndex, size: number): void;
184
+ setColumnWidth(column: number, size: number): void;
463
185
  /**
464
186
  * Resets the column width for the specified column to the calculated width
465
- * @param column The column model index to reset
187
+ * @param {Number} column The column model index to reset
466
188
  */
467
- resetColumnWidth(column: ModelIndex): void;
189
+ resetColumnWidth(column: number): void;
468
190
  /**
469
191
  * Sets the width for the specified row
470
- * @param row The row model index to set
471
- * @param size The size to set it to
192
+ * @param {Number} row The row model index to set
193
+ * @param {Number} size The size to set it to, or null to reset the row size
472
194
  */
473
- setRowHeight(row: ModelIndex, size: number): void;
474
- /**
475
- * Resets the row height for the specified row to the calculated height
476
- * @param row The row model index to reset
477
- */
478
- resetRowHeight(row: ModelIndex): void;
195
+ setRowHeight(row: number, size: number): void;
196
+ resetRowHeight(row: any): void;
479
197
  }
480
- export default GridMetricCalculator;
481
198
  //# sourceMappingURL=GridMetricCalculator.d.ts.map