ng-virtual-list 21.11.1 → 21.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -638,6 +638,7 @@ Inputs
638
638
  | scrollbarThumbRenderer | TemplateRef<any> \| null = null | Scrollbar customization template. |
639
639
  | scrollbarThumbParams | {[propName: string]: any;} \| null | Additional options for the scrollbar. |
640
640
  | 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/21.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. |
641
642
  | trackBy | string? = 'id' | The name of the property by which tracking is performed. |
642
643
 
643
644
  <br/>
@@ -693,13 +694,13 @@ Properties
693
694
 
694
695
  | Angular version | ng-virtual-list version | git | npm |
695
696
  |--|--|--|--|
696
- | 20.x | 20.11.7 | [20.x](https://github.com/DjonnyX/ng-virtual-list/tree/21.x) | [20.11.7](https://www.npmjs.com/package/ng-virtual-list/v/20.11.7) |
697
- | 19.x | 19.11.2 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.11.2](https://www.npmjs.com/package/ng-virtual-list/v/19.11.2) |
698
- | 18.x | 18.11.1 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.11.1](https://www.npmjs.com/package/ng-virtual-list/v/18.11.1) |
699
- | 17.x | 17.11.1 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.11.1](https://www.npmjs.com/package/ng-virtual-list/v/17.11.1) |
700
- | 16.x | 16.11.1 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.11.1](https://www.npmjs.com/package/ng-virtual-list/v/16.11.1) |
701
- | 15.x | 15.11.2 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.11.2](https://www.npmjs.com/package/ng-virtual-list/v/15.11.2) |
702
- | 14.x | 14.11.2 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.11.2](https://www.npmjs.com/package/ng-virtual-list/v/14.11.2) |
697
+ | 20.x | 20.11.10 | [20.x](https://github.com/DjonnyX/ng-virtual-list/tree/21.x) | [20.11.10](https://www.npmjs.com/package/ng-virtual-list/v/20.11.10) |
698
+ | 19.x | 19.11.3 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.11.3](https://www.npmjs.com/package/ng-virtual-list/v/19.11.3) |
699
+ | 18.x | 18.11.2 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.11.2](https://www.npmjs.com/package/ng-virtual-list/v/18.11.2) |
700
+ | 17.x | 17.11.2 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.11.2](https://www.npmjs.com/package/ng-virtual-list/v/17.11.2) |
701
+ | 16.x | 16.11.3 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.11.3](https://www.npmjs.com/package/ng-virtual-list/v/16.11.3) |
702
+ | 15.x | 15.11.4 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.11.4](https://www.npmjs.com/package/ng-virtual-list/v/15.11.4) |
703
+ | 14.x | 14.11.4 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.11.4](https://www.npmjs.com/package/ng-virtual-list/v/14.11.4) |
703
704
  <br/>
704
705
 
705
706
  ## 🤝 Contributing
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, signal, ElementRef, DestroyRef, computed, output, Input, Directive, Injector, ChangeDetectionStrategy, Component, InjectionToken, viewChild, input, ViewChild, effect, ViewContainerRef, ViewEncapsulation, NO_ERRORS_SCHEMA, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Injectable, inject, signal, ElementRef, DestroyRef, computed, output, Input, Directive, Injector, ChangeDetectionStrategy, Component, InjectionToken, viewChild, input, ViewChild, effect, ViewContainerRef, ViewEncapsulation, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
3
3
  import { Subject, BehaviorSubject, tap, fromEvent, race, of, debounceTime, switchMap as switchMap$1, combineLatest, map, filter as filter$1, takeUntil as takeUntil$1, startWith, from, take, delay, distinctUntilChanged, skip } from 'rxjs';
4
4
  import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
5
5
  import { BehaviorSubject as BehaviorSubject$1 } from 'rxjs/internal/BehaviorSubject';
@@ -190,6 +190,14 @@ const DEFAULT_ANIMATION_PARAMS = {
190
190
  navigateToItem: 150,
191
191
  navigateByKeyboard: NAVIGATION_BY_KEYBOARD_TIMER,
192
192
  };
193
+ const DEFAULT_SCROLLING_SETTINGS = {
194
+ frictionalForce: 0.035,
195
+ maxDuration: 4000,
196
+ mass: 0.005,
197
+ maxDistance: 12500,
198
+ speedScale: 15,
199
+ optimization: true,
200
+ };
193
201
  const DEFAULT_OVERSCROLL_ENABLED = true;
194
202
  const DEFAULT_SNAP = false;
195
203
  const DEFAULT_SELECT_BY_CLICK = true;
@@ -2472,6 +2480,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
2472
2480
  */
2473
2481
  class BaseVirtualListItemComponent {
2474
2482
  _apiService = inject(NgVirtualListPublicService);
2483
+ _service = inject(NgVirtualListService);
2475
2484
  _id;
2476
2485
  get id() {
2477
2486
  return this._id;
@@ -2537,6 +2546,9 @@ class BaseVirtualListItemComponent {
2537
2546
  }
2538
2547
  _destroyRef = inject(DestroyRef);
2539
2548
  constructor() {
2549
+ this._id = this._service.generateComponentId();
2550
+ this._listId = this._service.id;
2551
+ this._displayId = createDisplayId(this._listId, this._id);
2540
2552
  this.classes = computed(() => {
2541
2553
  const data = this.data(), focused = this.focused();
2542
2554
  return {
@@ -2718,14 +2730,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
2718
2730
  * @email djonnyx@gmail.com
2719
2731
  */
2720
2732
  class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
2721
- _service = inject(NgVirtualListService);
2722
2733
  maxClickDistance = signal(DEFAULT_CLICK_DISTANCE, ...(ngDevMode ? [{ debugName: "maxClickDistance" }] : []));
2723
2734
  _injector = inject(Injector);
2724
2735
  constructor() {
2725
2736
  super();
2726
- this._id = this._service.generateComponentId();
2727
- this._listId = this._service.id;
2728
- this._displayId = createDisplayId(this._listId, this._id);
2729
2737
  }
2730
2738
  ngOnInit() {
2731
2739
  this._service.$clickDistance.pipe(takeUntilDestroyed(this._destroyRef), tap(v => {
@@ -3357,6 +3365,7 @@ class NgScrollView extends BaseScrollView {
3357
3365
  cdkScrollable;
3358
3366
  scrollBehavior = input(DEFAULT_SCROLL_BEHAVIOR, ...(ngDevMode ? [{ debugName: "scrollBehavior" }] : []));
3359
3367
  overscrollEnabled = input(DEFAULT_OVERSCROLL_ENABLED, ...(ngDevMode ? [{ debugName: "overscrollEnabled" }] : []));
3368
+ scrollingSettings = input(DEFAULT_SCROLLING_SETTINGS, ...(ngDevMode ? [{ debugName: "scrollingSettings" }] : []));
3360
3369
  _normalizeValueFromZero = inject(SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO);
3361
3370
  _$scroll = new Subject();
3362
3371
  $scroll = this._$scroll.asObservable();
@@ -3506,14 +3515,14 @@ class NgScrollView extends BaseScrollView {
3506
3515
  }
3507
3516
  calculateVelocity(offsets, delta, timestamp, indexOffset = 10) {
3508
3517
  offsets.push([delta, timestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : timestamp]);
3509
- const len = offsets.length, startIndex = len > indexOffset ? len - indexOffset : 0, lastVSign = calculateDirection(offsets);
3518
+ const len = offsets.length, startIndex = len > indexOffset ? len - indexOffset : 0, lastVSign = calculateDirection(offsets), speedScale = this.scrollingSettings()?.speedScale ?? SPEED_SCALE;
3510
3519
  let vSum = 0;
3511
3520
  for (let i = startIndex, l = offsets.length; i < l; i++) {
3512
3521
  const p0 = offsets[i];
3513
3522
  if (lastVSign !== Math.sign(p0[0])) {
3514
3523
  continue;
3515
3524
  }
3516
- const v0 = (p0[1] !== 0 ? lastVSign * Math.abs(p0[0] / p0[1]) * SPEED_SCALE : 0);
3525
+ const v0 = (p0[1] !== 0 ? lastVSign * Math.abs(p0[0] / p0[1]) * speedScale : 0);
3517
3526
  vSum += Math.sign(v0) * Math.pow(v0, 4) * .003;
3518
3527
  }
3519
3528
  const l = Math.min(offsets.length, indexOffset), v0 = l > 0 ? (vSum / l) : 0;
@@ -3523,6 +3532,7 @@ class NgScrollView extends BaseScrollView {
3523
3532
  velocities.push([delta, timestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : timestamp]);
3524
3533
  const len = velocities.length, startIndex = len > indexOffset ? len - indexOffset : 0;
3525
3534
  let aSum = 0, prevV0, iteration = 0, lastVSign = calculateDirection(velocities);
3535
+ const mass = this.scrollingSettings()?.mass ?? MASS;
3526
3536
  for (let i = startIndex, l = velocities.length; i < l; i++) {
3527
3537
  const v00 = prevV0, v01 = velocities[i];
3528
3538
  if (lastVSign !== Math.sign(v01[0])) {
@@ -3530,13 +3540,13 @@ class NgScrollView extends BaseScrollView {
3530
3540
  }
3531
3541
  if (v00) {
3532
3542
  const a0 = timestamp < MAX_VELOCITY_TIMESTAMP ? (v00[1] !== 0 ? (lastVSign * Math.abs(Math.abs(v01[0]) - Math.abs(v00[0]))) / Math.abs(v00[1]) : 0) : 0.1;
3533
- aSum = (aSum * MASS) + a0;
3543
+ aSum = (aSum * mass) + a0;
3534
3544
  prevV0 = v01;
3535
3545
  }
3536
3546
  prevV0 = v01;
3537
3547
  iteration++;
3538
3548
  }
3539
- const a0 = aSum * FRICTION_FORCE;
3549
+ const a0 = aSum * (this.scrollingSettings()?.frictionalForce ?? FRICTION_FORCE);
3540
3550
  return { a0 };
3541
3551
  }
3542
3552
  stopScrolling() {
@@ -3547,7 +3557,7 @@ class NgScrollView extends BaseScrollView {
3547
3557
  }
3548
3558
  moveWithAcceleration(isVertical, position, v0, v, a0, timestamp) {
3549
3559
  if (a0 !== 0 && timestamp < MAX_VELOCITY_TIMESTAMP) {
3550
- const dvSign = Math.sign(v), duration = DURATION, maxDuration = MAX_DURATION, maxDistance = dvSign * MAX_DIST, s = (dvSign * Math.abs((a0 * Math.pow(duration, 2)) * .5) / 1000) / MASS, distance = Math.abs(s) < MAX_DIST ? s : maxDistance, positionWithVelocity = position + (this._inversion ? -1 : 1) * distance, vmax = Math.max(Math.abs(v0), Math.abs(v)), ad = Math.abs(vmax !== 0 ? Math.sqrt(vmax) : 0) * 10 / MASS, aDuration = ad < maxDuration ? ad : maxDuration, startPosition = isVertical ? this.y : this.x;
3560
+ const dvSign = Math.sign(v), mass = this.scrollingSettings()?.mass ?? MASS, duration = DURATION, maxDuration = this.scrollingSettings()?.maxDuration ?? MAX_DURATION, maxDist = this.scrollingSettings()?.maxDistance ?? MAX_DIST, maxDistance = dvSign * maxDist, s = (dvSign * Math.abs((a0 * Math.pow(duration, 2)) * .5) / 1000) / mass, distance = Math.abs(s) < maxDist ? s : maxDistance, positionWithVelocity = position + (this._inversion ? -1 : 1) * distance, vmax = Math.max(Math.abs(v0), Math.abs(v)), ad = Math.abs(vmax !== 0 ? Math.sqrt(vmax) : 0) * 10 / mass, aDuration = ad < maxDuration ? ad : maxDuration, startPosition = isVertical ? this.y : this.x;
3551
3561
  this.animate(startPosition, Math.round(positionWithVelocity), aDuration, easeOutQuad, true);
3552
3562
  }
3553
3563
  }
@@ -3667,7 +3677,7 @@ class NgScrollView extends BaseScrollView {
3667
3677
  }
3668
3678
  }
3669
3679
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollView, deps: [], target: i0.ɵɵFactoryTarget.Component });
3670
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: NgScrollView, isStandalone: true, selector: "ng-scroll-view", inputs: { scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, overscrollEnabled: { classPropertyName: "overscrollEnabled", publicName: "overscrollEnabled", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "cdkScrollable", first: true, predicate: ["scrollViewport"], descendants: true, read: CdkScrollable }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
3680
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.0", type: NgScrollView, isStandalone: true, selector: "ng-scroll-view", inputs: { scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, overscrollEnabled: { classPropertyName: "overscrollEnabled", publicName: "overscrollEnabled", isSignal: true, isRequired: false, transformFunction: null }, scrollingSettings: { classPropertyName: "scrollingSettings", publicName: "scrollingSettings", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "cdkScrollable", first: true, predicate: ["scrollViewport"], descendants: true, read: CdkScrollable }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
3671
3681
  }
3672
3682
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollView, decorators: [{
3673
3683
  type: Component,
@@ -3678,7 +3688,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
3678
3688
  }], ctorParameters: () => [], propDecorators: { cdkScrollable: [{
3679
3689
  type: ViewChild,
3680
3690
  args: ['scrollViewport', { read: CdkScrollable }]
3681
- }], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], overscrollEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "overscrollEnabled", required: false }] }] } });
3691
+ }], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], overscrollEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "overscrollEnabled", required: false }] }], scrollingSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollingSettings", required: false }] }] } });
3682
3692
 
