ng-virtual-list 18.11.3 → 18.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 (274) hide show
  1. package/README.md +115 -111
  2. package/esm2022/lib/components/ng-list-item/base/base-virtual-list-item-component.mjs +170 -61
  3. package/esm2022/lib/components/ng-list-item/const/index.mjs +41 -2
  4. package/esm2022/lib/components/ng-list-item/interfaces/template-context.mjs +1 -1
  5. package/esm2022/lib/components/ng-list-item/ng-virtual-list-item.component.mjs +55 -51
  6. package/esm2022/lib/components/ng-list-item/ng-virtual-list-item.module.mjs +5 -5
  7. package/esm2022/lib/components/ng-list-item/utils/create-display-id.mjs +7 -1
  8. package/esm2022/lib/components/ng-list-item/utils/get-element-by-index.mjs +17 -3
  9. package/esm2022/lib/components/ng-list-item/utils/index.mjs +3 -2
  10. package/esm2022/lib/components/ng-list-item/utils/matrix-3d.mjs +18 -0
  11. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list/ng-prerender-list.component.mjs +172 -47
  12. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.mjs +32 -16
  13. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.mjs +5 -5
  14. package/esm2022/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.component.mjs +58 -34
  15. package/esm2022/lib/components/ng-prerender-container/core/prerender-track-box.mjs +37 -7
  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 +58 -28
  18. package/esm2022/lib/components/ng-scroll-bar/const/index.mjs +8 -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 +236 -88
  21. package/esm2022/lib/components/ng-scroll-view/base/base-scroll-view.component.mjs +170 -44
  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 +610 -99
  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 +342 -160
  32. package/esm2022/lib/const/index.mjs +50 -10
  33. package/esm2022/lib/core/cache-map.mjs +1 -54
  34. package/esm2022/lib/core/const/index.mjs +3 -0
  35. package/esm2022/lib/core/enums/index.mjs +3 -0
  36. package/esm2022/lib/core/enums/item-display-methods.mjs +14 -0
  37. package/esm2022/lib/core/events/index.mjs +3 -0
  38. package/esm2022/lib/core/events/track-box-events.mjs +12 -0
  39. package/esm2022/lib/core/interfaces/get-item-position-options.mjs +2 -0
  40. package/esm2022/lib/core/interfaces/get-metrics-returns.mjs +2 -0
  41. package/esm2022/lib/core/interfaces/index.mjs +2 -0
  42. package/esm2022/lib/core/interfaces/item.mjs +2 -0
  43. package/esm2022/lib/core/interfaces/metrics.mjs +2 -0
  44. package/esm2022/lib/core/interfaces/recalculate-metrics-options.mjs +2 -0
  45. package/esm2022/lib/core/interfaces/update-collection-options.mjs +2 -0
  46. package/esm2022/lib/core/interfaces/update-collection-returns.mjs +2 -0
  47. package/esm2022/lib/core/track-box.mjs +601 -191
  48. package/esm2022/lib/core/tracker.mjs +14 -8
  49. package/esm2022/lib/core/types/cache-map-events.mjs +2 -0
  50. package/esm2022/lib/core/types/cache-map-listeners.mjs +2 -0
  51. package/esm2022/lib/core/types/cache.mjs +2 -0
  52. package/esm2022/lib/core/types/index.mjs +2 -0
  53. package/esm2022/lib/core/types/on-change-event-listener.mjs +2 -0
  54. package/esm2022/lib/core/types/on-tick-event-listener.mjs +2 -0
  55. package/esm2022/lib/core/utils/get-service-id-prop.mjs +10 -0
  56. package/esm2022/lib/core/utils/index.mjs +3 -0
  57. package/esm2022/lib/directives/index.mjs +3 -3
  58. package/esm2022/lib/directives/locale-sensitive/locale-sensitive.directive.mjs +34 -13
  59. package/esm2022/lib/directives/virtual-click/virtual-click.directive.mjs +67 -0
  60. package/esm2022/lib/directives/virtual-click/virtual-click.module.mjs +19 -0
  61. package/esm2022/lib/enums/alignments.mjs +12 -0
  62. package/esm2022/lib/enums/collapsing-modes.mjs +22 -0
  63. package/esm2022/lib/enums/index.mjs +8 -4
  64. package/esm2022/lib/enums/selecting-modes-types.mjs +22 -0
  65. package/esm2022/lib/enums/selecting-modes.mjs +22 -0
  66. package/esm2022/lib/enums/snap-to-item-aligns.mjs +22 -0
  67. package/esm2022/lib/enums/spreading-modes.mjs +18 -0
  68. package/esm2022/lib/interfaces/animation-params.mjs +1 -1
  69. package/esm2022/lib/interfaces/base-virtual-list-item-component.mjs +2 -9
  70. package/esm2022/lib/interfaces/index.mjs +1 -1
  71. package/esm2022/lib/interfaces/item-transformation.mjs +2 -0
  72. package/esm2022/lib/interfaces/point.mjs +2 -0
  73. package/esm2022/lib/interfaces/scroll-options.mjs +1 -1
  74. package/esm2022/lib/interfaces/scroll-params.mjs +1 -1
  75. package/esm2022/lib/models/item-config-map.model.mjs +1 -1
  76. package/esm2022/lib/models/item.model.mjs +1 -1
  77. package/esm2022/lib/models/render-item-config.model.mjs +1 -1
  78. package/esm2022/lib/models/render-item-measures.model.mjs +1 -1
  79. package/esm2022/lib/ng-virtual-list-public.service.mjs +6 -7
  80. package/esm2022/lib/ng-virtual-list.component.mjs +2032 -902
  81. package/esm2022/lib/ng-virtual-list.service.mjs +91 -30
  82. package/esm2022/lib/transformations/deck-of-cards-3d.mjs +57 -0
  83. package/esm2022/lib/transformations/deck-of-cards.mjs +54 -0
  84. package/esm2022/lib/transformations/event-horizon.mjs +47 -0
  85. package/esm2022/lib/transformations/index.mjs +13 -0
  86. package/esm2022/lib/transformations/linear.mjs +47 -0
  87. package/esm2022/lib/transformations/swipe-3d.mjs +51 -0
  88. package/esm2022/lib/types/alignment.mjs +2 -0
  89. package/esm2022/lib/types/arithmetic-expression.mjs +2 -0
  90. package/esm2022/lib/types/collapsing-mode.mjs +2 -0
  91. package/esm2022/lib/types/collection-mode.mjs +2 -0
  92. package/esm2022/lib/types/color.mjs +2 -0
  93. package/esm2022/lib/types/direction.mjs +2 -0
  94. package/esm2022/lib/types/float-or-persentage-value.mjs +2 -0
  95. package/esm2022/lib/types/focus-item-params.mjs +1 -1
  96. package/esm2022/lib/types/gradient-color-position.mjs +1 -1
  97. package/esm2022/lib/types/index.mjs +1 -1
  98. package/esm2022/lib/types/item-transform.mjs +2 -0
  99. package/esm2022/lib/types/scroll-direction.mjs +1 -1
  100. package/esm2022/lib/types/selecting-mode.mjs +2 -0
  101. package/esm2022/lib/types/snap-to-item-align.mjs +2 -0
  102. package/esm2022/lib/types/snapping-distance.mjs +2 -0
  103. package/esm2022/lib/types/snapping-method.mjs +2 -0
  104. package/esm2022/lib/types/spreading-mode.mjs +2 -0
  105. package/esm2022/lib/types/text-direction.mjs +2 -0
  106. package/esm2022/lib/utils/animator/animator.mjs +28 -8
  107. package/esm2022/lib/utils/animator/const/index.mjs +2 -0
  108. package/esm2022/lib/utils/animator/index.mjs +3 -2
  109. package/esm2022/lib/utils/animator/interfaces/animator-params.mjs +2 -0
  110. package/esm2022/lib/utils/animator/interfaces/animator-update-data.mjs +2 -0
  111. package/esm2022/lib/utils/animator/interfaces/index.mjs +2 -0
  112. package/esm2022/lib/utils/animator/types/easing.mjs +1 -1
  113. package/esm2022/lib/utils/disposable-component.mjs +27 -0
  114. package/esm2022/lib/utils/event-emitter/event-emitter.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/list-validators.mjs +1 -1
  123. package/esm2022/lib/utils/normalize-collection.mjs +42 -0
  124. package/esm2022/lib/utils/object.mjs +1 -1
  125. package/esm2022/lib/utils/parse-arithmetic-expression.mjs +53 -0
  126. package/esm2022/lib/utils/parse-float-or-persentage-value.mjs +17 -0
  127. package/esm2022/lib/utils/scrolling-direction.mjs +29 -0
  128. package/esm2022/lib/utils/snapping-method.mjs +1 -1
  129. package/esm2022/public-api.mjs +4 -1
  130. package/fesm2022/ng-virtual-list.mjs +7539 -3898
  131. package/fesm2022/ng-virtual-list.mjs.map +1 -1
  132. package/lib/components/ng-list-item/base/base-virtual-list-item-component.d.ts +40 -16
  133. package/lib/components/ng-list-item/const/index.d.ts +3 -1
  134. package/lib/components/ng-list-item/interfaces/template-context.d.ts +1 -1
  135. package/lib/components/ng-list-item/ng-virtual-list-item.component.d.ts +5 -2
  136. package/lib/components/ng-list-item/ng-virtual-list-item.module.d.ts +2 -2
  137. package/lib/components/ng-list-item/utils/create-display-id.d.ts +6 -0
  138. package/lib/components/ng-list-item/utils/get-element-by-index.d.ts +15 -1
  139. package/lib/components/ng-list-item/utils/index.d.ts +2 -1
  140. package/lib/components/ng-list-item/utils/matrix-3d.d.ts +7 -0
  141. package/lib/components/ng-prerender-container/components/ng-prerender-list/ng-prerender-list.component.d.ts +69 -26
  142. package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.component.d.ts +2 -2
  143. package/lib/components/ng-prerender-container/components/ng-prerender-list-item/ng-prerender-list-item.module.d.ts +2 -2
  144. package/lib/components/ng-prerender-container/components/ng-prerender-scroller/ng-prerender-scroller.component.d.ts +33 -12
  145. package/lib/components/ng-prerender-container/interfaces/refresh-params.d.ts +1 -0
  146. package/lib/components/ng-prerender-container/ng-prerender-container.component.d.ts +20 -17
  147. package/lib/components/ng-scroll-bar/const/index.d.ts +2 -0
  148. package/lib/components/ng-scroll-bar/interfaces/scroll-bar-template-context.d.ts +2 -2
  149. package/lib/components/ng-scroll-bar/ng-scroll-bar.component.d.ts +75 -24
  150. package/lib/components/ng-scroll-view/base/base-scroll-view.component.d.ts +49 -16
  151. package/lib/components/ng-scroll-view/const/index.d.ts +3 -1
  152. package/lib/components/ng-scroll-view/interfaces/scroll-to-params.d.ts +4 -1
  153. package/lib/components/ng-scroll-view/ng-scroll-view.component.d.ts +79 -11
  154. package/lib/components/ng-scroll-view/utils/calculate-direction.d.ts +6 -0
  155. package/lib/components/ng-scroll-view/utils/calculate-velocity.d.ts +7 -0
  156. package/lib/components/ng-scroll-view/utils/get-dir.d.ts +7 -0
  157. package/lib/components/ng-scroll-view/utils/index.d.ts +3 -1
  158. package/lib/components/ng-scroll-view/utils/matrix-3d.d.ts +7 -0
  159. package/lib/components/ng-scroller/enums/scroller-directions.d.ts +2 -1
  160. package/lib/components/ng-scroller/ng-scroller.component.d.ts +111 -47
  161. package/lib/const/index.d.ts +46 -5
  162. package/lib/core/cache-map.d.ts +0 -10
  163. package/lib/core/const/index.d.ts +1 -0
  164. package/lib/core/enums/index.d.ts +2 -0
  165. package/lib/core/enums/item-display-methods.d.ts +12 -0
  166. package/lib/core/events/index.d.ts +2 -0
  167. package/lib/core/events/track-box-events.d.ts +10 -0
  168. package/lib/core/interfaces/get-item-position-options.d.ts +10 -0
  169. package/lib/core/interfaces/get-metrics-returns.d.ts +11 -0
  170. package/lib/core/interfaces/index.d.ts +8 -0
  171. package/lib/core/interfaces/item.d.ts +9 -0
  172. package/lib/core/interfaces/metrics.d.ts +51 -0
  173. package/lib/core/interfaces/recalculate-metrics-options.d.ts +32 -0
  174. package/lib/core/interfaces/update-collection-options.d.ts +10 -0
  175. package/lib/core/interfaces/update-collection-returns.d.ts +14 -0
  176. package/lib/core/track-box.d.ts +25 -95
  177. package/lib/core/tracker.d.ts +1 -1
  178. package/lib/core/types/cache-map-events.d.ts +8 -0
  179. package/lib/core/types/cache-map-listeners.d.ts +9 -0
  180. package/lib/core/types/cache.d.ts +12 -0
  181. package/lib/core/types/index.d.ts +6 -0
  182. package/lib/core/types/on-change-event-listener.d.ts +7 -0
  183. package/lib/core/types/on-tick-event-listener.d.ts +7 -0
  184. package/lib/core/utils/get-service-id-prop.d.ts +7 -0
  185. package/lib/core/utils/index.d.ts +2 -0
  186. package/lib/directives/index.d.ts +2 -2
  187. package/lib/directives/locale-sensitive/locale-sensitive.directive.d.ts +16 -6
  188. package/lib/directives/virtual-click/virtual-click.directive.d.ts +22 -0
  189. package/lib/directives/virtual-click/virtual-click.module.d.ts +8 -0
  190. package/lib/enums/alignments.d.ts +10 -0
  191. package/lib/enums/collapsing-modes.d.ts +20 -0
  192. package/lib/enums/index.d.ts +7 -9
  193. package/lib/enums/{method-for-selecting-types.d.ts → selecting-modes-types.d.ts} +3 -3
  194. package/lib/enums/{methods-for-selecting.d.ts → selecting-modes.d.ts} +3 -3
  195. package/lib/enums/snap-to-item-aligns.d.ts +20 -0
  196. package/lib/enums/spreading-modes.d.ts +16 -0
  197. package/lib/interfaces/animation-params.d.ts +1 -0
  198. package/lib/interfaces/base-virtual-list-item-component.d.ts +13 -13
  199. package/lib/interfaces/index.d.ts +3 -2
  200. package/lib/interfaces/item-transformation.d.ts +22 -0
  201. package/lib/interfaces/point.d.ts +16 -0
  202. package/lib/interfaces/scroll-options.d.ts +4 -0
  203. package/lib/interfaces/scroll-params.d.ts +3 -2
  204. package/lib/models/item-config-map.model.d.ts +5 -0
  205. package/lib/models/item.model.d.ts +7 -0
  206. package/lib/models/render-item-config.model.d.ts +50 -0
  207. package/lib/models/render-item-measures.model.d.ts +71 -0
  208. package/lib/ng-virtual-list-public.service.d.ts +4 -5
  209. package/lib/ng-virtual-list.component.d.ts +462 -135
  210. package/lib/ng-virtual-list.service.d.ts +33 -12
  211. package/lib/transformations/deck-of-cards-3d.d.ts +54 -0
  212. package/lib/transformations/deck-of-cards.d.ts +50 -0
  213. package/lib/transformations/event-horizon.d.ts +26 -0
  214. package/lib/transformations/index.d.ts +7 -0
  215. package/lib/transformations/linear.d.ts +26 -0
  216. package/lib/transformations/swipe-3d.d.ts +38 -0
  217. package/lib/types/alignment.d.ts +8 -0
  218. package/lib/types/arithmetic-expression.d.ts +10 -0
  219. package/lib/types/collapsing-mode.d.ts +8 -0
  220. package/lib/{enums → types}/collection-mode.d.ts +1 -1
  221. package/lib/types/color.d.ts +4 -0
  222. package/lib/{enums → types}/direction.d.ts +1 -1
  223. package/lib/types/float-or-persentage-value.d.ts +7 -0
  224. package/lib/types/focus-item-params.d.ts +6 -0
  225. package/lib/types/gradient-color-position.d.ts +1 -1
  226. package/lib/types/index.d.ts +15 -1
  227. package/lib/types/item-transform.d.ts +9 -0
  228. package/lib/types/scroll-direction.d.ts +2 -0
  229. package/lib/types/selecting-mode.d.ts +8 -0
  230. package/lib/types/snap-to-item-align.d.ts +8 -0
  231. package/lib/types/snapping-distance.d.ts +8 -0
  232. package/lib/{enums → types}/snapping-method.d.ts +1 -1
  233. package/lib/types/spreading-mode.d.ts +8 -0
  234. package/lib/{enums → types}/text-direction.d.ts +1 -1
  235. package/lib/utils/animator/animator.d.ts +10 -17
  236. package/lib/utils/animator/const/index.d.ts +1 -0
  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 +6 -0
  242. package/lib/utils/disposable-component.d.ts +15 -0
  243. package/lib/utils/get-scroll-state-version.d.ts +1 -0
  244. package/lib/utils/is-collapse-mode.d.ts +8 -0
  245. package/lib/utils/is-collection-mode.d.ts +1 -1
  246. package/lib/utils/is-direction.d.ts +1 -1
  247. package/lib/utils/is-persentage-value.d.ts +7 -0
  248. package/lib/utils/is-select-mode.d.ts +8 -0
  249. package/lib/utils/is-spreading-mode.d.ts +8 -0
  250. package/lib/utils/list-validators.d.ts +1 -1
  251. package/lib/utils/normalize-collection.d.ts +8 -0
  252. package/lib/utils/object.d.ts +1 -1
  253. package/lib/utils/parse-arithmetic-expression.d.ts +8 -0
  254. package/lib/utils/parse-float-or-persentage-value.d.ts +7 -0
  255. package/lib/utils/scrolling-direction.d.ts +17 -0
  256. package/lib/utils/snapping-method.d.ts +1 -1
  257. package/package.json +1 -1
  258. package/public-api.d.ts +3 -0
  259. package/esm2022/lib/components/ng-scroller/const/index.mjs +0 -2
  260. package/esm2022/lib/directives/item-click/item-click.directive.mjs +0 -59
  261. package/esm2022/lib/directives/item-click/item-click.module.mjs +0 -19
  262. package/esm2022/lib/enums/collection-mode.mjs +0 -2
  263. package/esm2022/lib/enums/direction.mjs +0 -2
  264. package/esm2022/lib/enums/method-for-selecting-types.mjs +0 -22
  265. package/esm2022/lib/enums/method-for-selecting.mjs +0 -2
  266. package/esm2022/lib/enums/methods-for-selecting.mjs +0 -22
  267. package/esm2022/lib/enums/snapping-method.mjs +0 -2
  268. package/esm2022/lib/enums/text-direction.mjs +0 -2
  269. package/esm2022/lib/utils/is-method-for-selecting.mjs +0 -18
  270. package/lib/components/ng-scroller/const/index.d.ts +0 -1
  271. package/lib/directives/item-click/item-click.directive.d.ts +0 -19
  272. package/lib/directives/item-click/item-click.module.d.ts +0 -8
  273. package/lib/enums/method-for-selecting.d.ts +0 -8
  274. package/lib/utils/is-method-for-selecting.d.ts +0 -8
