intelliwaketssveltekitv25 1.0.18 → 1.0.19
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/dist/VirtualList.svelte
CHANGED
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
let average_height: number | undefined = $state()
|
|
33
33
|
|
|
34
34
|
let is_scrolling = false
|
|
35
|
+
let is_refreshing = false
|
|
35
36
|
|
|
36
37
|
let visible = $derived(
|
|
37
38
|
items.slice(start, end).map((data, i) => ({
|
|
@@ -42,13 +43,15 @@
|
|
|
42
43
|
|
|
43
44
|
// whenever `items` changes, invalidate the current heightmap
|
|
44
45
|
$effect(() => {
|
|
45
|
-
if (mounted) {
|
|
46
|
+
if (mounted && !is_scrolling) {
|
|
46
47
|
refresh(items, viewport_height, itemHeight)
|
|
47
48
|
}
|
|
48
49
|
})
|
|
49
50
|
|
|
50
51
|
async function refresh(items: T[], viewport_height: number, itemHeight: number | undefined) {
|
|
51
|
-
if (!viewport) return
|
|
52
|
+
if (!viewport || is_refreshing) return
|
|
53
|
+
|
|
54
|
+
is_refreshing = true
|
|
52
55
|
|
|
53
56
|
const { scrollTop } = viewport
|
|
54
57
|
|
|
@@ -81,10 +84,12 @@
|
|
|
81
84
|
|
|
82
85
|
bottom = remaining * average_height
|
|
83
86
|
height_map.length = items.length
|
|
87
|
+
|
|
88
|
+
is_refreshing = false
|
|
84
89
|
}
|
|
85
90
|
|
|
86
91
|
async function handle_scroll() {
|
|
87
|
-
if (!viewport || !rows || is_scrolling) return
|
|
92
|
+
if (!viewport || !rows || is_scrolling || is_refreshing) return
|
|
88
93
|
|
|
89
94
|
is_scrolling = true
|
|
90
95
|
|
package/dist/VirtualTable.svelte
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
let average_height: number | undefined = $state()
|
|
43
43
|
|
|
44
44
|
let is_scrolling = false
|
|
45
|
+
let is_refreshing = false
|
|
45
46
|
|
|
46
47
|
let visible = $derived(
|
|
47
48
|
items.slice(start, end).map((data, i) => ({
|
|
@@ -52,13 +53,15 @@
|
|
|
52
53
|
|
|
53
54
|
// whenever `items` changes, invalidate the current heightmap
|
|
54
55
|
$effect(() => {
|
|
55
|
-
if (mounted) {
|
|
56
|
+
if (mounted && !is_scrolling) {
|
|
56
57
|
refresh(items, viewport_height, itemHeight)
|
|
57
58
|
}
|
|
58
59
|
})
|
|
59
60
|
|
|
60
61
|
async function refresh(items: T[], viewport_height: number, itemHeight: number | undefined) {
|
|
61
|
-
if (!viewport) return
|
|
62
|
+
if (!viewport || is_refreshing) return
|
|
63
|
+
|
|
64
|
+
is_refreshing = true
|
|
62
65
|
|
|
63
66
|
const { scrollTop } = viewport
|
|
64
67
|
|
|
@@ -91,10 +94,12 @@
|
|
|
91
94
|
|
|
92
95
|
bottom = remaining * average_height
|
|
93
96
|
height_map.length = items.length
|
|
97
|
+
|
|
98
|
+
is_refreshing = false
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
async function handle_scroll() {
|
|
97
|
-
if (!viewport || !rows || is_scrolling) return
|
|
102
|
+
if (!viewport || !rows || is_scrolling || is_refreshing) return
|
|
98
103
|
|
|
99
104
|
is_scrolling = true
|
|
100
105
|
|