3683
3693
  const DEFAULT_THICKNESS = 6, DEFAULT_SIZE = 6, PX = 'px', WIDTH = 'width', HEIGHT = 'height', OPACITY = 'opacity', OPACITY_0 = '0', OPACITY_1 = '1', TRANSITION = 'transition', NONE = 'none', TRANSITION_FADE_IN = `${OPACITY} 500ms ease-out`;
3684
3694
 
@@ -5173,6 +5183,66 @@ class NgVirtualListComponent {
5173
5183
  * Defines the scrolling behavior for any element on the page. The default value is "smooth".
5174
5184
  */
5175
5185
  scrollBehavior = input(DEFAULT_SCROLL_BEHAVIOR, { ...(ngDevMode ? { debugName: "scrollBehavior" } : {}), ...this._scrollBehaviorOptions });
5186
+ _scrollingSettingsOptions = {
5187
+ transform: (v) => {
5188
+ let valid = validateObject(v, true, true);
5189
+ if (valid && !!v) {
5190
+ const { frictionalForce, mass, maxDistance, maxDuration, speedScale, optimization } = v;
5191
+ valid = validateFloat(frictionalForce, true);
5192
+ if (!valid) {
5193
+ console.error('The "frictionalForce" parameter must be of type `number` or `undefined`.');
5194
+ return DEFAULT_SCROLLING_SETTINGS;
5195
+ }
5196
+ valid = validateFloat(mass, true);
5197
+ if (!valid) {
5198
+ console.error('The "mass" parameter must be of type `number` or `undefined`.');
5199
+ return DEFAULT_SCROLLING_SETTINGS;
5200
+ }
5201
+ valid = validateFloat(maxDistance, true);
5202
+ if (!valid) {
5203
+ console.error('The "maxDistance" parameter must be of type `number` or `undefined`.');
5204
+ return DEFAULT_SCROLLING_SETTINGS;
5205
+ }
5206
+ valid = validateFloat(maxDuration, true);
5207
+ if (!valid) {
5208
+ console.error('The "maxDuration" parameter must be of type `number` or `undefined`.');
5209
+ return DEFAULT_SCROLLING_SETTINGS;
5210
+ }
5211
+ valid = validateFloat(speedScale, true);
5212
+ if (!valid) {
5213
+ console.error('The "speedScale" parameter must be of type `number` or `undefined`.');
5214
+ return DEFAULT_SCROLLING_SETTINGS;
5215
+ }
5216
+ valid = validateBoolean(optimization, true);
5217
+ if (!valid) {
5218
+ console.error('The "optimization" parameter must be of type `boolean` or `undefined`.');
5219
+ return DEFAULT_SCROLLING_SETTINGS;
5220
+ }
5221
+ }
5222
+ if (!valid) {
5223
+ console.error('The "scrollingSettings" parameter must be of type `object` or null.');
5224
+ return DEFAULT_SCROLLING_SETTINGS;
5225
+ }
5226
+ return {
5227
+ frictionalForce: v.frictionalForce !== undefined && v.frictionalForce > 0 ? v.frictionalForce : DEFAULT_SCROLLING_SETTINGS.frictionalForce,
5228
+ mass: v.mass !== undefined && v.mass > 0 ? v.mass : DEFAULT_SCROLLING_SETTINGS.mass,
5229
+ maxDistance: v.maxDistance !== undefined && v.maxDistance > 0 ? v.maxDistance : DEFAULT_SCROLLING_SETTINGS.maxDistance,
5230
+ maxDuration: v.maxDuration !== undefined && v.maxDuration > 0 ? v.maxDuration : DEFAULT_SCROLLING_SETTINGS.maxDuration,
5231
+ speedScale: v.speedScale !== undefined && v.speedScale > 0 ? v.speedScale : DEFAULT_SCROLLING_SETTINGS.speedScale,
5232
+ optimization: v.optimization ?? DEFAULT_SCROLLING_SETTINGS.optimization,
5233
+ };
5234
+ },
5235
+ };
5236
+ /**
5237
+ * Scrolling settings.
5238
+ * - frictionalForce - Frictional force. Default value is 0.035.
5239
+ * - mass - Mass. Default value is 0.005.
5240
+ * - maxDistance - Maximum scrolling distance. Default value is 12500.
5241
+ * - maxDuration - Maximum animation duration. Default value is 4000.
5242
+ * - speedScale - Speed scale. Default value is 15.
5243
+ * - optimization - Enables scrolling performance optimization. Default value is `true`.
5244
+ */
5245
+ scrollingSettings = input(DEFAULT_SCROLLING_SETTINGS, { ...(ngDevMode ? { debugName: "scrollingSettings" } : {}), ...this._scrollingSettingsOptions });
5176
5246
  _animationParamsOptions = {
5177
5247
  transform: (v) => {
5178
5248
  const valid = validateObject(v, true, true);
@@ -6025,7 +6095,7 @@ class NgVirtualListComponent {
6025
6095
  }
6026
6096
  })).subscribe();
