@sectile/vue 0.15.1 → 0.16.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.
- package/README.md +5 -5
- package/dist/internal/virtual-collection.d.ts +45 -24
- package/dist/internal/virtual-collection.js +1 -1
- package/dist/internal/virtual-collection.js.map +1 -1
- package/dist/internal/virtual-core.d.ts +109 -34
- package/dist/internal/virtual-core.js +1 -1
- package/dist/internal/virtual-core.js.map +1 -1
- package/dist/internal/virtual-list.d.ts +58 -85
- package/dist/internal/virtual-list.js +1 -1
- package/dist/internal/virtual-list.js.map +1 -1
- package/dist/virtual-core.d.ts +1 -1
- package/dist/virtual-core.js +1 -1
- package/dist/virtual-core.js.map +1 -1
- package/dist/virtual-grid.d.ts +50 -75
- package/dist/virtual-grid.js +1 -1
- package/dist/virtual-grid.js.map +1 -1
- package/dist/virtual-list.d.ts +2 -1
- package/dist/virtual-list.js.map +1 -1
- package/dist/virtual-masonry.d.ts +51 -76
- package/dist/virtual-masonry.js +1 -1
- package/dist/virtual-masonry.js.map +1 -1
- package/dist/virtual-spatial.d.ts +44 -32
- package/dist/virtual-spatial.js +1 -1
- package/dist/virtual-spatial.js.map +1 -1
- package/package.json +6 -6
- package/dist/internal/virtual-collection-model.d.ts +0 -46
- package/dist/internal/virtual-collection-model.js +0 -2
- package/dist/internal/virtual-collection-model.js.map +0 -1
|
@@ -1,82 +1,47 @@
|
|
|
1
|
-
import { type AllowedComponentProps, type ComponentCustomProps, type PropType, type
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import { type
|
|
5
|
-
import { type
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly estimateSize?: VirtualListEstimate<Value>;
|
|
1
|
+
import { type AllowedComponentProps, type ComponentCustomProps, type PropType, type SlotsType, type VNodeArrayChildren, type VNodeChild, type VNodeProps } from 'vue';
|
|
2
|
+
import type { StableID } from '@sectile/core';
|
|
3
|
+
import { type VirtualSizePolicy } from '@sectile/virtual/collection';
|
|
4
|
+
import { type LinearAxis, type LinearLayoutState, type LinearMeasurement } from '@sectile/virtual/linear-layout';
|
|
5
|
+
import { type VirtualInsets, type VirtualLayoutPlan, type VirtualMeasurementResolver, type VirtualRect, type VirtualizerErrorHandler } from '@sectile/dom/virtual';
|
|
6
|
+
import { type PreparedVirtualCollection, type VirtualCollectionBaseProps, type VirtualCollectionExpose, type VirtualCollectionIDResolver, type VirtualCollectionItemAttributes, type VirtualCollectionItemSlotProps } from './virtual-collection.js';
|
|
7
|
+
export type VirtualListItemAttributes<Value> = VirtualCollectionItemAttributes<Value>;
|
|
8
|
+
export type VirtualListIDResolver<Value, ID extends StableID = StableID> = VirtualCollectionIDResolver<Value, ID>;
|
|
9
|
+
export interface VirtualListProps<Value = unknown, ID extends StableID = StableID> extends VirtualCollectionBaseProps<Value, ID> {
|
|
10
|
+
readonly sizePolicy: VirtualSizePolicy<Value>;
|
|
12
11
|
readonly axis?: LinearAxis;
|
|
13
12
|
readonly gap?: number;
|
|
14
|
-
readonly overscan?: number | Partial<VirtualInsets>;
|
|
15
|
-
readonly maxItems?: number;
|
|
16
|
-
readonly initialViewport?: VirtualRect;
|
|
17
|
-
readonly as?: string;
|
|
18
|
-
readonly contentAs?: string;
|
|
19
|
-
readonly itemAs?: string;
|
|
20
|
-
readonly itemAttributes?: VirtualListItemAttributes<Value>;
|
|
21
13
|
}
|
|
22
|
-
export type VirtualListPublicProps<Value = unknown> = VirtualListProps<Value> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
23
|
-
readonly onStateChange?: (state: LinearLayoutState<
|
|
24
|
-
readonly onPlanChange?: (plan: VirtualLayoutPlan<
|
|
14
|
+
export type VirtualListPublicProps<Value = unknown, ID extends StableID = StableID> = VirtualListProps<Value, ID> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
15
|
+
readonly onStateChange?: (state: LinearLayoutState<ID>) => unknown;
|
|
16
|
+
readonly onPlanChange?: (plan: VirtualLayoutPlan<ID>) => unknown;
|
|
25
17
|
readonly onError?: VirtualizerErrorHandler;
|
|
26
18
|
};
|
|
27
|
-
export interface VirtualListSlotProps<Value = unknown> {
|
|
28
|
-
readonly value: Value;
|
|
29
|
-
readonly key: string;
|
|
30
|
-
readonly index: number;
|
|
31
|
-
readonly placement: VirtualPlacement<string>;
|
|
32
|
-
}
|
|
33
|
-
export interface VirtualListExpose {
|
|
34
|
-
readonly root: ShallowRef<HTMLElement | null | undefined>;
|
|
35
|
-
readonly state: LinearLayoutState<string>;
|
|
36
|
-
readonly plan: VirtualLayoutPlan<string> | null;
|
|
37
|
-
scrollTo(id: string, alignment?: VirtualScrollAlignment): ReturnType<VirtualizerConnection<LinearLayoutState<string>, string, {
|
|
38
|
-
readonly index: number;
|
|
39
|
-
readonly extent: Extent;
|
|
40
|
-
}, LinearPatch<string>>['scrollTo']>;
|
|
41
|
-
refresh(): void;
|
|
42
|
-
flush(): ReturnType<VirtualizerConnection<LinearLayoutState<string>, string, {
|
|
43
|
-
readonly index: number;
|
|
44
|
-
readonly extent: Extent;
|
|
45
|
-
}, LinearPatch<string>>['flush']>;
|
|
19
|
+
export interface VirtualListSlotProps<Value = unknown, ID extends StableID = StableID> extends VirtualCollectionItemSlotProps<Value, ID> {
|
|
46
20
|
}
|
|
21
|
+
export type VirtualListExpose<ID extends StableID = StableID> = VirtualCollectionExpose<LinearLayoutState<ID>, ID>;
|
|
47
22
|
export interface VirtualListComponent {
|
|
48
|
-
new <Value = unknown>(props: VirtualListPublicProps<Value>): {
|
|
49
|
-
$props: VirtualListPublicProps<Value>;
|
|
23
|
+
new <Value = unknown, ID extends StableID = StableID>(props: VirtualListPublicProps<Value, ID>): {
|
|
24
|
+
$props: VirtualListPublicProps<Value, ID>;
|
|
50
25
|
$slots: {
|
|
51
|
-
|
|
26
|
+
header?: () => VNodeChild;
|
|
27
|
+
item?: (props: VirtualListSlotProps<Value, ID>) => VNodeChild;
|
|
52
28
|
empty?: () => VNodeChild;
|
|
29
|
+
footer?: () => VNodeChild;
|
|
53
30
|
};
|
|
54
31
|
};
|
|
55
32
|
}
|
|
56
|
-
export interface VirtualCollectionExpose<State> {
|
|
57
|
-
readonly root: ShallowRef<HTMLElement | null | undefined>;
|
|
58
|
-
readonly state: State;
|
|
59
|
-
readonly plan: VirtualLayoutPlan<string> | null;
|
|
60
|
-
scrollTo(id: string, alignment?: VirtualScrollAlignment): ReturnType<VirtualizerConnection<object, string, unknown, unknown>['scrollTo']> | undefined;
|
|
61
|
-
refresh(): void;
|
|
62
|
-
flush(): ReturnType<VirtualizerConnection<object, string, unknown, unknown>['flush']> | undefined;
|
|
63
|
-
}
|
|
64
33
|
declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
65
34
|
items: {
|
|
66
35
|
type: PropType<readonly unknown[]>;
|
|
67
36
|
required: true;
|
|
68
37
|
};
|
|
69
|
-
|
|
70
|
-
type: PropType<
|
|
38
|
+
getID: {
|
|
39
|
+
type: PropType<VirtualListIDResolver<unknown>>;
|
|
71
40
|
required: true;
|
|
72
41
|
};
|
|
73
|
-
|
|
74
|
-
type: PropType<
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
itemSize: {
|
|
78
|
-
type: NumberConstructor;
|
|
79
|
-
default: undefined;
|
|
42
|
+
sizePolicy: {
|
|
43
|
+
type: PropType<VirtualSizePolicy<unknown>>;
|
|
44
|
+
required: true;
|
|
80
45
|
};
|
|
81
46
|
axis: {
|
|
82
47
|
type: PropType<LinearAxis>;
|
|
@@ -90,6 +55,10 @@ declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
90
55
|
type: PropType<number | Partial<VirtualInsets>>;
|
|
91
56
|
default: number;
|
|
92
57
|
};
|
|
58
|
+
viewportInsets: {
|
|
59
|
+
type: PropType<number | Partial<VirtualInsets>>;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
93
62
|
maxItems: {
|
|
94
63
|
type: NumberConstructor;
|
|
95
64
|
default: number;
|
|
@@ -115,25 +84,21 @@ declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
115
84
|
default: undefined;
|
|
116
85
|
};
|
|
117
86
|
}>, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
118
|
-
stateChange: (_state: LinearLayoutState<
|
|
119
|
-
planChange: (_plan: VirtualLayoutPlan<
|
|
87
|
+
stateChange: (_state: LinearLayoutState<StableID>) => boolean;
|
|
88
|
+
planChange: (_plan: VirtualLayoutPlan<StableID>) => boolean;
|
|
120
89
|
error: (_error: Parameters<VirtualizerErrorHandler>[0]) => boolean;
|
|
121
90
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
122
91
|
items: {
|
|
123
92
|
type: PropType<readonly unknown[]>;
|
|
124
93
|
required: true;
|
|
125
94
|
};
|
|
126
|
-
|
|
127
|
-
type: PropType<
|
|
95
|
+
getID: {
|
|
96
|
+
type: PropType<VirtualListIDResolver<unknown>>;
|
|
128
97
|
required: true;
|
|
129
98
|
};
|
|
130
|
-
|
|
131
|
-
type: PropType<
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
itemSize: {
|
|
135
|
-
type: NumberConstructor;
|
|
136
|
-
default: undefined;
|
|
99
|
+
sizePolicy: {
|
|
100
|
+
type: PropType<VirtualSizePolicy<unknown>>;
|
|
101
|
+
required: true;
|
|
137
102
|
};
|
|
138
103
|
axis: {
|
|
139
104
|
type: PropType<LinearAxis>;
|
|
@@ -147,6 +112,10 @@ declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
147
112
|
type: PropType<number | Partial<VirtualInsets>>;
|
|
148
113
|
default: number;
|
|
149
114
|
};
|
|
115
|
+
viewportInsets: {
|
|
116
|
+
type: PropType<number | Partial<VirtualInsets>>;
|
|
117
|
+
default: undefined;
|
|
118
|
+
};
|
|
150
119
|
maxItems: {
|
|
151
120
|
type: NumberConstructor;
|
|
152
121
|
default: number;
|
|
@@ -172,15 +141,14 @@ declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
172
141
|
default: undefined;
|
|
173
142
|
};
|
|
174
143
|
}>> & Readonly<{
|
|
175
|
-
onError?: (_error: import("@sectile/core
|
|
176
|
-
onPlanChange?: (_plan: VirtualLayoutPlan<
|
|
177
|
-
onStateChange?: (_state: LinearLayoutState<
|
|
144
|
+
onError?: (_error: import("@sectile/core").SectileError<import("@sectile/virtual").VirtualErrorCode>) => any;
|
|
145
|
+
onPlanChange?: (_plan: VirtualLayoutPlan<StableID>) => any;
|
|
146
|
+
onStateChange?: (_state: LinearLayoutState<StableID>) => any;
|
|
178
147
|
}>, {
|
|
179
|
-
estimateSize: VirtualListEstimate<unknown>;
|
|
180
|
-
itemSize: number;
|
|
181
148
|
axis: LinearAxis;
|
|
182
149
|
gap: number;
|
|
183
150
|
overscan: number | Partial<import("@sectile/core/geometry").Insets>;
|
|
151
|
+
viewportInsets: number | Partial<import("@sectile/core/geometry").Insets>;
|
|
184
152
|
maxItems: number;
|
|
185
153
|
initialViewport: import("@sectile/core/geometry").Rect;
|
|
186
154
|
as: string;
|
|
@@ -188,27 +156,32 @@ declare const VirtualListRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
188
156
|
itemAs: string;
|
|
189
157
|
itemAttributes: VirtualListItemAttributes<unknown>;
|
|
190
158
|
}, SlotsType<{
|
|
191
|
-
|
|
159
|
+
header: () => VNodeChild;
|
|
160
|
+
item: (props: VirtualListSlotProps<unknown>) => VNodeChild;
|
|
192
161
|
empty: () => VNodeChild;
|
|
162
|
+
footer: () => VNodeChild;
|
|
193
163
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
194
164
|
export declare const VirtualList: typeof VirtualListRuntime & VirtualListComponent;
|
|
195
|
-
export declare function createVirtualListMeasurementResolver(axis: LinearAxis): VirtualMeasurementResolver<LinearLayoutState<
|
|
196
|
-
export declare function createVirtualListState(prepared:
|
|
197
|
-
|
|
198
|
-
estimateSize: VirtualListEstimate<unknown> | undefined;
|
|
165
|
+
export declare function createVirtualListMeasurementResolver(axis: LinearAxis): VirtualMeasurementResolver<LinearLayoutState<StableID>, StableID, LinearMeasurement>;
|
|
166
|
+
export declare function createVirtualListState(prepared: PreparedVirtualCollection<unknown, StableID>, items: readonly unknown[], props: Readonly<{
|
|
167
|
+
sizePolicy: VirtualSizePolicy<unknown>;
|
|
199
168
|
axis: LinearAxis;
|
|
200
169
|
gap: number;
|
|
201
170
|
maxItems: number;
|
|
202
|
-
|
|
171
|
+
crossExtent: number;
|
|
172
|
+
}>, automaticEstimate?: number): LinearLayoutState<StableID>;
|
|
203
173
|
export declare function createEmptyVirtualListState(props: Readonly<{
|
|
204
174
|
axis: LinearAxis;
|
|
205
175
|
gap: number;
|
|
206
176
|
maxItems: number;
|
|
207
|
-
|
|
177
|
+
crossExtent: number;
|
|
178
|
+
}>): LinearLayoutState<StableID>;
|
|
208
179
|
export declare function bootstrapTrailingOverscanExtent(overscan: number | Partial<VirtualInsets>, axis: LinearAxis): number;
|
|
209
|
-
export declare function renderVirtualListBootstrapItems(prepared:
|
|
180
|
+
export declare function renderVirtualListBootstrapItems(prepared: PreparedVirtualCollection<unknown, StableID>, items: readonly unknown[], count: number, props: Readonly<{
|
|
210
181
|
axis: LinearAxis;
|
|
211
182
|
gap: number;
|
|
183
|
+
crossExtent: number;
|
|
212
184
|
itemAs: string;
|
|
213
185
|
itemAttributes: VirtualListItemAttributes<unknown> | undefined;
|
|
214
|
-
}>, render: ((props: VirtualListSlotProps<unknown>) => VNodeChild) | undefined, itemRef: (index: number
|
|
186
|
+
}>, render: ((props: VirtualListSlotProps<unknown, StableID>) => VNodeChild) | undefined, itemRef: (index: number) => (value: unknown) => void): VNodeArrayChildren;
|
|
187
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent,h,nextTick,onBeforeUnmount,onMounted,shallowRef,watch}from'vue';import{createSequence}from'@sectile/core/sequence';import{createExtentIndex,createUniformExtentIndex}from'@sectile/virtual/extent-index';import{linearLayoutStrategyFor,tryApplyLinearPatch,createLinearLayout}from'@sectile/virtual/linear-layout';import{createAxisMeasurementResolver,virtualItemStyle}from'@sectile/dom/virtual';import{Primitive}from'../primitive.js';import{VirtualizerContent,VirtualizerRoot,useVirtualizer}from'./virtual-core.js';import{assertVirtualListSizeMode,createPreparedVirtualListSequence,estimatedExtent,exactExtent,prepareVirtualList,reconcileVirtualList,requireAutomaticEstimate,requiresDOMBootstrap,updatePreparedVirtualList}from'./virtual-collection-model.js';const VirtualListRuntime=/* @__PURE__ */defineComponent({name:'SectileVirtualList',inheritAttrs:false,props:{items:{type:Array,required:true},getKey:{type:Function,required:true},estimateSize:{type:[Number,Function],default:undefined},itemSize:{type:Number,default:undefined},axis:{type:String,default:'vertical'},gap:{type:Number,default:0},overscan:{type:[Number,Object],default:240},maxItems:{type:Number,default:1_000_000},initialViewport:{type:Object,default:undefined},as:{type:String,default:'div'},contentAs:{type:String,default:'div'},itemAs:{type:String,default:'div'},itemAttributes:{type:Function,default:undefined}},emits:{stateChange:_state=>true,planChange:_plan=>true,error:_error=>true},slots:Object,setup(props,{attrs,emit,expose,slots}){assertVirtualListSizeMode(props.itemSize,props.estimateSize);const prepared=shallowRef(prepareVirtualList(props.items,props.getKey,props.maxItems));const automaticEstimate=shallowRef();const bootstrapCount=shallowRef(requiresDOMBootstrap(props.itemSize,props.estimateSize)&&prepared.value.domain.size>0?1:0);const bootstrapElements=new Map;let bootstrapScheduled=false;let disposed=false;const state=shallowRef(requiresDOMBootstrap(props.itemSize,props.estimateSize)?createEmptyVirtualListState(props):createVirtualListState(prepared.value,props.items,props));const measure=props.itemSize===undefined?createVirtualListMeasurementResolver(props.axis):undefined;const virtualizer=useVirtualizer({state,strategy:linearLayoutStrategyFor(),overscan:()=>props.overscan,...props.initialViewport===undefined?{}:{initialViewport:props.initialViewport},...measure===undefined?{}:{measure},onStateChange:value=>{emit('stateChange',value)},onPlanChange:value=>{emit('planChange',value)},onError:error=>{emit('error',error)}});const registrations=new Map;const elements=new Map;const itemRefs=new Map;const pendingMeasurements=new Set;const forcedMeasurements=new Set;let measurementScheduled=false;const setRootElement=value=>{virtualizer.root.value=value instanceof HTMLElement?value:null};const measurePendingItems=()=>{measurementScheduled=false;if(disposed||pendingMeasurements.size===0)return;const connection=virtualizer.connection.value;if(connection===undefined)return;const queued=Array.from(pendingMeasurements);pendingMeasurements.clear();const measurements=[];for(const id of queued){const element=elements.get(id);const index=state.value.domain.indexOf(id);if(element===undefined||index===null)continue;const current=state.value.extents.extentAt(index);if(current?.kind==='exact'&&!forcedMeasurements.has(id))continue;const measurement=measureVirtualListElement(props.axis,id,element,state.value);if(measurement!==null)measurements.push(measurement)}for(const id of queued)forcedMeasurements.delete(id);if(measurements.length>0)connection.measure(measurements)};const scheduleItemMeasurement=(id,force=false)=>{if(props.itemSize!==undefined)return;pendingMeasurements.add(id);if(force)forcedMeasurements.add(id);if(measurementScheduled)return;measurementScheduled=true;void nextTick(measurePendingItems)};const scheduleChangedRenderedItemMeasurements=(previousPrepared,previousState,nextPrepared,nextState)=>{if(props.itemSize!==undefined)return;for(const id of elements.keys()){const previousIndex=previousState.domain.indexOf(id);const nextIndex=nextState.domain.indexOf(id);if(previousIndex!==null&&nextIndex!==null&&!Object.is(previousPrepared.items[previousIndex],nextPrepared.items[nextIndex]))scheduleItemMeasurement(id,true)}};const itemRef=id=>{const existing=itemRefs.get(id);if(existing!==undefined)return existing;const callback=value=>{const element=value instanceof HTMLElement?value:null;if(element!==null&&elements.get(id)===element)return;registrations.get(id)?.();registrations.delete(id);elements.delete(id);if(element!==null){elements.set(id,element);registrations.set(id,virtualizer.registerItem(element,id));scheduleItemMeasurement(id)}};itemRefs.set(id,callback);return callback};const bootstrapItemRef=(index,value)=>{const element=value instanceof HTMLElement?value:null;if(element===null)bootstrapElements.delete(index);else{bootstrapElements.set(index,element);scheduleBootstrap()}};const completeBootstrap=()=>{if(automaticEstimate.value!==undefined||!requiresDOMBootstrap(props.itemSize,props.estimateSize)||prepared.value.domain.size===0)return;const count=Math.min(bootstrapCount.value,prepared.value.domain.size);const extents=[];for(let index=0;index<count;index+=1){const element=bootstrapElements.get(index);if(element===undefined)return;const bounds=element.getBoundingClientRect();const extent=props.axis==='vertical'?bounds.height:bounds.width;if(!Number.isFinite(extent)||extent<=0)return;extents.push(extent)}const total=extents.reduce((sum,extent)=>sum+extent,0)+props.gap*Math.max(0,extents.length-1);const root=virtualizer.root.value;const measuredViewportExtent=props.axis==='vertical'?root?.clientHeight??0:root?.clientWidth??0;const viewportExtent=measuredViewportExtent>0?measuredViewportExtent:props.axis==='vertical'?props.initialViewport?.height??0:props.initialViewport?.width??0;const target=viewportExtent+bootstrapTrailingOverscanExtent(props.overscan,props.axis);const average=extents.reduce((sum,extent)=>sum+extent,0)/extents.length;if(target>total&&count<prepared.value.domain.size){const nextCount=Math.min(prepared.value.domain.size,Math.max(count+1,Math.ceil((target+props.gap)/(average+props.gap))));bootstrapCount.value=nextCount;return}automaticEstimate.value=average;bootstrapCount.value=0;bootstrapElements.clear();state.value=createVirtualListState(prepared.value,props.items,props,automaticEstimate.value)};function scheduleBootstrap(){if(disposed||bootstrapScheduled||automaticEstimate.value!==undefined||bootstrapCount.value===0)return;bootstrapScheduled=true;void nextTick(()=>{bootstrapScheduled=false;if(!disposed)completeBootstrap()})}onMounted(scheduleBootstrap);watch(()=>props.items,items=>{const previousPrepared=prepared.value;const previousState=state.value;const next=updatePreparedVirtualList(previousPrepared,items,props.getKey);if(requiresDOMBootstrap(props.itemSize,props.estimateSize)&&automaticEstimate.value===undefined){prepared.value=next;bootstrapCount.value=next.domain.size>0?1:0;scheduleBootstrap();return}const patch=reconcileVirtualList(state.value,next,items,props,automaticEstimate.value);if(patch===null){scheduleChangedRenderedItemMeasurements(previousPrepared,previousState,next,previousState);prepared.value=next;return}const result=virtualizer.connection.value===undefined?tryApplyLinearPatch(state.value,patch):virtualizer.connection.value.mutate(patch);if(!result.ok){if(virtualizer.connection.value===undefined)emit('error',result.error);return}if(virtualizer.connection.value===undefined)state.value=result.value.state;scheduleChangedRenderedItemMeasurements(previousPrepared,previousState,next,result.value.state);for(const id of itemRefs.keys()){if(result.value.state.domain.indexOf(id)===null)itemRefs.delete(id)}prepared.value=next},{flush:'sync'});let constructionWarningShown=false;watch(()=>[props.axis,props.gap,props.maxItems,props.itemSize,props.estimateSize,props.initialViewport?.x,props.initialViewport?.y,props.initialViewport?.width,props.initialViewport?.height],(value,previous)=>{if(constructionWarningShown||value.every((item,index)=>Object.is(item,previous[index])))return;constructionWarningShown=true;console.warn('[Sectile] VirtualList axis, gap, maxItems, itemSize, estimateSize, and initialViewport are construction-time options. Remount the list to change them.')},{flush:'sync'});onBeforeUnmount(()=>{disposed=true;for(const unregister of registrations.values())unregister();registrations.clear();elements.clear();itemRefs.clear();bootstrapElements.clear();pendingMeasurements.clear();forcedMeasurements.clear()});expose(Object.freeze({root:virtualizer.root,get state(){return state.value},get plan(){return virtualizer.plan.value},scrollTo:virtualizer.scrollTo,refresh:virtualizer.refresh,flush:virtualizer.flush}));return()=>{const plan=virtualizer.plan.value;const rootStyle=attrs['style'];const rootAttributes={...attrs};delete rootAttributes['style'];const bootstrapping=automaticEstimate.value===undefined&&bootstrapCount.value>0;const contentStyle=props.axis==='vertical'?{position:'relative',width:'100%',...bootstrapping?{}:{height:`${plan?.contentSize.height??0}px`}}:{position:'relative',height:'100%',...bootstrapping?{display:'flex'}:{width:`${plan?.contentSize.width??0}px`}};const children=plan?.placements.map(placement=>{const index=placement.index;const value=props.items[index];if(index>=props.items.length||prepared.value.domain.at(index)!==placement.id)return null;const itemAttributes=props.itemAttributes?.(value,index)??{};const itemStyle=virtualItemStyle(placement,props.itemSize===undefined?undefined:props.axis==='vertical'?{height:true}:{width:true});const rendered=slots['default']?.({value,key:placement.id,index,placement});const itemChildren=rendered===undefined||rendered===null?[]:Array.isArray(rendered)?rendered:[rendered];return h(props.itemAs,{...itemAttributes,key:placement.id,...props.itemSize===undefined?{ref:itemRef(placement.id)}:{},style:[itemAttributes['style'],itemStyle,props.axis==='vertical'?{width:'100%'}:{height:'100%'}],'data-scope':'virtual-list','data-part':'item','data-index':placement.index,'data-visible':placement.visible?'':undefined},itemChildren)})??[];if(automaticEstimate.value===undefined&&bootstrapCount.value>0){children.push(...renderVirtualListBootstrapItems(prepared.value,props.items,bootstrapCount.value,props,slots['default'],bootstrapItemRef))}if(prepared.value.domain.size===0){const empty=slots['empty']?.();if(empty!==undefined&&empty!==null)children.push(empty)}return h(props.as,{...rootAttributes,ref:setRootElement,style:[{overflow:'auto'},rootStyle],'data-scope':'virtual-list','data-part':'root'},[h(props.contentAs,{style:contentStyle,'data-scope':'virtual-list','data-part':'content'},children)])}}});export const VirtualList=VirtualListRuntime;export function createVirtualListMeasurementResolver(axis){return({element,placement,state})=>measureVirtualListElement(axis,placement.id,element,state)}function measureVirtualListElement(axis,id,element,state){const index=state.domain.indexOf(id);if(index===null)return null;const bounds=element.getBoundingClientRect();const value=axis==='vertical'?bounds.height:bounds.width;if(!Number.isFinite(value)||value<=0)return null;const current=state.extents.extentAt(index);if(current?.kind==='exact'&&Math.abs(current.value-value)<0.01)return null;return Object.freeze({index,extent:Object.freeze({kind:'exact',value})})}export function createVirtualListState(prepared,items,props,automaticEstimate){const estimate=props.estimateSize??automaticEstimate;const sharedExtent=props.itemSize!==undefined?exactExtent(props.itemSize):typeof estimate!=='function'?estimatedExtent(requireAutomaticEstimate(estimate),undefined,0):null;return createLinearLayout(createPreparedVirtualListSequence(prepared,props.maxItems),sharedExtent===null?createExtentIndex(Array.from({length:prepared.domain.size},(_unused,index)=>estimatedExtent(estimate,items[index],index)),{maxItems:props.maxItems}):createUniformExtentIndex(prepared.domain.size,sharedExtent,{maxItems:props.maxItems}),{axis:props.axis,gap:props.gap,crossExtent:1})}export function createEmptyVirtualListState(props){return createLinearLayout(createSequence([],{maxItems:props.maxItems,maxIDCodeUnits:1_024}),createUniformExtentIndex(0,exactExtent(0),{maxItems:props.maxItems}),{axis:props.axis,gap:props.gap,crossExtent:1})}export function bootstrapTrailingOverscanExtent(overscan,axis){if(typeof overscan==='number')return overscan;return axis==='vertical'?overscan.bottom??0:overscan.right??0}export function renderVirtualListBootstrapItems(prepared,items,count,props,render,itemRef){return Array.from({length:Math.min(count,prepared.domain.size)},(_unused,index)=>{const value=items[index];const id=prepared.domain.at(index);const attributes=props.itemAttributes?.(value,index)??{};const placement=Object.freeze({id,index,rect:Object.freeze({x:0,y:0,width:0,height:0}),visible:true});const rendered=render?.({value,key:id,index,placement});const children=rendered===undefined||rendered===null?[]:Array.isArray(rendered)?rendered:[rendered];return h(props.itemAs,{...attributes,key:id,ref:element=>itemRef(index,element),style:[attributes['style'],props.axis==='vertical'?{width:'100%'}:{height:'100%'},props.gap>0&&index>0?props.axis==='vertical'?{marginTop:`${props.gap}px`}:{marginLeft:`${props.gap}px`}:undefined],'data-scope':'virtual-list','data-part':'item','data-index':index,'data-visible':'','data-bootstrap':''},children)})}
|
|
1
|
+
import{defineComponent,h,nextTick,onBeforeUnmount,onMounted,shallowRef,watch}from'vue';import{createSequence}from'@sectile/core/sequence';import{createExactVirtualExtent,createVirtualExtent,reconcileVirtualCollectionExtents,reconcileVirtualCollectionValueExtents,virtualSizePolicyRequiresMeasurement}from'@sectile/virtual/collection';import{createExtentIndex,createUniformExtentIndex}from'@sectile/virtual/extent-index';import{createLinearLayout,linearLayoutStrategyFor,setLinearCrossExtent,tryApplyLinearMeasurements,tryApplyLinearPatch}from'@sectile/virtual/linear-layout';import{}from'@sectile/dom/virtual';import{VirtualizerFooter,VirtualizerHeader,VirtualizerRoot,VirtualizerSurface}from'./virtual-core.js';import{constrainPreparedVirtualCollection,createVirtualCollectionExpose,prepareVirtualCollection,renderHighLevelItems,updatePreparedVirtualCollection}from'./virtual-collection.js';const VirtualListRuntime=/* @__PURE__ */defineComponent({name:'SectileVirtualList',inheritAttrs:false,props:{items:{type:Array,required:true},getID:{type:Function,required:true},sizePolicy:{type:Object,required:true},axis:{type:String,default:'vertical'},gap:{type:Number,default:0},overscan:{type:[Number,Object],default:240},viewportInsets:{type:[Number,Object],default:undefined},maxItems:{type:Number,default:1_000_000},initialViewport:{type:Object,default:undefined},as:{type:String,default:'div'},contentAs:{type:String,default:'div'},itemAs:{type:String,default:'div'},itemAttributes:{type:Function,default:undefined}},emits:{stateChange:_state=>true,planChange:_plan=>true,error:_error=>true},slots:Object,setup(props,{attrs,emit,expose,slots}){const axis=props.axis;const gap=props.gap;const maxItems=props.maxItems;const sizePolicy=props.sizePolicy;const initialViewport=props.initialViewport===undefined?undefined:Object.freeze({...props.initialViewport});const prepared=shallowRef(prepareVirtualCollection(props.items,props.getID,maxItems));const automaticEstimate=shallowRef();const bootstrapCount=shallowRef(virtualSizePolicyRequiresMeasurement(sizePolicy)&&prepared.value.domain.size>0?1:0);const bootstrapElements=new Map;const bootstrapRefs=new Map;let bootstrapScheduled=false;let disposed=false;const initialCrossExtent=crossExtentForViewport(axis,initialViewport);const initialState=virtualSizePolicyRequiresMeasurement(sizePolicy)?createEmptyVirtualListState({axis,gap,maxItems,crossExtent:initialCrossExtent}):createVirtualListState(prepared.value,props.items,{sizePolicy,axis,gap,maxItems,crossExtent:initialCrossExtent});const activeState=shallowRef(initialState);const root=shallowRef();const measure=sizePolicy.kind==='fixed'?undefined:createVirtualListMeasurementResolver(axis);const isBootstrapping=()=>automaticEstimate.value===undefined&&bootstrapCount.value>0&&prepared.value.domain.size>0;const phase=()=>prepared.value.domain.size===0?'empty':isBootstrapping()?'bootstrap':'ready';const currentState=()=>root.value?.state??activeState.value;const bootstrapItemRef=index=>{const existing=bootstrapRefs.get(index);if(existing!==undefined)return existing;const callback=value=>{const element=value instanceof HTMLElement?value:null;if(element===null){bootstrapElements.delete(index);if(bootstrapRefs.get(index)===callback)bootstrapRefs.delete(index);return}bootstrapElements.set(index,element);scheduleBootstrap()};bootstrapRefs.set(index,callback);return callback};const completeBootstrap=()=>{if(!isBootstrapping())return;const count=Math.min(bootstrapCount.value,prepared.value.domain.size);const extents=[];for(let index=0;index<count;index+=1){const element=bootstrapElements.get(index);if(element===undefined)return;const bounds=element.getBoundingClientRect();const extent=axis==='vertical'?bounds.height:bounds.width;if(!Number.isFinite(extent)||extent<=0)return;extents.push(extent)}const total=extents.reduce((sum,extent)=>sum+extent,0)+gap*Math.max(0,extents.length-1);const scrollport=root.value?.scrollport.value;const measuredViewportExtent=axis==='vertical'?scrollport?.clientHeight??0:scrollport?.clientWidth??0;const viewportExtent=measuredViewportExtent>0?measuredViewportExtent:axis==='vertical'?initialViewport?.height??0:initialViewport?.width??0;const target=viewportExtent+bootstrapTrailingOverscanExtent(props.overscan,axis);const average=extents.reduce((sum,extent)=>sum+extent,0)/extents.length;if(target>total&&count<prepared.value.domain.size){bootstrapCount.value=Math.min(prepared.value.domain.size,Math.max(count+1,Math.ceil((target+gap)/(average+gap))));return}automaticEstimate.value=average;bootstrapCount.value=0;bootstrapElements.clear();bootstrapRefs.clear();activeState.value=createVirtualListState(prepared.value,props.items,{sizePolicy,axis,gap,maxItems,crossExtent:currentState().crossExtent},average)};function scheduleBootstrap(){if(disposed||bootstrapScheduled||automaticEstimate.value!==undefined||bootstrapCount.value===0)return;bootstrapScheduled=true;void nextTick(()=>{bootstrapScheduled=false;if(!disposed)completeBootstrap()})}onMounted(scheduleBootstrap);watch(()=>[props.items,props.getID],()=>{const next=updatePreparedVirtualCollection(prepared.value,props.items,props.getID);if(virtualSizePolicyRequiresMeasurement(sizePolicy)&&automaticEstimate.value===undefined){prepared.value=next;bootstrapCount.value=next.domain.size>0?1:0;scheduleBootstrap();return}let nextState=currentState();const exposed=root.value;const patch=reconcileVirtualCollectionExtents(nextState,next,sizePolicy,automaticEstimate.value);if(patch!==null){const result=exposed===undefined?tryApplyLinearPatch(nextState,patch):exposed.mutate(patch);if(!result.ok){if(exposed===undefined){emit('error',result.error)}return}nextState=result.value.state;activeState.value=nextState}const valueUpdates=reconcileVirtualCollectionValueExtents(nextState,next,sizePolicy,automaticEstimate.value);if(valueUpdates.length>0){const result=exposed===undefined?tryApplyLinearMeasurements(nextState,{generation:nextState.generation,measurements:valueUpdates}):exposed.measure(valueUpdates);if(!result.ok){if(exposed===undefined){emit('error',result.error)}return}nextState=result.value.state;activeState.value=nextState}prepared.value=next},{flush:'sync'});const syncCrossExtent=plan=>{const crossExtent=axis==='vertical'?plan.viewport.width:plan.viewport.height;const state=currentState();const next=setLinearCrossExtent(state,crossExtent);if(Object.is(next,state))return false;activeState.value=next;return true};let constructionWarningShown=false;watch(()=>[props.axis,props.gap,props.maxItems,props.sizePolicy,props.initialViewport?.x,props.initialViewport?.y,props.initialViewport?.width,props.initialViewport?.height],()=>{if(constructionWarningShown||props.axis===axis&&props.gap===gap&&props.maxItems===maxItems&&sameVirtualSizePolicy(props.sizePolicy,sizePolicy)&&sameVirtualRect(props.initialViewport,initialViewport))return;constructionWarningShown=true;console.warn('[Sectile] VirtualList axis, gap, maxItems, sizePolicy, and initialViewport are construction-time options. Remount the list to change them.')},{flush:'sync'});onBeforeUnmount(()=>{disposed=true;bootstrapElements.clear();bootstrapRefs.clear()});expose(createVirtualCollectionExpose(root,initialState,phase));return()=>h(VirtualizerRoot,{...attrs,ref:root,defaultState:activeState.value,strategy:linearLayoutStrategyFor(),overscan:props.overscan,...props.viewportInsets===undefined?{}:{viewportInsets:props.viewportInsets},...initialViewport===undefined?{}:{initialViewport},...measure===undefined?{}:{measure},as:props.as,style:[{overflow:'auto'},attrs['style']],'data-virtual-layout':'virtual-list','data-phase':phase(),onStateChange:value=>{const state=value;activeState.value=state;emit('stateChange',state)},onPlanChange:plan=>{if(syncCrossExtent(plan))return;emit('planChange',plan)},onError:error=>emit('error',error)},{default:({placements})=>[slots['header']===undefined?null:h(VirtualizerHeader,{},{default:()=>slots['header']?.()}),h(VirtualizerSurface,{as:props.contentAs,...isBootstrapping()&&axis==='horizontal'?{style:{display:'flex'}}:{}},{default:()=>isBootstrapping()?renderVirtualListBootstrapItems(prepared.value,props.items,bootstrapCount.value,{axis,gap,crossExtent:currentState().crossExtent,itemAs:props.itemAs,itemAttributes:props.itemAttributes},slots['item'],bootstrapItemRef):renderHighLevelItems('virtual-list',placements,prepared.value,props.items,props.itemAs,props.itemAttributes,linearItemSize(axis,sizePolicy),(value,id,index,placement)=>slots['item']?.({value,id,index,placement}),slots['empty'])}),slots['footer']===undefined?null:h(VirtualizerFooter,{},{default:()=>slots['footer']?.()})]})}});export const VirtualList=VirtualListRuntime;export function createVirtualListMeasurementResolver(axis){return({element,placement,state})=>measureVirtualListElement(axis,placement.id,element,state)}function measureVirtualListElement(axis,id,element,state){const index=state.domain.indexOf(id);if(index===null)return null;const bounds=element.getBoundingClientRect();const value=axis==='vertical'?bounds.height:bounds.width;if(!Number.isFinite(value)||value<=0)return null;const current=state.extents.extentAt(index);if(current?.kind==='exact'&&Math.abs(current.value-value)<0.01)return null;return Object.freeze({index,extent:Object.freeze({kind:'exact',value})})}export function createVirtualListState(prepared,items,props,automaticEstimate){return createLinearLayout(constrainPreparedVirtualCollection(prepared,props.maxItems),createVirtualListExtentIndex(prepared,items,props.sizePolicy,props.maxItems,automaticEstimate),{axis:props.axis,gap:props.gap,crossExtent:props.crossExtent})}export function createEmptyVirtualListState(props){return createLinearLayout(createSequence([],{maxItems:props.maxItems,maxIDCodeUnits:1_024}),createUniformExtentIndex(0,createExactVirtualExtent(0),{maxItems:props.maxItems}),{axis:props.axis,gap:props.gap,crossExtent:props.crossExtent})}export function bootstrapTrailingOverscanExtent(overscan,axis){if(typeof overscan==='number')return overscan;return axis==='vertical'?overscan.bottom??0:overscan.right??0}export function renderVirtualListBootstrapItems(prepared,items,count,props,render,itemRef){return Array.from({length:Math.min(count,prepared.domain.size)},(_unused,index)=>{const value=items[index];const id=prepared.domain.at(index);const attributes=props.itemAttributes?.(value,index)??{};const placement=Object.freeze({id,index,rect:Object.freeze(props.axis==='vertical'?{x:0,y:0,width:props.crossExtent,height:0}:{x:0,y:0,width:0,height:props.crossExtent}),visible:true});const rendered=render?.({value,id,index,placement});const children=rendered===undefined||rendered===null?[]:Array.isArray(rendered)?rendered:[rendered];return h(props.itemAs,{...attributes,key:id,ref:itemRef(index),style:[attributes['style'],props.crossExtent>0?props.axis==='vertical'?{width:`${props.crossExtent}px`}:{height:`${props.crossExtent}px`}:undefined,props.gap>0&&index>0?props.axis==='vertical'?{marginTop:`${props.gap}px`}:{marginLeft:`${props.gap}px`}:undefined],'data-scope':'virtual-list','data-part':'item','data-index':index,'data-visible':'','data-bootstrap':''},children)})}function createVirtualListExtentIndex(prepared,items,sizePolicy,maxItems,automaticEstimate){if(prepared.domain.size===0){return createUniformExtentIndex(0,createExactVirtualExtent(0),{maxItems})}const shared=sizePolicy.kind==='fixed'||sizePolicy.kind==='measured'||sizePolicy.kind==='estimated'&&typeof sizePolicy.estimate==='number'?createVirtualExtent(sizePolicy,items[0],0,automaticEstimate):null;return shared===null?createExtentIndex(Array.from({length:prepared.domain.size},(_unused,index)=>createVirtualExtent(sizePolicy,items[index],index,automaticEstimate)),{maxItems}):createUniformExtentIndex(prepared.domain.size,shared,{maxItems})}function linearItemSize(axis,sizePolicy){if(sizePolicy.kind==='fixed')return'both';return axis==='vertical'?'width':'height'}function crossExtentForViewport(axis,viewport){if(viewport===undefined)return 0;return axis==='vertical'?viewport.width:viewport.height}function sameVirtualSizePolicy(left,right){if(left.kind!==right.kind)return false;if(left.kind==='measured'&&right.kind==='measured')return true;if(left.kind==='fixed'&&right.kind==='fixed'){return left.extent===right.extent}return left.kind==='estimated'&&right.kind==='estimated'&&Object.is(left.estimate,right.estimate)}function sameVirtualRect(left,right){if(left===undefined||right===undefined)return left===right;return left.x===right.x&&left.y===right.y&&left.width===right.width&&left.height===right.height}
|
|
2
2
|
//# sourceMappingURL=virtual-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list.js","names":["defineComponent","h","nextTick","onBeforeUnmount","onMounted","shallowRef","watch","createSequence","createExtentIndex","createUniformExtentIndex","linearLayoutStrategyFor","tryApplyLinearPatch","createLinearLayout","createAxisMeasurementResolver","virtualItemStyle","Primitive","VirtualizerContent","VirtualizerRoot","useVirtualizer","assertVirtualListSizeMode","createPreparedVirtualListSequence","estimatedExtent","exactExtent","prepareVirtualList","reconcileVirtualList","requireAutomaticEstimate","requiresDOMBootstrap","updatePreparedVirtualList","VirtualListRuntime","name","inheritAttrs","props","items","type","Array","required","getKey","Function","estimateSize","Number","default","undefined","itemSize","axis","String","gap","overscan","Object","maxItems","initialViewport","as","contentAs","itemAs","itemAttributes","emits","stateChange","_state","planChange","_plan","error","_error","slots","setup","attrs","emit","expose","prepared","automaticEstimate","bootstrapCount","value","domain","size","bootstrapElements","Map","bootstrapScheduled","disposed","state","createEmptyVirtualListState","createVirtualListState","measure","createVirtualListMeasurementResolver","virtualizer","strategy","onStateChange","onPlanChange","onError","registrations","elements","itemRefs","pendingMeasurements","Set","forcedMeasurements","measurementScheduled","setRootElement","root","HTMLElement","measurePendingItems","connection","queued","from","clear","measurements","id","element","get","index","indexOf","current","extents","extentAt","kind","has","measurement","measureVirtualListElement","push","delete","length","scheduleItemMeasurement","force","add","scheduleChangedRenderedItemMeasurements","previousPrepared","previousState","nextPrepared","nextState","keys","previousIndex","nextIndex","is","itemRef","existing","callback","set","registerItem","bootstrapItemRef","scheduleBootstrap","completeBootstrap","count","Math","min","bounds","getBoundingClientRect","extent","height","width","isFinite","total","reduce","sum","max","measuredViewportExtent","clientHeight","clientWidth","viewportExtent","target","bootstrapTrailingOverscanExtent","average","nextCount","ceil","next","patch","result","mutate","ok","flush","constructionWarningShown","x","y","previous","every","item","console","warn","unregister","values","freeze","plan","scrollTo","refresh","rootStyle","rootAttributes","bootstrapping","contentStyle","position","contentSize","display","children","placements","map","placement","at","itemStyle","rendered","key","itemChildren","isArray","ref","style","visible","renderVirtualListBootstrapItems","empty","overflow","VirtualList","abs","estimate","sharedExtent","_unused","crossExtent","maxIDCodeUnits","bottom","right","render","attributes","rect","marginTop","marginLeft"],"sources":["../../src/internal/virtual-list.ts"],"mappings":"OAASA,gBAAiBC,EAAGC,SAAUC,gBAAiBC,UAAWC,WAAYC,UAA+K,aACrPC,mBAA6G,gCAC7GC,kBAAmBC,6BAA+D,uCAClFC,wBAAyBC,oBAAqBC,uBAA6G,wCAC3JC,8BAA+BC,qBAAqO,8BACpQC,cAAiB,yBACjBC,mBAAoBC,gBAAiBC,mBAAiF,2BAE7HC,0BACAC,kCACAC,gBACAC,YACAC,mBACAC,qBACAC,yBACAC,qBACAC,8BAKK,gCA8FP,MAAMC,kCAAqC5B,gBAAgB,CACzD6B,KAAM,qBACNC,aAAc,MACdC,MAAO,CACLC,MAAO,CACLC,KAAMC,MACNC,SAAU,MAEZC,OAAQ,CACNH,KAAMI,SACNF,SAAU,MAEZG,aAAc,CACZL,KAAM,CAACM,OAAQF,UACfG,QAASC,WAEXC,SAAU,CAAET,KAAMM,OAAQC,QAASC,WACnCE,KAAM,CACJV,KAAMW,OACNJ,QAAS,YAEXK,IAAK,CAAEZ,KAAMM,OAAQC,QAAS,GAC9BM,SAAU,CACRb,KAAM,CAACM,OAAQQ,QACfP,QAAS,KAEXQ,SAAU,CAAEf,KAAMM,OAAQC,QAAS,WACnCS,gBAAiB,CACfhB,KAAMc,OACNP,QAASC,WAEXS,GAAI,CAAEjB,KAAMW,OAAQJ,QAAS,OAC7BW,UAAW,CAAElB,KAAMW,OAAQJ,QAAS,OACpCY,OAAQ,CAAEnB,KAAMW,OAAQJ,QAAS,OACjCa,eAAgB,CACdpB,KAAMI,SACNG,QAASC,YAGba,MAAO,CACLC,YAAcC,QAA+C,KAC7DC,WAAaC,OAA8C,KAC3DC,MAAQC,QAA4D,MAEtEC,MAAOd,OAIP,KAAAe,CAAM/B,OAAOgC,MAAOC,KAAMC,OAAQJ,QAChC1C,0BAA0BY,MAAMW,SAAU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AASoK,OAAS,CACxB,QAEM,SAAUX,gCACdrI,SACAlC,MACAyG,MACA1G,MAMAoL,OACAlF,SAEA,OAAO/F,MAAMiE,KAAK,CAAEiB,OAAQsB,KAAKC,IAAIF,MAAOvE,SAASI,OAAOC,OAAS,CAACuI,QAASrG,SAC7E,MAAMpC,MAAQrC,MAAMyE,OACpB,MAAMH,GAAKpC,SAASI,OAAOwH,GAAGrF,OAC9B,MAAM2G,WAAarL,MAAMsB,iBAAiBgB,MAAOoC,QAAU,GAC3D,MAAMoF,UAAY9I,OAAOgI,OAAO,CAC9BzE,GACAG,MACA4G,KAAMtK,OAAOgI,OAAO,CAAET,EAAG,EAAGC,EAAG,EAAGvB,MAAO,EAAGD,OAAQ,IACpDuD,QAAS,OAEX,MAAMN,SAAWmB,SAAS,CAAE9I,MAAO4H,IAAK3F,GAAIG,MAAOoF,YACnD,MAAMH,SAAWM,WAAavJ,WAAauJ,WAAa,KACpD,GACA9J,MAAMiK,QAAQH,UACZA,SACA,CAACA,UACP,OAAO/L,EAAE8B,MAAMqB,OAAQ,IAClBgK,WACHnB,IAAK3F,GACL8F,IAAM7F,SAAqB0B,QAAQxB,MAAOF,SAC1C8F,MAAO,CACLe,WAAW,SACXrL,MAAMY,OAAS,WAAa,CAAEqG,MAAO,QAAW,CAAED,OAAQ,QAC1DhH,MAAMc,IAAM,GAAK4D,MAAQ,EACrB1E,MAAMY,OAAS,WACb,CAAE2K,UAAW,GAAGvL,MAAMc,SACtB,CAAE0K,WAAY,GAAGxL,MAAMc,SACzBJ,WAEN,aAAc,eACd,YAAa,OACb,aAAcgE,MACd,eAAgB,GAChB,iBAAkB,IACjBiF,WAEP","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"virtual-list.js","names":["defineComponent","h","nextTick","onBeforeUnmount","onMounted","shallowRef","watch","createSequence","createExactVirtualExtent","createVirtualExtent","reconcileVirtualCollectionExtents","reconcileVirtualCollectionValueExtents","virtualSizePolicyRequiresMeasurement","createExtentIndex","createUniformExtentIndex","createLinearLayout","linearLayoutStrategyFor","setLinearCrossExtent","tryApplyLinearMeasurements","tryApplyLinearPatch","VirtualizerFooter","VirtualizerHeader","VirtualizerRoot","VirtualizerSurface","constrainPreparedVirtualCollection","createVirtualCollectionExpose","prepareVirtualCollection","renderHighLevelItems","updatePreparedVirtualCollection","VirtualListRuntime","name","inheritAttrs","props","items","type","Array","required","getID","Function","sizePolicy","Object","axis","String","default","gap","Number","overscan","viewportInsets","undefined","maxItems","initialViewport","as","contentAs","itemAs","itemAttributes","emits","stateChange","_state","planChange","_plan","error","_error","slots","setup","attrs","emit","expose","freeze","prepared","automaticEstimate","bootstrapCount","value","domain","size","bootstrapElements","Map","bootstrapRefs","bootstrapScheduled","disposed","initialCrossExtent","crossExtentForViewport","initialState","createEmptyVirtualListState","crossExtent","createVirtualListState","activeState","root","measure","kind","createVirtualListMeasurementResolver","isBootstrapping","phase","currentState","state","bootstrapItemRef","index","existing","get","callback","element","HTMLElement","delete","set","scheduleBootstrap","completeBootstrap","count","Math","min","extents","bounds","getBoundingClientRect","extent","height","width","isFinite","push","total","reduce","sum","max","length","scrollport","measuredViewportExtent","clientHeight","clientWidth","viewportExtent","target","bootstrapTrailingOverscanExtent","average","ceil","clear","next","nextState","exposed","patch","result","mutate","ok","valueUpdates","generation","measurements","flush","syncCrossExtent","plan","viewport","is","constructionWarningShown","x","y","sameVirtualSizePolicy","sameVirtualRect","console","warn","ref","defaultState","strategy","style","overflow","onStateChange","onPlanChange","onError","placements","display","renderVirtualListBootstrapItems","linearItemSize","id","placement","VirtualList","measureVirtualListElement","indexOf","current","extentAt","abs","createVirtualListExtentIndex","maxIDCodeUnits","bottom","right","render","itemRef","from","_unused","at","attributes","rect","visible","rendered","children","isArray","key","marginTop","marginLeft","shared","estimate","left"],"sources":["../../src/internal/virtual-list.ts"],"mappings":"OAASA,gBAAiBC,EAAGC,SAAUC,gBAAiBC,UAAWC,WAAYC,UAA8K,aAEpPC,mBAAsB,gCAE7BC,yBACAC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B,CAAC2G,QAASrF,QAAUtF,oBAClB8B,WACAN,MAAM8D,OACNA,MACA1B,oBAGJ,CAAEpB,WAEJnC,yBAAyBsD,SAASI,OAAOC,KAAMsH,OAAQ,CAAE9I,UAC/D,CAEA,SAASmH,eACP3H,KACAF,YAEA,GAAIA,WAAWiD,OAAS,QAAS,MAAO,OACxC,OAAO/C,OAAS,WAAa,QAAU,QACzC,CAEA,SAASuC,uBACPvC,KACAuG,UAEA,GAAIA,WAAahG,UAAW,OAAO,EACnC,OAAOP,OAAS,WAAauG,SAAS/B,MAAQ+B,SAAShC,MACzD,CAEA,SAASqC,sBACP4C,KACAjB,OAEA,GAAIiB,KAAKzG,OAASwF,MAAMxF,KAAM,OAAO,MACrC,GAAIyG,KAAKzG,OAAS,YAAcwF,MAAMxF,OAAS,WAAY,OAAO,KAClE,GAAIyG,KAAKzG,OAAS,SAAWwF,MAAMxF,OAAS,QAAS,CACnD,OAAOyG,KAAKlF,SAAWiE,MAAMjE,MAC/B,CACA,OAAOkF,KAAKzG,OAAS,aAChBwF,MAAMxF,OAAS,aACfhD,OAAOyG,GAAGgD,KAAKD,SAAUhB,MAAMgB,SACtC,CAEA,SAAS1C,gBACP2C,KACAjB,OAEA,GAAIiB,OAASjJ,WAAagI,QAAUhI,UAAW,OAAOiJ,OAASjB,MAC/D,OAAOiB,KAAK9C,IAAM6B,MAAM7B,GACnB8C,KAAK7C,IAAM4B,MAAM5B,GACjB6C,KAAKhF,QAAU+D,MAAM/D,OACrBgF,KAAKjF,SAAWgE,MAAMhE,MAC7B","ignoreList":[]}
|
package/dist/virtual-core.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { VirtualizerFooter, VirtualizerHeader, VirtualizerItem, VirtualizerRoot, VirtualizerSurface, useVirtualizer, type UseVirtualizerOptions, type UseVirtualizerReturn, type VirtualizerFrameProps, type VirtualizerHostErrorCode, type VirtualizerItemProps, type VirtualizerItemSize, type VirtualizerOperationResult, type VirtualizerRootExpose, type VirtualizerRootProps, type VirtualizerRootSlotProps, type VirtualizerSurfaceProps } from './internal/virtual-core.js';
|
package/dist/virtual-core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{VirtualizerFooter,VirtualizerHeader,VirtualizerItem,VirtualizerRoot,VirtualizerSurface,useVirtualizer}from"./internal/virtual-core.js";export{VirtualizerFooter,VirtualizerHeader,VirtualizerItem,VirtualizerRoot,VirtualizerSurface,useVirtualizer};
|
|
2
2
|
//# sourceMappingURL=virtual-core.js.map
|
package/dist/virtual-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/virtual-core.ts"],"mappings":"AAEA,OAAS,
|
|
1
|
+
{"version":3,"sources":["../src/virtual-core.ts"],"mappings":"AAEA,OAAS,kBAAmB,kBAAmB,gBAAiB,gBAAiB,mBAAoB,mBAAkV","names":[],"file":"virtual-core.js"}
|
package/dist/virtual-grid.d.ts
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { type AllowedComponentProps, type ComponentCustomProps, type PropType, type SlotsType, type VNodeChild, type VNodeProps } from 'vue';
|
|
2
|
+
import type { StableID } from '@sectile/core';
|
|
3
|
+
import { type VirtualLanePolicy, type VirtualSizePolicy } from '@sectile/virtual/collection';
|
|
2
4
|
import { type TrackGridLayoutState } from '@sectile/virtual/track-grid-layout';
|
|
3
5
|
import { type VirtualInsets, type VirtualLayoutPlan, type VirtualRect, type VirtualizerErrorHandler } from '@sectile/dom/virtual';
|
|
4
|
-
import { type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly itemSize?: number;
|
|
9
|
-
readonly estimateSize?: VirtualListEstimate<Value>;
|
|
6
|
+
import { type VirtualCollectionBaseProps, type VirtualCollectionIDResolver, type VirtualCollectionItemAttributes, type VirtualCollectionItemSlotProps } from './internal/virtual-collection.js';
|
|
7
|
+
export interface VirtualGridProps<Value = unknown, ID extends StableID = StableID> extends VirtualCollectionBaseProps<Value, ID> {
|
|
8
|
+
readonly sizePolicy: VirtualSizePolicy<Value>;
|
|
9
|
+
readonly lanePolicy: VirtualLanePolicy;
|
|
10
10
|
readonly rowGap?: number;
|
|
11
11
|
}
|
|
12
|
-
export type VirtualGridPublicProps<Value = unknown> = VirtualGridProps<Value> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
13
|
-
readonly onStateChange?: (state: TrackGridLayoutState<
|
|
14
|
-
readonly onPlanChange?: (plan: VirtualLayoutPlan<
|
|
12
|
+
export type VirtualGridPublicProps<Value = unknown, ID extends StableID = StableID> = VirtualGridProps<Value, ID> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
13
|
+
readonly onStateChange?: (state: TrackGridLayoutState<ID>) => unknown;
|
|
14
|
+
readonly onPlanChange?: (plan: VirtualLayoutPlan<ID>) => unknown;
|
|
15
15
|
readonly onError?: VirtualizerErrorHandler;
|
|
16
16
|
};
|
|
17
|
-
export interface VirtualGridSlotProps<Value = unknown> extends
|
|
17
|
+
export interface VirtualGridSlotProps<Value = unknown, ID extends StableID = StableID> extends VirtualCollectionItemSlotProps<Value, ID> {
|
|
18
18
|
readonly row: number;
|
|
19
19
|
readonly column: number;
|
|
20
20
|
}
|
|
21
21
|
export interface VirtualGridComponent {
|
|
22
|
-
new <Value = unknown>(props: VirtualGridPublicProps<Value>): {
|
|
23
|
-
$props: VirtualGridPublicProps<Value>;
|
|
22
|
+
new <Value = unknown, ID extends StableID = StableID>(props: VirtualGridPublicProps<Value, ID>): {
|
|
23
|
+
$props: VirtualGridPublicProps<Value, ID>;
|
|
24
24
|
$slots: {
|
|
25
|
-
|
|
25
|
+
header?: () => VNodeChild;
|
|
26
|
+
item?: (props: VirtualGridSlotProps<Value, ID>) => VNodeChild;
|
|
26
27
|
empty?: () => VNodeChild;
|
|
28
|
+
footer?: () => VNodeChild;
|
|
27
29
|
};
|
|
28
30
|
};
|
|
29
31
|
}
|
|
@@ -32,33 +34,17 @@ declare const VirtualGridRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
32
34
|
type: PropType<readonly unknown[]>;
|
|
33
35
|
required: true;
|
|
34
36
|
};
|
|
35
|
-
|
|
36
|
-
type: PropType<
|
|
37
|
+
getID: {
|
|
38
|
+
type: PropType<VirtualCollectionIDResolver<unknown, StableID>>;
|
|
37
39
|
required: true;
|
|
38
40
|
};
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
estimateSize: {
|
|
44
|
-
type: PropType<VirtualListEstimate<unknown>>;
|
|
45
|
-
default: undefined;
|
|
46
|
-
};
|
|
47
|
-
laneCount: {
|
|
48
|
-
type: NumberConstructor;
|
|
49
|
-
default: undefined;
|
|
50
|
-
};
|
|
51
|
-
minLaneSize: {
|
|
52
|
-
type: NumberConstructor;
|
|
53
|
-
default: number;
|
|
54
|
-
};
|
|
55
|
-
maxLaneCount: {
|
|
56
|
-
type: NumberConstructor;
|
|
57
|
-
default: number;
|
|
41
|
+
sizePolicy: {
|
|
42
|
+
type: PropType<VirtualSizePolicy<unknown>>;
|
|
43
|
+
required: true;
|
|
58
44
|
};
|
|
59
|
-
|
|
60
|
-
type:
|
|
61
|
-
|
|
45
|
+
lanePolicy: {
|
|
46
|
+
type: PropType<VirtualLanePolicy>;
|
|
47
|
+
required: true;
|
|
62
48
|
};
|
|
63
49
|
rowGap: {
|
|
64
50
|
type: NumberConstructor;
|
|
@@ -68,6 +54,10 @@ declare const VirtualGridRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
68
54
|
type: PropType<number | Partial<VirtualInsets>>;
|
|
69
55
|
default: number;
|
|
70
56
|
};
|
|
57
|
+
viewportInsets: {
|
|
58
|
+
type: PropType<number | Partial<VirtualInsets>>;
|
|
59
|
+
default: undefined;
|
|
60
|
+
};
|
|
71
61
|
maxItems: {
|
|
72
62
|
type: NumberConstructor;
|
|
73
63
|
default: number;
|
|
@@ -89,45 +79,29 @@ declare const VirtualGridRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
89
79
|
default: string;
|
|
90
80
|
};
|
|
91
81
|
itemAttributes: {
|
|
92
|
-
type: PropType<
|
|
82
|
+
type: PropType<VirtualCollectionItemAttributes<unknown>>;
|
|
93
83
|
default: undefined;
|
|
94
84
|
};
|
|
95
85
|
}>, () => VNodeChild, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
96
|
-
stateChange: (_state: TrackGridLayoutState<
|
|
97
|
-
planChange: (_plan: VirtualLayoutPlan<
|
|
86
|
+
stateChange: (_state: TrackGridLayoutState<StableID>) => boolean;
|
|
87
|
+
planChange: (_plan: VirtualLayoutPlan<StableID>) => boolean;
|
|
98
88
|
error: (_error: Parameters<VirtualizerErrorHandler>[0]) => boolean;
|
|
99
89
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
100
90
|
items: {
|
|
101
91
|
type: PropType<readonly unknown[]>;
|
|
102
92
|
required: true;
|
|
103
93
|
};
|
|
104
|
-
|
|
105
|
-
type: PropType<
|
|
94
|
+
getID: {
|
|
95
|
+
type: PropType<VirtualCollectionIDResolver<unknown, StableID>>;
|
|
106
96
|
required: true;
|
|
107
97
|
};
|
|
108
|
-
|
|
109
|
-
type:
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
estimateSize: {
|
|
113
|
-
type: PropType<VirtualListEstimate<unknown>>;
|
|
114
|
-
default: undefined;
|
|
115
|
-
};
|
|
116
|
-
laneCount: {
|
|
117
|
-
type: NumberConstructor;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
|
-
minLaneSize: {
|
|
121
|
-
type: NumberConstructor;
|
|
122
|
-
default: number;
|
|
123
|
-
};
|
|
124
|
-
maxLaneCount: {
|
|
125
|
-
type: NumberConstructor;
|
|
126
|
-
default: number;
|
|
98
|
+
sizePolicy: {
|
|
99
|
+
type: PropType<VirtualSizePolicy<unknown>>;
|
|
100
|
+
required: true;
|
|
127
101
|
};
|
|
128
|
-
|
|
129
|
-
type:
|
|
130
|
-
|
|
102
|
+
lanePolicy: {
|
|
103
|
+
type: PropType<VirtualLanePolicy>;
|
|
104
|
+
required: true;
|
|
131
105
|
};
|
|
132
106
|
rowGap: {
|
|
133
107
|
type: NumberConstructor;
|
|
@@ -137,6 +111,10 @@ declare const VirtualGridRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
137
111
|
type: PropType<number | Partial<VirtualInsets>>;
|
|
138
112
|
default: number;
|
|
139
113
|
};
|
|
114
|
+
viewportInsets: {
|
|
115
|
+
type: PropType<number | Partial<VirtualInsets>>;
|
|
116
|
+
default: undefined;
|
|
117
|
+
};
|
|
140
118
|
maxItems: {
|
|
141
119
|
type: NumberConstructor;
|
|
142
120
|
default: number;
|
|
@@ -158,31 +136,28 @@ declare const VirtualGridRuntime: import("vue").DefineComponent<import("vue").Ex
|
|
|
158
136
|
default: string;
|
|
159
137
|
};
|
|
160
138
|
itemAttributes: {
|
|
161
|
-
type: PropType<
|
|
139
|
+
type: PropType<VirtualCollectionItemAttributes<unknown>>;
|
|
162
140
|
default: undefined;
|
|
163
141
|
};
|
|
164
142
|
}>> & Readonly<{
|
|
165
143
|
onError?: (_error: import("@sectile/core").SectileError<import("@sectile/virtual").VirtualErrorCode>) => any;
|
|
166
|
-
onPlanChange?: (_plan: VirtualLayoutPlan<
|
|
167
|
-
onStateChange?: (_state: TrackGridLayoutState<
|
|
144
|
+
onPlanChange?: (_plan: VirtualLayoutPlan<StableID>) => any;
|
|
145
|
+
onStateChange?: (_state: TrackGridLayoutState<StableID>) => any;
|
|
168
146
|
}>, {
|
|
169
|
-
itemSize: number;
|
|
170
|
-
estimateSize: VirtualListEstimate<unknown>;
|
|
171
|
-
laneCount: number;
|
|
172
|
-
minLaneSize: number;
|
|
173
|
-
maxLaneCount: number;
|
|
174
|
-
laneGap: number;
|
|
175
147
|
rowGap: number;
|
|
176
148
|
overscan: number | Partial<import("@sectile/core/geometry").Insets>;
|
|
149
|
+
viewportInsets: number | Partial<import("@sectile/core/geometry").Insets>;
|
|
177
150
|
maxItems: number;
|
|
178
151
|
initialViewport: import("@sectile/core/geometry").Rect;
|
|
179
152
|
as: string;
|
|
180
153
|
contentAs: string;
|
|
181
154
|
itemAs: string;
|
|
182
|
-
itemAttributes:
|
|
155
|
+
itemAttributes: VirtualCollectionItemAttributes<unknown>;
|
|
183
156
|
}, SlotsType<{
|
|
184
|
-
|
|
157
|
+
header: () => VNodeChild;
|
|
158
|
+
item: (props: VirtualGridSlotProps<unknown>) => VNodeChild;
|
|
185
159
|
empty: () => VNodeChild;
|
|
160
|
+
footer: () => VNodeChild;
|
|
186
161
|
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
187
162
|
export declare const VirtualGrid: typeof VirtualGridRuntime & VirtualGridComponent;
|
|
188
163
|
export {};
|