package/README.md CHANGED
@@ -1,12 +1,16 @@
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
 
@@ -16,16 +20,7 @@ Works correctly in all browsers and platforms.
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
 
@@ -107,9 +102,7 @@ npm i ng-virtual-list
107
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
- @if (data) {
111
- <span>{{data.name}}</span>
112
- }
105
+ <span *ngIf="data">{{data.name}}</span>
113
106
  </ng-template>
114
107
  ```
115
108
  ```ts
@@ -127,15 +120,13 @@ items = Array.from({ length: 100000 }, (_, i) => ({ id: i, name: `Item #${i}` })
127
120
  Template:
128
121
  ```html
129
122
  <ng-virtual-list class="list" direction="horizontal" [items]="horizontalItems" [bufferSize]="1" [maxBufferSize]="5"
130
- [itemRenderer]="horizontalItemRenderer" [dynamicSize]="false" [itemSize]="64" [methodForSelecting]="'select'"
123
+ [itemRenderer]="horizontalItemRenderer" [dynamicSize]="false" [itemSize]="64" [selectingMode]="'select'"
131
124
  [selectedIds]="2" (onSelect)="onSelect($event)" (onItemClick)="onItemClick($event)"></ng-virtual-list>
132
125
 
133
126
  <ng-template #horizontalItemRenderer let-data="data" let-config="config">
134
- @if (data) {
135
- <div [ngClass]="{'list__h-container': true, 'selected': config.selected}">
136
- <span>{{data.name}}</span>
137
- </div>
138
- }
127
+ <div *ngIf="data" [ngClass]="{'list__h-container': true, 'selected': api.selected}">
128
+ <span>{{data.name}}</span>
129
+ </div>
139
130
  </ng-template>
140
131
  ```
141
132
 
@@ -177,24 +168,17 @@ export class AppComponent {
177
168
  Template:
178
169
  ```html
179
170
  <ng-virtual-list class="list" direction="horizontal" [items]="horizontalGroupItems" [itemRenderer]="horizontalGroupItemRenderer"
180
- [bufferSize]="1" [maxBufferSize]="5" [itemConfigMap]="horizontalGroupItemConfigMap" [dynamicSize]="false" [itemSize]="54" [snap]="true"
181
- 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>
182
172
 
183
173
  <ng-template #horizontalGroupItemRenderer let-data="data" let-config="config">
184
- @if (data) {
185
- @switch (data.type) {
186
- @case ("group-header") {
187
- <div class="list__h-group-container">
188
- <span>{{data.name}}</span>
189
- </div>
190
- }
191
- @default {
192
- <div [ngClass]="{'list__h-container': true, 'selected': config.selected}">
193
- <span>{{data.name}}</span>
194
- </div>
195
- }
196
- }
197
- }
174
+ <ng-container *ngIf="data" [ngSwitch]="data.type">
175
+ <div *ngSwitchCase="'group-header'" class="list__h-group-container">
176
+ <span>{{data.name}}</span>
177
+ </div>
178
+ <div *ngSwitchCase="'item'" [ngClass]="{'list__h-container': true, 'selected': config.selected}">
179
+ <span>{{data.name}}</span>
180
+ </div>
181
+ </ng-container>
198
182
  </ng-template>
199
183
  ```
200
184
 
@@ -254,11 +238,9 @@ Template:
254
238
  [dynamicSize]="false" [itemSize]="40"></ng-virtual-list>
255
239
 
256
240
  <ng-template #itemRenderer let-data="data">
257
- @if (data) {
258
- <div class="list__container">
259
- <p>{{data.name}}</p>
260
- </div>
261
- }
241
+ <div *ngIf="data" class="list__container">
242
+ <p>{{data.name}}</p>
243
+ </div>
262
244
  </ng-template>
263
245
  ```
264
246
 
@@ -292,23 +274,17 @@ export class AppComponent {
292
274
  Template:
293
275
  ```html
294
276
  <ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
295
- [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="false"></ng-virtual-list>
277
+ [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [stickyEnabled]="false"></ng-virtual-list>
296
278
 
297
279
  <ng-template #groupItemRenderer let-data="data">
298
- @if (data) {
299
- @switch (data.type) {
300
- @case ("group-header") {
301
- <div class="list__group-container">
302
- <p>{{data.name}}</p>
303
- </div>
304
- }
305
- @default {
306
- <div class="list__container">
307
- <p>{{data.name}}</p>
308
- </div>
309
- }
310
- }
311
- }
280
+ <ng-container *ngIf="data" [ngSwitch]="data.type">
281
+ <div *ngSwitchCase="'group-header'" class="list__group-container">
282
+ <span>{{data.name}}</span>
283
+ </div>
284
+ <div *ngSwitchCase="'item'" class="list__container">
285
+ <span>{{data.name}}</span>
286
+ </div>
287
+ </ng-container>
312
288
  </ng-template>
313
289
  ```
314
290
 
@@ -319,23 +295,17 @@ Template:
319
295
  Template (with snapping):
320
296
  ```html
321
297
  <ng-virtual-list class="list simple" [items]="groupItems" [bufferSize]="1" [maxBufferSize]="5" [itemRenderer]="groupItemRenderer"
322
- [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [snap]="true"></ng-virtual-list>
298
+ [itemConfigMap]="groupItemConfigMap" [dynamicSize]="false" [itemSize]="40" [stickyEnabled]="true"></ng-virtual-list>
323
299
 
324
300
  <ng-template #groupItemRenderer let-data="data">
325
- @if (data) {
326
- @switch (data.type) {
327
- @case ("group-header") {
328
- <div class="list__group-container">
329
- <p>{{data.name}}</p>
330
- </div>
331
- }
332
- @default {
333
- <div class="list__container">
334
- <p>{{data.name}}</p>
335
- </div>
336
- }
337
- }
338
- }
301
+ <ng-container *ngIf="data" [ngSwitch]="data.type">
302
+ <div *ngSwitchCase="'group-header'" class="list__group-container">
303
+ <span>{{data.name}}</span>
304
+ </div>
305
+ <div *ngSwitchCase="'item'" class="list__container">
306
+ <span>{{data.name}}</span>
307
+ </div>
308
+ </ng-container>
339
309
  </ng-template>
340
310
  ```
341
311
 
@@ -387,11 +357,9 @@ Template
387
357
  [dynamicSize]="false" [itemSize]="40"></ng-virtual-list>
388
358
 
389
359
  <ng-template #itemRenderer let-data="data">
390
- @if (data) {
391
- <div class="list__container">
360
+ <div *ngIf="data" class="list__container">
392
361
  <span>{{data.name}}</span>
393
362
  </div>
394
- }
395
363
  </ng-template>
396
364
  ```
397
365
 
@@ -438,23 +406,17 @@ Virtual list with height-adjustable elements.
438
406
  Template
439
407
  ```html
440
408
  <ng-virtual-list #dynamicList class="list" [items]="groupDynamicItems" [itemRenderer]="groupItemRenderer" [bufferSize]="1" [maxBufferSize]="5"
441
- [itemConfigMap]="groupDynamicItemConfigMap" [snap]="true"></ng-virtual-list>
409
+ [itemConfigMap]="groupDynamicItemConfigMap" [stickyEnabled]="true"></ng-virtual-list>
442
410
 
443
411
  <ng-template #groupItemRenderer let-data="data">
444
- @if (data) {
445
- @switch (data.type) {
446
- @case ("group-header") {
447
- <div class="list__group-container">
448
- <span>{{data.name}}</span>
449
- </div>
450
- }
451
- @default {
452
- <div class="list__container">
453
- <span>{{data.name}}</span>
454
- </div>
455
- }
456
- }
457
- }
412
+ <ng-container *ngIf="data" [ngSwitch]="data.type">
413
+ <div *ngSwitchCase="'group-header'" class="list__group-container">
414
+ <span>{{data.name}}</span>
415
+ </div>
416
+ <div *ngSwitchCase="'item'" class="list__container">
417
+ <span>{{data.name}}</span>
418
+ </div>
419
+ </ng-container>
458
420
  </ng-template>
459
421
  ```
460
422
 
@@ -575,11 +537,9 @@ Selecting even elements:
575
537
  [itemRenderer]="horizontalItemRenderer" [itemSize]="54"></ng-virtual-list>
576
538
 
577
539
  <ng-template #horizontalItemRenderer let-data="data" let-config="config">
578
- @if (data) {
579
- <div [ngClass]="{'item-container': true, 'even': config.even}">
580
- <span>{{data.name}}</span>
581
- </div>
582
- }
540
+ <div *ngIf="data" [ngClass]="{'item-container': true, 'even': config.even}">
541
+ <span>{{data.name}}</span>
542
+ </div>
583
543
  </ng-template>
584
544
  ```
585
545
 
@@ -601,35 +561,52 @@ Inputs
601
561
 
602
562
  | Property | Type | Description |
603
563
  |---|---|---|
604
- | animationParams | [IAnimationParams](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.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/18.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 }". |
605
566
  | bufferSize | number? = 2 | Number of elements outside the scope of visibility. Default value is 2. |
606
- | 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. |
607
568
  | collapsedIds | Array<[Id](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/types/id.ts)> | Sets the collapsed items. |
608
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/18.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`. |
609
571
  | collectionMode | [CollectionMode? = 'normal'](https://github.com/DjonnyX/ng-virtual-list/blob/18.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`. |
610
573
  | direction | [Direction? = 'vertical'](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/enums/direction.ts) | Determines the direction in which elements are placed. Default value is "vertical". |
611
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. |
612
- | 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. |
613
576
  | id | number | Readonly. Returns the unique identifier of the component. |
614
577
  | items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. The collection of elements must be immutable. |
615
- | 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/18.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`. |
616
580
  | itemRenderer | TemplateRef | Rendering element template. |
617
- | itemConfigMap | [IVirtualListItemConfigMap?](https://github.com/DjonnyX/ng-virtual-list/blob/18.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`. |
618
- | methodForSelecting | [MethodForSelecting](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.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. |
619
586
  | langTextDir | [TextDirection? = 'ltr'](https://github.com/DjonnyX/ng-virtual-list/blob/18.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). |
620
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/18.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`. |
621
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". |
622
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`. |
623
- | 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". |
624
599
  | selectedIds | Array<[Id](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/types/id.ts)> \| [Id](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/types/id.ts) \| null | Sets the selected items. |
625
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. |
626
- | clickDistance | number? = 40 | The maximum scroll distance at which a click event is triggered. |
627
601
  | waitForPreparation | boolean? = true | If true, it will wait until the list items are fully prepared before displaying them.. The default value is `true`. |
628
- | scrollStartOffset | number? = 0 | Sets the scroll start offset value; Default value is "0". |
629
- | scrollEndOffset | number? = 0 | Sets the scroll end offset value; Default value is "0". |
630
- | snappingMethod | [SnappingMethod](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts). [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - Classic group visualization. [SnappingMethods.ADVANCED](https://github.com/DjonnyX/ng-virtual-list/blob/18.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. |
631
- | 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. |
632
- | 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/18.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/18.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/18.x/projects/ng-virtual-list/src/lib/enums/snap-to-item-align.ts) = [SnapToItemAligns](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.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/18.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) = [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts). [SnappingMethods.STANDART](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/enums/snapping-method.ts) - Classic group visualization. [SnappingMethods.ADVANCED](https://github.com/DjonnyX/ng-virtual-list/blob/18.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. |
633
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". |
634
611
  | scrollbarEnabled | boolean? = true | Determines whether the scrollbar is shown or not. The default value is "true". |
635
612
  | scrollbarInteractive | boolean? = true | Determines whether scrolling using the scrollbar will be possible. The default value is "true". |
@@ -638,8 +615,11 @@ Inputs
638
615
  | scrollbarThumbRenderer | TemplateRef<any> \| null = null | Scrollbar customization template. |
639
616
  | scrollbarThumbParams | {[propName: string]: any;} \| null | Additional options for the scrollbar. |
640
617
  | scrollBehavior | ScrollBehavior? = 'smooth' | Defines the scrolling behavior for any element on the page. The default value is "smooth". |
641
- | scrollingSettings | [IScrollingSettings](https://github.com/DjonnyX/ng-virtual-list/blob/18.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/18.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/18.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`. |
642
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`. |
643
623
 
644
624
  <br/>
645
625
 
@@ -647,6 +627,7 @@ Outputs
647
627
 
648
628
  | Event | Type | Description |
649
629
  |---|---|---|
630
+ | onSnapItem | [Id](https://github.com/DjonnyX/ng-virtual-list/blob/18.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. |
650
631
  | onItemClick | [IRenderVirtualListItem](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/models/render-item.model.ts) \| null | Fires when an element is clicked. |
651
632
  | onScroll | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/interfaces/scroll-event.ts)) => void | Fires when the list has been scrolled. |
652
633
  | onScrollEnd | ([IScrollEvent](https://github.com/DjonnyX/ng-virtual-list/blob/18.x/projects/ng-virtual-list/src/lib/interfaces/scroll-event.ts)) => void | Fires when the list has completed scrolling. |
@@ -690,6 +671,29 @@ Properties
690
671
 
691
672
  <br/>
692
673
 
674
+ ### [VirtualClickModule](https://github.com/DjonnyX/ng-virtual-list/blob/18.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
+
693
697
  ## 🤝 Contributing
694
698
 
695
699
  PRs and feature requests are welcome!