@kws3/ui 2.2.1 → 4.0.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/CHANGELOG.mdx
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# 4.0.0
|
|
2
|
+
- add svelte 4 compatibility
|
|
3
|
+
|
|
4
|
+
--------------
|
|
5
|
+
|
|
6
|
+
# 2.2.2
|
|
7
|
+
- `ScrollableList` - fix jumping issue when edge of scrollable regions are reached
|
|
8
|
+
|
|
1
9
|
# 2.2.1
|
|
2
10
|
- `Icon` fix icon sizes when line-awesome icons are loaded
|
|
3
11
|
- `Icon` fix material icons when icon family is set globally
|
|
@@ -54,7 +54,9 @@ while more items are loading
|
|
|
54
54
|
bind:offsetHeight={viewport_height}>
|
|
55
55
|
<div
|
|
56
56
|
bind:this={contents}
|
|
57
|
-
style="padding-top: {
|
|
57
|
+
style="padding-top: {start === 0
|
|
58
|
+
? 0
|
|
59
|
+
: top}px; padding-bottom: {bottom}px;">
|
|
58
60
|
{#each visible as item (item.index)}
|
|
59
61
|
<div class="row">
|
|
60
62
|
<!--Default slot for list view items-->
|
|
@@ -148,7 +150,7 @@ while more items are loading
|
|
|
148
150
|
|
|
149
151
|
async function refresh() {
|
|
150
152
|
if (!mounted) return;
|
|
151
|
-
const scrollTop = viewport
|
|
153
|
+
const { scrollTop } = viewport;
|
|
152
154
|
await tick(); // wait until the DOM is up to date
|
|
153
155
|
let content_height = top - scrollTop;
|
|
154
156
|
let i = start;
|
|
@@ -172,7 +174,7 @@ while more items are loading
|
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
async function handle_scroll() {
|
|
175
|
-
const scrollTop = viewport
|
|
177
|
+
const { scrollTop } = viewport;
|
|
176
178
|
const old_start = start;
|
|
177
179
|
for (let v = 0; v < rows.length; v += 1) {
|
|
178
180
|
height_map[start + v] = item_height || rows[v].offsetHeight;
|
|
@@ -183,7 +185,10 @@ while more items are loading
|
|
|
183
185
|
const row_height = height_map[i] || average_height;
|
|
184
186
|
if (y + row_height > scrollTop) {
|
|
185
187
|
start = i;
|
|
186
|
-
top =
|
|
188
|
+
top =
|
|
189
|
+
y > row_height * padding_threshold
|
|
190
|
+
? y - row_height * padding_threshold
|
|
191
|
+
: y;
|
|
187
192
|
break;
|
|
188
193
|
}
|
|
189
194
|
y += row_height;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kws3/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "UI components for use with Svelte v3 applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"svelte": "index.js",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typescript": "^5.0.4"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "4126948ef47aada6b868e310f9b7e22951835b9b"
|
|
39
39
|
}
|