ng-virtual-list 16.11.4 → 16.12.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.
Files changed (270) hide show
  1. package/README.md +79 -41
  2. package/esm2022/lib/components/ng-list-item/base/base-virtual-list-item-component.mjs +133 -31
  3. package/esm2022/lib/components/ng-list-item/const/index.mjs +13 -2
  4. package/esm2022/lib/components/ng-list-item/ng-virtual-list-item.component.mjs +35 -42
  5. package/esm2022/lib/components/ng-list-item/ng-virtual-list-item.module.mjs +5 -5
  6. package/esm2022/lib/components/ng-list-item/utils/create-display-id.mjs +7 -1
  7. package/esm2022/lib/components/ng-list-item/utils/get-element-by-index.mjs +17 -3
  8. package/esm2022/lib/components/ng-list-item/utils/index.mjs +3 -2
  9. package/esm2022/lib/components/ng-list-item/utils/matrix-3d.mjs +18 -0
  10. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list/ng-prerender-list.component.mjs +28 -18
  11. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.mjs +32 -16
  12. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.mjs +5 -5
  13. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.component.mjs +8 -6
  14. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.module.mjs +3 -3
  15. package/esm2022/lib/components/ng-prerender-container/core/prerender-track-box.mjs +38 -8
  16. package/esm2022/lib/components/ng-prerender-container/interfaces/refresh-params.mjs +1 -1
  17. package/esm2022/lib/components/ng-prerender-container/ng-prerender-container.component.mjs +7 -6
  18. package/esm2022/lib/components/ng-prerender-container/types/cache.mjs +1 -1
  19. package/esm2022/lib/components/ng-scroll-bar/interfaces/scroll-bar-template-context.mjs +1 -1
  20. package/esm2022/lib/components/ng-scroll-bar/ng-scroll-bar.component.mjs +68 -27
  21. package/esm2022/lib/components/ng-scroll-view/base/base-scroll-view.component.mjs +108 -21
  22. package/esm2022/lib/components/ng-scroll-view/const/index.mjs +4 -2
  23. package/esm2022/lib/components/ng-scroll-view/interfaces/scroll-to-params.mjs +1 -1
  24. package/esm2022/lib/components/ng-scroll-view/ng-scroll-view.component.mjs +553 -71
  25. package/esm2022/lib/components/ng-scroll-view/utils/calculate-direction.mjs +7 -1
  26. package/esm2022/lib/components/ng-scroll-view/utils/calculate-velocity.mjs +12 -0
  27. package/esm2022/lib/components/ng-scroll-view/utils/get-dir.mjs +10 -0
  28. package/esm2022/lib/components/ng-scroll-view/utils/index.mjs +4 -2
  29. package/esm2022/lib/components/ng-scroll-view/utils/matrix-3d.mjs +15 -0
  30. package/esm2022/lib/components/ng-scroller/enums/scroller-directions.mjs +1 -1
  31. package/esm2022/lib/components/ng-scroller/ng-scroller.component.mjs +199 -123
  32. package/esm2022/lib/components/ng-scroller/utils/scroll-box.mjs +2 -2
  33. package/esm2022/lib/const/index.mjs +50 -10
  34. package/esm2022/lib/core/cache-map.mjs +1 -54
  35. package/esm2022/lib/core/const/index.mjs +3 -0
  36. package/esm2022/lib/core/enums/index.mjs +3 -0
  37. package/esm2022/lib/core/enums/item-display-methods.mjs +14 -0
  38. package/esm2022/lib/core/events/index.mjs +3 -0
  39. package/esm2022/lib/core/events/track-box-events.mjs +12 -0
  40. package/esm2022/lib/core/interfaces/get-item-position-options.mjs +2 -0
  41. package/esm2022/lib/core/interfaces/get-metrics-returns.mjs +2 -0
  42. package/esm2022/lib/core/interfaces/index.mjs +2 -0
  43. package/esm2022/lib/core/interfaces/item.mjs +2 -0
  44. package/esm2022/lib/core/interfaces/metrics.mjs +2 -0
  45. package/esm2022/lib/core/interfaces/recalculate-metrics-options.mjs +2 -0
  46. package/esm2022/lib/core/interfaces/update-collection-options.mjs +2 -0
  47. package/esm2022/lib/core/interfaces/update-collection-returns.mjs +2 -0
  48. package/esm2022/lib/core/track-box.mjs +602 -192
  49. package/esm2022/lib/core/tracker.mjs +14 -8
  50. package/esm2022/lib/core/types/cache-map-events.mjs +2 -0
  51. package/esm2022/lib/core/types/cache-map-listeners.mjs +2 -0
  52. package/esm2022/lib/core/types/cache.mjs +2 -0
  53. package/esm2022/lib/core/types/index.mjs +2 -0
  54. package/esm2022/lib/core/types/on-change-event-listener.mjs +2 -0
  55. package/esm2022/lib/core/types/on-tick-event-listener.mjs +2 -0
  56. package/esm2022/lib/core/utils/get-service-id-prop.mjs +10 -0
  57. package/esm2022/lib/core/utils/index.mjs +3 -0
  58. package/esm2022/lib/directives/index.mjs +3 -3
  59. package/esm2022/lib/directives/locale-sensitive/locale-sensitive.directive.mjs +2 -1
  60. package/esm2022/lib/directives/virtual-click/virtual-click.directive.mjs +67 -0
  61. package/esm2022/lib/directives/virtual-click/virtual-click.module.mjs +19 -0
  62. package/esm2022/lib/enums/alignments.mjs +12 -0
  63. package/esm2022/lib/enums/collapsing-modes.mjs +22 -0
  64. package/esm2022/lib/enums/index.mjs +8 -4
  65. package/esm2022/lib/enums/selecting-modes-types.mjs +22 -0
  66. package/esm2022/lib/enums/selecting-modes.mjs +22 -0
  67. package/esm2022/lib/enums/snap-to-item-aligns.mjs +22 -0
  68. package/esm2022/lib/enums/spreading-modes.mjs +18 -0
  69. package/esm2022/lib/interfaces/animation-params.mjs +1 -1
  70. package/esm2022/lib/interfaces/base-virtual-list-item-component.mjs +2 -9
  71. package/esm2022/lib/interfaces/index.mjs +1 -1
  72. package/esm2022/lib/interfaces/item-transformation.mjs +2 -0
  73. package/esm2022/lib/interfaces/point.mjs +2 -0
  74. package/esm2022/lib/interfaces/scroll-options.mjs +1 -1
  75. package/esm2022/lib/interfaces/scroll-params.mjs +1 -1
  76. package/esm2022/lib/models/item-config-map.model.mjs +1 -1
  77. package/esm2022/lib/models/item.model.mjs +1 -1
  78. package/esm2022/lib/models/render-item-config.model.mjs +1 -1
  79. package/esm2022/lib/models/render-item-measures.model.mjs +1 -1
  80. package/esm2022/lib/ng-virtual-list-public.service.mjs +6 -7
  81. package/esm2022/lib/ng-virtual-list.component.mjs +1061 -355
  82. package/esm2022/lib/ng-virtual-list.service.mjs +83 -28
  83. package/esm2022/lib/transformations/deck-of-cards-3d.mjs +57 -0
  84. package/esm2022/lib/transformations/deck-of-cards.mjs +54 -0
  85. package/esm2022/lib/transformations/event-horizon.mjs +47 -0
  86. package/esm2022/lib/transformations/index.mjs +13 -0
  87. package/esm2022/lib/transformations/linear.mjs +47 -0
  88. package/esm2022/lib/transformations/swipe-3d.mjs +51 -0
  89. package/esm2022/lib/types/alignment.mjs +2 -0
  90. package/esm2022/lib/types/arithmetic-expression.mjs +2 -0
  91. package/esm2022/lib/types/collapsing-mode.mjs +2 -0
  92. package/esm2022/lib/types/collection-mode.mjs +2 -0
  93. package/esm2022/lib/types/color.mjs +2 -0
  94. package/esm2022/lib/types/direction.mjs +2 -0
  95. package/esm2022/lib/types/float-or-persentage-value.mjs +2 -0
  96. package/esm2022/lib/types/focus-item-params.mjs +1 -1
  97. package/esm2022/lib/types/gradient-color-position.mjs +1 -1
  98. package/esm2022/lib/types/index.mjs +1 -1
  99. package/esm2022/lib/types/item-transform.mjs +2 -0
  100. package/esm2022/lib/types/scroll-direction.mjs +1 -1
  101. package/esm2022/lib/types/selecting-mode.mjs +2 -0
  102. package/esm2022/lib/types/snap-to-item-align.mjs +2 -0
  103. package/esm2022/lib/types/snapping-distance.mjs +2 -0
  104. package/esm2022/lib/types/snapping-method.mjs +2 -0
  105. package/esm2022/lib/types/spreading-mode.mjs +2 -0
  106. package/esm2022/lib/types/text-direction.mjs +2 -0
  107. package/esm2022/lib/utils/animator/animator.mjs +28 -8
  108. package/esm2022/lib/utils/animator/const/index.mjs +2 -0
  109. package/esm2022/lib/utils/animator/ease.mjs +1 -13
  110. package/esm2022/lib/utils/animator/index.mjs +3 -2
  111. package/esm2022/lib/utils/animator/interfaces/animator-params.mjs +2 -0
  112. package/esm2022/lib/utils/animator/interfaces/animator-update-data.mjs +2 -0
  113. package/esm2022/lib/utils/animator/interfaces/index.mjs +2 -0
  114. package/esm2022/lib/utils/animator/types/easing.mjs +1 -1
  115. package/esm2022/lib/utils/get-scroll-state-version.mjs +12 -0
  116. package/esm2022/lib/utils/is-collapse-mode.mjs +18 -0
  117. package/esm2022/lib/utils/is-collection-mode.mjs +1 -1
  118. package/esm2022/lib/utils/is-direction.mjs +1 -1
  119. package/esm2022/lib/utils/is-persentage-value.mjs +14 -0
  120. package/esm2022/lib/utils/is-select-mode.mjs +18 -0
  121. package/esm2022/lib/utils/is-spreading-mode.mjs +15 -0
  122. package/esm2022/lib/utils/normalize-collection.mjs +42 -0
  123. package/esm2022/lib/utils/parse-arithmetic-expression.mjs +53 -0
  124. package/esm2022/lib/utils/parse-float-or-persentage-value.mjs +17 -0
  125. package/esm2022/lib/utils/scrolling-direction.mjs +29 -0
  126. package/esm2022/lib/utils/snapping-method.mjs +1 -1
  127. package/esm2022/public-api.mjs +4 -1
  128. package/fesm2022/ng-virtual-list.mjs +5722 -3073
  129. package/fesm2022/ng-virtual-list.mjs.map +1 -1
  130. package/lib/components/ng-list-item/base/base-virtual-list-item-component.d.ts +19 -4
  131. package/lib/components/ng-list-item/const/index.d.ts +1 -1
  132. package/lib/components/ng-list-item/ng-virtual-list-item.component.d.ts +1 -1
  133. package/lib/components/ng-list-item/ng-virtual-list-item.module.d.ts +2 -2
  134. package/lib/components/ng-list-item/utils/create-display-id.d.ts +6 -0
  135. package/lib/components/ng-list-item/utils/get-element-by-index.d.ts +15 -1
  136. package/lib/components/ng-list-item/utils/index.d.ts +2 -1
  137. package/lib/components/ng-list-item/utils/matrix-3d.d.ts +7 -0
  138. package/lib/components/ng-prerender-container/components/ng-prerender-list/ng-prerender-list.component.d.ts +11 -7
  139. package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.d.ts +2 -2
  140. package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.d.ts +2 -2
  141. package/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.component.d.ts +3 -3
  142. package/lib/components/ng-prerender-container/core/prerender-track-box.d.ts +1 -1
  143. package/lib/components/ng-prerender-container/interfaces/refresh-params.d.ts +2 -1
  144. package/lib/components/ng-prerender-container/ng-prerender-container.component.d.ts +5 -4
  145. package/lib/components/ng-prerender-container/types/cache.d.ts +1 -1
  146. package/lib/components/ng-scroll-bar/interfaces/scroll-bar-template-context.d.ts +1 -1
  147. package/lib/components/ng-scroll-bar/ng-scroll-bar.component.d.ts +11 -6
  148. package/lib/components/ng-scroll-view/base/base-scroll-view.component.d.ts +30 -10
  149. package/lib/components/ng-scroll-view/const/index.d.ts +3 -1
  150. package/lib/components/ng-scroll-view/interfaces/scroll-to-params.d.ts +4 -1
  151. package/lib/components/ng-scroll-view/ng-scroll-view.component.d.ts +65 -7
  152. package/lib/components/ng-scroll-view/utils/calculate-direction.d.ts +6 -0
  153. package/lib/components/ng-scroll-view/utils/calculate-velocity.d.ts +7 -0
  154. package/lib/components/ng-scroll-view/utils/get-dir.d.ts +7 -0
  155. package/lib/components/ng-scroll-view/utils/index.d.ts +3 -1
  156. package/lib/components/ng-scroll-view/utils/matrix-3d.d.ts +7 -0
  157. package/lib/components/ng-scroller/enums/scroller-directions.d.ts +2 -1
  158. package/lib/components/ng-scroller/ng-scroller.component.d.ts +40 -26
  159. package/lib/components/ng-scroller/utils/scroll-box.d.ts +1 -1
  160. package/lib/const/index.d.ts +46 -5
  161. package/lib/core/cache-map.d.ts +0 -10
  162. package/lib/core/const/index.d.ts +1 -0
  163. package/lib/core/enums/index.d.ts +2 -0
  164. package/lib/core/enums/item-display-methods.d.ts +12 -0
  165. package/lib/core/events/index.d.ts +2 -0
  166. package/lib/core/events/track-box-events.d.ts +10 -0
  167. package/lib/core/interfaces/get-item-position-options.d.ts +10 -0
  168. package/lib/core/interfaces/get-metrics-returns.d.ts +11 -0
  169. package/lib/core/interfaces/index.d.ts +8 -0
  170. package/lib/core/interfaces/item.d.ts +9 -0
  171. package/lib/core/interfaces/metrics.d.ts +51 -0
  172. package/lib/core/interfaces/recalculate-metrics-options.d.ts +32 -0
  173. package/lib/core/interfaces/update-collection-options.d.ts +10 -0
  174. package/lib/core/interfaces/update-collection-returns.d.ts +14 -0
  175. package/lib/core/track-box.d.ts +26 -96
  176. package/lib/core/tracker.d.ts +1 -1
  177. package/lib/core/types/cache-map-events.d.ts +8 -0
  178. package/lib/core/types/cache-map-listeners.d.ts +9 -0
  179. package/lib/core/types/cache.d.ts +12 -0
  180. package/lib/core/types/index.d.ts +6 -0
  181. package/lib/core/types/on-change-event-listener.d.ts +7 -0
  182. package/lib/core/types/on-tick-event-listener.d.ts +7 -0
  183. package/lib/core/utils/get-service-id-prop.d.ts +7 -0
  184. package/lib/core/utils/index.d.ts +2 -0
  185. package/lib/directives/index.d.ts +2 -2
  186. package/lib/directives/locale-sensitive/locale-sensitive.directive.d.ts +1 -1
  187. package/lib/directives/{item-click/item-click.directive.d.ts → virtual-click/virtual-click.directive.d.ts} +4 -4
  188. package/lib/directives/virtual-click/virtual-click.module.d.ts +8 -0
  189. package/lib/enums/alignments.d.ts +10 -0
  190. package/lib/enums/collapsing-modes.d.ts +20 -0
  191. package/lib/enums/index.d.ts +7 -9
  192. package/lib/enums/{method-for-selecting-types.d.ts → selecting-modes-types.d.ts} +3 -3
  193. package/lib/enums/{methods-for-selecting.d.ts → selecting-modes.d.ts} +3 -3
  194. package/lib/enums/snap-to-item-aligns.d.ts +20 -0
  195. package/lib/enums/spreading-modes.d.ts +16 -0
  196. package/lib/interfaces/animation-params.d.ts +1 -0
  197. package/lib/interfaces/base-virtual-list-item-component.d.ts +13 -13
  198. package/lib/interfaces/index.d.ts +3 -2
  199. package/lib/interfaces/item-transformation.d.ts +22 -0
  200. package/lib/interfaces/point.d.ts +16 -0
  201. package/lib/interfaces/scroll-options.d.ts +4 -0
  202. package/lib/interfaces/scroll-params.d.ts +2 -1
  203. package/lib/models/item-config-map.model.d.ts +5 -0
  204. package/lib/models/item.model.d.ts +7 -0
  205. package/lib/models/render-item-config.model.d.ts +50 -0
  206. package/lib/models/render-item-measures.model.d.ts +71 -0
  207. package/lib/ng-virtual-list-public.service.d.ts +4 -5
  208. package/lib/ng-virtual-list.component.d.ts +251 -53
  209. package/lib/ng-virtual-list.service.d.ts +30 -12
  210. package/lib/transformations/deck-of-cards-3d.d.ts +54 -0
  211. package/lib/transformations/deck-of-cards.d.ts +50 -0
  212. package/lib/transformations/event-horizon.d.ts +26 -0
  213. package/lib/transformations/index.d.ts +7 -0
  214. package/lib/transformations/linear.d.ts +26 -0
  215. package/lib/transformations/swipe-3d.d.ts +38 -0
  216. package/lib/types/alignment.d.ts +8 -0
  217. package/lib/types/arithmetic-expression.d.ts +10 -0
  218. package/lib/types/collapsing-mode.d.ts +8 -0
  219. package/lib/{enums → types}/collection-mode.d.ts +1 -1
  220. package/lib/types/color.d.ts +4 -0
  221. package/lib/{enums → types}/direction.d.ts +1 -1
  222. package/lib/types/float-or-persentage-value.d.ts +7 -0
  223. package/lib/types/focus-item-params.d.ts +6 -0
  224. package/lib/types/gradient-color-position.d.ts +1 -1
  225. package/lib/types/index.d.ts +15 -1
  226. package/lib/types/item-transform.d.ts +9 -0
  227. package/lib/types/scroll-direction.d.ts +2 -0
  228. package/lib/types/selecting-mode.d.ts +8 -0
  229. package/lib/types/snap-to-item-align.d.ts +8 -0
  230. package/lib/types/snapping-distance.d.ts +8 -0
  231. package/lib/{enums → types}/snapping-method.d.ts +1 -1
  232. package/lib/types/spreading-mode.d.ts +8 -0
  233. package/lib/{enums → types}/text-direction.d.ts +1 -1
  234. package/lib/utils/animator/animator.d.ts +10 -17
  235. package/lib/utils/animator/const/index.d.ts +1 -0
  236. package/lib/utils/animator/ease.d.ts +0 -12
  237. package/lib/utils/animator/index.d.ts +2 -1
  238. package/lib/utils/animator/interfaces/animator-params.d.ts +18 -0
  239. package/lib/utils/animator/interfaces/animator-update-data.d.ts +13 -0
  240. package/lib/utils/animator/interfaces/index.d.ts +3 -0
  241. package/lib/utils/animator/types/easing.d.ts +1 -1
  242. package/lib/utils/get-scroll-state-version.d.ts +1 -0
  243. package/lib/utils/is-collapse-mode.d.ts +8 -0
  244. package/lib/utils/is-collection-mode.d.ts +1 -1
  245. package/lib/utils/is-direction.d.ts +1 -1
  246. package/lib/utils/is-persentage-value.d.ts +7 -0
  247. package/lib/utils/is-select-mode.d.ts +8 -0
  248. package/lib/utils/is-spreading-mode.d.ts +8 -0
  249. package/lib/utils/normalize-collection.d.ts +8 -0
  250. package/lib/utils/parse-arithmetic-expression.d.ts +8 -0
  251. package/lib/utils/parse-float-or-persentage-value.d.ts +7 -0
  252. package/lib/utils/scrolling-direction.d.ts +17 -0
  253. package/lib/utils/snapping-method.d.ts +1 -1
  254. package/package.json +1 -1
  255. package/public-api.d.ts +3 -0
  256. package/esm2022/lib/components/ng-scroller/const/index.mjs +0 -2
  257. package/esm2022/lib/directives/item-click/item-click.directive.mjs +0 -66
  258. package/esm2022/lib/directives/item-click/item-click.module.mjs +0 -19
  259. package/esm2022/lib/enums/collection-mode.mjs +0 -2
  260. package/esm2022/lib/enums/direction.mjs +0 -2
  261. package/esm2022/lib/enums/method-for-selecting-types.mjs +0 -22
  262. package/esm2022/lib/enums/method-for-selecting.mjs +0 -2
  263. package/esm2022/lib/enums/methods-for-selecting.mjs +0 -22
  264. package/esm2022/lib/enums/snapping-method.mjs +0 -2
  265. package/esm2022/lib/enums/text-direction.mjs +0 -2
  266. package/esm2022/lib/utils/is-method-for-selecting.mjs +0 -18
  267. package/lib/components/ng-scroller/const/index.d.ts +0 -1
  268. package/lib/directives/item-click/item-click.module.d.ts +0 -8
  269. package/lib/enums/method-for-selecting.d.ts +0 -8
  270. package/lib/utils/is-method-for-selecting.d.ts +0 -8