6027
6097
  const $preventScrollSnapping = this.$preventScrollSnapping;
6028
- $preventScrollSnapping.pipe(takeUntilDestroyed(), filter$1(v => !!v), debounceTime(0), tap(() => {
6098
+ $preventScrollSnapping.pipe(takeUntilDestroyed(), filter$1(v => !!v), tap(() => {
6029
6099
  if (this._readyForShow) {
6030
6100
  this._trackBox.isScrollEnd;
6031
6101
  this._trackBox.isScrollStart = this._trackBox.isScrollEnd = false;
@@ -6108,12 +6178,12 @@ class NgVirtualListComponent {
6108
6178
  this.resetBoundsSize(isVertical, totalSize);
6109
6179
  this.createDisplayComponentsIfNeed(displayItems);
6110
6180
  this.tracking();
6181
+ this.snappingHandler();
6111
6182
  const delta = this._trackBox.delta, scrollPositionAfterUpdate = Math.round(actualScrollSize + delta), roundedScrollPositionAfterUpdate = Math.round(scrollPositionAfterUpdate), roundedMaxPositionAfterUpdate = Math.round(totalSize - viewportSize);
6112
6183
  if (this._isSnappingMethodAdvanced) {
6113
6184
  this.updateRegularRenderer();
6114
6185
  }
6115
6186
  scroller.delta = delta;
6116
- this.snappingHandler();
6117
6187
  if ((snapScrollToStart && this._trackBox.isSnappedToStart) ||
6118
6188
  (snapScrollToStart && currentScrollSize <= MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
6119
6189
  if (currentScrollSize !== roundedScrollPositionAfterUpdate) {
@@ -6154,11 +6224,11 @@ class NgVirtualListComponent {
6154
6224
  if (emitUpdate) {
6155
6225
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
6156
6226
  }
6157
- this._trackBox.isScrollEnd;
6158
6227
  return;
6159
6228
  }
6160
- if ((scrollPositionAfterUpdate >= 0 && scrollPositionAfterUpdate < roundedMaxPositionAfterUpdate) ||
6161
- (scrollSize !== roundedMaxPositionAfterUpdate || currentScrollSize !== scrollPositionAfterUpdate)) {
6229
+ if (scrollSize !== scrollPositionAfterUpdate &&
6230
+ ((scrollPositionAfterUpdate >= 0 && scrollPositionAfterUpdate < roundedMaxPositionAfterUpdate) ||
6231
+ (scrollSize !== roundedMaxPositionAfterUpdate || currentScrollSize !== scrollPositionAfterUpdate))) {
6162
6232
  this._trackBox.clearDelta();
6163
6233
  if (this._readyForShow) {
6164
6234
  this.emitScrollEvent(true, false, userAction);
@@ -6171,8 +6241,8 @@ class NgVirtualListComponent {
6171
6241
  if (emitUpdate) {
6172
6242
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
6173
6243
  }
6244
+ return;
6174
6245
  }
6175
- return;
6176
6246
  }
6177
6247
  if (emitUpdate) {
6178
6248
  this._$update.next(this.getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft, cacheVersion));
@@ -6190,16 +6260,18 @@ class NgVirtualListComponent {
6190
6260
  itemsChanged = true;
6191
6261
  prevItems = items;
6192
6262
  }
6193
- const scroller = this._scrollerComponent(), velocity = this._scrollerComponent()?.averageVelocity ?? 0, maxScrollSize = isVertical ? (scroller?.scrollHeight || 0) : (scroller?.scrollWidth ?? 0), isEdges = scrollSize === 0 || scrollSize === maxScrollSize, isScrolling = this._$scrollingTo.getValue(), useDebouncedUpdate = dynamicSize && !itemsChanged && hasUserAction && !isScrolling && (velocity > 0 && velocity < MAX_VELOCITY_FOR_SCROLL_QUALITY_OPTIMIZATION_LVL1), rerenderOptimization = dynamicSize && !itemsChanged && (hasUserAction || hasScrollbarUserAction) && !isEdges && velocity > 0 &&
6263
+ const enabledOptimization = this.scrollingSettings()?.optimization ?? DEFAULT_SCROLLING_SETTINGS.optimization, scroller = this._scrollerComponent(), velocity = this._scrollerComponent()?.averageVelocity ?? 0, maxScrollSize = isVertical ? (scroller?.scrollHeight || 0) : (scroller?.scrollWidth ?? 0), isEdges = scrollSize === 0 || scrollSize === maxScrollSize, isScrolling = this._$scrollingTo.getValue(), useDebouncedUpdate = dynamicSize && !itemsChanged && hasUserAction && !isScrolling && (velocity > 0 && velocity < MAX_VELOCITY_FOR_SCROLL_QUALITY_OPTIMIZATION_LVL1), rerenderOptimization = enabledOptimization && dynamicSize && !itemsChanged && (hasUserAction || hasScrollbarUserAction) && !isEdges && velocity > 0 &&
6194
6264
  (velocity > MAX_VELOCITY_FOR_SCROLL_QUALITY_OPTIMIZATION_LVL2 || hasUserAction);
6195
- if (useDebouncedUpdate) {
6196
- debouncedUpdate.execute({
6197
- snapScrollToStart, snapScrollToEnd, bounds, listBounds, scrollEndOffset, items, itemConfigMap, scrollSize, itemSize, collapsedIds,
6198
- bufferSize, maxBufferSize, snap, isVertical, dynamicSize, enabledBufferOptimization, cacheVersion, userAction: hasUserAction,
6199
- }, rerenderOptimization, itemsChanged);
6200
- return;
6265
+ if (enabledOptimization) {
6266
+ if (useDebouncedUpdate) {
6267
+ debouncedUpdate.execute({
6268
+ snapScrollToStart, snapScrollToEnd, bounds, listBounds, scrollEndOffset, items, itemConfigMap, scrollSize, itemSize, collapsedIds,
6269
+ bufferSize, maxBufferSize, snap, isVertical, dynamicSize, enabledBufferOptimization, cacheVersion, userAction: hasUserAction,
6270
+ }, rerenderOptimization, itemsChanged);
6271
+ return;
6272
+ }
6273
+ debouncedUpdate.dispose();
6201
6274
  }
6202
- debouncedUpdate.dispose();
6203
6275
  if (!isScrolling) {
6204
6276
  update({
6205
6277
  snapScrollToStart, snapScrollToEnd, bounds, listBounds, scrollEndOffset, items, itemConfigMap, scrollSize, itemSize, collapsedIds,
@@ -6212,19 +6284,10 @@ class NgVirtualListComponent {
6212
6284
  const scrollHandler = (userAction = false) => {
6213
6285
  const scroller = this._scrollerComponent();
6214
6286
  if (!!scroller) {
6215
- const isVertical = this._isVertical, bounds = this._bounds(), listBounds = this._listBounds(), scrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft), maxScrollSize = isVertical ? (listBounds?.height ?? 0) - (bounds?.height ?? 0) : (listBounds?.width ?? 0) - (bounds?.width ?? 0), actualScrollSize = scrollSize;
6287
+ const isVertical = this._isVertical, scrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft), actualScrollSize = scrollSize;
6216
6288
  if (this._readyForShow) {
6217
6289
  if (userAction) {
6218
- if (this._trackBox.isSnappedToStart) {
6219
- if (scrollSize > MIN_PIXELS_FOR_PREVENT_SNAPPING) {
6220
- this._$preventScrollSnapping.next(true);
6221
- }
6222
- }
6223
- if (this._trackBox.isSnappedToEnd) {
6224
- if (scrollSize < (maxScrollSize - MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
6225
- this._$preventScrollSnapping.next(true);
6226
- }
6227
- }
6290
+ this._$preventScrollSnapping.next(true);
6228
6291
  }
6229
6292
  }
6230
6293
  this._scrollSize.set(actualScrollSize);
@@ -6782,20 +6845,20 @@ class NgVirtualListComponent {
6782
6845
  }
6783
6846
  }
6784
6847
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6785
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NgVirtualListComponent, isStandalone: false, selector: "ng-virtual-list", inputs: { scrollbarThickness: { classPropertyName: "scrollbarThickness", publicName: "scrollbarThickness", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null }, scrollbarThumbRenderer: { classPropertyName: "scrollbarThumbRenderer", publicName: "scrollbarThumbRenderer", isSignal: true, isRequired: false, transformFunction: null }, scrollbarThumbParams: { classPropertyName: "scrollbarThumbParams", publicName: "scrollbarThumbParams", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, waitForPreparation: { classPropertyName: "waitForPreparation", publicName: "waitForPreparation", isSignal: true, isRequired: false, transformFunction: null }, clickDistance: { classPropertyName: "clickDistance", publicName: "clickDistance", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, defaultItemValue: { classPropertyName: "defaultItemValue", publicName: "defaultItemValue", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, collapsedIds: { classPropertyName: "collapsedIds", publicName: "collapsedIds", isSignal: true, isRequired: false, transformFunction: null }, selectByClick: { classPropertyName: "selectByClick", publicName: "selectByClick", isSignal: true, isRequired: false, transformFunction: null }, collapseByClick: { classPropertyName: "collapseByClick", publicName: "collapseByClick", isSignal: true, isRequired: false, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, snapToEndTransitionInstantOffset: { classPropertyName: "snapToEndTransitionInstantOffset", publicName: "snapToEndTransitionInstantOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollStartOffset: { classPropertyName: "scrollStartOffset", publicName: "scrollStartOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollEndOffset: { classPropertyName: "scrollEndOffset", publicName: "scrollEndOffset", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToStart: { classPropertyName: "snapScrollToStart", publicName: "snapScrollToStart", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToEnd: { classPropertyName: "snapScrollToEnd", publicName: "snapScrollToEnd", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToBottom: { classPropertyName: "snapScrollToBottom", publicName: "snapScrollToBottom", isSignal: true, isRequired: false, transformFunction: null }, scrollbarEnabled: { classPropertyName: "scrollbarEnabled", publicName: "scrollbarEnabled", isSignal: true, isRequired: false, transformFunction: null }, scrollbarInteractive: { classPropertyName: "scrollbarInteractive", publicName: "scrollbarInteractive", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, animationParams: { classPropertyName: "animationParams", publicName: "animationParams", isSignal: true, isRequired: false, transformFunction: null }, overscrollEnabled: { classPropertyName: "overscrollEnabled", publicName: "overscrollEnabled", isSignal: true, isRequired: false, transformFunction: null }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, collectionMode: { classPropertyName: "collectionMode", publicName: "collectionMode", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, screenReaderMessage: { classPropertyName: "screenReaderMessage", publicName: "screenReaderMessage", isSignal: true, isRequired: false, transformFunction: null }, langTextDir: { classPropertyName: "langTextDir", publicName: "langTextDir", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse", onScrollReachStart: "onScrollReachStart", onScrollReachEnd: "onScrollReachEnd" }, host: { styleAttribute: "position: relative;" }, providers: [NgVirtualListService, NgVirtualListPublicService], viewQueries: [{ propertyName: "_prerender", first: true, predicate: ["prerender"], descendants: true, isSignal: true }, { propertyName: "_scrollerComponent", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "_listContainerRef", first: true, predicate: ["renderersContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "_snapContainerRef", first: true, predicate: ["snapRendererContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"ngvl__screen-reader\">\r\n {{ screenReaderFormattedMessage() }}\r\n</div>\r\n\r\n<ng-prerender-container #prerender [bounds]=\"bounds()!\" [direction]=\"direction()\"\r\n [dynamic]=\"dynamicSize()\" [isVertical]=\"isVertical\" [itemSize]=\"itemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset()\" [endOffset]=\"scrollEndOffset()\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (snap()) {\r\n <div localeSensitive [langTextDir]=\"langTextDir()\" #snappedContainer class=\"ngvl__snapped-container\"\r\n [ngClass]=\"classes()\">\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n </div>\r\n}\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset()\"\r\n [direction]=\"direction()\" [endOffset]=\"scrollEndOffset()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [focusedElement]=\"focusedElement()\" [loading]=\"loading()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollbarEnabled]=\"scrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\">\r\n <ng-container #renderersContainer></ng-container>\r\n</ng-scroller>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__snapped-container{position:relative;width:100%;opacity:0}.ngvl__snapped-container.prepared{opacity:1}.ngvl__list-snapper{-webkit-tap-highlight-color:transparent;pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list-scroller{-webkit-tap-highlight-color:transparent;position:absolute;left:0;top:0;width:100%;height:100%;z-index:0}.ngvl__screen-reader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgScrollerComponent, selector: "ng-scroller", inputs: ["scrollbarEnabled", "scrollbarInteractive", "focusedElement", "content", "loading", "classes", "scrollbarMinSize", "scrollbarThickness", "scrollbarThumbRenderer", "scrollbarThumbParams"], outputs: ["onScrollbarVisible"] }, { kind: "component", type: NgPrerenderContainer, selector: "ng-prerender-container", inputs: ["enabled", "direction", "isVertical", "scrollbarEnabled", "startOffset", "endOffset", "bounds", "dynamic", "itemSize", "trackBy", "itemRenderer"] }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
6848
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: NgVirtualListComponent, isStandalone: false, selector: "ng-virtual-list", inputs: { scrollbarThickness: { classPropertyName: "scrollbarThickness", publicName: "scrollbarThickness", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null }, scrollbarThumbRenderer: { classPropertyName: "scrollbarThumbRenderer", publicName: "scrollbarThumbRenderer", isSignal: true, isRequired: false, transformFunction: null }, scrollbarThumbParams: { classPropertyName: "scrollbarThumbParams", publicName: "scrollbarThumbParams", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, waitForPreparation: { classPropertyName: "waitForPreparation", publicName: "waitForPreparation", isSignal: true, isRequired: false, transformFunction: null }, clickDistance: { classPropertyName: "clickDistance", publicName: "clickDistance", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, defaultItemValue: { classPropertyName: "defaultItemValue", publicName: "defaultItemValue", isSignal: true, isRequired: false, transformFunction: null }, selectedIds: { classPropertyName: "selectedIds", publicName: "selectedIds", isSignal: true, isRequired: false, transformFunction: null }, collapsedIds: { classPropertyName: "collapsedIds", publicName: "collapsedIds", isSignal: true, isRequired: false, transformFunction: null }, selectByClick: { classPropertyName: "selectByClick", publicName: "selectByClick", isSignal: true, isRequired: false, transformFunction: null }, collapseByClick: { classPropertyName: "collapseByClick", publicName: "collapseByClick", isSignal: true, isRequired: false, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, snapToEndTransitionInstantOffset: { classPropertyName: "snapToEndTransitionInstantOffset", publicName: "snapToEndTransitionInstantOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollStartOffset: { classPropertyName: "scrollStartOffset", publicName: "scrollStartOffset", isSignal: true, isRequired: false, transformFunction: null }, scrollEndOffset: { classPropertyName: "scrollEndOffset", publicName: "scrollEndOffset", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToStart: { classPropertyName: "snapScrollToStart", publicName: "snapScrollToStart", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToEnd: { classPropertyName: "snapScrollToEnd", publicName: "snapScrollToEnd", isSignal: true, isRequired: false, transformFunction: null }, snapScrollToBottom: { classPropertyName: "snapScrollToBottom", publicName: "snapScrollToBottom", isSignal: true, isRequired: false, transformFunction: null }, scrollbarEnabled: { classPropertyName: "scrollbarEnabled", publicName: "scrollbarEnabled", isSignal: true, isRequired: false, transformFunction: null }, scrollbarInteractive: { classPropertyName: "scrollbarInteractive", publicName: "scrollbarInteractive", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: true, isRequired: false, transformFunction: null }, scrollingSettings: { classPropertyName: "scrollingSettings", publicName: "scrollingSettings", isSignal: true, isRequired: false, transformFunction: null }, animationParams: { classPropertyName: "animationParams", publicName: "animationParams", isSignal: true, isRequired: false, transformFunction: null }, overscrollEnabled: { classPropertyName: "overscrollEnabled", publicName: "overscrollEnabled", isSignal: true, isRequired: false, transformFunction: null }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, collectionMode: { classPropertyName: "collectionMode", publicName: "collectionMode", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, screenReaderMessage: { classPropertyName: "screenReaderMessage", publicName: "screenReaderMessage", isSignal: true, isRequired: false, transformFunction: null }, langTextDir: { classPropertyName: "langTextDir", publicName: "langTextDir", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse", onScrollReachStart: "onScrollReachStart", onScrollReachEnd: "onScrollReachEnd" }, host: { styleAttribute: "position: relative;" }, providers: [NgVirtualListService, NgVirtualListPublicService], viewQueries: [{ propertyName: "_prerender", first: true, predicate: ["prerender"], descendants: true, isSignal: true }, { propertyName: "_scrollerComponent", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "_listContainerRef", first: true, predicate: ["renderersContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "_snapContainerRef", first: true, predicate: ["snapRendererContainer"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"ngvl__screen-reader\">\r\n {{ screenReaderFormattedMessage() }}\r\n</div>\r\n\r\n<ng-prerender-container #prerender [bounds]=\"bounds()!\" [direction]=\"direction()\"\r\n [dynamic]=\"dynamicSize()\" [isVertical]=\"isVertical\" [itemSize]=\"itemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset()\" [endOffset]=\"scrollEndOffset()\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (snap()) {\r\n <div localeSensitive [langTextDir]=\"langTextDir()\" #snappedContainer class=\"ngvl__snapped-container\"\r\n [ngClass]=\"classes()\">\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n </div>\r\n}\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset()\"\r\n [direction]=\"direction()\" [endOffset]=\"scrollEndOffset()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [focusedElement]=\"focusedElement()\" [loading]=\"loading()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollbarEnabled]=\"scrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\" [scrollingSettings]=\"scrollingSettings()\">\r\n <ng-container #renderersContainer></ng-container>\r\n</ng-scroller>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__snapped-container{position:relative;width:100%;opacity:0}.ngvl__snapped-container.prepared{opacity:1}.ngvl__list-snapper{-webkit-tap-highlight-color:transparent;pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list-scroller{-webkit-tap-highlight-color:transparent;position:absolute;left:0;top:0;width:100%;height:100%;z-index:0}.ngvl__screen-reader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: NgScrollerComponent, selector: "ng-scroller", inputs: ["scrollbarEnabled", "scrollbarInteractive", "focusedElement", "content", "loading", "classes", "scrollbarMinSize", "scrollbarThickness", "scrollbarThumbRenderer", "scrollbarThumbParams"], outputs: ["onScrollbarVisible"] }, { kind: "component", type: NgPrerenderContainer, selector: "ng-prerender-container", inputs: ["enabled", "direction", "isVertical", "scrollbarEnabled", "startOffset", "endOffset", "bounds", "dynamic", "itemSize", "trackBy", "itemRenderer"] }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
6786
6849
  }
6787
6850
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgVirtualListComponent, decorators: [{
6788
6851
  type: Component,
6789
6852
  args: [{ selector: 'ng-virtual-list', host: {
6790
6853
  'style': 'position: relative;'
6791
- }, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, providers: [NgVirtualListService, NgVirtualListPublicService], template: "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"ngvl__screen-reader\">\r\n {{ screenReaderFormattedMessage() }}\r\n</div>\r\n\r\n<ng-prerender-container #prerender [bounds]=\"bounds()!\" [direction]=\"direction()\"\r\n [dynamic]=\"dynamicSize()\" [isVertical]=\"isVertical\" [itemSize]=\"itemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset()\" [endOffset]=\"scrollEndOffset()\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (snap()) {\r\n <div localeSensitive [langTextDir]=\"langTextDir()\" #snappedContainer class=\"ngvl__snapped-container\"\r\n [ngClass]=\"classes()\">\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n </div>\r\n}\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset()\"\r\n [direction]=\"direction()\" [endOffset]=\"scrollEndOffset()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [focusedElement]=\"focusedElement()\" [loading]=\"loading()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollbarEnabled]=\"scrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\">\r\n <ng-container #renderersContainer></ng-container>\r\n</ng-scroller>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__snapped-container{position:relative;width:100%;opacity:0}.ngvl__snapped-container.prepared{opacity:1}.ngvl__list-snapper{-webkit-tap-highlight-color:transparent;pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list-scroller{-webkit-tap-highlight-color:transparent;position:absolute;left:0;top:0;width:100%;height:100%;z-index:0}.ngvl__screen-reader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
6854
+ }, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, providers: [NgVirtualListService, NgVirtualListPublicService], template: "<div aria-live=\"polite\" aria-atomic=\"true\" class=\"ngvl__screen-reader\">\r\n {{ screenReaderFormattedMessage() }}\r\n</div>\r\n\r\n<ng-prerender-container #prerender [bounds]=\"bounds()!\" [direction]=\"direction()\"\r\n [dynamic]=\"dynamicSize()\" [isVertical]=\"isVertical\" [itemSize]=\"itemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset()\" [endOffset]=\"scrollEndOffset()\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (snap()) {\r\n <div localeSensitive [langTextDir]=\"langTextDir()\" #snappedContainer class=\"ngvl__snapped-container\"\r\n [ngClass]=\"classes()\">\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n </div>\r\n}\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset()\"\r\n [direction]=\"direction()\" [endOffset]=\"scrollEndOffset()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [focusedElement]=\"focusedElement()\" [loading]=\"loading()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollbarEnabled]=\"scrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\" [scrollingSettings]=\"scrollingSettings()\">\r\n <ng-container #renderersContainer></ng-container>\r\n</ng-scroller>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.vertical){height:320px}.ngvl__snapped-container{position:relative;width:100%;opacity:0}.ngvl__snapped-container.prepared{opacity:1}.ngvl__list-snapper{-webkit-tap-highlight-color:transparent;pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list-scroller{-webkit-tap-highlight-color:transparent;position:absolute;left:0;top:0;width:100%;height:100%;z-index:0}.ngvl__screen-reader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
6792
6855
  }], ctorParameters: () => [], propDecorators: { _prerender: [{ type: i0.ViewChild, args: ['prerender', { isSignal: true }] }], _listContainerRef: [{
6793
6856
  type: ViewChild,
6794
6857
  args: ['renderersContainer', { read: ViewContainerRef }]
6795
6858
  }], _snapContainerRef: [{
6796
6859
  type: ViewChild,
6797
6860
  args: ['snapRendererContainer', { read: ViewContainerRef }]
6798
- }], _scrollerComponent: [{ type: i0.ViewChild, args: ['scroller', { isSignal: true }] }], onScroll: [{ type: i0.Output, args: ["onScroll"] }], onScrollEnd: [{ type: i0.Output, args: ["onScrollEnd"] }], onViewportChange: [{ type: i0.Output, args: ["onViewportChange"] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], onCollapse: [{ type: i0.Output, args: ["onCollapse"] }], onScrollReachStart: [{ type: i0.Output, args: ["onScrollReachStart"] }], onScrollReachEnd: [{ type: i0.Output, args: ["onScrollReachEnd"] }], scrollbarThickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThickness", required: false }] }], scrollbarMinSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarMinSize", required: false }] }], scrollbarThumbRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThumbRenderer", required: false }] }], scrollbarThumbParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThumbParams", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], waitForPreparation: [{ type: i0.Input, args: [{ isSignal: true, alias: "waitForPreparation", required: false }] }], clickDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickDistance", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], defaultItemValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultItemValue", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }], collapsedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedIds", required: false }] }], selectByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectByClick", required: false }] }], collapseByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseByClick", required: false }] }], snap: [{ type: i0.Input, args: [{ isSignal: true, alias: "snap", required: false }] }], snapToEndTransitionInstantOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapToEndTransitionInstantOffset", required: false }] }], scrollStartOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollStartOffset", required: false }] }], scrollEndOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollEndOffset", required: false }] }], snapScrollToStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToStart", required: false }] }], snapScrollToEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToEnd", required: false }] }], snapScrollToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToBottom", required: false }] }], scrollbarEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarEnabled", required: false }] }], scrollbarInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarInteractive", required: false }] }], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], animationParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationParams", required: false }] }], overscrollEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "overscrollEnabled", required: false }] }], enabledBufferOptimization: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabledBufferOptimization", required: false }] }], itemRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemRenderer", required: true }] }], itemConfigMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemConfigMap", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], dynamicSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "dynamicSize", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], collectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "collectionMode", required: false }] }], bufferSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferSize", required: false }] }], maxBufferSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxBufferSize", required: false }] }], snappingMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "snappingMethod", required: false }] }], methodForSelecting: [{ type: i0.Input, args: [{ isSignal: true, alias: "methodForSelecting", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], screenReaderMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "screenReaderMessage", required: false }] }], langTextDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "langTextDir", required: false }] }] } });
6861
+ }], _scrollerComponent: [{ type: i0.ViewChild, args: ['scroller', { isSignal: true }] }], onScroll: [{ type: i0.Output, args: ["onScroll"] }], onScrollEnd: [{ type: i0.Output, args: ["onScrollEnd"] }], onViewportChange: [{ type: i0.Output, args: ["onViewportChange"] }], onItemClick: [{ type: i0.Output, args: ["onItemClick"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], onCollapse: [{ type: i0.Output, args: ["onCollapse"] }], onScrollReachStart: [{ type: i0.Output, args: ["onScrollReachStart"] }], onScrollReachEnd: [{ type: i0.Output, args: ["onScrollReachEnd"] }], scrollbarThickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThickness", required: false }] }], scrollbarMinSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarMinSize", required: false }] }], scrollbarThumbRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThumbRenderer", required: false }] }], scrollbarThumbParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarThumbParams", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], waitForPreparation: [{ type: i0.Input, args: [{ isSignal: true, alias: "waitForPreparation", required: false }] }], clickDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickDistance", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], defaultItemValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultItemValue", required: false }] }], selectedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIds", required: false }] }], collapsedIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedIds", required: false }] }], selectByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectByClick", required: false }] }], collapseByClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseByClick", required: false }] }], snap: [{ type: i0.Input, args: [{ isSignal: true, alias: "snap", required: false }] }], snapToEndTransitionInstantOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapToEndTransitionInstantOffset", required: false }] }], scrollStartOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollStartOffset", required: false }] }], scrollEndOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollEndOffset", required: false }] }], snapScrollToStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToStart", required: false }] }], snapScrollToEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToEnd", required: false }] }], snapScrollToBottom: [{ type: i0.Input, args: [{ isSignal: true, alias: "snapScrollToBottom", required: false }] }], scrollbarEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarEnabled", required: false }] }], scrollbarInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarInteractive", required: false }] }], scrollBehavior: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollBehavior", required: false }] }], scrollingSettings: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollingSettings", required: false }] }], animationParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationParams", required: false }] }], overscrollEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "overscrollEnabled", required: false }] }], enabledBufferOptimization: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabledBufferOptimization", required: false }] }], itemRenderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemRenderer", required: true }] }], itemConfigMap: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemConfigMap", required: false }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], dynamicSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "dynamicSize", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], collectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "collectionMode", required: false }] }], bufferSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferSize", required: false }] }], maxBufferSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxBufferSize", required: false }] }], snappingMethod: [{ type: i0.Input, args: [{ isSignal: true, alias: "snappingMethod", required: false }] }], methodForSelecting: [{ type: i0.Input, args: [{ isSignal: true, alias: "methodForSelecting", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], screenReaderMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "screenReaderMessage", required: false }] }], langTextDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "langTextDir", required: false }] }] } });
6799
6862
 
