1.0.0-init.2 • Published 6 years ago
@dreamworld/dw-lazy-list v1.0.0-init.2
dw-lazy-list
An element which is used to load list row's data lazily. Data can be load in continuous or nonContinuous way.
Installation
npm install @dreamworld/dw-lazy-listUsage
@import '@dreamworld/dw-lazy-list/dw-lazy-list';Demo
Features
- Sets
activeproperty on light dom when it becomes visible in the viewport- setting of the
activeproperty depends on thenonContinuous,initialItemsCount,prerenderItemsCountandprerenderItemsPercentagesproperty.
- setting of the
- Can work in 2 direction. Horizontal and Vertical
- Set
prerenderItemsPercentagesorprerenderItemsCountto pre setactiveproperty on light dom before it's visible to viewportprerenderItemsCountwill not work fornonContinuouslist
How it works
- It selets all light element using
slot - It listen on owned
scrollevent and windowresizeevent to refresh list. - It marks
activeflag on light element which is available in visible viewport area. - It provides
refreshmethod to refresh list. Integration element must use this method in following cases:- New item is added to list
- Existing item is removed
- Order is changed
- Item's height is changed.
Methods
- refresh
- scrollToBottom
- canScrollTop
- canScrollBottom
- scrollToIndex
Examples
<lazy-list initialItemsCount=20>
<child-el></child-el>
<child-el></child-el>
</lazy-list>1.0.0-init.2
6 years ago
1.0.0-init.1
6 years ago