svelte-tiny-virtual-list
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -905,3 +905,3 @@ (function (global, factory) { | ||
// (319:2) {#each items as item (item.index)} | ||
// (316:2) {#each items as item (item.index)} | ||
function create_each_block(key_1, ctx) { | ||
@@ -1099,6 +1099,2 @@ let first; | ||
function cssVal(val) { | ||
return typeof val === "number" ? val + "px" : val; | ||
} | ||
function instance($$self, $$props, $$invalidate) { | ||
@@ -1227,7 +1223,11 @@ let { $$slots: slots = {}, $$scope } = $$props; | ||
let updatedItems = []; | ||
$$invalidate(2, wrapperStyle = "height:" + cssVal(height) + ";width:" + cssVal(width)); | ||
const totalSize = sizeAndPositionManager.getTotalSize(); | ||
$$invalidate(3, innerStyle = (scrollDirection === DIRECTION.VERTICAL | ||
? "flex-direction:column;height:" | ||
: "width:") + cssVal(sizeAndPositionManager.getTotalSize())); | ||
if (scrollDirection === DIRECTION.VERTICAL) { | ||
$$invalidate(2, wrapperStyle = `height:${height}px;width:${width};`); | ||
$$invalidate(3, innerStyle = `flex-direction:column;height:${totalSize}px;`); | ||
} else { | ||
$$invalidate(2, wrapperStyle = `height:${height};width:${width}px`); | ||
$$invalidate(3, innerStyle = `width:${totalSize}px;`); | ||
} | ||
@@ -1307,16 +1307,16 @@ const hasStickyIndices = stickyIndices != null && stickyIndices.length !== 0; | ||
if (scrollDirection === DIRECTION.VERTICAL) { | ||
style = "left:0;width:100%;height:" + cssVal(size); | ||
style = `left:0;width:100%;height:${size}px;`; | ||
if (sticky) { | ||
style += ";position:sticky;flex-grow:0;z-index:1;top:0;margin-top:" + cssVal(offset) + ";margin-bottom:" + cssVal(-(offset + size)) + ";"; | ||
style += `position:sticky;flex-grow:0;z-index:1;top:0;margin-top:${offset}px;margin-bottom:${-(offset + size)}px;`; | ||
} else { | ||
style += ";position:absolute;top:" + cssVal(offset) + ";"; | ||
style += `position:absolute;top:${offset}px;`; | ||
} | ||
} else { | ||
style = "top:0;width:" + cssVal(size); | ||
style = `top:0;width:${size}px;`; | ||
if (sticky) { | ||
style += ";position:sticky;z-index:1;left:0;margin-left:" + cssVal(offset) + ";margin-right:" + cssVal(-(offset + size)) + ";"; | ||
style += `position:sticky;z-index:1;left:0;margin-left:${offset}px;margin-right:${-(offset + size)}px;`; | ||
} else { | ||
style += ";position:absolute;height:100%;left:" + cssVal(offset) + ";"; | ||
style += `position:absolute;height:100%;left:${offset};`; | ||
} | ||
@@ -1323,0 +1323,0 @@ } |
{ | ||
"name": "svelte-tiny-virtual-list", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "A tiny but mighty list virtualization component for svelte, with zero dependencies 💪", | ||
@@ -5,0 +5,0 @@ "svelte": "src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2995
118095