package/README.md CHANGED
@@ -1,31 +1,26 @@
1
1
  # NgVirtualList
2
2
 
3
- 🚀 High-performance virtual scrolling for Angular apps. Render 100,000+ items in Angular without breaking a sweat. Smooth, customizable, and developer-friendly.
3
+ 🚀 High-performance virtual scrolling for Angular apps. Render 10,000+ items in Angular without breaking a sweat. Smooth, customizable, and developer-friendly.
4
4
 
5
- Flexible, and actively maintained Angular library that excels with high-performance, feature-rich virtualized lists—including grouping, sticky headers, snapping, animations, collapsing group elements, single and multiple selection of elements and both scroll directions. Whether you're rendering millions of items or building interactive list components, it delivers scalability and customization. Angular (14–20) compatibility.
5
+ ⚡A powerful API for implementing lists of varying functionality and complexity.
6
6
 
7
- The main advantage of this solution is the elimination of the "empty spaces" effect during fast scrolling, which occurs in the classic implementation of virtualized lists. Visualization is as close as possible to native lists.
7
+ ✨Flexible, and actively maintained Angular library that excels with high-performance, feature-rich virtualized lists—including grouping, sticky headers, snapping, animations, collapsing group elements, single and multiple selection of elements and both scroll directions, lists with scrolling bindings for elements, galleries of varying complexity, including 3D transformations of elements and effects such as MotionBlur, DOF ​​(Depth Of Field) and Fog. Whether you're rendering millions of items or building interactive list components, it delivers scalability and customization. Angular (14–22) compatibility.
8
8
 
