virtua 0.52.3 → 0.52.5

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  > A zero-config, fast and small virtual list and grid component for [React](https://github.com/facebook/react), [Vue](https://vuejs.org/), [Solid](https://www.solidjs.com/), [Svelte](https://svelte.dev/) and [Angular](https://angular.dev/).
6
6
 
7
- ![example](./example.gif)
7
+ ![list example](./example.gif) ![grid example](./example2.gif)
8
8
 
9
9
  If you want to check the difference with the alternatives right away, [see comparison section](#comparison).
10
10
 
@@ -433,7 +433,7 @@ This package uses [exports of package.json](https://nodejs.org/api/packages.html
433
433
  | Horizontal scroll | ✅ | ✅ | ✅ | ✅ | 🟠 (needs customization) |
434
434
  | Horizontal scroll in RTL direction | ✅ | ❌ | ✅ | ❌ | 🟠 (isRtl) |
435
435
  | Grid (Virtualization for two dimensions) | ✅ (VGrid) | ❌ | ✅ ([Grid](https://react-window.vercel.app/grid/grid)) | ✅ ([Grid](https://github.com/bvaughn/react-virtualized/blob/master/docs/Grid.md)) | 🟠 (needs customization) |
436
- | Tabular data (Columns with headers) | ✅ (VGrid) | ✅ (TableVirtuoso) | 🟠 ([Supported](https://react-window.vercel.app/list/tabular-data)) | ✅ ([Table](https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md)) | 🟠 (needs customization) |
436
+ | Tabular data (Columns with headers) | ✅ (VGrid) | ✅ (TableVirtuoso) | ✅ ([Supported](https://react-window.vercel.app/list/tabular-data)) | ✅ ([Table](https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md)) | 🟠 (needs customization) |
437
437
  | HTML table element | 🟠 (needs customization) | ✅ (TableVirtuoso) | ❌ | ❌ | 🟠 (needs customization) |
438
438
  | Masonry | ❌ | ✅ (VirtuosoMasonry) | ❌ | ✅ ([Masonry](https://github.com/bvaughn/react-virtualized/blob/master/docs/Masonry.md)) | 🟠 (needs customization) |
439
439
  | Window scroller | ✅ (WindowVirtualizer) | ✅ | ❌ | ✅ ([WindowScroller](https://github.com/bvaughn/react-virtualized/blob/master/docs/WindowScroller.md)) | ✅ (useWindowVirtualizer) |
@@ -2,6 +2,11 @@ import { ItemsRange } from '../core/index.js';
2
2
  export declare const styleToString: (obj: Record<string, string | undefined>) => string;
3
3
  export declare const isSameRange: (prev: ItemsRange, next: ItemsRange) => boolean;
4
4
  export declare const defaultGetKey: (_data: unknown, i: number) => string;
5
+ export type ItemAttrs = {
6
+ [key: string]: any;
7
+ style?: Record<string, string | undefined>;
8
+ class?: string;
9
+ };
5
10
  /**
6
11
  * A function that provides properties/attributes for item element
7
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../src/svelte/utils.ts"],"sourcesContent":["import type { ItemsRange } from \"../core/index.js\";\n\nexport const styleToString = (\n obj: Record<string, string | undefined>,\n): string => {\n return Object.keys(obj).reduce((acc, k) => {\n const value = obj[k];\n if (value == null) {\n return acc;\n }\n return acc + `${k}:${value};`;\n }, \"\");\n};\n\nexport const isSameRange = (prev: ItemsRange, next: ItemsRange): boolean => {\n return prev[0] === next[0] && prev[1] === next[1];\n};\n\nexport const defaultGetKey = (_data: unknown, i: number) => \"_\" + i;\n\n/**\n * @internal\n */\nexport type ItemAttrs = {\n [key: string]: any;\n style?: Record<string, string | undefined>;\n class?: string;\n};\n\n/**\n * A function that provides properties/attributes for item element\n */\nexport type ItemProps<T = unknown> = (payload: {\n item: T;\n index: number;\n}) => ItemAttrs | undefined;\n"],"mappings":";AAEA,IAAa,iBACX,QACW;CACX,OAAO,OAAO,KAAK,GAAG,CAAC,CAAC,QAAQ,KAAK,MAAM;EACzC,MAAM,QAAQ,IAAI;EAClB,IAAI,SAAS,MACX,OAAO;EAET,OAAO,MAAM,GAAG,EAAE,GAAG,MAAM;CAC7B,GAAG,EAAE;AACP;AAEA,IAAa,eAAe,MAAkB,SAA8B;CAC1E,OAAO,KAAK,OAAO,KAAK,MAAM,KAAK,OAAO,KAAK;AACjD;AAEA,IAAa,iBAAiB,OAAgB,MAAc,MAAM"}
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../src/svelte/utils.ts"],"sourcesContent":["import type { ItemsRange } from \"../core/index.js\";\n\nexport const styleToString = (\n obj: Record<string, string | undefined>,\n): string => {\n return Object.keys(obj).reduce((acc, k) => {\n const value = obj[k];\n if (value == null) {\n return acc;\n }\n return acc + `${k}:${value};`;\n }, \"\");\n};\n\nexport const isSameRange = (prev: ItemsRange, next: ItemsRange): boolean => {\n return prev[0] === next[0] && prev[1] === next[1];\n};\n\nexport const defaultGetKey = (_data: unknown, i: number) => \"_\" + i;\n\nexport type ItemAttrs = {\n [key: string]: any;\n style?: Record<string, string | undefined>;\n class?: string;\n};\n\n/**\n * A function that provides properties/attributes for item element\n */\nexport type ItemProps<T = unknown> = (payload: {\n item: T;\n index: number;\n}) => ItemAttrs | undefined;\n"],"mappings":";AAEA,IAAa,iBACX,QACW;CACX,OAAO,OAAO,KAAK,GAAG,CAAC,CAAC,QAAQ,KAAK,MAAM;EACzC,MAAM,QAAQ,IAAI;EAClB,IAAI,SAAS,MACX,OAAO;EAET,OAAO,MAAM,GAAG,EAAE,GAAG,MAAM;CAC7B,GAAG,EAAE;AACP;AAEA,IAAa,eAAe,MAAkB,SAA8B;CAC1E,OAAO,KAAK,OAAO,KAAK,MAAM,KAAK,OAAO,KAAK;AACjD;AAEA,IAAa,iBAAiB,OAAgB,MAAc,MAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtua",
3
- "version": "0.52.3",
3
+ "version": "0.52.5",
4
4
  "description": "A zero-config, fast and small virtual list and grid component for React, Vue, Solid, Svelte and Angular.",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",