vlist 1.9.1 → 2.0.1
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 +104 -97
- package/README.md +46 -33
- package/dist/constants.d.ts +11 -6
- package/dist/core/create.d.ts +10 -0
- package/dist/core/dom.d.ts +8 -0
- package/dist/core/hooks.d.ts +16 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/pipeline.d.ts +51 -0
- package/dist/core/pool.d.ts +9 -0
- package/dist/core/scroll.d.ts +32 -0
- package/dist/core/sizes.d.ts +8 -0
- package/dist/core/state.d.ts +47 -0
- package/dist/core/types.d.ts +187 -0
- package/dist/{builder → core}/velocity.d.ts +1 -1
- package/dist/index.d.ts +28 -19
- package/dist/index.js +1 -1
- package/dist/internals.d.ts +11 -7
- package/dist/internals.js +1 -1
- package/dist/plugins/a11y/index.d.ts +2 -0
- package/dist/plugins/a11y/plugin.d.ts +13 -0
- package/dist/{features → plugins}/async/index.d.ts +1 -1
- package/dist/{features → plugins}/async/manager.d.ts +5 -1
- package/dist/plugins/async/plugin.d.ts +48 -0
- package/dist/plugins/autosize/index.d.ts +5 -0
- package/dist/plugins/autosize/plugin.d.ts +19 -0
- package/dist/plugins/grid/index.d.ts +7 -0
- package/dist/plugins/grid/plugin.d.ts +23 -0
- package/dist/{features → plugins}/groups/index.d.ts +1 -1
- package/dist/plugins/groups/plugin.d.ts +22 -0
- package/dist/plugins/masonry/index.d.ts +8 -0
- package/dist/plugins/masonry/plugin.d.ts +32 -0
- package/dist/plugins/page/index.d.ts +5 -0
- package/dist/plugins/page/plugin.d.ts +21 -0
- package/dist/plugins/scale/index.d.ts +5 -0
- package/dist/plugins/scale/plugin.d.ts +24 -0
- package/dist/plugins/scrollbar/index.d.ts +7 -0
- package/dist/plugins/scrollbar/plugin.d.ts +20 -0
- package/dist/plugins/selection/index.d.ts +6 -0
- package/dist/plugins/selection/plugin.d.ts +16 -0
- package/dist/{features → plugins}/selection/state.d.ts +8 -0
- package/dist/plugins/snapshots/index.d.ts +5 -0
- package/dist/plugins/snapshots/plugin.d.ts +17 -0
- package/dist/plugins/sortable/index.d.ts +6 -0
- package/dist/plugins/sortable/plugin.d.ts +34 -0
- package/dist/{features → plugins}/table/index.d.ts +1 -1
- package/dist/plugins/table/plugin.d.ts +20 -0
- package/dist/plugins/transition/index.d.ts +5 -0
- package/dist/plugins/transition/plugin.d.ts +22 -0
- package/dist/size.json +1 -1
- package/dist/utils/padding.d.ts +2 -4
- package/dist/vlist-grid.css +1 -1
- package/dist/vlist-masonry.css +1 -1
- package/dist/vlist-table.css +1 -1
- package/dist/vlist.css +1 -1
- package/package.json +9 -4
- package/dist/builder/a11y.d.ts +0 -16
- package/dist/builder/api.d.ts +0 -21
- package/dist/builder/context.d.ts +0 -36
- package/dist/builder/core.d.ts +0 -16
- package/dist/builder/data.d.ts +0 -71
- package/dist/builder/dom.d.ts +0 -15
- package/dist/builder/index.d.ts +0 -25
- package/dist/builder/materialize.d.ts +0 -166
- package/dist/builder/pool.d.ts +0 -10
- package/dist/builder/range.d.ts +0 -10
- package/dist/builder/scroll.d.ts +0 -24
- package/dist/builder/types.d.ts +0 -512
- package/dist/features/async/feature.d.ts +0 -72
- package/dist/features/autosize/feature.d.ts +0 -34
- package/dist/features/autosize/index.d.ts +0 -2
- package/dist/features/grid/feature.d.ts +0 -48
- package/dist/features/grid/index.d.ts +0 -9
- package/dist/features/groups/feature.d.ts +0 -75
- package/dist/features/masonry/feature.d.ts +0 -45
- package/dist/features/masonry/index.d.ts +0 -9
- package/dist/features/page/feature.d.ts +0 -109
- package/dist/features/page/index.d.ts +0 -9
- package/dist/features/scale/feature.d.ts +0 -42
- package/dist/features/scale/index.d.ts +0 -10
- package/dist/features/scrollbar/feature.d.ts +0 -81
- package/dist/features/scrollbar/index.d.ts +0 -8
- package/dist/features/selection/feature.d.ts +0 -91
- package/dist/features/selection/index.d.ts +0 -7
- package/dist/features/snapshots/feature.d.ts +0 -79
- package/dist/features/snapshots/index.d.ts +0 -9
- package/dist/features/sortable/feature.d.ts +0 -101
- package/dist/features/sortable/index.d.ts +0 -6
- package/dist/features/table/feature.d.ts +0 -67
- package/dist/features/transition/feature.d.ts +0 -30
- package/dist/features/transition/index.d.ts +0 -9
- /package/dist/{features → plugins}/async/placeholder.d.ts +0 -0
- /package/dist/{features → plugins}/async/sparse.d.ts +0 -0
- /package/dist/{features → plugins}/grid/layout.d.ts +0 -0
- /package/dist/{features → plugins}/grid/renderer.d.ts +0 -0
- /package/dist/{features → plugins}/grid/types.d.ts +0 -0
- /package/dist/{features → plugins}/groups/async-bridge.d.ts +0 -0
- /package/dist/{features → plugins}/groups/layout.d.ts +0 -0
- /package/dist/{features → plugins}/groups/sticky.d.ts +0 -0
- /package/dist/{features → plugins}/groups/types.d.ts +0 -0
- /package/dist/{features → plugins}/masonry/layout.d.ts +0 -0
- /package/dist/{features → plugins}/masonry/renderer.d.ts +0 -0
- /package/dist/{features → plugins}/masonry/types.d.ts +0 -0
- /package/dist/{features → plugins}/scrollbar/controller.d.ts +0 -0
- /package/dist/{features → plugins}/scrollbar/scrollbar.d.ts +0 -0
- /package/dist/{features → plugins}/table/header.d.ts +0 -0
- /package/dist/{features → plugins}/table/layout.d.ts +0 -0
- /package/dist/{features → plugins}/table/renderer.d.ts +0 -0
- /package/dist/{features → plugins}/table/types.d.ts +0 -0
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vlist/builder — Materialize Context Factory
|
|
3
|
-
*
|
|
4
|
-
* Extracts the BuilderContext object, default data-manager proxy, and default
|
|
5
|
-
* scroll-controller proxy out of materialize() in core.ts.
|
|
6
|
-
*
|
|
7
|
-
* All shared mutable state lives in a single `$` (MRefs) object that both
|
|
8
|
-
* core.ts and this module read/write through. Property names are kept short
|
|
9
|
-
* (2–3 chars) so they survive minification without bloating the bundle.
|
|
10
|
-
* Each factory destructures to readable locals on entry.
|
|
11
|
-
*
|
|
12
|
-
* Immutable dependencies are passed via a `deps` (MDeps) object — these are
|
|
13
|
-
* destructured once and never re-read, so their names don't matter at runtime.
|
|
14
|
-
*/
|
|
15
|
-
import type { VListItem, VListEvents, ItemTemplate, ItemState, Range } from "../types";
|
|
16
|
-
import type { SizeCache } from "../rendering/sizes";
|
|
17
|
-
import type { Emitter } from "../events/emitter";
|
|
18
|
-
import type { DOMStructure } from "./dom";
|
|
19
|
-
import type { createElementPool } from "./pool";
|
|
20
|
-
import type { BuilderConfig, BuilderContext, BuilderState, ResolvedBuilderConfig } from "./types";
|
|
21
|
-
/**
|
|
22
|
-
* Mutable refs object shared between core.ts materialize() and context factories.
|
|
23
|
-
*
|
|
24
|
-
* Key mapping (short → long):
|
|
25
|
-
*
|
|
26
|
-
* | Key | Meaning |
|
|
27
|
-
* |------|------------------------|
|
|
28
|
-
* | it | items |
|
|
29
|
-
* | hc | sizeCache |
|
|
30
|
-
* | ch | containerHeight |
|
|
31
|
-
* | cw | containerWidth |
|
|
32
|
-
* | id | isDestroyed |
|
|
33
|
-
* | ii | isInitialized |
|
|
34
|
-
* | ls | lastScrollTop |
|
|
35
|
-
* | vt | velocityTracker |
|
|
36
|
-
* | ss | selectionSet |
|
|
37
|
-
* | fi | focusedIndex |
|
|
38
|
-
* | la | lastAriaSetSize |
|
|
39
|
-
* | dm | dataManagerProxy |
|
|
40
|
-
* | sc | scrollControllerProxy |
|
|
41
|
-
* | vtf | virtualTotalFn |
|
|
42
|
-
* | sgt | scrollGetTop |
|
|
43
|
-
* | sst | scrollSetTop |
|
|
44
|
-
* | sab | scrollIsAtBottom |
|
|
45
|
-
* | sic | scrollIsCompressed |
|
|
46
|
-
* | rfn | renderIfNeededFn |
|
|
47
|
-
* | ffn | forceRenderFn |
|
|
48
|
-
* | gvr | getVisibleRange |
|
|
49
|
-
* | gsp | getScrollToPos |
|
|
50
|
-
* | pef | positionElementFn |
|
|
51
|
-
* | at | activeTemplate |
|
|
52
|
-
* | vre | viewportResizeEnabled |
|
|
53
|
-
* | st | scrollTarget |
|
|
54
|
-
* | gcw | getContainerWidth |
|
|
55
|
-
* | gch | getContainerHeight |
|
|
56
|
-
*/
|
|
57
|
-
export interface MRefs<T extends VListItem = VListItem> {
|
|
58
|
-
/** items */
|
|
59
|
-
it: T[];
|
|
60
|
-
/** sizeCache */
|
|
61
|
-
hc: SizeCache;
|
|
62
|
-
/** containerHeight */
|
|
63
|
-
ch: number;
|
|
64
|
-
/** containerWidth */
|
|
65
|
-
cw: number;
|
|
66
|
-
/** isDestroyed */
|
|
67
|
-
id: boolean;
|
|
68
|
-
/** isInitialized */
|
|
69
|
-
ii: boolean;
|
|
70
|
-
/** lastScrollTop */
|
|
71
|
-
ls: number;
|
|
72
|
-
/** velocityTracker */
|
|
73
|
-
vt: {
|
|
74
|
-
velocity: number;
|
|
75
|
-
sampleCount: number;
|
|
76
|
-
};
|
|
77
|
-
/** selectionSet */
|
|
78
|
-
ss: Set<string | number>;
|
|
79
|
-
/** focusedIndex */
|
|
80
|
-
fi: number;
|
|
81
|
-
/** lastAriaSetSize */
|
|
82
|
-
la: string;
|
|
83
|
-
/** dataManagerProxy */
|
|
84
|
-
dm: any;
|
|
85
|
-
/** scrollControllerProxy */
|
|
86
|
-
sc: any;
|
|
87
|
-
/** virtualTotalFn */
|
|
88
|
-
vtf: () => number;
|
|
89
|
-
/** scrollGetTop */
|
|
90
|
-
sgt: () => number;
|
|
91
|
-
/** scrollSetTop */
|
|
92
|
-
sst: (pos: number) => void;
|
|
93
|
-
/** scrollIsAtBottom */
|
|
94
|
-
sab: (threshold?: number) => boolean;
|
|
95
|
-
/** scrollIsCompressed */
|
|
96
|
-
sic: boolean;
|
|
97
|
-
/** renderIfNeededFn */
|
|
98
|
-
rfn: () => void;
|
|
99
|
-
/** forceRenderFn */
|
|
100
|
-
ffn: () => void;
|
|
101
|
-
/** getVisibleRange */
|
|
102
|
-
gvr: (scrollTop: number, cHeight: number, hc: SizeCache, total: number, out: Range) => void;
|
|
103
|
-
/** getScrollToPos */
|
|
104
|
-
gsp: (index: number, hc: SizeCache, cHeight: number, total: number, align: "start" | "center" | "end") => number;
|
|
105
|
-
/** positionElementFn */
|
|
106
|
-
pef: (element: HTMLElement, index: number) => void;
|
|
107
|
-
/** activeTemplate */
|
|
108
|
-
at: ItemTemplate<T>;
|
|
109
|
-
/** viewportResizeEnabled */
|
|
110
|
-
vre: boolean;
|
|
111
|
-
/** scrollTarget */
|
|
112
|
-
st: HTMLElement | Window;
|
|
113
|
-
/** wheelHandler - for features to disable wheel handling if needed */
|
|
114
|
-
wh: ((e: WheelEvent) => void) | null;
|
|
115
|
-
/** getContainerWidth */
|
|
116
|
-
gcw: () => number;
|
|
117
|
-
/** getContainerHeight */
|
|
118
|
-
gch: () => number;
|
|
119
|
-
/** gap — item spacing along main axis (0 = none) */
|
|
120
|
-
gp: number;
|
|
121
|
-
/** mainAxisPadding — sum of CSS padding along scroll axis (0 = none) */
|
|
122
|
-
mp: number;
|
|
123
|
-
/** stripeIndexFn — maps layout index to stripe index (-1 = skip) */
|
|
124
|
-
sif: (index: number) => number;
|
|
125
|
-
/** itemToScrollIndex — maps flat item index to size-cache index (identity for list, floor(index/cols) for grid) */
|
|
126
|
-
i2s: (index: number) => number;
|
|
127
|
-
/** updateItemClassesFn */
|
|
128
|
-
uic: (index: number, isSelected: boolean, isFocused: boolean) => void;
|
|
129
|
-
/** constrainSizeForIndex — null = always constrain (Mode A default) */
|
|
130
|
-
csi: ((index: number) => boolean) | null;
|
|
131
|
-
}
|
|
132
|
-
/** Immutable dependencies the context factory needs from materialize(). */
|
|
133
|
-
export interface MDeps<T extends VListItem = VListItem> {
|
|
134
|
-
readonly dom: DOMStructure;
|
|
135
|
-
readonly emitter: Emitter<VListEvents<T>>;
|
|
136
|
-
readonly resolvedConfig: ResolvedBuilderConfig;
|
|
137
|
-
readonly rawConfig: BuilderConfig<T>;
|
|
138
|
-
readonly rendered: Map<number, HTMLElement>;
|
|
139
|
-
readonly pool: ReturnType<typeof createElementPool>;
|
|
140
|
-
readonly itemState: ItemState;
|
|
141
|
-
readonly sharedState: BuilderState;
|
|
142
|
-
readonly renderRange: Range;
|
|
143
|
-
readonly isHorizontal: boolean;
|
|
144
|
-
readonly classPrefix: string;
|
|
145
|
-
readonly contentSizeHandlers: Array<() => void>;
|
|
146
|
-
readonly idleHandlers: Array<() => void>;
|
|
147
|
-
readonly afterScroll: Array<(scrollPosition: number, direction: string) => void>;
|
|
148
|
-
readonly clickHandlers: Array<(event: MouseEvent) => void>;
|
|
149
|
-
readonly contextMenuHandlers: Array<(event: MouseEvent) => void>;
|
|
150
|
-
readonly keydownHandlers: Array<(event: KeyboardEvent) => void>;
|
|
151
|
-
readonly resizeHandlers: Array<(width: number, height: number) => void>;
|
|
152
|
-
readonly destroyHandlers: Array<() => void>;
|
|
153
|
-
readonly methods: Map<string, Function>;
|
|
154
|
-
readonly onScrollFrame: () => void;
|
|
155
|
-
readonly resizeObserver: ResizeObserver;
|
|
156
|
-
readonly afterRenderBatch: ReadonlyArray<(items: ReadonlyArray<{
|
|
157
|
-
index: number;
|
|
158
|
-
element: HTMLElement;
|
|
159
|
-
}>) => void>;
|
|
160
|
-
readonly applyTemplate: (element: HTMLElement, result: string | HTMLElement) => void;
|
|
161
|
-
readonly updateContentSize: () => void;
|
|
162
|
-
}
|
|
163
|
-
export declare const createMaterializeCtx: <T extends VListItem = VListItem>($: MRefs<T>, deps: MDeps<T>) => BuilderContext<T>;
|
|
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" | "onScrollFrame">) => any;
|
|
166
|
-
//# sourceMappingURL=materialize.d.ts.map
|
package/dist/builder/pool.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vlist/builder — Element Pool
|
|
3
|
-
* Recycling pool for DOM elements to reduce allocation during scrolling.
|
|
4
|
-
*/
|
|
5
|
-
export declare const createElementPool: (maxSize?: number) => {
|
|
6
|
-
acquire: () => HTMLElement;
|
|
7
|
-
release: (el: HTMLElement) => void;
|
|
8
|
-
clear: () => void;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=pool.d.ts.map
|
package/dist/builder/range.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vlist/builder — Range Calculations
|
|
3
|
-
* Visible range detection, overscan application, and scroll-to-index positioning.
|
|
4
|
-
*/
|
|
5
|
-
import type { Range } from "../types";
|
|
6
|
-
import type { SizeCache } from "../rendering/sizes";
|
|
7
|
-
export declare const calcVisibleRange: (scrollPosition: number, containerHeight: number, hc: SizeCache, totalItems: number, out: Range) => void;
|
|
8
|
-
export declare const applyOverscan: (visible: Range, overscan: number, totalItems: number, out: Range) => void;
|
|
9
|
-
export declare const calcScrollToPosition: (index: number, hc: SizeCache, containerHeight: number, totalItems: number, align: "start" | "center" | "end", mainAxisPadding?: number) => number;
|
|
10
|
-
//# sourceMappingURL=range.d.ts.map
|
package/dist/builder/scroll.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vlist/builder — Scroll Utilities
|
|
3
|
-
* Easing, scroll-argument resolution, and smooth scroll animation.
|
|
4
|
-
*/
|
|
5
|
-
import type { ScrollToOptions } from "../types";
|
|
6
|
-
export declare const easeInOutQuad: (t: number) => number;
|
|
7
|
-
export declare const resolveScrollArgs: (o?: "start" | "center" | "end" | ScrollToOptions) => {
|
|
8
|
-
align: "start" | "center" | "end";
|
|
9
|
-
behavior: "auto" | "smooth";
|
|
10
|
-
duration: number;
|
|
11
|
-
};
|
|
12
|
-
/** Scroll controller interface — minimal surface needed by the animation. */
|
|
13
|
-
export interface ScrollController {
|
|
14
|
-
scrollTo: (position: number) => void;
|
|
15
|
-
getScrollTop: () => number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Create a smooth scroll animator with its own animation state.
|
|
19
|
-
*/
|
|
20
|
-
export declare const createSmoothScroll: (scrollController: ScrollController, renderFn: () => void) => {
|
|
21
|
-
animateScroll: (from: number, to: number, duration: number) => void;
|
|
22
|
-
cancelScroll: () => void;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=scroll.d.ts.map
|