9
- Works correctly in all browsers and platforms.
9
+ 🧬The main advantage of this solution is the elimination of the "empty spaces" effect during fast scrolling, which occurs in the classic implementation of virtualized lists. Visualization is as close as possible to native lists.
10
+
11
+ 💻 Works correctly in all browsers and platforms.
12
+
13
+ 💪 The software portion of the project was completed without a single line of code written using AI (artificial intelligence)!
10
14
 
11
15
  <img width="1033" height="171" alt="logo" src="https://github.com/user-attachments/assets/b559cfde-405a-4361-b71b-6715478d997d" />
12
16
 
13
- <b>Angular version 16.X.X</b>.
17
+ <b>Angular version 14.X.X</b>.
14
18
 
15
19
  ![npm](https://img.shields.io/npm/v/ng-virtual-list)
16
20
  ![npm downloads](https://img.shields.io/npm/dm/ng-virtual-list)
17
21
  ![npm total downloads](https://img.shields.io/npm/dt/ng-virtual-list)
18
22
 
19
- [Chat Demo](https://chat-demo.eugene-grebennikov.pro/)
20
- [(Code)](https://github.com/DjonnyX/ng-virtual-list-chat-demo)
21
-
22
- [News Feed Demo](https://news-feed-demo.eugene-grebennikov.pro/)
23
- [(Code)](https://github.com/DjonnyX/ng-virtual-list-news-feed-demo)
24
-
25
- [Live Examples (Storybook)](https://ng-virtual-list-examples.eugene-grebennikov.pro/)
26
-
27
- [Examples](https://ng-virtual-list.eugene-grebennikov.pro/)
28
- [(Code)](https://github.com/DjonnyX/ng-virtual-list-demo/tree/main/src/app)
23
+ [Documentation](https://ng-virtual-list.eugene-grebennikov.pro/)
29
24
 
30
25
  <br/>
31
26
 
@@ -104,7 +99,7 @@ npm i ng-virtual-list
104
99
 
105
100
  ## 🚀 Quick Start
106
101
  ```html
107
- <ng-virtual-list [items]="items" [bufferSize]="1" [itemRenderer]="itemRenderer" [dynamicSize]="false" [itemSize]="64"></ng-virtual-list>
102
+ <ng-virtual-list [items]="items" [bufferSize]="5" [itemRenderer]="itemRenderer" [dynamicSize]="false" [itemSize]="64"></ng-virtual-list>
108
103
 
109
104
  <ng-template #itemRenderer let-data="data">
110
105
  <span *ngIf="data">{{data.name}}</span>
@@ -125,13 +120,13 @@ items = Array.from({ length: 100000 }, (_, i) => ({ id: i, name: `Item #${i}` })
125
120
  Template:
126
121
  ```html
127
122
  <ng-virtual-list class="list" direction="horizontal" [items]="horizontalItems" [bufferSize]="1" [maxBufferSize]="5"
128
- [itemRenderer]="horizontalItemRenderer" [dynamicSize]="false" [itemSize]="64" methodForSelecting="select"
123
+ [itemRenderer]="horizontalItemRenderer" [dynamicSize]="false" [itemSize]="64" [selectingMode]="'select'"
129
124
  [selectedIds]="2" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
130
125
 
131
126
  <ng-template #horizontalItemRenderer let-data="data" let-config="config">
132
- <div *ngIf="data" [ngClass]="{'list__h-container': true, 'selected': config.selected}">
133
- <span>{{data.name}}</span>
134
- </div>
127
+ <div *ngIf="data" [ngClass]="{'list__h-container': true, 'selected': api.selected}">
128
+ <span>{{data.name}}</span>
129
+ </div>
135
130
  </ng-template>
136
131
  ```
137
132
 
@@ -173,8 +168,7 @@ export class AppComponent {
173
168
  Template:
174
169
  ```html
175
170
  <ng-virtual-list class="list" direction="horizontal" [items]="horizontalGroupItems" [itemRenderer]="horizontalGroupItemRenderer"
176
- [bufferSize]="1" [maxBufferSize]="5" [itemConfigMap]="horizontalGroupItemConfigMap" [dynamicSize]="false" [itemSize]="54" [snap]="true"
177
- methodForSelecting="multi-select" [selectedIds]="[3,2]" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
171
+ [bufferSize]="1" [maxBufferSize]="5" [itemConfigMap]="horizontalGroupItemConfigMap" [dynamicSize]="false" [itemSize]="54" [stickyEnabled]="true" selectingMode="multi-select" [selectedIds]="[3,2]" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
178
172
 
179
173
  <ng-template #horizontalGroupItemRenderer let-data="data" let-config="config">
180
174
  <ng-container *ngIf="data" [ngSwitch]="data.type">
@@ -245,7 +239,7 @@ Template:
245
239
 
246
240
  <ng-template #itemRenderer let-data="data">
247
241
  <div *ngIf="data" class="list__container">
248
- <span>{{data.name}}</span>
242
+ <p>{{data.name}}</p>
249
243
  </div>
250
244
  </ng-template>
251
245
  ```
@@ -280,7 +274,7 @@ export class AppComponent {
280
274
  Template:
281
275
  ```html
282
276
  <ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
283
- [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="false"></ng-virtual-list>
277
+ [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [stickyEnabled]="false"></ng-virtual-list>
284
278
 
285
279
  <ng-template #groupItemRenderer let-data="data">
286
280
  <ng-container *ngIf="data" [ngSwitch]="data.type">
@@ -301,7 +295,7 @@ Template:
301
295
  Template (with snapping):
302
296
  ```html
303
297
  <ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
304
- [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="true"></ng-virtual-list>
298
+ [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [stickyEnabled]="true"></ng-virtual-list>
305
299
 
306
300
  <ng-template #groupItemRenderer let-data="data">
307
301
  <ng-container *ngIf="data" [ngSwitch]="data.type">
@@ -359,7 +353,7 @@ Template
359
353
  <button class="scroll-to__button" (click)="onButtonScrollToIdClickHandler($event)">Scroll</button>
360
354
  </div>
361
355
 
362
- <ng-virtual-list #virtualList class="list" [items]="items" [itemRenderer]="itemRenderer" [bufferSize]="1"
356
+ <ng-virtual-list #virtualList class="list" [items]="items" [itemRenderer]="itemRenderer" [bufferSize]="1" [maxBufferSize]="5"
363
357
  [dynamicSize]="false" [itemSize]="40"></ng-virtual-list>
364
358
 
365
359
  <ng-template #itemRenderer let-data="data">
@@ -412,7 +406,7 @@ Virtual list with height-adjustable elements.
412
406
  Template
413
407
  ```html
414
408
  <ng-virtual-list #dynamicList class="list" [items]="groupDynamicItems" [itemRenderer]="groupItemRenderer" [bufferSize]="1" [maxBufferSize]="5"
415
- [itemConfigMap]="groupDynamicItemConfigMap" [snap]="true"></ng-virtual-list>
409
+ [itemConfigMap]="groupDynamicItemConfigMap" [stickyEnabled]="true"></ng-virtual-list>
416
410
 
417
411
  <ng-template #groupItemRenderer let-data="data">
418
412
  <ng-container *ngIf="data" [ngSwitch]="data.type">
@@ -567,35 +561,52 @@ Inputs
567
561
 
568
562
  | Property | Type | Description |
569
563
  |---|---|---|
570
- | animationParams | [IAnimationParams](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/interfaces/animation-params.ts)? = { scrollToItem: 50, navigateToItem: 150, navigateByKeyboard: 50 } | Animation parameters. The default value is "{ scrollToItem: 50, navigateToItem: 150, , navigateByKeyboard: 50 }". |
564
+ | alignment | [Alignment](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/alignment.ts) | Determines the alignment of the list. Two modes are available: `none` and `center`. The `center` mode aligns the list items to the center of the viewport, ideal for use with the `itemTransform` property. The `none` mode means no alignment. The default value is `none`. |
565
+ | animationParams | [IAnimationParams](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/interfaces/animation-params.ts)? = { scrollToItem: 50, snapToItem: 150, navigateToItem: 150, navigateByKeyboard: 50 } | Animation parameters. The default value is "{ scrollToItem: 50, snapToItem: 150, navigateToItem: 150, navigateByKeyboard: 50 }". |
571
566
  | bufferSize | number? = 2 | Number of elements outside the scope of visibility. Default value is 2. |
572
- | maxBufferSize | number? = 10 | Maximum number of elements outside the scope of visibility. Default value is 10. If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled. The greater the scroll size, the more elements are allocated for rendering. |
567
+ | clickDistance | number? = 40 | The maximum scroll distance at which a click event is triggered. |
573
568
  | collapsedIds | Array<[Id](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/id.ts)> | Sets the collapsed items. |
574
569
  | collapseByClick | boolean? = true | If `false`, the element is collapsed using the config.collapse method passed to the template; if `true`, the element is collapsed by clicking on it. The default value is `true`. |
570
+ | collapsingMode | [CollapsingMode](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/collapsing-modes.ts) | Mode for collapsing list items. Default value is `none`. `none` - List items are not selectable. `multi-collapse` - List items are collapsed one by one. 'accordion' - Accordion collapsible list items. Default value is `multi-collapse`. |
575
571
  | collectionMode | [CollectionMode? = 'normal'](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/collection-mode.ts) | Determines the action modes for collection elements. Default value is `normal`. |
572
+ | divides | number = 1 | Column or row numbers. The default value is `1`. |
576
573
  | direction | [Direction? = 'vertical'](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/direction.ts) | Determines the direction in which elements are placed. Default value is "vertical". |
577
574
  | dynamicSize | boolean? = true | If true, items in the list may have different sizes, and the itemSize property must be specified to adjust the sizes of items in the unallocated area. If false then the items in the list have a fixed size specified by the itemSize property. The default value is true. |
578
- | enabledBufferOptimization | boolean? = true | Experimental! Enables buffer optimization. Can only be used if items in the collection are not added or updated. |
575
+ | enabledBufferOptimization | boolean? = false | Experimental! Enables buffer optimization. Can only be used if items in the collection are not added or updated. |
579
576
  | id | number | Readonly. Returns the unique identifier of the component. |
580
577
  | items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. The collection of elements must be immutable. |
581
- | itemSize | number? = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element. If the dynamicSize property is true, the items in the list can have different sizes, and you must specify the itemSize property to adjust the sizes of the items in the unallocated area. |
578
+ | itemSize | number \| 'viewport' = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element. If the dynamicSize property is true, the items in the list can have different sizes, and you must specify the itemSize property to adjust the sizes of the items in the unallocated area. If the value is 'viewport', the sizes of elements are automatically resized to fit the viewport size. |
579
+ | itemTransform | [ItemTransform](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/item-transform.ts) \| null = null | Custom transformation of element's position, rotation, scale, opacity and zIndex. The default value is `null`. |
582
580
  | itemRenderer | TemplateRef | Rendering element template. |
583
- | itemConfigMap | [IVirtualListItemConfigMap?](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/item-config-map.model.ts) | Sets `sticky` position and `selectable` for the list item element. If `sticky` position is greater than `0`, then `sticky` position is applied. If the `sticky` value is greater than `0`, then the `sticky` position mode is enabled for the element. `1` - position start, `2` - position end. Default value is `0`. `selectable` determines whether an element can be selected or not. Default value is `true`. |
584
- | methodForSelecting | [MethodForSelecting](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/method-for-selecting.ts) | Method for selecting list items. Default value is 'none'. 'select' - List items are selected one by one. 'multi-select' - Multiple selection of list items. 'none' - List items are not selectable. |
581
+ | itemConfigMap | [IVirtualListItemConfigMap?](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/item-config-map.model.ts) | Sets `sticky` position, `fullSize`, `collapsable` and `selectable` for the list item element. If `sticky` position is greater than `0`, then `sticky` position is applied.
582
+ If the `sticky` value is greater than `0`, then the `sticky` position mode is enabled for the element. `1` - position start, `2` - position end. Default value is `0`.
583
+ `selectable` determines whether an element can be selected or not. Default value is `true`.
584
+ `collapsable` determines whether an element with a `sticky` property greater than zero can collapse and collapse elements in front that do not have a `sticky` property.
585
+ `fullSize` determines the size of an element when rendering lists with cell divisions. If sticky is 1 or 2, fullSize automatically becomes true. The default value is false. |
585
586
  | langTextDir | [TextDirection? = 'ltr'](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/text-direction.ts) | A string indicating the direction of text for the locale. Can be either "ltr" (left-to-right) or "rtl" (right-to-left). |
586
587
  | loading | boolean? = false | If `true`, the scrollBar goes into loading state. The default value is `false`. |
588
+ | maxBufferSize | number? = 10 | Maximum number of elements outside the scope of visibility. Default value is 10. If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled. The greater the scroll size, the more elements are allocated for rendering. |
589
+ | maxMotionBlur | number = 0.5 | Maximum motion blur effect. The default value is `0.5`. |
590
+ | selectingMode | [SelectingMode](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/selecting-mode.ts) | Method for selecting list items. Default value is 'none'. 'select' - List items are selected one by one. 'multi-select' - Multiple selection of list items. 'none' - List items are not selectable. |
591
+ | minItemSize | number \| 'viewport' = 1 | If the `dynamicSize` property is enabled, the minimum size of the element is set. If the value is 'viewport', the sizes of elements are automatically resized to fit the viewport size. |
592
+ | maxItemSize | number \| 'viewport' = Number.MAX_SAFE_INTEGER | If the `dynamicSize` property is enabled, the maximum size of the element is set. If the value is 'viewport', the sizes of elements are automatically resized to fit the viewport size. |
593
+ | motionBlur | number \| 'disabled' = 0.15 | Motion blur effect. The default value is `0.25`. |
594
+ | motionBlurEnabled | boolean = false | Determines whether to apply motion blur or not. The default value is `false`. |
587
595
  | overscrollEnabled | boolean? = true | Determines whether the overscroll (re-scroll) feature will work. The default value is "true". |
596
+ | overlappingScrollbar | boolean? = false | Determines whether the scroll bar will overlap the list. The default value is "false". |
588
597
  | selectByClick | boolean? = true | If `false`, the element is selected using the config.select method passed to the template; if `true`, the element is selected by clicking on it. The default value is `true`. |
589
- | snap | boolean? = false | Determines whether elements will snap. Default value is "false". |
598
+ | stickyEnabled | boolean? = false | Determines whether items with the given `sticky` in `itemConfigMap` will stick to the edges. Default value is "false". |
590
599
  | selectedIds | Array<[Id](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/id.ts)> \| [Id](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/id.ts) \| null | Sets the selected items. |
591
600
  | screenReaderMessage | string? = "Showing items $1 to $2" | Message for screen reader. The message format is: "some text `$1` some text `$2`", where `$1` is the number of the first element of the screen collection, `$2` is the number of the last element of the screen collection. |
592
- | clickDistance | number? = 40 | The maximum scroll distance at which a click event is triggered. |
593
601
  | waitForPreparation | boolean? = true | If true, it will wait until the list items are fully prepared before displaying them.. The default value is `true`. |
594
- | scrollStartOffset | number? = 0 | Sets the scroll start offset value; Default value is "0". |
595
- | scrollEndOffset | number? = 0 | Sets the scroll end offset value; Default value is "0". |
596
- | snappingMethod | [SnappingMethod](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) | Snapping method. Default value is [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts). [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - Classic group visualization. [SnappingMethods.ADVANCED](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - A mask is applied to the viewport area so that the background is displayed underneath the attached group. |
597
- | snapScrollToStart | boolean? = true | Determines whether the scroll will be anchored to the start of the list. Default value is "true". This property takes precedence over the snapScrollToEnd property. That is, if snapScrollToStart and snapScrollToEnd are enabled, the list will initially snap to the beginning; if you move the scroll bar to the end, the list will snap to the end. If snapScrollToStart is disabled and snapScrollToEnd is enabled, the list will snap to the end; if you move the scroll bar to the beginning, the list will snap to the beginning. If both snapScrollToStart and snapScrollToEnd are disabled, the list will never snap to the beginning or end. |
598
- | snapScrollToEnd | boolean? = true | Determines whether the scroll will be anchored to the утв of the list. Default value is "true". That is, if snapScrollToStart and snapScrollToEnd are enabled, the list will initially snap to the beginning; if you move the scroll bar to the end, the list will snap to the end. If snapScrollToStart is disabled and snapScrollToEnd is enabled, the list will snap to the end; if you move the scroll bar to the beginning, the list will snap to the beginning. If both snapScrollToStart and snapScrollToEnd are disabled, the list will never snap to the beginning or end. |
602
+ | scrollStartOffset | [FloatOrPersentageValue](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/float-or-persentage-value.ts) = 0 | Sets the scroll start offset value. Can be specified in absolute or percentage values. Supports arithmetic expressions of addition `50% + 25` or subtraction `50% - 25`. Default value is "0". |
603
+ | scrollEndOffset | [FloatOrPersentageValue](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/float-or-persentage-value.ts) = 0 | Sets the scroll end offset value. Can be specified in absolute or percentage values. Supports arithmetic expressions of addition `50% + 25` or subtraction `50% - 25`. Default value is "0". |
604
+ | snapToItem | boolean = false | Snap to an item. The default value is `false`. |
605
+ | snapToItemAlign | [SnapToItemAlign](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snap-to-item-align.ts) = [SnapToItemAligns](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snap-to-item-aligns.ts).CENTER | Alignment for snapToItem. Available values ​​are `start`, `center`, and `end`. The default value is `center`. |
606
+ | snappingDistance | [SnappingDistance](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/snapping-distance.ts) = "25%" | Snapping activation distance. Can be specified as a percentage of the element size or in absolute values. The default value is `25%`. |
607
+ | snappingMethod | [SnappingMethod](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) = [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-methods.ts) | Snapping method. Default value is [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts). [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - Classic group visualization. [SnappingMethods.ADVANCED](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - A mask is applied to the viewport area so that the background is displayed underneath the attached group. |
608
+ | snapScrollToStart | boolean? = true | Determines whether the scroll will be anchored to the start of the list. Default value is "true". This property takes precedence over the snapScrollToEnd property. That is, if snapScrollToStart and snapScrollToEnd are enabled, the list will initially snap to the beginning; if you move the scroll bar to the end, the list will snap to the end. If snapScrollToStart is disabled and snapScrollToEnd is enabled, the list will snap to the end; if you move the scroll bar to the beginning, the list will snap to the beginning. If both snapScrollToStart and snapScrollToEnd are disabled, the list will never snap to the beginning or end. In the `spreadingMode=SpreadingModes.INFINITY` mode, the `snapScrollToStart` property is automatically disabled, since the list has no beginning or end. |
609
+ | snapScrollToEnd | boolean? = true | Determines whether the scroll will be anchored to the утв of the list. Default value is "true". That is, if snapScrollToStart and snapScrollToEnd are enabled, the list will initially snap to the beginning; if you move the scroll bar to the end, the list will snap to the end. If snapScrollToStart is disabled and snapScrollToEnd is enabled, the list will snap to the end; if you move the scroll bar to the beginning, the list will snap to the beginning. If both snapScrollToStart and snapScrollToEnd are disabled, the list will never snap to the beginning or end. In the `spreadingMode=SpreadingModes.INFINITY` mode, the `snapScrollToEnd` property is automatically disabled, since the list has no beginning or end. |
599
610
  | snapToEndTransitionInstantOffset | number? = 0 | Sets the offset value; if the scroll area value is exceeded, the scroll animation will be disabled. Default value is "0". |
600
611
  | scrollbarEnabled | boolean? = true | Determines whether the scrollbar is shown or not. The default value is "true". |
601
612
  | scrollbarInteractive | boolean? = true | Determines whether scrolling using the scrollbar will be possible. The default value is "true". |
@@ -604,8 +615,11 @@ Inputs
604
615
  | scrollbarThumbRenderer | TemplateRef<any> \| null = null | Scrollbar customization template. |
605
616
  | scrollbarThumbParams | {[propName: string]: any;} \| null | Additional options for the scrollbar. |
606
617
  | scrollBehavior | ScrollBehavior? = 'smooth' | Defines the scrolling behavior for any element on the page. The default value is "smooth". |
607
- | scrollingSettings | [IScrollingSettings](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/interfaces/scrolling-settings.ts) = {frictionalForce: 0.035, mass: 0.005, maxDistance: 12500, maxDuration: 4000, speedScale: 15, optimization: true} | Scrolling settings. |
618
+ | scrollingSettings | [IScrollingSettings](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/interfaces/scrolling-settings.ts) = {frictionalForce: 0.035, mass: 0.005, maxDistance: 100000, maxDuration: 4000, speedScale: 10, optimization: true} | Scrolling settings. |
619
+ | scrollingOneByOne | boolean = false | Specifies whether to scroll one item at a time if true and the scrollToItem property is set. The default value is `false`. |
620
+ | spreadingMode | [SpreadingMode](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/enums/spreading-mode.ts) ='standart' | The order of list elements. Available values ​​are `standard` and `infinity`. `normal` — list elements are ordered according to the collection sequence. `infinity` — list elements are ordered cyclically, forming an infinite list. When set to `infinity`, the `alignment` property is forced to the value `Alignments.CENTER`, the `scrollbarEnabled` property is forced to the `false`. The default value is `standard`. |
608
621
  | trackBy | string? = 'id' | The name of the property by which tracking is performed. |
622
+ | zIndexWhenSelecting | string \| null = null | Defines the zIndex when a list item is selected. The default value is `null`. |
609
623
 
610
624
  <br/>
611
625
 
@@ -613,6 +627,7 @@ Outputs
613
627
 
614
628
  | Event | Type | Description |
615
629
  |---|---|---|
630
+ | onSnapItem | [Id](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/types/id.ts) | Emit the component ID when an element crosses the alignment line specified by the snapToItemAlign property. |
616
631
  | onItemClick | [IRenderVirtualListItem](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/models/render-item.model.ts) \| null | Fires when an element is clicked. |
617
632
  | onScroll | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/interfaces/scroll-event.ts)) => void | Fires when the list has been scrolled. |
618
633
  | onScrollEnd | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/interfaces/scroll-event.ts)) => void | Fires when the list has completed scrolling. |
@@ -656,6 +671,29 @@ Properties
656
671
 
657
672
  <br/>
658
673
 
674
+ ### [VirtualClickModule](https://github.com/DjonnyX/ng-virtual-list/blob/16.x/projects/ng-virtual-list/src/lib/directives/item-click/item-click.module.ts)
675
+
676
+ ### Virtual click directive
677
+
678
+ To correctly handle interactive elements within a list, such as buttons, you need to use the VirtualClick directive.
679
+
680
+ ```ts
681
+ import { NgVirtualListModule, VirtualClickModule } from 'ng-virtual-list';
682
+
683
+ @Component({
684
+ selector: 'example',
685
+ imports: [NgVirtualListModule, VirtualClickModule],
686
+ })
687
+ ```
688
+
689
+ ```html
690
+ <ng-template #itemRenderer let-data="data" let-config="config" let-api="api">
691
+ <div *ngIf="data" virtualClick (onVirtualClick)="api.select(data.id, true)">
692
+ <span>{{data.name}}</span>
693
+ </div>
694
+ </ng-template>
695
+ ```
696
+
659
697
  ## 🤝 Contributing
660
698
 
661
699
  PRs and feature requests are welcome!