@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: {top}px; padding-bottom: {bottom}px;">
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.scrollTop;
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.scrollTop;
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 = y - row_height * padding_threshold;
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": "2.2.1",
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": "e4e822a3de295420c1f1cdd832a1fca80b94683f"
38
+ "gitHead": "4126948ef47aada6b868e310f9b7e22951835b9b"
39
39
  }
@@ -13,7 +13,7 @@
13
13
  -->
14
14
  <div
15
15
  class="transible {klass}"
16
- in:fade={{
16
+ in:fade|global={{
17
17
  duration: duration || 300,
18
18
  delay: delay || 0,
19
19
  easing: getEasing(easing),
@@ -15,7 +15,7 @@
15
15
  -->
16
16
  <div
17
17
  class="transible {klass}"
18
- in:fly={{
18
+ in:fly|global={{
19
19
  x: x || 0,
20
20
  y: y || 0,
21
21
  duration: duration || 300,
@@ -16,7 +16,7 @@
16
16
  <div
17
17
  class="transible {klass}"
18
18
  style="transform:translate3d(0,0,0)"
19
- in:scale={{
19
+ in:scale|global={{
20
20
  // @ts-ignore
21
21
  from: from || 0.5,
22
22
  to: to || 1,
@@ -13,7 +13,7 @@
13
13
  -->
14
14
  <div
15
15
  class="transible {klass}"
16
- in:slide={{
16
+ in:slide|global={{
17
17
  duration: duration || 300,
18
18
  delay: delay || 0,
19
19
  easing: getEasing(easing),