6800
6863
  class LocaleSensitiveModule {
6801
6864
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: LocaleSensitiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -6838,7 +6901,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
6838
6901
  declarations: [NgVirtualListItemComponent],
6839
6902
  exports: [NgVirtualListItemComponent],
6840
6903
  imports: [CommonModule, ItemClickModule],
6841
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
6904
+ schemas: [NO_ERRORS_SCHEMA],
6842
6905
  }]
6843
6906
  }] });
6844
6907
 
@@ -6853,7 +6916,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
6853
6916
  declarations: [NgScrollBarComponent],
6854
6917
  exports: [NgScrollBarComponent],
6855
6918
  imports: [CommonModule],
6856
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
6919
+ schemas: [NO_ERRORS_SCHEMA],
6857
6920
  }]
6858
6921
  }] });
6859
6922
 
@@ -6868,7 +6931,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
6868
6931
  declarations: [NgScrollerComponent],
6869
6932
  exports: [NgScrollerComponent],
6870
6933
  imports: [CommonModule, NgScrollBarModule, LocaleSensitiveModule, CdkScrollableModule],
6871
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
6934
+ schemas: [NO_ERRORS_SCHEMA],
6872
6935
  }]
6873
6936
  }] });
6874
6937
 
@@ -6883,7 +6946,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
6883
6946
  declarations: [NgPrerenderVirtualListItemComponent],
6884
6947
  exports: [NgPrerenderVirtualListItemComponent],
6885
6948
  imports: [CommonModule, ItemClickModule],
6886
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
6949
+ schemas: [NO_ERRORS_SCHEMA],
6887
6950
  }]
6888
6951
  }] });
6889
6952
 
@@ -6898,7 +6961,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
6898
6961
  declarations: [NgPrerenderScrollerComponent],
6899
6962
  exports: [NgPrerenderScrollerComponent],
6900
6963
  imports: [CommonModule, LocaleSensitiveModule],
6901
- schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
6964
+ schemas: [NO_ERRORS_SCHEMA],
6902
6965
  }]
6903
6966
  }] });
6904
6967