@vuu-ui/vuu-utils 0.8.20-debug → 0.8.21-debug

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-utils",
3
- "version": "0.8.20-debug",
3
+ "version": "0.8.21-debug",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
7
- "@vuu-ui/vuu-data-types": "0.8.20-debug",
8
- "@vuu-ui/vuu-table-types": "0.8.20-debug",
9
- "@vuu-ui/vuu-filter-types": "0.8.20-debug",
10
- "@vuu-ui/vuu-protocol-types": "0.8.20-debug"
7
+ "@vuu-ui/vuu-data-types": "0.8.21-debug",
8
+ "@vuu-ui/vuu-table-types": "0.8.21-debug",
9
+ "@vuu-ui/vuu-filter-types": "0.8.21-debug",
10
+ "@vuu-ui/vuu-protocol-types": "0.8.21-debug"
11
11
  },
12
12
  "peerDependencies": {
13
13
  "react": ">=17.0.2",
@@ -1,8 +1,23 @@
1
- import { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
- import { MutableRefObject } from "react";
1
+ import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
+ import type { MutableRefObject } from "react";
3
3
  export type RowOffsetFunc = (row: DataSourceRow, pctScrollTop?: number) => number;
4
4
  export type RowAtPositionFunc = (position: number) => number;
5
- export type RowPositioning = [RowOffsetFunc, RowAtPositionFunc];
5
+ /**
6
+ * RowOffset function, RowAtPosition function, isVirtualScroll
7
+ */
8
+ export type RowPositioning = [RowOffsetFunc, RowAtPositionFunc, boolean];
6
9
  export declare const actualRowPositioning: (rowHeight: number) => RowPositioning;
7
- export declare const virtualRowPositioning: (rowHeight: number, additionalPixelsNeeded: number, pctScrollTop: MutableRefObject<number>) => RowPositioning;
10
+ /**
11
+ * return functions for determining a) the pixel offset to apply to a row, given the
12
+ * row index and b) the index of the row at a given scroll offset. This implementation
13
+ * is used when we are forced to 'virtualise' scrolling - because the number of rows
14
+ * is high enough that we cannot create a large enough HTML content container.
15
+ *
16
+ * @param rowHeight
17
+ * @param virtualisedExtent
18
+ * @param pctScrollTop
19
+ * @returns
20
+ */
21
+ export declare const virtualRowPositioning: (rowHeight: number, virtualisedExtent: number, pctScrollTop: MutableRefObject<number>) => RowPositioning;
22
+ export declare const getRowElementAtIndex: (container: HTMLDivElement, rowIndex: number) => HTMLElement | null;
8
23
  export declare const getIndexFromRowElement: (rowElement: HTMLElement) => number;