schummar-table 0.26.1 → 0.27.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.
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { CommonFilterProps, SerializableValue } from '../types';
3
+ import type { VirtualListProps } from './virtualList';
3
4
  export declare function SelectFilter<T, V, F extends SerializableValue>({ options: providedOptions, stringValue, render, singleSelect, hideSearchField, hideResetButton, ...props }: {
4
5
  /** Which options are provided to select. By default all unique item values are used. */
5
6
  options?: F[];
@@ -13,4 +14,7 @@ export declare function SelectFilter<T, V, F extends SerializableValue>({ option
13
14
  hideSearchField?: boolean;
14
15
  /** If enabled, the reset button is hidden. */
15
16
  hideResetButton?: boolean;
17
+ /** Virtual list props.
18
+ * @default true */
19
+ virtual?: VirtualListProps<unknown>['virtual'];
16
20
  } & CommonFilterProps<T, V, F, Set<F>>): JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type { HTMLProps, ReactNode } from 'react';
2
+ export interface VirtualListProps<T> extends Omit<HTMLProps<HTMLDivElement>, 'children'> {
3
+ virtual?: boolean | {
4
+ rowHeight?: number;
5
+ initalRowHeight?: number;
6
+ throttleScroll?: number;
7
+ overscan?: number;
8
+ overscanBottom?: number;
9
+ overscanTop?: number;
10
+ };
11
+ items: T[];
12
+ children: (item: T, index: number) => ReactNode;
13
+ }
14
+ export declare function VirtualList<T>({ virtual, items, children, ...props }: VirtualListProps<T>): JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import type { MemoizedTableTheme } from '../types';
2
- export declare function calcClassNames<T>(classes: MemoizedTableTheme<any>['classes'] | undefined, item: T, index: number): (string | false | undefined)[];
3
- export declare function calcCss<T>(styles: MemoizedTableTheme<any>['styles'] | undefined, item: T, index: number): (false | import("@emotion/serialize").CSSObject | undefined)[];
2
+ export declare function calcClassNames<T>(classes: MemoizedTableTheme<T>['classes'] | undefined, item: T, index: number): (string | false | undefined)[];
3
+ export declare function calcCss<T>(styles: MemoizedTableTheme<T>['styles'] | undefined, item: T, index: number): (false | import("@emotion/serialize").CSSObject | undefined)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "schummar-table",
3
- "version": "0.26.1",
3
+ "version": "0.27.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "repository": "schummar/schummar-table",