vue-virtual-flow 0.0.3 → 0.0.4
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 +51 -5
- package/README.vi.md +51 -7
- package/dist/components/WindowGirdVirtualScroll.d.cts +53 -0
- package/dist/components/WindowGirdVirtualScroll.d.ts +53 -0
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/types.d.cts +16 -0
- package/dist/types.d.ts +16 -0
- package/dist/vue-virtual-flow.cjs +1 -1
- package/dist/vue-virtual-flow.css +1 -1
- package/dist/vue-virtual-flow.js +1354 -1061
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
A small, typed, and accessible collection of virtual scrolling components for
|
|
6
6
|
Vue 3. It covers fixed and variable-height lists, window scrolling, chat,
|
|
7
|
-
short-media feeds, and horizontal carousels.
|
|
7
|
+
window-scrolling grids, short-media feeds, and horizontal carousels.
|
|
8
8
|
|
|
9
9
|
Only the items needed for the current viewport are mounted, keeping large data
|
|
10
10
|
sets responsive without prescribing how an item should look.
|
|
@@ -18,6 +18,7 @@ sets responsive without prescribing how an item should look.
|
|
|
18
18
|
- [VirtualList and DynamicVirtualScroll](#virtuallist-and-dynamicvirtualscroll)
|
|
19
19
|
- [VirtualScroll](#virtualscroll)
|
|
20
20
|
- [WindowDynamicVirtualScroll](#windowdynamicvirtualscroll)
|
|
21
|
+
- [WindowGirdVirtualScroll](#windowgirdvirtualscroll)
|
|
21
22
|
- [ChatVirtualScroll](#chatvirtualscroll)
|
|
22
23
|
- [ShortMediaFeed](#shortmediafeed)
|
|
23
24
|
- [VirtualCarousel](#virtualcarousel)
|
|
@@ -83,8 +84,8 @@ createApp(App).use(VueVirtualScroll).mount('#app')
|
|
|
83
84
|
```
|
|
84
85
|
|
|
85
86
|
The plugin registers `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll`,
|
|
86
|
-
`WindowDynamicVirtualScroll`, `
|
|
87
|
-
`VirtualCarousel`.
|
|
87
|
+
`WindowDynamicVirtualScroll`, `WindowGirdVirtualScroll`, `ChatVirtualScroll`,
|
|
88
|
+
`ShortMediaFeed`, and `VirtualCarousel`.
|
|
88
89
|
|
|
89
90
|
## Choose a component
|
|
90
91
|
|
|
@@ -94,6 +95,7 @@ The plugin registers `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll`,
|
|
|
94
95
|
| `DynamicVirtualScroll` | Same behavior as `VirtualList`, with an explicit name. | Component container | Variable, measured automatically |
|
|
95
96
|
| `VirtualScroll` | Every row has the same known height. | Component container | Fixed |
|
|
96
97
|
| `WindowDynamicVirtualScroll` | The page itself should scroll instead of a nested container. | Browser window | Variable, measured automatically |
|
|
98
|
+
| `WindowGirdVirtualScroll` | A fixed-height card grid should use page scrolling. | Browser window | Fixed row height |
|
|
97
99
|
| `ChatVirtualScroll` | Messages are appended at the bottom and older history is prepended. | Component container | Variable, measured automatically |
|
|
98
100
|
| `ShortMediaFeed` | One full-height item should snap into view at a time. | Component container | One viewport per item |
|
|
99
101
|
| `VirtualCarousel` | Several horizontal slides should snap and virtualize. | Component container | Calculated from container width |
|
|
@@ -362,6 +364,47 @@ const list = ref<VirtualScrollExpose>()
|
|
|
362
364
|
- Methods: `scrollTo`, `scrollToIndex`, and `scrollToTop`. They scroll the
|
|
363
365
|
browser window; `scrollTo` accepts an offset relative to the list.
|
|
364
366
|
|
|
367
|
+
### WindowGirdVirtualScroll
|
|
368
|
+
|
|
369
|
+
Use `WindowGirdVirtualScroll` for a multi-column grid whose cards have a known,
|
|
370
|
+
fixed height and whose viewport is the browser window. Virtualization happens
|
|
371
|
+
by complete rows, so every visible column remains mounted together.
|
|
372
|
+
|
|
373
|
+
```vue
|
|
374
|
+
<script setup lang="ts">
|
|
375
|
+
import { WindowGirdVirtualScroll } from 'vue-virtual-flow'
|
|
376
|
+
|
|
377
|
+
const products = Array.from({ length: 10_000 }, (_, id) => ({
|
|
378
|
+
id,
|
|
379
|
+
name: `Product ${id + 1}`,
|
|
380
|
+
}))
|
|
381
|
+
</script>
|
|
382
|
+
|
|
383
|
+
<template>
|
|
384
|
+
<WindowGirdVirtualScroll
|
|
385
|
+
:items="products"
|
|
386
|
+
:item-size="240"
|
|
387
|
+
:columns="4"
|
|
388
|
+
:gap="16"
|
|
389
|
+
item-key="id"
|
|
390
|
+
aria-label="Product grid"
|
|
391
|
+
>
|
|
392
|
+
<template #default="{ item, rowIndex, columnIndex }">
|
|
393
|
+
<ProductCard
|
|
394
|
+
:product="item"
|
|
395
|
+
:data-position="`${rowIndex}:${columnIndex}`"
|
|
396
|
+
/>
|
|
397
|
+
</template>
|
|
398
|
+
</WindowGirdVirtualScroll>
|
|
399
|
+
</template>
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`itemSize` is the height of one grid row. Content that exceeds it is clipped.
|
|
403
|
+
`columns` defaults to `2`, `gap` defaults to `0`, and `overscan` defaults to
|
|
404
|
+
one extra row before and after the visible range. The remaining list props,
|
|
405
|
+
events, named slots, and exposed methods match `WindowDynamicVirtualScroll`.
|
|
406
|
+
The default slot also receives `rowIndex` and `columnIndex`.
|
|
407
|
+
|
|
365
408
|
### ChatVirtualScroll
|
|
366
409
|
|
|
367
410
|
`ChatVirtualScroll` is designed for variable-height conversations. It opens at
|
|
@@ -719,7 +762,8 @@ converted to pixels. `height="fill"` is shorthand for `height="100%"`:
|
|
|
719
762
|
|
|
720
763
|
A percentage height only works when its parent has an explicit height.
|
|
721
764
|
Development builds warn when it resolves to `0px`.
|
|
722
|
-
`WindowDynamicVirtualScroll`
|
|
765
|
+
`WindowDynamicVirtualScroll` and `WindowGirdVirtualScroll` use the browser
|
|
766
|
+
window and have no `height` prop.
|
|
723
767
|
|
|
724
768
|
### Stable item keys
|
|
725
769
|
|
|
@@ -782,7 +826,8 @@ to false after the final page.
|
|
|
782
826
|
### Pull to refresh
|
|
783
827
|
|
|
784
828
|
Pull-to-refresh is available on `VirtualList`, `DynamicVirtualScroll`,
|
|
785
|
-
`VirtualScroll`,
|
|
829
|
+
`VirtualScroll`, `WindowDynamicVirtualScroll`, and
|
|
830
|
+
`WindowGirdVirtualScroll`:
|
|
786
831
|
|
|
787
832
|
```vue
|
|
788
833
|
<VirtualList
|
|
@@ -823,6 +868,7 @@ import type {
|
|
|
823
868
|
VirtualScrollExpose,
|
|
824
869
|
VirtualScrollProps,
|
|
825
870
|
WindowDynamicVirtualScrollProps,
|
|
871
|
+
WindowGirdVirtualScrollProps,
|
|
826
872
|
} from 'vue-virtual-flow'
|
|
827
873
|
```
|
|
828
874
|
|
package/README.vi.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Bộ component virtual scrolling nhỏ gọn, có type đầy đủ và hỗ trợ khả năng tiếp
|
|
6
6
|
cận cho Vue 3. Thư viện hỗ trợ danh sách chiều cao cố định hoặc động, cuộn theo
|
|
7
|
-
cửa sổ, giao diện chat, feed media ngắn và carousel ngang.
|
|
7
|
+
cửa sổ, grid cuộn theo cửa sổ, giao diện chat, feed media ngắn và carousel ngang.
|
|
8
8
|
|
|
9
9
|
Chỉ các item cần thiết cho viewport hiện tại được mount, nhờ đó tập dữ liệu lớn
|
|
10
10
|
vẫn phản hồi nhanh mà component không áp đặt giao diện của từng item.
|
|
@@ -18,6 +18,7 @@ vẫn phản hồi nhanh mà component không áp đặt giao diện của từn
|
|
|
18
18
|
- [VirtualList và DynamicVirtualScroll](#virtuallist-và-dynamicvirtualscroll)
|
|
19
19
|
- [VirtualScroll](#virtualscroll)
|
|
20
20
|
- [WindowDynamicVirtualScroll](#windowdynamicvirtualscroll)
|
|
21
|
+
- [WindowGirdVirtualScroll](#windowgirdvirtualscroll)
|
|
21
22
|
- [ChatVirtualScroll](#chatvirtualscroll)
|
|
22
23
|
- [ShortMediaFeed](#shortmediafeed)
|
|
23
24
|
- [VirtualCarousel](#virtualcarousel)
|
|
@@ -83,8 +84,8 @@ createApp(App).use(VueVirtualScroll).mount('#app')
|
|
|
83
84
|
```
|
|
84
85
|
|
|
85
86
|
Plugin đăng ký `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll`,
|
|
86
|
-
`WindowDynamicVirtualScroll`, `
|
|
87
|
-
`VirtualCarousel`.
|
|
87
|
+
`WindowDynamicVirtualScroll`, `WindowGirdVirtualScroll`, `ChatVirtualScroll`,
|
|
88
|
+
`ShortMediaFeed` và `VirtualCarousel`.
|
|
88
89
|
|
|
89
90
|
## Chọn component
|
|
90
91
|
|
|
@@ -94,6 +95,7 @@ Plugin đăng ký `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll`,
|
|
|
94
95
|
| `DynamicVirtualScroll` | Giống `VirtualList` nhưng tên gọi thể hiện rõ chiều cao động. | Container của component | Động, tự đo |
|
|
95
96
|
| `VirtualScroll` | Tất cả hàng có cùng chiều cao đã biết. | Container của component | Cố định |
|
|
96
97
|
| `WindowDynamicVirtualScroll` | Muốn trang cuộn thay vì tạo một container cuộn lồng bên trong. | Cửa sổ trình duyệt | Động, tự đo |
|
|
98
|
+
| `WindowGirdVirtualScroll` | Grid card có chiều cao cố định và dùng trang để cuộn. | Cửa sổ trình duyệt | Chiều cao hàng cố định |
|
|
97
99
|
| `ChatVirtualScroll` | Tin nhắn mới được thêm ở cuối và lịch sử cũ được thêm ở đầu. | Container của component | Động, tự đo |
|
|
98
100
|
| `ShortMediaFeed` | Mỗi lần cần snap một item đầy viewport. | Container của component | Một viewport cho mỗi item |
|
|
99
101
|
| `VirtualCarousel` | Cần hiển thị và snap nhiều slide theo chiều ngang. | Container của component | Tính từ chiều rộng container |
|
|
@@ -362,6 +364,47 @@ const list = ref<VirtualScrollExpose>()
|
|
|
362
364
|
- Methods: `scrollTo`, `scrollToIndex` và `scrollToTop`. Các method này cuộn
|
|
363
365
|
cửa sổ trình duyệt; `scrollTo` nhận offset tương đối so với đầu danh sách.
|
|
364
366
|
|
|
367
|
+
### WindowGirdVirtualScroll
|
|
368
|
+
|
|
369
|
+
Dùng `WindowGirdVirtualScroll` cho grid nhiều cột có card với chiều cao cố định
|
|
370
|
+
đã biết và dùng cửa sổ trình duyệt làm viewport. Component virtualize theo cả
|
|
371
|
+
hàng để các cột đang hiển thị luôn được mount cùng nhau.
|
|
372
|
+
|
|
373
|
+
```vue
|
|
374
|
+
<script setup lang="ts">
|
|
375
|
+
import { WindowGirdVirtualScroll } from 'vue-virtual-flow'
|
|
376
|
+
|
|
377
|
+
const products = Array.from({ length: 10_000 }, (_, id) => ({
|
|
378
|
+
id,
|
|
379
|
+
name: `Sản phẩm ${id + 1}`,
|
|
380
|
+
}))
|
|
381
|
+
</script>
|
|
382
|
+
|
|
383
|
+
<template>
|
|
384
|
+
<WindowGirdVirtualScroll
|
|
385
|
+
:items="products"
|
|
386
|
+
:item-size="240"
|
|
387
|
+
:columns="4"
|
|
388
|
+
:gap="16"
|
|
389
|
+
item-key="id"
|
|
390
|
+
aria-label="Grid sản phẩm"
|
|
391
|
+
>
|
|
392
|
+
<template #default="{ item, rowIndex, columnIndex }">
|
|
393
|
+
<ProductCard
|
|
394
|
+
:product="item"
|
|
395
|
+
:data-position="`${rowIndex}:${columnIndex}`"
|
|
396
|
+
/>
|
|
397
|
+
</template>
|
|
398
|
+
</WindowGirdVirtualScroll>
|
|
399
|
+
</template>
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`itemSize` là chiều cao của một hàng grid; nội dung vượt quá kích thước này sẽ
|
|
403
|
+
bị ẩn. `columns` mặc định là `2`, `gap` mặc định là `0`, còn `overscan` mặc
|
|
404
|
+
định render thêm một hàng trước và sau vùng nhìn thấy. Các prop list còn lại,
|
|
405
|
+
event, named slot và method qua ref giống `WindowDynamicVirtualScroll`. Default
|
|
406
|
+
slot nhận thêm `rowIndex` và `columnIndex`.
|
|
407
|
+
|
|
365
408
|
### ChatVirtualScroll
|
|
366
409
|
|
|
367
410
|
`ChatVirtualScroll` dành cho hội thoại có tin nhắn cao thấp khác nhau. Mặc định
|
|
@@ -717,8 +760,8 @@ Các component dùng container nhận một số hoặc chuỗi chiều cao CSS.
|
|
|
717
760
|
|
|
718
761
|
Chiều cao phần trăm chỉ hoạt động khi thẻ cha có chiều cao xác định. Bản
|
|
719
762
|
development cảnh báo nếu viewport được tính thành `0px`.
|
|
720
|
-
`WindowDynamicVirtualScroll` dùng cửa sổ trình
|
|
721
|
-
`height`.
|
|
763
|
+
`WindowDynamicVirtualScroll` và `WindowGirdVirtualScroll` dùng cửa sổ trình
|
|
764
|
+
duyệt nên không có prop `height`.
|
|
722
765
|
|
|
723
766
|
### Key ổn định cho item
|
|
724
767
|
|
|
@@ -778,8 +821,8 @@ phép request tiếp theo. Giữ `loading` là true trong toàn bộ request và
|
|
|
778
821
|
|
|
779
822
|
### Kéo để làm mới
|
|
780
823
|
|
|
781
|
-
Pull-to-refresh có trên `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll
|
|
782
|
-
và `
|
|
824
|
+
Pull-to-refresh có trên `VirtualList`, `DynamicVirtualScroll`, `VirtualScroll`,
|
|
825
|
+
`WindowDynamicVirtualScroll` và `WindowGirdVirtualScroll`:
|
|
783
826
|
|
|
784
827
|
```vue
|
|
785
828
|
<VirtualList
|
|
@@ -820,6 +863,7 @@ import type {
|
|
|
820
863
|
VirtualScrollExpose,
|
|
821
864
|
VirtualScrollProps,
|
|
822
865
|
WindowDynamicVirtualScrollProps,
|
|
866
|
+
WindowGirdVirtualScrollProps,
|
|
823
867
|
} from 'vue-virtual-flow'
|
|
824
868
|
```
|
|
825
869
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.cjs';
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
|
|
5
|
+
readonly onLoadMore?: (() => any) | undefined;
|
|
6
|
+
readonly onRefresh?: (() => any) | undefined;
|
|
7
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
|
|
8
|
+
items: readonly T[];
|
|
9
|
+
itemSize: number;
|
|
10
|
+
columns?: number;
|
|
11
|
+
gap?: number;
|
|
12
|
+
overscan?: number;
|
|
13
|
+
itemKey?: ItemKey<T> extends infer Key ? Key : never;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
hasMore?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingItemSize?: number;
|
|
18
|
+
loadMoreThreshold?: number;
|
|
19
|
+
pullToRefresh?: boolean;
|
|
20
|
+
refreshing?: boolean;
|
|
21
|
+
pullRefreshThreshold?: number;
|
|
22
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
|
23
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
24
|
+
scrollTo: (position: number, options?: ScrollToOptions) => void;
|
|
25
|
+
scrollToIndex: (index: number, options?: ScrollToOptions & {
|
|
26
|
+
align?: ScrollAlignment;
|
|
27
|
+
}) => void;
|
|
28
|
+
scrollToTop: (behavior?: ScrollBehavior) => void;
|
|
29
|
+
}>): void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: {
|
|
32
|
+
default(props: {
|
|
33
|
+
item: T;
|
|
34
|
+
index: number;
|
|
35
|
+
rowIndex: number;
|
|
36
|
+
columnIndex: number;
|
|
37
|
+
}): unknown;
|
|
38
|
+
empty?(): unknown;
|
|
39
|
+
loading?(): unknown;
|
|
40
|
+
refresh?(props: {
|
|
41
|
+
pullDistance: number;
|
|
42
|
+
progress: number;
|
|
43
|
+
refreshing: boolean;
|
|
44
|
+
}): unknown;
|
|
45
|
+
};
|
|
46
|
+
emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
|
|
47
|
+
}>) => import('vue').VNode & {
|
|
48
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_PrettifyLocal<T> = {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} & {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ItemKey, ScrollAlignment, VirtualScrollEvent } from '../types.js';
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onScroll?: ((event: VirtualScrollEvent) => any) | undefined;
|
|
5
|
+
readonly onLoadMore?: (() => any) | undefined;
|
|
6
|
+
readonly onRefresh?: (() => any) | undefined;
|
|
7
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onScroll" | "onLoadMore" | "onRefresh"> & {
|
|
8
|
+
items: readonly T[];
|
|
9
|
+
itemSize: number;
|
|
10
|
+
columns?: number;
|
|
11
|
+
gap?: number;
|
|
12
|
+
overscan?: number;
|
|
13
|
+
itemKey?: ItemKey<T> extends infer Key ? Key : never;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
hasMore?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
loadingItemSize?: number;
|
|
18
|
+
loadMoreThreshold?: number;
|
|
19
|
+
pullToRefresh?: boolean;
|
|
20
|
+
refreshing?: boolean;
|
|
21
|
+
pullRefreshThreshold?: number;
|
|
22
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
|
23
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
24
|
+
scrollTo: (position: number, options?: ScrollToOptions) => void;
|
|
25
|
+
scrollToIndex: (index: number, options?: ScrollToOptions & {
|
|
26
|
+
align?: ScrollAlignment;
|
|
27
|
+
}) => void;
|
|
28
|
+
scrollToTop: (behavior?: ScrollBehavior) => void;
|
|
29
|
+
}>): void;
|
|
30
|
+
attrs: any;
|
|
31
|
+
slots: {
|
|
32
|
+
default(props: {
|
|
33
|
+
item: T;
|
|
34
|
+
index: number;
|
|
35
|
+
rowIndex: number;
|
|
36
|
+
columnIndex: number;
|
|
37
|
+
}): unknown;
|
|
38
|
+
empty?(): unknown;
|
|
39
|
+
loading?(): unknown;
|
|
40
|
+
refresh?(props: {
|
|
41
|
+
pullDistance: number;
|
|
42
|
+
progress: number;
|
|
43
|
+
refreshing: boolean;
|
|
44
|
+
}): unknown;
|
|
45
|
+
};
|
|
46
|
+
emit: ((evt: "scroll", event: VirtualScrollEvent) => void) & ((evt: "loadMore") => void) & ((evt: "refresh") => void);
|
|
47
|
+
}>) => import('vue').VNode & {
|
|
48
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_PrettifyLocal<T> = {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} & {};
|
package/dist/index.d.cts
CHANGED
|
@@ -5,6 +5,7 @@ import { default as ShortMediaFeed } from './components/ShortMediaFeed.cjs';
|
|
|
5
5
|
import { default as VirtualCarousel } from './components/VirtualCarousel.cjs';
|
|
6
6
|
import { default as VirtualScroll } from './components/VirtualScroll.cjs';
|
|
7
7
|
import { default as WindowDynamicVirtualScroll } from './components/WindowDynamicVirtualScroll.cjs';
|
|
8
|
+
import { default as WindowGirdVirtualScroll } from './components/WindowGirdVirtualScroll.cjs';
|
|
8
9
|
declare module 'vue' {
|
|
9
10
|
interface GlobalComponents {
|
|
10
11
|
ChatVirtualScroll: typeof ChatVirtualScroll;
|
|
@@ -14,10 +15,11 @@ declare module 'vue' {
|
|
|
14
15
|
VirtualList: typeof DynamicVirtualScroll;
|
|
15
16
|
VirtualScroll: typeof VirtualScroll;
|
|
16
17
|
WindowDynamicVirtualScroll: typeof WindowDynamicVirtualScroll;
|
|
18
|
+
WindowGirdVirtualScroll: typeof WindowGirdVirtualScroll;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
declare const VirtualList: typeof DynamicVirtualScroll;
|
|
20
|
-
export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, };
|
|
21
|
-
export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, } from './types.cjs';
|
|
22
|
+
export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, WindowGirdVirtualScroll, };
|
|
23
|
+
export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.cjs';
|
|
22
24
|
export declare const VueVirtualScroll: Plugin;
|
|
23
25
|
export default VueVirtualScroll;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { default as ShortMediaFeed } from './components/ShortMediaFeed.js';
|
|
|
5
5
|
import { default as VirtualCarousel } from './components/VirtualCarousel.js';
|
|
6
6
|
import { default as VirtualScroll } from './components/VirtualScroll.js';
|
|
7
7
|
import { default as WindowDynamicVirtualScroll } from './components/WindowDynamicVirtualScroll.js';
|
|
8
|
+
import { default as WindowGirdVirtualScroll } from './components/WindowGirdVirtualScroll.js';
|
|
8
9
|
declare module 'vue' {
|
|
9
10
|
interface GlobalComponents {
|
|
10
11
|
ChatVirtualScroll: typeof ChatVirtualScroll;
|
|
@@ -14,10 +15,11 @@ declare module 'vue' {
|
|
|
14
15
|
VirtualList: typeof DynamicVirtualScroll;
|
|
15
16
|
VirtualScroll: typeof VirtualScroll;
|
|
16
17
|
WindowDynamicVirtualScroll: typeof WindowDynamicVirtualScroll;
|
|
18
|
+
WindowGirdVirtualScroll: typeof WindowGirdVirtualScroll;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
declare const VirtualList: typeof DynamicVirtualScroll;
|
|
20
|
-
export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, };
|
|
21
|
-
export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, } from './types.js';
|
|
22
|
+
export { ChatVirtualScroll, DynamicVirtualScroll, ShortMediaFeed, VirtualCarousel, VirtualList, VirtualScroll, WindowDynamicVirtualScroll, WindowGirdVirtualScroll, };
|
|
23
|
+
export type { ChatVirtualScrollExpose, ChatVirtualScrollProps, DynamicVirtualScrollProps, ItemKey, ResponsiveBreakpoint, ScrollAlignment, ShortMediaFeedChangeEvent, ShortMediaFeedExpose, ShortMediaFeedProps, VirtualCarouselChangeEvent, VirtualCarouselExpose, VirtualCarouselProps, VirtualListExpose, VirtualListProps, VirtualScrollEvent, VirtualScrollExpose, VirtualScrollProps, WindowDynamicVirtualScrollProps, WindowGirdVirtualScrollProps, } from './types.js';
|
|
22
24
|
export declare const VueVirtualScroll: Plugin;
|
|
23
25
|
export default VueVirtualScroll;
|
package/dist/types.d.cts
CHANGED
|
@@ -43,6 +43,22 @@ export interface WindowDynamicVirtualScrollProps<T> {
|
|
|
43
43
|
refreshing?: boolean;
|
|
44
44
|
pullRefreshThreshold?: number;
|
|
45
45
|
}
|
|
46
|
+
export interface WindowGirdVirtualScrollProps<T> {
|
|
47
|
+
items: readonly T[];
|
|
48
|
+
itemSize: number;
|
|
49
|
+
columns?: number;
|
|
50
|
+
gap?: number;
|
|
51
|
+
overscan?: number;
|
|
52
|
+
itemKey?: ItemKey<T>;
|
|
53
|
+
ariaLabel?: string;
|
|
54
|
+
hasMore?: boolean;
|
|
55
|
+
loading?: boolean;
|
|
56
|
+
loadingItemSize?: number;
|
|
57
|
+
loadMoreThreshold?: number;
|
|
58
|
+
pullToRefresh?: boolean;
|
|
59
|
+
refreshing?: boolean;
|
|
60
|
+
pullRefreshThreshold?: number;
|
|
61
|
+
}
|
|
46
62
|
export interface ChatVirtualScrollProps<T> {
|
|
47
63
|
items: readonly T[];
|
|
48
64
|
estimatedItemSize?: number;
|
package/dist/types.d.ts
CHANGED
|
@@ -43,6 +43,22 @@ export interface WindowDynamicVirtualScrollProps<T> {
|
|
|
43
43
|
refreshing?: boolean;
|
|
44
44
|
pullRefreshThreshold?: number;
|
|
45
45
|
}
|
|
46
|
+
export interface WindowGirdVirtualScrollProps<T> {
|
|
47
|
+
items: readonly T[];
|
|
48
|
+
itemSize: number;
|
|
49
|
+
columns?: number;
|
|
50
|
+
gap?: number;
|
|
51
|
+
overscan?: number;
|
|
52
|
+
itemKey?: ItemKey<T>;
|
|
53
|
+
ariaLabel?: string;
|
|
54
|
+
hasMore?: boolean;
|
|
55
|
+
loading?: boolean;
|
|
56
|
+
loadingItemSize?: number;
|
|
57
|
+
loadMoreThreshold?: number;
|
|
58
|
+
pullToRefresh?: boolean;
|
|
59
|
+
refreshing?: boolean;
|
|
60
|
+
pullRefreshThreshold?: number;
|
|
61
|
+
}
|
|
46
62
|
export interface ChatVirtualScrollProps<T> {
|
|
47
63
|
items: readonly T[];
|
|
48
64
|
estimatedItemSize?: number;
|