vlist 1.7.5 → 1.7.7
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.github.md +12 -12
- package/README.md +11 -11
- package/dist/builder/materialize.d.ts +1 -1
- package/dist/builder/types.d.ts +9 -0
- package/dist/features/grid/renderer.d.ts +1 -1
- package/dist/features/groups/sticky.d.ts +6 -1
- package/dist/features/masonry/renderer.d.ts +1 -1
- package/dist/features/scrollbar/scrollbar.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/internals.js +1 -1
- package/dist/rendering/aria.d.ts +13 -0
- package/dist/rendering/renderer.d.ts +1 -1
- package/dist/size.json +1 -1
- package/dist/vlist.css +1 -1
- package/package.json +1 -1
package/README.github.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# vlist
|
|
2
2
|
|
|
3
|
-
The virtual list library for every framework. Accessible by default, batteries-included, with composable features — in
|
|
3
|
+
The virtual list library for every framework. Accessible by default, batteries-included, with composable features — in 11.2 KB.
|
|
4
4
|
|
|
5
|
-
**v1.7.
|
|
5
|
+
**v1.7.7** — [Changelog](./CHANGELOG.md)
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/vlist)
|
|
8
8
|
[](https://github.com/floor/vlist/actions/workflows/ci.yml)
|
|
@@ -11,7 +11,7 @@ The virtual list library for every framework. Accessible by default, batteries-i
|
|
|
11
11
|
- **New: `withSortable()`** — drag-and-drop reordering with auto-scroll, keyboard support, and ARIA announcements
|
|
12
12
|
- **Accessible** — WAI-ARIA, 2D keyboard navigation, focus recovery, screen-reader DOM ordering, ARIA live region
|
|
13
13
|
- **Zero dependencies** — framework-agnostic core with tiny adapters for Vue, Svelte, Solid, React
|
|
14
|
-
- **
|
|
14
|
+
- **11.2 KB gzipped** — composable features with perfect tree-shaking
|
|
15
15
|
- **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
|
|
16
16
|
- **Grid, masonry, table, groups, async, selection, sortable, scale** — all opt-in
|
|
17
17
|
- **Vertical & horizontal** — single axis-neutral code path, every feature works in both orientations
|
|
@@ -94,19 +94,19 @@ const list = vlist({
|
|
|
94
94
|
|
|
95
95
|
| Feature | Size | Description |
|
|
96
96
|
|---------|------|-------------|
|
|
97
|
-
| **Base** |
|
|
98
|
-
| `withAsync()` | +4.
|
|
99
|
-
| `withSelection()` | +3.
|
|
97
|
+
| **Base** | 11.2 KB | Virtualization, ARIA, keyboard nav, gap, padding |
|
|
98
|
+
| `withAsync()` | +4.5 KB | Lazy loading with velocity-aware fetching |
|
|
99
|
+
| `withSelection()` | +3.2 KB | Single/multiple selection with 2D keyboard nav |
|
|
100
100
|
| `withScale()` | +3.7 KB | 1M+ items via scroll compression |
|
|
101
|
-
| `withGroups()` | +4.
|
|
101
|
+
| `withGroups()` | +4.6 KB | Sticky/inline headers with async group discovery |
|
|
102
102
|
| `withAutoSize()` | +0.9 KB | Auto-measure items via ResizeObserver |
|
|
103
|
-
| `withScrollbar()` | +1.
|
|
104
|
-
| `withGrid()` | +
|
|
105
|
-
| `withMasonry()` | +3.
|
|
103
|
+
| `withScrollbar()` | +1.8 KB | Custom scrollbar UI |
|
|
104
|
+
| `withGrid()` | +4.0 KB | 2D grid layout |
|
|
105
|
+
| `withMasonry()` | +3.5 KB | Pinterest-style masonry with lane-aware keyboard nav |
|
|
106
106
|
| `withTable()` | +5.5 KB | Data table with columns, resize, sort |
|
|
107
|
-
| `withPage()` | +0.
|
|
107
|
+
| `withPage()` | +0.7 KB | Window-level scrolling |
|
|
108
108
|
| `withSortable()` | +3.0 KB | Drag-and-drop reordering with auto-scroll |
|
|
109
|
-
| `withSnapshots()` | +1.
|
|
109
|
+
| `withSnapshots()` | +1.3 KB | Scroll position save/restore |
|
|
110
110
|
|
|
111
111
|
## Examples
|
|
112
112
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# vlist
|
|
2
2
|
|
|
3
|
-
The virtual list library for every framework. Accessible by default, batteries-included, with composable features — in
|
|
3
|
+
The virtual list library for every framework. Accessible by default, batteries-included, with composable features — in 11.2 KB.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/vlist)
|
|
6
6
|
[](https://github.com/floor/vlist/actions/workflows/ci.yml)
|
|
@@ -9,7 +9,7 @@ The virtual list library for every framework. Accessible by default, batteries-i
|
|
|
9
9
|
- **New: `withSortable()`** — drag-and-drop reordering with auto-scroll, keyboard support, and ARIA announcements
|
|
10
10
|
- **Zero dependencies** — framework-agnostic core, tiny adapters for Vue, Svelte, Solid, React
|
|
11
11
|
- **Accessible** — WAI-ARIA, 2D keyboard navigation, focus recovery, screen-reader DOM ordering
|
|
12
|
-
- **
|
|
12
|
+
- **11.2 KB gzipped** — composable features with perfect tree-shaking
|
|
13
13
|
- **Constant memory** — ~0.1 MB overhead at any scale, from 10K to 1M+ items
|
|
14
14
|
- **Vertical & horizontal** — single axis-neutral code path, every feature works in both orientations
|
|
15
15
|
|
|
@@ -54,19 +54,19 @@ const list = vlist({ container: '#app', items, item: { height: 200, template: re
|
|
|
54
54
|
|
|
55
55
|
| Feature | Size | Description |
|
|
56
56
|
|---------|------|-------------|
|
|
57
|
-
| **Base** |
|
|
58
|
-
| `withAsync()` | +4.
|
|
59
|
-
| `withSelection()` | +3.
|
|
57
|
+
| **Base** | 11.2 KB | Virtualization, ARIA, keyboard nav, gap, padding |
|
|
58
|
+
| `withAsync()` | +4.5 KB | Lazy loading with velocity-aware fetching |
|
|
59
|
+
| `withSelection()` | +3.2 KB | Single/multiple selection with 2D keyboard nav |
|
|
60
60
|
| `withScale()` | +3.7 KB | 1M+ items via scroll compression |
|
|
61
|
-
| `withGroups()` | +4.
|
|
61
|
+
| `withGroups()` | +4.6 KB | Sticky/inline headers with async group discovery |
|
|
62
62
|
| `withAutoSize()` | +0.9 KB | Auto-measure items via ResizeObserver |
|
|
63
|
-
| `withScrollbar()` | +1.
|
|
64
|
-
| `withGrid()` | +
|
|
65
|
-
| `withMasonry()` | +3.
|
|
63
|
+
| `withScrollbar()` | +1.8 KB | Custom scrollbar UI |
|
|
64
|
+
| `withGrid()` | +4.0 KB | 2D grid layout |
|
|
65
|
+
| `withMasonry()` | +3.5 KB | Pinterest-style masonry with lane-aware keyboard nav |
|
|
66
66
|
| `withTable()` | +5.5 KB | Data table with columns, resize, sort |
|
|
67
|
-
| `withPage()` | +0.
|
|
67
|
+
| `withPage()` | +0.7 KB | Window-level scrolling |
|
|
68
68
|
| `withSortable()` | +3.0 KB | Drag-and-drop reordering with auto-scroll |
|
|
69
|
-
| `withSnapshots()` | +1.
|
|
69
|
+
| `withSnapshots()` | +1.3 KB | Scroll position save/restore |
|
|
70
70
|
|
|
71
71
|
## Framework Adapters
|
|
72
72
|
|
|
@@ -162,5 +162,5 @@ export interface MDeps<T extends VListItem = VListItem> {
|
|
|
162
162
|
}
|
|
163
163
|
export declare const createMaterializeCtx: <T extends VListItem = VListItem>($: MRefs<T>, deps: MDeps<T>) => BuilderContext<T>;
|
|
164
164
|
export declare const createDefaultDataProxy: <T extends VListItem = VListItem>($: MRefs<T>, deps: Pick<MDeps<T>, "rendered" | "itemState" | "contentSizeHandlers" | "applyTemplate" | "updateContentSize">, ctx: BuilderContext<T>) => any;
|
|
165
|
-
export declare const createDefaultScrollProxy: <T extends VListItem = VListItem>($: MRefs<T>, deps: Pick<MDeps<T>, "dom" | "classPrefix">) => any;
|
|
165
|
+
export declare const createDefaultScrollProxy: <T extends VListItem = VListItem>($: MRefs<T>, deps: Pick<MDeps<T>, "dom" | "classPrefix" | "onScrollFrame">) => any;
|
|
166
166
|
//# sourceMappingURL=materialize.d.ts.map
|
package/dist/builder/types.d.ts
CHANGED
|
@@ -346,6 +346,15 @@ export interface BuilderContext<T extends VListItem = VListItem> {
|
|
|
346
346
|
* native DOM scrollTop (which can't represent compressed scroll space).
|
|
347
347
|
*/
|
|
348
348
|
setScrollFns(getTop: () => number, setTop: (pos: number) => void): void;
|
|
349
|
+
/**
|
|
350
|
+
* Trigger the full scroll pipeline (render, events, afterScroll, velocity
|
|
351
|
+
* tracking, idle scheduling) using the current scroll position from $.sgt().
|
|
352
|
+
*
|
|
353
|
+
* Use this from animation loops (e.g. scale feature's smooth scroll) instead
|
|
354
|
+
* of scrollController.scrollTo() — it avoids the double-render caused by the
|
|
355
|
+
* scrollTo proxy calling $.rfn() after $.sst already triggered onScrollFrame.
|
|
356
|
+
*/
|
|
357
|
+
triggerScrollFrame(): void;
|
|
349
358
|
/**
|
|
350
359
|
* Set the scroll target element (default: viewport).
|
|
351
360
|
* Used by window mode feature to use window instead of viewport for scroll events.
|
|
@@ -67,5 +67,5 @@ export interface GridRenderer<T extends VListItem = VListItem> {
|
|
|
67
67
|
* @param ariaIdPrefix - Optional unique prefix for element IDs (for aria-activedescendant)
|
|
68
68
|
* @param isHorizontal - Whether layout is horizontal (scrolls right)
|
|
69
69
|
*/
|
|
70
|
-
export declare const createGridRenderer: <T extends VListItem = VListItem>(itemsContainer: HTMLElement, template: ItemTemplate<T>, sizeCache: SizeCache, gridLayout: GridLayout, classPrefix: string, initialContainerWidth: number, totalItemsGetter?: () => number, ariaIdPrefix?: string, isHorizontal?: boolean) => GridRenderer<T>;
|
|
70
|
+
export declare const createGridRenderer: <T extends VListItem = VListItem>(itemsContainer: HTMLElement, template: ItemTemplate<T>, sizeCache: SizeCache, gridLayout: GridLayout, classPrefix: string, initialContainerWidth: number, totalItemsGetter?: () => number, ariaIdPrefix?: string, isHorizontal?: boolean, ariaPosInSetGetter?: (layoutIndex: number) => number) => GridRenderer<T>;
|
|
71
71
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -17,5 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import type { GroupLayout, StickyHeader } from "./types";
|
|
19
19
|
import type { SizeCache } from "../../rendering/sizes";
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Create the sticky header container element upfront (before data arrives)
|
|
22
|
+
* so the DOM structure is stable and doesn't cause a visual shift.
|
|
23
|
+
*/
|
|
24
|
+
export declare const createStickyContainer: (root: HTMLElement, classPrefix: string, horizontal: boolean, headerHeight: number, stickyOffset?: number) => HTMLElement;
|
|
25
|
+
export declare const createStickyHeader: (root: HTMLElement, layout: GroupLayout, sizeCache: SizeCache, renderInto: (slot: HTMLElement, groupIndex: number) => void, classPrefix: string, horizontal?: boolean, stickyOffset?: number, getCompressionRatio?: () => number, existingContainer?: HTMLElement) => StickyHeader;
|
|
21
26
|
//# sourceMappingURL=sticky.d.ts.map
|
|
@@ -51,5 +51,5 @@ export interface MasonryRenderer<T extends VListItem = VListItem> {
|
|
|
51
51
|
* @param totalItemsGetter - Optional getter for total item count (for aria-setsize)
|
|
52
52
|
* @param ariaIdPrefix - Optional unique prefix for element IDs (for aria-activedescendant)
|
|
53
53
|
*/
|
|
54
|
-
export declare const createMasonryRenderer: <T extends VListItem = VListItem>(itemsContainer: HTMLElement, template: ItemTemplate<T>, classPrefix: string, isHorizontal?: boolean, totalItemsGetter?: () => number, ariaIdPrefix?: string) => MasonryRenderer<T>;
|
|
54
|
+
export declare const createMasonryRenderer: <T extends VListItem = VListItem>(itemsContainer: HTMLElement, template: ItemTemplate<T>, classPrefix: string, isHorizontal?: boolean, totalItemsGetter?: () => number, ariaIdPrefix?: string, ariaPosInSetGetter?: (layoutIndex: number) => number) => MasonryRenderer<T>;
|
|
55
55
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -89,11 +89,12 @@ export type ScrollCallback = (position: number) => void;
|
|
|
89
89
|
/**
|
|
90
90
|
* Create a scrollbar instance
|
|
91
91
|
*
|
|
92
|
-
* @param viewport - The viewport element
|
|
92
|
+
* @param viewport - The viewport element (used for events and CSS variables)
|
|
93
93
|
* @param onScroll - Callback when scrollbar interaction causes scroll
|
|
94
94
|
* @param config - Scrollbar configuration
|
|
95
95
|
* @param classPrefix - CSS class prefix (default: 'vlist')
|
|
96
96
|
* @param horizontal - Whether the scrollbar is horizontal (default: false)
|
|
97
|
+
* @param parent - Element to append scrollbar DOM to (default: viewport)
|
|
97
98
|
*/
|
|
98
|
-
export declare const createScrollbar: (viewport: HTMLElement, onScroll: ScrollCallback, config?: ScrollbarConfig, classPrefix?: string, horizontal?: boolean) => Scrollbar;
|
|
99
|
+
export declare const createScrollbar: (viewport: HTMLElement, onScroll: ScrollCallback, config?: ScrollbarConfig, classPrefix?: string, horizontal?: boolean, parent?: HTMLElement) => Scrollbar;
|
|
99
100
|
//# sourceMappingURL=scrollbar.d.ts.map
|