ng-virtual-list 21.12.4 → 21.12.9
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/fesm2022/ng-virtual-list.mjs +257 -137
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ng-virtual-list.d.ts +29 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, inject, viewChild, signal, ElementRef, DestroyRef, effect, computed, ChangeDetectionStrategy, Component, output, Input, Directive, Injector, InjectionToken, input, ViewChild, ViewContainerRef, ViewEncapsulation, NO_ERRORS_SCHEMA, NgModule } from '@angular/core';
|
|
3
|
-
import { Subject, BehaviorSubject, distinctUntilChanged, combineLatest, tap, map, fromEvent, race, of, debounceTime, switchMap as switchMap$1, filter as filter$1, delay, takeUntil as takeUntil$1, startWith,
|
|
3
|
+
import { Subject, BehaviorSubject, distinctUntilChanged, combineLatest, tap, map, fromEvent, race, of, debounceTime, switchMap as switchMap$1, filter as filter$1, delay, takeUntil as takeUntil$1, startWith, take, from, skip } from 'rxjs';
|
|
4
4
|
import { takeUntilDestroyed, toSignal, toObservable } from '@angular/core/rxjs-interop';
|
|
5
5
|
import { BehaviorSubject as BehaviorSubject$1 } from 'rxjs/internal/BehaviorSubject';
|
|
6
6
|
import * as i1 from '@angular/common';
|
|
@@ -328,7 +328,7 @@ const VISIBILITY_HIDDEN = 'hidden';
|
|
|
328
328
|
const SIZE_100_PERSENT = '100%';
|
|
329
329
|
const SIZE_AUTO = 'auto';
|
|
330
330
|
const UNSET$5 = 'unset';
|
|
331
|
-
const LEFT$
|
|
331
|
+
const LEFT$3 = 'left';
|
|
332
332
|
const RIGHT$1 = 'right';
|
|
333
333
|
const POSITION$1 = 'position';
|
|
334
334
|
const POSITION_RELATIVE = 'relative';
|
|
@@ -1818,7 +1818,7 @@ class ScrollEvent {
|
|
|
1818
1818
|
|
|
1819
1819
|
/**
|
|
1820
1820
|
* Event emitter
|
|
1821
|
-
* @link https://github.com/DjonnyX/ng-virtual-list/blob/
|
|
1821
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/21.x/projects/ng-virtual-list/src/lib/utils/event-emitter/event-emitter.ts
|
|
1822
1822
|
* @author Evgenii Alexandrovich Grebennikov
|
|
1823
1823
|
* @email djonnyx@gmail.com
|
|
1824
1824
|
*/
|
|
@@ -2728,7 +2728,7 @@ class TrackBox extends CacheMap {
|
|
|
2728
2728
|
* Calculates list metrics
|
|
2729
2729
|
*/
|
|
2730
2730
|
recalculateMetrics(options) {
|
|
2731
|
-
const { alignment, fromItemId, bounds, collection, dynamicSize, isVertical, itemSize, minItemSize, maxItemSize, bufferSize: minBufferSize, scrollSize, stickyEnabled, itemConfigMap, enabledBufferOptimization, previousTotalSize, snapToItem, snapToItemAlign, deletedItemsMap, itemTransform } = options, roundedScrollSize = Math.round(scrollSize);
|
|
2731
|
+
const { alignment, fromItemId, bounds, collection, dynamicSize, isVertical, itemSize, minItemSize, maxItemSize, bufferSize: minBufferSize, scrollSize, stickyEnabled, itemConfigMap, enabledBufferOptimization, previousTotalSize, snapToItem, snapToItemAlign, deletedItemsMap, inverted, itemTransform } = options, roundedScrollSize = Math.round(scrollSize);
|
|
2732
2732
|
const trackBy = this._trackingPropertyName, bufferSize = Math.max(minBufferSize, this._bufferSize), { width, height } = bounds, sizeProperty = isVertical ? HEIGHT_PROP_NAME : WIDTH_PROP_NAME, size = isVertical ? height : width, totalLength = collection.length, typicalItemSize = itemSize, w = isVertical ? width : typicalItemSize, h = isVertical ? typicalItemSize : height, map = this._map, snapshot = this._snapshot, divides = this._divides, stickyPos = Math.floor(scrollSize) + this._scrollStartOffset, leftItemsOrRowsWeights = [], isFromId = fromItemId !== undefined && (typeof fromItemId === 'number' && fromItemId > -1)
|
|
2733
2733
|
|| (typeof fromItemId === 'string' && fromItemId > '-1');
|
|
2734
2734
|
let leftItemsOffset = 0, rightItemsOffset = 0;
|
|
@@ -3181,6 +3181,7 @@ class TrackBox extends CacheMap {
|
|
|
3181
3181
|
rightItemLength,
|
|
3182
3182
|
rightItemsWeight,
|
|
3183
3183
|
scrollSize: actualScrollSize,
|
|
3184
|
+
maxScrollSize: totalSize,
|
|
3184
3185
|
leftSizeOfAddedItems,
|
|
3185
3186
|
sizeProperty,
|
|
3186
3187
|
stickyEnabled,
|
|
@@ -3195,6 +3196,7 @@ class TrackBox extends CacheMap {
|
|
|
3195
3196
|
isUpdating,
|
|
3196
3197
|
snapToItem,
|
|
3197
3198
|
snapToItemAlign,
|
|
3199
|
+
inverted,
|
|
3198
3200
|
itemTransform,
|
|
3199
3201
|
};
|
|
3200
3202
|
return metrics;
|
|
@@ -3246,7 +3248,7 @@ class TrackBox extends CacheMap {
|
|
|
3246
3248
|
return false;
|
|
3247
3249
|
}
|
|
3248
3250
|
generateDisplayCollection(items, actualItems, itemConfigMap, metrics) {
|
|
3249
|
-
const { width, height, normalizedItemWidth, normalizedItemHeight, dynamicSize, divides, itemsOnDisplayLength, itemsFromStartToScrollEnd, isVertical, leftLayoutOffset: layoutOffset, leftLayoutIndexOffset: layoutIndexOffset, renderItems: renderItemsLength, scrollSize, sizeProperty, stickyEnabled, stickyPos, startPosition, totalLength, startIndex, typicalItemSize, minItemSize, maxItemSize, snapToItem, snapToItemAlign, itemTransform, } = metrics, displayItems = [];
|
|
3251
|
+
const { width, height, normalizedItemWidth, normalizedItemHeight, dynamicSize, divides, itemsOnDisplayLength, itemsFromStartToScrollEnd, isVertical, leftLayoutOffset: layoutOffset, leftLayoutIndexOffset: layoutIndexOffset, renderItems: renderItemsLength, scrollSize, maxScrollSize, sizeProperty, stickyEnabled, stickyPos, startPosition, totalLength, startIndex, typicalItemSize, minItemSize, maxItemSize, snapToItem, snapToItemAlign, inverted, itemTransform, } = metrics, displayItems = [];
|
|
3250
3252
|
if (items.length) {
|
|
3251
3253
|
const trackBy = this._trackingPropertyName, actualSnippedPosition = stickyPos, isSnappingMethodAdvanced = this._isSnappingMethodAdvanced, deltaOffet = (isSnappingMethodAdvanced ? scrollSize : 0), scrollDirection = this._scrollDirection, boundsSize = isVertical ? height : width, actualEndSnippedPosition = scrollSize + boundsSize - this._scrollEndOffset;
|
|
3252
3254
|
let pos = startPosition, renderItems = renderItemsLength, stickyItem, nextSticky, stickyItemIndex = -1, nexstStickyItemIndex = -1, stickyItemSize = 0, endStickyItem, nextEndSticky, endStickyItemIndex = -1, endStickyItemSize = 0;
|
|
@@ -3286,6 +3288,7 @@ class TrackBox extends CacheMap {
|
|
|
3286
3288
|
position: pos,
|
|
3287
3289
|
boundsSize,
|
|
3288
3290
|
scrollSize,
|
|
3291
|
+
maxScrollSize,
|
|
3289
3292
|
absoluteStartPosition,
|
|
3290
3293
|
absoluteStartPositionPercent,
|
|
3291
3294
|
absoluteEndPosition,
|
|
@@ -3316,6 +3319,7 @@ class TrackBox extends CacheMap {
|
|
|
3316
3319
|
tabIndex: i - layoutIndexOffset,
|
|
3317
3320
|
divides,
|
|
3318
3321
|
opacity: 1,
|
|
3322
|
+
inverted,
|
|
3319
3323
|
zIndex: Z_INDEX_1,
|
|
3320
3324
|
};
|
|
3321
3325
|
const itemData = collectionItem;
|
|
@@ -3362,6 +3366,7 @@ class TrackBox extends CacheMap {
|
|
|
3362
3366
|
position: pos,
|
|
3363
3367
|
boundsSize,
|
|
3364
3368
|
scrollSize,
|
|
3369
|
+
maxScrollSize,
|
|
3365
3370
|
absoluteStartPosition,
|
|
3366
3371
|
absoluteStartPositionPercent,
|
|
3367
3372
|
absoluteEndPosition,
|
|
@@ -3398,6 +3403,7 @@ class TrackBox extends CacheMap {
|
|
|
3398
3403
|
tabIndex: i - layoutIndexOffset,
|
|
3399
3404
|
divides,
|
|
3400
3405
|
opacity: 1,
|
|
3406
|
+
inverted,
|
|
3401
3407
|
zIndex: Z_INDEX_1,
|
|
3402
3408
|
};
|
|
3403
3409
|
const itemData = collectionItem;
|
|
@@ -3458,6 +3464,7 @@ class TrackBox extends CacheMap {
|
|
|
3458
3464
|
position: pos,
|
|
3459
3465
|
boundsSize,
|
|
3460
3466
|
scrollSize,
|
|
3467
|
+
maxScrollSize,
|
|
3461
3468
|
absoluteStartPosition,
|
|
3462
3469
|
absoluteStartPositionPercent,
|
|
3463
3470
|
absoluteEndPosition,
|
|
@@ -3496,6 +3503,7 @@ class TrackBox extends CacheMap {
|
|
|
3496
3503
|
opacity: 1,
|
|
3497
3504
|
zIndex: Z_INDEX_0,
|
|
3498
3505
|
fullSize,
|
|
3506
|
+
inverted,
|
|
3499
3507
|
};
|
|
3500
3508
|
if (snapped) {
|
|
3501
3509
|
config.zIndex = Z_INDEX_2;
|
|
@@ -3640,18 +3648,18 @@ class TrackBox extends CacheMap {
|
|
|
3640
3648
|
let first = null, last = null;
|
|
3641
3649
|
if (!!components) {
|
|
3642
3650
|
for (const comp of components) {
|
|
3643
|
-
const id = comp.instance.itemId ?? null, isVertical = comp.instance.item?.config?.isVertical, x = comp.instance.item?.measures?.x ?? 0, y = comp.instance.item?.measures?.y ?? 0, isFirst = comp.instance.item?.config?.isFirst ?? false, isLast = comp.instance.item?.config?.isLast ?? false,
|
|
3651
|
+
const id = comp.instance.itemId ?? null, isVertical = comp.instance.item?.config?.isVertical, inverted = comp.instance.item?.config.inverted ?? false, maxScrollSize = comp.instance.item?.measures.maxScrollSize ?? 0, { width, height } = comp.instance.getBounds(), x = comp.instance.item?.measures?.x ?? 0, xx = inverted ? (maxScrollSize - x) - width : x, y = comp.instance.item?.measures?.y ?? 0, isFirst = comp.instance.item?.config?.isFirst ?? false, isLast = comp.instance.item?.config?.isLast ?? false, pos = position;
|
|
3644
3652
|
if (isVertical && (pos >= y && pos < y + height)) {
|
|
3645
3653
|
return { id, x, y, width, height, isFirst, isLast };
|
|
3646
3654
|
}
|
|
3647
|
-
else if (!isVertical && (pos >=
|
|
3648
|
-
return { id, x, y, width, height, isFirst, isLast };
|
|
3655
|
+
else if (!isVertical && (pos >= xx && pos < xx + width)) {
|
|
3656
|
+
return { id, x: xx, y, width, height, isFirst, isLast };
|
|
3649
3657
|
}
|
|
3650
3658
|
if (isFirst) {
|
|
3651
|
-
first = { id, x, y, width, height, isFirst, isLast };
|
|
3659
|
+
first = { id, x: xx, y, width, height, isFirst, isLast };
|
|
3652
3660
|
}
|
|
3653
3661
|
else if (isLast) {
|
|
3654
|
-
last = { id, x, y, width, height, isFirst, isLast };
|
|
3662
|
+
last = { id, x: xx, y, width, height, isFirst, isLast };
|
|
3655
3663
|
}
|
|
3656
3664
|
}
|
|
3657
3665
|
}
|
|
@@ -4039,7 +4047,7 @@ const easeLinear = (t) => {
|
|
|
4039
4047
|
|
|
4040
4048
|
/**
|
|
4041
4049
|
* Animator
|
|
4042
|
-
* @link https://github.com/DjonnyX/ng-virtual-list/blob/
|
|
4050
|
+
* @link https://github.com/DjonnyX/ng-virtual-list/blob/21.x/projects/ng-virtual-list/src/lib/utils/animator/animator.ts
|
|
4043
4051
|
* @author Evgenii Alexandrovich Grebennikov
|
|
4044
4052
|
* @email djonnyx@gmail.com
|
|
4045
4053
|
*/
|
|
@@ -4059,9 +4067,13 @@ class Animator {
|
|
|
4059
4067
|
_endValue = 0;
|
|
4060
4068
|
_prevPos = 0;
|
|
4061
4069
|
updateTo(end) {
|
|
4062
|
-
this.
|
|
4063
|
-
|
|
4064
|
-
|
|
4070
|
+
if (this.hasAnimation()) {
|
|
4071
|
+
this._startValue = this._prevPos;
|
|
4072
|
+
this._endValue = end;
|
|
4073
|
+
this._diff = this._endValue - this._startValue;
|
|
4074
|
+
return true;
|
|
4075
|
+
}
|
|
4076
|
+
return false;
|
|
4065
4077
|
}
|
|
4066
4078
|
animate(params) {
|
|
4067
4079
|
this.stop();
|
|
@@ -4093,6 +4105,9 @@ class Animator {
|
|
|
4093
4105
|
const frameTimestamp = t - prevTime, actualFrameTimestamp = frameTimestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : frameTimestamp;
|
|
4094
4106
|
prevTime = t;
|
|
4095
4107
|
this._prevPos = currentValue;
|
|
4108
|
+
if (isFinished) {
|
|
4109
|
+
this._animationId = -1;
|
|
4110
|
+
}
|
|
4096
4111
|
if (onUpdate !== undefined) {
|
|
4097
4112
|
const data = {
|
|
4098
4113
|
id,
|
|
@@ -4104,7 +4119,6 @@ class Animator {
|
|
|
4104
4119
|
onUpdate(data);
|
|
4105
4120
|
}
|
|
4106
4121
|
if (isFinished) {
|
|
4107
|
-
this._animationId = -1;
|
|
4108
4122
|
if (onComplete !== undefined) {
|
|
4109
4123
|
const data = {
|
|
4110
4124
|
id,
|
|
@@ -4141,7 +4155,7 @@ class Animator {
|
|
|
4141
4155
|
const SCROLL_VIEW_INVERSION = new InjectionToken('ScrollViewInversion');
|
|
4142
4156
|
const SCROLL_VIEW_OVERSCROLL_ENABLED = new InjectionToken('ScrollViewOverscrollEnabled');
|
|
4143
4157
|
const SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO = new InjectionToken('ScrollViewNormalizeValueFromZero');
|
|
4144
|
-
const TOP$1 = 'top', LEFT$
|
|
4158
|
+
const TOP$1 = 'top', LEFT$2 = 'left', INSTANT$1 = 'instant', AUTO = 'auto', SMOOTH = 'smooth', DURATION = 2000, FRICTION_FORCE = .035, MAX_DURATION = 4000, ANIMATION_DURATION = 50, MASS = .005, ACCELERATION_SCALE = 40, MAX_DIST = 12500, MIN_DELTA = 0.1, MAX_VELOCITY_TIMESTAMP = 100, MAX_VELOCITIES_LENGTH = 10, MIN_ACCELERATION = 0.001, SPEED_SCALE = 15, OVERSCROLL_START_ITERATION = 2;
|
|
4145
4159
|
const MAX_ITERATIONS_FOR_AVERAGE_CALCULATIONS = 5, INSTANT_VELOCITY_SCALE = 1000;
|
|
4146
4160
|
const SCROLL_EVENT$1 = new Event(SCROLLER_SCROLL);
|
|
4147
4161
|
|
|
@@ -4262,6 +4276,7 @@ class BaseScrollView {
|
|
|
4262
4276
|
isInfinity = input(false, ...(ngDevMode ? [{ debugName: "isInfinity" }] : []));
|
|
4263
4277
|
isVertical;
|
|
4264
4278
|
grabbing = signal(false, ...(ngDevMode ? [{ debugName: "grabbing" }] : []));
|
|
4279
|
+
langTextDir = input(TextDirections.LTR, ...(ngDevMode ? [{ debugName: "langTextDir" }] : []));
|
|
4265
4280
|
_inversion = inject(SCROLL_VIEW_INVERSION);
|
|
4266
4281
|
_overscrollEnabled = inject(SCROLL_VIEW_OVERSCROLL_ENABLED);
|
|
4267
4282
|
_$updateScrollBar = new Subject();
|
|
@@ -4424,7 +4439,7 @@ class BaseScrollView {
|
|
|
4424
4439
|
}
|
|
4425
4440
|
}
|
|
4426
4441
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BaseScrollView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4427
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: BaseScrollView, isStandalone: true, selector: "base-scroll-view", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, startOffset: { classPropertyName: "startOffset", publicName: "startOffset", isSignal: true, isRequired: false, transformFunction: null }, endOffset: { classPropertyName: "endOffset", publicName: "endOffset", isSignal: true, isRequired: false, transformFunction: null }, alignmentStartOffset: { classPropertyName: "alignmentStartOffset", publicName: "alignmentStartOffset", isSignal: true, isRequired: false, transformFunction: null }, alignmentEndOffset: { classPropertyName: "alignmentEndOffset", publicName: "alignmentEndOffset", isSignal: true, isRequired: false, transformFunction: null }, isInfinity: { classPropertyName: "isInfinity", publicName: "isInfinity", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "scrollContent", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }, { propertyName: "scrollViewport", first: true, predicate: ["scrollViewport"], descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true });
|
|
4442
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: BaseScrollView, isStandalone: true, selector: "base-scroll-view", inputs: { direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, startOffset: { classPropertyName: "startOffset", publicName: "startOffset", isSignal: true, isRequired: false, transformFunction: null }, endOffset: { classPropertyName: "endOffset", publicName: "endOffset", isSignal: true, isRequired: false, transformFunction: null }, alignmentStartOffset: { classPropertyName: "alignmentStartOffset", publicName: "alignmentStartOffset", isSignal: true, isRequired: false, transformFunction: null }, alignmentEndOffset: { classPropertyName: "alignmentEndOffset", publicName: "alignmentEndOffset", isSignal: true, isRequired: false, transformFunction: null }, isInfinity: { classPropertyName: "isInfinity", publicName: "isInfinity", isSignal: true, isRequired: false, transformFunction: null }, langTextDir: { classPropertyName: "langTextDir", publicName: "langTextDir", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "scrollContent", first: true, predicate: ["scrollContent"], descendants: true, isSignal: true }, { propertyName: "scrollViewport", first: true, predicate: ["scrollViewport"], descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true });
|
|
4428
4443
|
}
|
|
4429
4444
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BaseScrollView, decorators: [{
|
|
4430
4445
|
type: Component,
|
|
@@ -4432,7 +4447,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
4432
4447
|
selector: 'base-scroll-view',
|
|
4433
4448
|
template: '',
|
|
4434
4449
|
}]
|
|
4435
|
-
}], ctorParameters: () => [], propDecorators: { scrollContent: [{ type: i0.ViewChild, args: ['scrollContent', { isSignal: true }] }], scrollViewport: [{ type: i0.ViewChild, args: ['scrollViewport', { isSignal: true }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], startOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "startOffset", required: false }] }], endOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "endOffset", required: false }] }], alignmentStartOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignmentStartOffset", required: false }] }], alignmentEndOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignmentEndOffset", required: false }] }], isInfinity: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInfinity", required: false }] }] } });
|
|
4450
|
+
}], ctorParameters: () => [], propDecorators: { scrollContent: [{ type: i0.ViewChild, args: ['scrollContent', { isSignal: true }] }], scrollViewport: [{ type: i0.ViewChild, args: ['scrollViewport', { isSignal: true }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], startOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "startOffset", required: false }] }], endOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "endOffset", required: false }] }], alignmentStartOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignmentStartOffset", required: false }] }], alignmentEndOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "alignmentEndOffset", required: false }] }], isInfinity: [{ type: i0.Input, args: [{ isSignal: true, alias: "isInfinity", required: false }] }], langTextDir: [{ type: i0.Input, args: [{ isSignal: true, alias: "langTextDir", required: false }] }] } });
|
|
4436
4451
|
|
|
4437
4452
|
/**
|
|
4438
4453
|
* ScrollingDirection
|
|
@@ -4514,10 +4529,32 @@ class NgScrollView extends BaseScrollView {
|
|
|
4514
4529
|
get averageVelocity() { return this._$averageVelocity.getValue(); }
|
|
4515
4530
|
_measureVelocityTimestamp = Date.now();
|
|
4516
4531
|
_measureVelocityLastPosition = this.isVertical() ? this._y : this._x;
|
|
4517
|
-
|
|
4532
|
+
_startPositionX = 0;
|
|
4533
|
+
_startPositionY = 0;
|
|
4534
|
+
set startPosition(v) {
|
|
4535
|
+
const isVertical = this.isVertical(), c = isVertical ? this._startPositionY : this._startPositionX;
|
|
4536
|
+
if (v !== c) {
|
|
4537
|
+
if (isVertical) {
|
|
4538
|
+
this._startPositionY = v;
|
|
4539
|
+
}
|
|
4540
|
+
else {
|
|
4541
|
+
this._startPositionX = v;
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
}
|
|
4545
|
+
get startPosition() {
|
|
4546
|
+
if (this.isVertical()) {
|
|
4547
|
+
return this._startPositionY;
|
|
4548
|
+
}
|
|
4549
|
+
return this._startPositionX;
|
|
4550
|
+
}
|
|
4518
4551
|
_animator = new Animator();
|
|
4519
4552
|
_interactive = true;
|
|
4553
|
+
_horizontalAxisInvertion;
|
|
4554
|
+
get inverted() { return this._horizontalAxisInvertion(); }
|
|
4520
4555
|
_overscrollIteration = 0;
|
|
4556
|
+
_overscrollStartIteration = 0;
|
|
4557
|
+
_overscrollApplied = false;
|
|
4521
4558
|
set x(v) {
|
|
4522
4559
|
this.setX(v);
|
|
4523
4560
|
}
|
|
@@ -4557,7 +4594,7 @@ class NgScrollView extends BaseScrollView {
|
|
|
4557
4594
|
_delta = 0;
|
|
4558
4595
|
set delta(v) {
|
|
4559
4596
|
this._delta = v;
|
|
4560
|
-
this.
|
|
4597
|
+
this.startPosition += v;
|
|
4561
4598
|
}
|
|
4562
4599
|
set startLayoutOffset(v) {
|
|
4563
4600
|
if (this._startLayoutOffset !== v) {
|
|
@@ -4566,12 +4603,18 @@ class NgScrollView extends BaseScrollView {
|
|
|
4566
4603
|
}
|
|
4567
4604
|
}
|
|
4568
4605
|
get startLayoutOffset() { return this._startLayoutOffset; }
|
|
4606
|
+
_scrollDirectionValueX = 0;
|
|
4607
|
+
_scrollDirectionValueY = 0;
|
|
4569
4608
|
_intersectionComponentId = null;
|
|
4570
4609
|
_isAlignmentAnimation = false;
|
|
4571
4610
|
get animated() { return this._animator?.isAnimated ?? false; }
|
|
4572
4611
|
constructor() {
|
|
4573
4612
|
super();
|
|
4574
4613
|
let mouseCanceled = false, touchCanceled = false;
|
|
4614
|
+
this._horizontalAxisInvertion = computed(() => {
|
|
4615
|
+
const isVertical = this.isVertical(), langTextDir = this.langTextDir();
|
|
4616
|
+
return !isVertical && langTextDir === TextDirections.RTL;
|
|
4617
|
+
}, ...(ngDevMode ? [{ debugName: "_horizontalAxisInvertion" }] : []));
|
|
4575
4618
|
const $viewportBounds = toObservable(this.viewportBounds);
|
|
4576
4619
|
$viewportBounds.pipe(takeUntilDestroyed(), debounceTime(0), tap(() => {
|
|
4577
4620
|
this._isMoving = false;
|
|
@@ -4589,17 +4632,20 @@ class NgScrollView extends BaseScrollView {
|
|
|
4589
4632
|
const $wheel = this.$wheel;
|
|
4590
4633
|
$wheel.pipe(takeUntilDestroyed(), switchMap$1(v => of(this.averageVelocity)), debounceTime(100), tap(v => {
|
|
4591
4634
|
this.snapWithInitialForceIfNecessary(v);
|
|
4635
|
+
this._overscrollIteration = this._overscrollStartIteration = 0;
|
|
4636
|
+
this._overscrollApplied = false;
|
|
4592
4637
|
this._scrollDirection.clear();
|
|
4638
|
+
this._scrollDirectionValueX = this._scrollDirectionValueY = 0;
|
|
4593
4639
|
})).subscribe();
|
|
4594
4640
|
const $viewport = toObservable(this.scrollViewport).pipe(takeUntilDestroyed(this._destroyRef), filter$1(v => !!v), map(v => v.nativeElement)), $content = toObservable(this.scrollContent).pipe(takeUntilDestroyed(this._destroyRef), filter$1(v => !!v), map(v => v.nativeElement)), $wheelEmitter = this._inversion ? $viewport : $content;
|
|
4595
4641
|
$wheelEmitter.pipe(takeUntilDestroyed(this._destroyRef), switchMap$1(content => {
|
|
4596
4642
|
return fromEvent(content, WHEEL, { passive: false }).pipe(filter$1(() => this._interactive), takeUntilDestroyed(this._destroyRef), tap(e => {
|
|
4597
4643
|
const isVertical = this.isVertical();
|
|
4598
4644
|
this.emitScrollableEvent();
|
|
4599
|
-
this.checkOverscroll(e);
|
|
4645
|
+
this.checkOverscroll(e, true);
|
|
4600
4646
|
this.stopScrolling(true);
|
|
4601
|
-
const scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, startPos = isVertical ? this._y : this._x, delta = isVertical ? e.deltaY : e.deltaX, dp = (startPos + delta), position = this.isInfinity() ? dp : (dp < 0 ? 0 : dp > scrollSize ? scrollSize : dp);
|
|
4602
|
-
this.scroll({ [isVertical ? TOP$1 : LEFT$
|
|
4647
|
+
const scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, startPos = isVertical ? this._y : this._x, delta = isVertical ? e.deltaY : (e.deltaX * (this._horizontalAxisInvertion() ? -1 : 1)), dp = (startPos + delta), position = this.isInfinity() ? dp : (dp < 0 ? 0 : dp > scrollSize ? scrollSize : dp);
|
|
4648
|
+
this.scroll({ [isVertical ? TOP$1 : LEFT$2]: position, behavior: INSTANT$1, userAction: true, blending: false, fireUpdate: true });
|
|
4603
4649
|
this._$wheel.next(delta);
|
|
4604
4650
|
}));
|
|
4605
4651
|
})).subscribe();
|
|
@@ -4639,7 +4685,10 @@ class NgScrollView extends BaseScrollView {
|
|
|
4639
4685
|
$content.pipe(takeUntilDestroyed(this._destroyRef), switchMap$1(content => {
|
|
4640
4686
|
return fromEvent(content, MOUSE_DOWN, { passive: false }).pipe(takeUntilDestroyed(this._destroyRef), filter$1(v => this._interactive), switchMap$1(e => {
|
|
4641
4687
|
mouseCanceled = false;
|
|
4688
|
+
this._overscrollStartIteration = 0;
|
|
4689
|
+
this._overscrollApplied = false;
|
|
4642
4690
|
this._scrollDirection.clear();
|
|
4691
|
+
this._scrollDirectionValueX = this._scrollDirectionValueY = 0;
|
|
4643
4692
|
this.cancelOverscroll();
|
|
4644
4693
|
this.onDragStart();
|
|
4645
4694
|
this.stopScrolling(true);
|
|
@@ -4651,23 +4700,34 @@ class NgScrollView extends BaseScrollView {
|
|
|
4651
4700
|
const inversion = this._inversion, isVertical = this.isVertical();
|
|
4652
4701
|
this._isMoving = true;
|
|
4653
4702
|
this.grabbing.set(true);
|
|
4654
|
-
this.
|
|
4655
|
-
|
|
4703
|
+
this._startPositionX = this.x;
|
|
4704
|
+
this._startPositionY = this.y;
|
|
4705
|
+
let prevClientPositionX = (e.clientX) * (this._horizontalAxisInvertion() ? -1 : 1), prevClientPositionY = e.clientY, startClientPosX = prevClientPositionX, startClientPosY = prevClientPositionY, offsetsX = new Array(), offsetsY = new Array(), velocitiesX = new Array(), velocitiesY = new Array(), startTime = Date.now();
|
|
4656
4706
|
return fromEvent(window, MOUSE_MOVE, { passive: false }).pipe(takeUntilDestroyed(this._destroyRef), takeUntil$1($mouseDragCancel), tap(e => {
|
|
4657
4707
|
this.checkOverscroll(e);
|
|
4658
4708
|
}), switchMap$1(e => {
|
|
4659
|
-
const { position, currentPos, endTime, scrollDelta } = this.calculatePosition(
|
|
4660
|
-
|
|
4709
|
+
const { position: positionX, currentPos: currentPosX, endTime, scrollDelta: scrollDeltaX } = this.calculatePosition(false, true, this._horizontalAxisInvertion(), e, inversion, startClientPosX, startTime, prevClientPositionX, offsetsX, velocitiesX), { position: positionY, currentPos: currentPosY, scrollDelta: scrollDeltaY } = this.calculatePosition(true, true, false, e, inversion, startClientPosY, startTime, prevClientPositionY, offsetsY, velocitiesY), position = isVertical ? positionY : positionX;
|
|
4710
|
+
prevClientPositionX = currentPosX;
|
|
4711
|
+
prevClientPositionY = currentPosY;
|
|
4712
|
+
this._scrollDirectionValueX += Math.abs(scrollDeltaX);
|
|
4713
|
+
this._scrollDirectionValueY += Math.abs(scrollDeltaY);
|
|
4661
4714
|
this.move(isVertical, position, true, true, true);
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4715
|
+
if (this.isInfinity()) {
|
|
4716
|
+
const offset = Math.abs(position) - Math.abs(isVertical ? this._y : this._x), scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, viewportSize = isVertical ? this.viewportBounds().height : this.viewportBounds().width;
|
|
4717
|
+
if (position >= (scrollSize - viewportSize * .5) || position <= 0) {
|
|
4718
|
+
if (isVertical) {
|
|
4719
|
+
startClientPosY -= offset;
|
|
4720
|
+
}
|
|
4721
|
+
else {
|
|
4722
|
+
startClientPosX -= offset;
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4665
4725
|
}
|
|
4666
4726
|
startTime = endTime;
|
|
4667
4727
|
return race([fromEvent(window, MOUSE_UP, { passive: false }), fromEvent(content, MOUSE_UP, { passive: false })]).pipe(takeUntilDestroyed(this._destroyRef), takeUntil$1($mouseDragCancel), tap(e => {
|
|
4668
4728
|
mouseCanceled = true;
|
|
4669
4729
|
this.cancelOverscroll();
|
|
4670
|
-
const endTime = Date.now(), timestamp = endTime - startTime, { v0 } = this.calculateVelocity(
|
|
4730
|
+
const endTime = Date.now(), timestamp = endTime - startTime, { v0 } = this.calculateVelocity(isVertical ? offsetsY : offsetsX, isVertical ? scrollDeltaY : scrollDeltaX, timestamp), { a0 } = this.calculateAcceleration(isVertical ? velocitiesY : velocitiesX, v0, timestamp);
|
|
4671
4731
|
this._isMoving = false;
|
|
4672
4732
|
this.grabbing.set(false);
|
|
4673
4733
|
if (!this.snapIfNecessary(v0, false) && this.scrollBehavior() !== BEHAVIOR_INSTANT) {
|
|
@@ -4717,7 +4777,10 @@ class NgScrollView extends BaseScrollView {
|
|
|
4717
4777
|
$content.pipe(takeUntilDestroyed(this._destroyRef), switchMap$1(content => {
|
|
4718
4778
|
return fromEvent(content, TOUCH_START, { passive: false }).pipe(takeUntilDestroyed(this._destroyRef), filter$1(() => this._interactive), switchMap$1(e => {
|
|
4719
4779
|
touchCanceled = false;
|
|
4780
|
+
this._overscrollStartIteration = 0;
|
|
4781
|
+
this._overscrollApplied = false;
|
|
4720
4782
|
this._scrollDirection.clear();
|
|
4783
|
+
this._scrollDirectionValueX = this._scrollDirectionValueY = 0;
|
|
4721
4784
|
this.cancelOverscroll();
|
|
4722
4785
|
this.onDragStart();
|
|
4723
4786
|
this.stopScrolling(true);
|
|
@@ -4729,23 +4792,34 @@ class NgScrollView extends BaseScrollView {
|
|
|
4729
4792
|
const inversion = this._inversion, isVertical = this.isVertical();
|
|
4730
4793
|
this._isMoving = true;
|
|
4731
4794
|
this.grabbing.set(true);
|
|
4732
|
-
this.
|
|
4733
|
-
|
|
4795
|
+
this._startPositionX = this.x;
|
|
4796
|
+
this._startPositionY = this.y;
|
|
4797
|
+
let prevClientPositionX = (e.touches[e.touches.length - 1].clientX) * (this._horizontalAxisInvertion() ? -1 : 1), prevClientPositionY = e.touches[e.touches.length - 1].clientY, startClientPosX = prevClientPositionX, startClientPosY = prevClientPositionY, offsetsX = new Array(), offsetsY = new Array(), velocitiesX = new Array(), velocitiesY = new Array(), startTime = Date.now();
|
|
4734
4798
|
return fromEvent(window, TOUCH_MOVE, { passive: false }).pipe(takeUntilDestroyed(this._destroyRef), takeUntil$1($touchCanceler), tap(e => {
|
|
4735
4799
|
this.checkOverscroll(e);
|
|
4736
4800
|
}), switchMap$1(e => {
|
|
4737
|
-
const { position, currentPos, endTime, scrollDelta } = this.calculatePosition(
|
|
4738
|
-
|
|
4801
|
+
const { position: positionX, currentPos: currentPosX, endTime, scrollDelta: scrollDeltaX } = this.calculatePosition(false, true, this._horizontalAxisInvertion(), e, inversion, startClientPosX, startTime, prevClientPositionX, offsetsX, velocitiesX), { position: positionY, currentPos: currentPosY, scrollDelta: scrollDeltaY } = this.calculatePosition(true, true, false, e, inversion, startClientPosY, startTime, prevClientPositionY, offsetsY, velocitiesY), position = isVertical ? positionY : positionX;
|
|
4802
|
+
prevClientPositionX = currentPosX;
|
|
4803
|
+
prevClientPositionY = currentPosY;
|
|
4804
|
+
this._scrollDirectionValueX += Math.abs(scrollDeltaX);
|
|
4805
|
+
this._scrollDirectionValueY += Math.abs(scrollDeltaY);
|
|
4739
4806
|
this.move(isVertical, position, true, true, true);
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4807
|
+
if (this.isInfinity()) {
|
|
4808
|
+
const offset = Math.abs(position) - Math.abs(isVertical ? this._y : this._x), scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, viewportSize = isVertical ? this.viewportBounds().height : this.viewportBounds().width;
|
|
4809
|
+
if (position >= (scrollSize - viewportSize * .5) || position <= 0) {
|
|
4810
|
+
if (isVertical) {
|
|
4811
|
+
startClientPosY -= offset;
|
|
4812
|
+
}
|
|
4813
|
+
else {
|
|
4814
|
+
startClientPosX -= offset;
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4743
4817
|
}
|
|
4744
4818
|
startTime = endTime;
|
|
4745
4819
|
return race([fromEvent(window, TOUCH_END, { passive: false }), fromEvent(content, TOUCH_END, { passive: false })]).pipe(takeUntilDestroyed(this._destroyRef), takeUntil$1($touchCanceler), tap(e => {
|
|
4746
4820
|
touchCanceled = true;
|
|
4747
4821
|
this.cancelOverscroll();
|
|
4748
|
-
const endTime = Date.now(), timestamp = endTime - startTime, { v0 } = this.calculateVelocity(
|
|
4822
|
+
const endTime = Date.now(), timestamp = endTime - startTime, { v0 } = this.calculateVelocity(isVertical ? offsetsY : offsetsX, isVertical ? scrollDeltaY : scrollDeltaX, timestamp), { a0 } = this.calculateAcceleration(isVertical ? velocitiesY : velocitiesX, v0, timestamp);
|
|
4749
4823
|
this._isMoving = false;
|
|
4750
4824
|
this.grabbing.set(false);
|
|
4751
4825
|
if (!this.snapIfNecessary(v0, false) && this.scrollBehavior() !== BEHAVIOR_INSTANT) {
|
|
@@ -4827,8 +4901,11 @@ class NgScrollView extends BaseScrollView {
|
|
|
4827
4901
|
}
|
|
4828
4902
|
return false;
|
|
4829
4903
|
}
|
|
4830
|
-
calculatePosition(isVertical, e, inversion, startClientPos, startTime, prevClientPosition, offsets, velocities) {
|
|
4831
|
-
|
|
4904
|
+
calculatePosition(isVertical, enabled, axisInversion, e, inversion, startClientPos, startTime, prevClientPosition, offsets, velocities) {
|
|
4905
|
+
if (!enabled) {
|
|
4906
|
+
return { position: isVertical ? this._y : this._x, currentPos: null, endTime: Date.now(), scrollDelta: 0 };
|
|
4907
|
+
}
|
|
4908
|
+
const currentPos = (isVertical ? e.touches?.[e.touches?.length - 1]?.clientY || e.clientY : e.touches?.[e.touches?.length - 1]?.clientX || e.clientX) * (axisInversion ? -1 : 1), scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, delta = (inversion ? -1 : 1) * (startClientPos - currentPos), dp = (isVertical ? this._startPositionY : this._startPositionX) + delta, position = this.isInfinity() ? dp : dp < 0 ? 0 : dp > scrollSize ? scrollSize : dp, endTime = Date.now(), timestamp = endTime - startTime, scrollDelta = (prevClientPosition === 0 || prevClientPosition === null) ? 0 : prevClientPosition - currentPos, { v0 } = this.calculateVelocity(offsets, scrollDelta, timestamp);
|
|
4832
4909
|
this.calculateAcceleration(velocities, v0, timestamp);
|
|
4833
4910
|
return { position, currentPos, endTime, scrollDelta };
|
|
4834
4911
|
}
|
|
@@ -4857,7 +4934,7 @@ class NgScrollView extends BaseScrollView {
|
|
|
4857
4934
|
}
|
|
4858
4935
|
}
|
|
4859
4936
|
}
|
|
4860
|
-
checkOverscroll(e) {
|
|
4937
|
+
checkOverscroll(e, wheel = false) {
|
|
4861
4938
|
if (!this._overscrollEnabled || !this.overscrollEnabled()) {
|
|
4862
4939
|
if (e.cancelable) {
|
|
4863
4940
|
e.stopImmediatePropagation();
|
|
@@ -4867,14 +4944,35 @@ class NgScrollView extends BaseScrollView {
|
|
|
4867
4944
|
}
|
|
4868
4945
|
if (this._overscrollEnabled) {
|
|
4869
4946
|
if (this.isVertical()) {
|
|
4870
|
-
|
|
4947
|
+
if (this._overscrollStartIteration < OVERSCROLL_START_ITERATION) {
|
|
4948
|
+
this._overscrollStartIteration++;
|
|
4949
|
+
this.checkOverscrollByAxis(e, this._y, this.scrollHeight);
|
|
4950
|
+
}
|
|
4951
|
+
else {
|
|
4952
|
+
if (wheel || this._overscrollApplied || this._scrollDirectionValueY > this._scrollDirectionValueX) {
|
|
4953
|
+
this._overscrollApplied = true;
|
|
4954
|
+
this.checkOverscrollByAxis(e, this._y, this.scrollHeight);
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4871
4957
|
}
|
|
4872
4958
|
else {
|
|
4873
|
-
|
|
4959
|
+
if (this._overscrollStartIteration < OVERSCROLL_START_ITERATION) {
|
|
4960
|
+
this._overscrollStartIteration++;
|
|
4961
|
+
this.checkOverscrollByAxis(e, this._x, this.scrollWidth);
|
|
4962
|
+
}
|
|
4963
|
+
else {
|
|
4964
|
+
if (wheel || this._overscrollApplied || this._scrollDirectionValueX > this._scrollDirectionValueY) {
|
|
4965
|
+
this._overscrollApplied = true;
|
|
4966
|
+
this.checkOverscrollByAxis(e, this._x, this.scrollWidth);
|
|
4967
|
+
}
|
|
4968
|
+
}
|
|
4874
4969
|
}
|
|
4875
4970
|
}
|
|
4876
4971
|
}
|
|
4877
4972
|
calculateVelocity(offsets, delta, timestamp, indexOffset = 10) {
|
|
4973
|
+
if (offsets.length > MAX_VELOCITIES_LENGTH) {
|
|
4974
|
+
offsets.shift();
|
|
4975
|
+
}
|
|
4878
4976
|
offsets.push([delta, timestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : timestamp]);
|
|
4879
4977
|
const len = offsets.length, startIndex = len > indexOffset ? len - indexOffset : 0, lastVSign = calculateDirection(offsets), speedScale = this.scrollingSettings()?.speedScale ?? SPEED_SCALE;
|
|
4880
4978
|
let vSum = 0;
|
|
@@ -4890,7 +4988,10 @@ class NgScrollView extends BaseScrollView {
|
|
|
4890
4988
|
return { v0 };
|
|
4891
4989
|
}
|
|
4892
4990
|
calculateAcceleration(velocities, delta, timestamp, indexOffset = 10) {
|
|
4893
|
-
velocities.
|
|
4991
|
+
if (velocities.length > MAX_VELOCITIES_LENGTH) {
|
|
4992
|
+
velocities.shift();
|
|
4993
|
+
}
|
|
4994
|
+
velocities.push([Math.abs(delta) < MIN_DELTA ? 0 : delta, timestamp < ANIMATOR_MIN_TIMESTAMP ? ANIMATOR_MIN_TIMESTAMP : timestamp]);
|
|
4894
4995
|
const len = velocities.length, startIndex = len > indexOffset ? len - indexOffset : 0;
|
|
4895
4996
|
let aSum = 0, prevV0, iteration = 0, lastVSign = calculateDirection(velocities);
|
|
4896
4997
|
const mass = this.scrollingSettings()?.mass ?? MASS;
|
|
@@ -4908,7 +5009,7 @@ class NgScrollView extends BaseScrollView {
|
|
|
4908
5009
|
iteration++;
|
|
4909
5010
|
}
|
|
4910
5011
|
const a0 = aSum * (this.scrollingSettings()?.frictionalForce ?? FRICTION_FORCE);
|
|
4911
|
-
return { a0 };
|
|
5012
|
+
return { a0: Math.abs(a0) < MIN_ACCELERATION ? 0 : a0 };
|
|
4912
5013
|
}
|
|
4913
5014
|
stopScrolling(force = false) {
|
|
4914
5015
|
if (this._isAlignmentAnimation && !force) {
|
|
@@ -4918,7 +5019,7 @@ class NgScrollView extends BaseScrollView {
|
|
|
4918
5019
|
this._animator.stop();
|
|
4919
5020
|
}
|
|
4920
5021
|
move(isVertical, position, blending = false, userAction = false, fireUpdate = true) {
|
|
4921
|
-
this.scroll({ [isVertical ? TOP$1 : LEFT$
|
|
5022
|
+
this.scroll({ [isVertical ? TOP$1 : LEFT$2]: position, behavior: INSTANT$1, blending, userAction, fireUpdate });
|
|
4922
5023
|
}
|
|
4923
5024
|
moveWithAcceleration(isVertical, position, v0, v, a0, timestamp) {
|
|
4924
5025
|
if (a0 !== 0 && timestamp < MAX_VELOCITY_TIMESTAMP) {
|
|
@@ -5214,7 +5315,7 @@ class NgScrollView extends BaseScrollView {
|
|
|
5214
5315
|
}
|
|
5215
5316
|
refreshCoordinate(x, y) {
|
|
5216
5317
|
const scrollContent = this.scrollContent()?.nativeElement;
|
|
5217
|
-
scrollContent.style.transform = matrix3d((this._inversion ? 1 : -1) * x + (this.isVertical() ? 0 : this._startLayoutOffset), (this._inversion ? 1 : -1) * y + (this.isVertical() ? this._startLayoutOffset : 0));
|
|
5318
|
+
scrollContent.style.transform = matrix3d((this._inversion ? 1 : -1) * x * (this._horizontalAxisInvertion() ? -1 : 1) + (this.isVertical() ? 0 : this._startLayoutOffset), (this._inversion ? 1 : -1) * y + (this.isVertical() ? this._startLayoutOffset : 0));
|
|
5218
5319
|
}
|
|
5219
5320
|
fireScrollEvent(userAction) {
|
|
5220
5321
|
this._$scroll.next(userAction);
|
|
@@ -5268,7 +5369,6 @@ class NgScrollBarComponent extends NgScrollView {
|
|
|
5268
5369
|
thickness = input(DEFAULT_THICKNESS, ...(ngDevMode ? [{ debugName: "thickness" }] : []));
|
|
5269
5370
|
scrollbarMinSize = input(0, ...(ngDevMode ? [{ debugName: "scrollbarMinSize" }] : []));
|
|
5270
5371
|
prepared = input(false, ...(ngDevMode ? [{ debugName: "prepared" }] : []));
|
|
5271
|
-
langTextDir = input(DEFAULT_LANG_TEXT_DIR, ...(ngDevMode ? [{ debugName: "langTextDir" }] : []));
|
|
5272
5372
|
interactive = input(DEFAULT_SCROLLBAR_INTERACTIVE, ...(ngDevMode ? [{ debugName: "interactive" }] : []));
|
|
5273
5373
|
overlapping = input(DEFAULT_OVERLAPPING_SCROLLBAR, ...(ngDevMode ? [{ debugName: "overlapping" }] : []));
|
|
5274
5374
|
show = input(false, ...(ngDevMode ? [{ debugName: "show" }] : []));
|
|
@@ -5365,7 +5465,7 @@ class NgScrollBarComponent extends NgScrollView {
|
|
|
5365
5465
|
if (!!el) {
|
|
5366
5466
|
const overlapping = this.overlapping(), langTextDir = this.langTextDir();
|
|
5367
5467
|
el.style[POSITION$1] = overlapping ? POSITION_ABSOLUTE : POSITION_RELATIVE;
|
|
5368
|
-
el.style[LEFT$
|
|
5468
|
+
el.style[LEFT$3] = overlapping && langTextDir === TextDirections.RTL ? '0' : UNSET$5;
|
|
5369
5469
|
el.style[RIGHT$1] = overlapping && langTextDir === TextDirections.LTR ? '0' : UNSET$5;
|
|
5370
5470
|
el.style[WIDTH] = overlapping ? SIZE_AUTO : SIZE_100_PERSENT;
|
|
5371
5471
|
}
|
|
@@ -5385,7 +5485,7 @@ class NgScrollBarComponent extends NgScrollView {
|
|
|
5385
5485
|
})).subscribe();
|
|
5386
5486
|
}
|
|
5387
5487
|
createDragEvent(userAction) {
|
|
5388
|
-
const isVertical = this.isVertical(), scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, scrollPosition = isVertical ? this.
|
|
5488
|
+
const isVertical = this.isVertical(), scrollSize = isVertical ? this.scrollHeight : this.scrollWidth, scrollPosition = isVertical ? this.y : this.x, startOffset = this.startOffset(), endOffset = this.endOffset(), scrollContent = this.scrollContent()?.nativeElement, scrollViewport = this.scrollViewport()?.nativeElement;
|
|
5389
5489
|
if (!!scrollViewport && !!scrollContent) {
|
|
5390
5490
|
const contentSize = isVertical ? scrollContent.offsetHeight : scrollContent.offsetWidth, viewportSize = isVertical ? scrollViewport.offsetHeight : scrollViewport.offsetWidth, offsetSize = (scrollSize !== 0 ? (startOffset / scrollSize) : 0), positionSize = (scrollSize !== 0 ? (scrollPosition / scrollSize) : 0), maxSize = 1 - offsetSize, pos = (positionSize - offsetSize);
|
|
5391
5491
|
const event = {
|
|
@@ -5413,7 +5513,7 @@ class NgScrollBarComponent extends NgScrollView {
|
|
|
5413
5513
|
this._scrollBarService.click(event);
|
|
5414
5514
|
}
|
|
5415
5515
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5416
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: NgScrollBarComponent, isStandalone: false, selector: "ng-scroll-bar", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, thumbGradientPositions: { classPropertyName: "thumbGradientPositions", publicName: "thumbGradientPositions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null }, prepared: { classPropertyName: "prepared", publicName: "prepared", isSignal: true, isRequired: false, transformFunction: null },
|
|
5516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.0", type: NgScrollBarComponent, isStandalone: false, selector: "ng-scroll-bar", inputs: { loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, thumbGradientPositions: { classPropertyName: "thumbGradientPositions", publicName: "thumbGradientPositions", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, thickness: { classPropertyName: "thickness", publicName: "thickness", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null }, prepared: { classPropertyName: "prepared", publicName: "prepared", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, overlapping: { classPropertyName: "overlapping", publicName: "overlapping", isSignal: true, isRequired: false, transformFunction: null }, show: { classPropertyName: "show", publicName: "show", isSignal: true, isRequired: false, transformFunction: null }, params: { classPropertyName: "params", publicName: "params", isSignal: true, isRequired: false, transformFunction: null }, renderer: { classPropertyName: "renderer", publicName: "renderer", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onDrag: "onDrag", onDragEnd: "onDragEnd" }, providers: [
|
|
5417
5517
|
{ provide: SCROLL_VIEW_INVERSION, useValue: true },
|
|
5418
5518
|
{ provide: SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO, useValue: false },
|
|
5419
5519
|
{ provide: SCROLL_VIEW_OVERSCROLL_ENABLED, useValue: false },
|
|
@@ -5430,9 +5530,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
5430
5530
|
NgScrollBarService,
|
|
5431
5531
|
NgScrollBarPublicService,
|
|
5432
5532
|
], standalone: false, template: "@let grab = grabbing();\r\n<div #scrollViewport class=\"track\" part=\"scrollbar-track\" [ngStyle]=\"styles()\" [ngClass]=\"{grabbing: grab}\">\r\n <div #scrollContent class=\"thumb\" part=\"scrollbar-thumb\" [class.horizontal]=\"!isVertical()\"\r\n (pointerdown)=\"click($event)\">\r\n <ng-container [ngTemplateOutlet]=\"thumbRenderer()\" [ngTemplateOutletContext]=\"templateContext()\" />\r\n </div>\r\n</div>\r\n\r\n<ng-template #defaultRenderer let-api=\"api\" let-width=\"width\" let-height=\"height\" let-fillPositions=\"fillPositions\"\r\n let-params=\"params\">\r\n <div class=\"shape\" part=\"scrollbar-thumb__shape\" [style.width.px]=\"width\" [style.height.px]=\"height\"></div>\r\n</ng-template>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none;width:100%;height:100%}.track{position:relative;overflow:hidden;width:100%;height:100%;cursor:grab}.track.grabbing{cursor:grabbing}.track .thumb{display:block;position:absolute;list-style:none;padding:0;margin:0;overflow:hidden}.track .thumb.prepared{overflow:hidden}.track .thumb.horizontal{top:0}.track .thumb .shape{box-sizing:border-box;pointer-events:none;background-color:#818181;border-radius:0;overflow:hidden}.track.grabbing .thumb{cursor:grabbing}\n"] }]
|
|
5433
|
-
}], ctorParameters: () => [], propDecorators: { _defaultRenderer: [{ type: i0.ViewChild, args: ['defaultRenderer', { isSignal: true }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], onDrag: [{ type: i0.Output, args: ["onDrag"] }], onDragEnd: [{ type: i0.Output, args: ["onDragEnd"] }], thumbGradientPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbGradientPositions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], scrollbarMinSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarMinSize", required: false }] }], prepared: [{ type: i0.Input, args: [{ isSignal: true, alias: "prepared", required: false }] }],
|
|
5533
|
+
}], ctorParameters: () => [], propDecorators: { _defaultRenderer: [{ type: i0.ViewChild, args: ['defaultRenderer', { isSignal: true }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], onDrag: [{ type: i0.Output, args: ["onDrag"] }], onDragEnd: [{ type: i0.Output, args: ["onDragEnd"] }], thumbGradientPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "thumbGradientPositions", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], thickness: [{ type: i0.Input, args: [{ isSignal: true, alias: "thickness", required: false }] }], scrollbarMinSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarMinSize", required: false }] }], prepared: [{ type: i0.Input, args: [{ isSignal: true, alias: "prepared", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], overlapping: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlapping", required: false }] }], show: [{ type: i0.Input, args: [{ isSignal: true, alias: "show", required: false }] }], params: [{ type: i0.Input, args: [{ isSignal: true, alias: "params", required: false }] }], renderer: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderer", required: false }] }] } });
|
|
5434
5534
|
|
|
5435
|
-
const RIGHT = 'right', DIR = 'dir';
|
|
5535
|
+
const LEFT$1 = 'left', RIGHT = 'right', DIR = 'dir';
|
|
5436
5536
|
/**
|
|
5437
5537
|
* LocaleSensitiveDirective
|
|
5438
5538
|
* Maximum performance for extremely large lists.
|
|
@@ -5448,14 +5548,15 @@ class LocaleSensitiveDirective {
|
|
|
5448
5548
|
constructor() {
|
|
5449
5549
|
const $langTextDir = toObservable(this.langTextDir), $listDir = toObservable(this.listDir);
|
|
5450
5550
|
combineLatest([$langTextDir, $listDir]).pipe(takeUntilDestroyed(), tap(([dir, listDir]) => {
|
|
5451
|
-
const element = this._elementRef.nativeElement
|
|
5452
|
-
element.setAttribute(DIR,
|
|
5453
|
-
if (dir === TextDirections.RTL
|
|
5551
|
+
const element = this._elementRef.nativeElement;
|
|
5552
|
+
element.setAttribute(DIR, dir);
|
|
5553
|
+
if (dir === TextDirections.RTL) {
|
|
5454
5554
|
element.style.textAlign = RIGHT;
|
|
5455
5555
|
element.classList.add(TextDirections.RTL);
|
|
5456
5556
|
element.classList.remove(TextDirections.LTR);
|
|
5457
5557
|
}
|
|
5458
5558
|
else {
|
|
5559
|
+
element.style.textAlign = LEFT$1;
|
|
5459
5560
|
element.classList.add(TextDirections.LTR);
|
|
5460
5561
|
element.classList.remove(TextDirections.RTL);
|
|
5461
5562
|
}
|
|
@@ -5506,7 +5607,6 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5506
5607
|
thumbSize = signal(0, ...(ngDevMode ? [{ debugName: "thumbSize" }] : []));
|
|
5507
5608
|
scrollbarShow = signal(false, ...(ngDevMode ? [{ debugName: "scrollbarShow" }] : []));
|
|
5508
5609
|
preparedSignal = signal(false, ...(ngDevMode ? [{ debugName: "preparedSignal" }] : []));
|
|
5509
|
-
langTextDir = signal(TextDirections.LTR, ...(ngDevMode ? [{ debugName: "langTextDir" }] : []));
|
|
5510
5610
|
listStyles = signal({ perspectiveOrigin: 'center' }, ...(ngDevMode ? [{ debugName: "listStyles" }] : []));
|
|
5511
5611
|
_scrollBox = new ScrollBox$1();
|
|
5512
5612
|
get host() {
|
|
@@ -5576,6 +5676,13 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5576
5676
|
super();
|
|
5577
5677
|
this._filterId = `${this._service.id}-${MOTION_BLUR}`;
|
|
5578
5678
|
this._filter = `url(#${this._filterId})`;
|
|
5679
|
+
this.$resizeViewport.pipe(takeUntilDestroyed(), debounceTime(0), tap(() => {
|
|
5680
|
+
this.snapIfNeed();
|
|
5681
|
+
}), switchMap$1(() => {
|
|
5682
|
+
return this.$scroll.pipe(takeUntilDestroyed(this._destroyRef), take(1), tap(() => {
|
|
5683
|
+
this.snapIfNeed();
|
|
5684
|
+
}));
|
|
5685
|
+
})).subscribe();
|
|
5579
5686
|
const $filter = toObservable(this.filter), $motionBlur = toObservable(this.motionBlur), $maxMotionBlur = toObservable(this.maxMotionBlur), $motionBlurEnabled = toObservable(this.motionBlurEnabled), $isVertical = toObservable(this.isVertical);
|
|
5580
5687
|
const $scrollbarScroll = this.$scrollbarScroll;
|
|
5581
5688
|
$scrollbarScroll.pipe(takeUntilDestroyed(), debounceTime(50), tap(() => {
|
|
@@ -5589,10 +5696,6 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5589
5696
|
}), debounceTime(50), tap(([, , filter, ,]) => {
|
|
5590
5697
|
filter.nativeElement.setStdDeviation(0, 0);
|
|
5591
5698
|
})).subscribe();
|
|
5592
|
-
this._service.$langTextDir.pipe(tap(v => {
|
|
5593
|
-
takeUntilDestroyed(this._destroyRef),
|
|
5594
|
-
this.langTextDir.set(v);
|
|
5595
|
-
})).subscribe();
|
|
5596
5699
|
const $prepare = toObservable(this.preparedSignal);
|
|
5597
5700
|
$prepare.pipe(takeUntilDestroyed(), filter$1(v => !!v), tap(() => {
|
|
5598
5701
|
this.updateScrollBarHandler(true, false, true);
|
|
@@ -5625,9 +5728,9 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5625
5728
|
});
|
|
5626
5729
|
}
|
|
5627
5730
|
recalculatePerspective() {
|
|
5628
|
-
const isVertical = this.isVertical(), scrollSize = (isVertical ? this.scrollTop : this.scrollLeft) - this._startLayoutOffset, { width, height } = this.viewportBounds();
|
|
5731
|
+
const isVertical = this.isVertical(), inverted = this._horizontalAxisInvertion(), scrollSize = (isVertical ? this.scrollTop : this.scrollLeft) - this._startLayoutOffset, maxScrollSize = isVertical ? this.scrollHeight : this.scrollWidth, { width, height } = this.viewportBounds();
|
|
5629
5732
|
this.listStyles.set({
|
|
5630
|
-
perspectiveOrigin: `${isVertical ? width * .5 : (scrollSize + width * .5)}${PX$1} ${isVertical ? (scrollSize + height * .5) : height * .5}${PX$1}`
|
|
5733
|
+
perspectiveOrigin: `${isVertical ? width * .5 : (inverted ? ((maxScrollSize - scrollSize) + width * .5 - this.startOffset()) : (scrollSize + width * .5))}${PX$1} ${isVertical ? (inverted ? ((maxScrollSize - scrollSize) + height * .5) : (scrollSize + height * .5)) : height * .5}${PX$1}`
|
|
5631
5734
|
});
|
|
5632
5735
|
}
|
|
5633
5736
|
onResizeViewport() {
|
|
@@ -5640,6 +5743,7 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5640
5743
|
this.viewportBounds.set(bounds);
|
|
5641
5744
|
this.updateScrollBar();
|
|
5642
5745
|
this._$resizeViewport.next(bounds);
|
|
5746
|
+
this.recalculatePerspective();
|
|
5643
5747
|
}
|
|
5644
5748
|
}
|
|
5645
5749
|
onResizeContent(value = null) {
|
|
@@ -5655,6 +5759,7 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5655
5759
|
this.contentBounds.set(bounds);
|
|
5656
5760
|
this.updateScrollBar();
|
|
5657
5761
|
this._$resizeContent.next(bounds);
|
|
5762
|
+
this.recalculatePerspective();
|
|
5658
5763
|
}
|
|
5659
5764
|
}
|
|
5660
5765
|
updateScrollBarHandler(update = false, blending = true, fireUpdate = false) {
|
|
@@ -5822,7 +5927,7 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
5822
5927
|
{ provide: SCROLL_VIEW_INVERSION, useValue: false },
|
|
5823
5928
|
{ provide: SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO, useValue: true },
|
|
5824
5929
|
{ provide: SCROLL_VIEW_OVERSCROLL_ENABLED, useValue: true },
|
|
5825
|
-
], viewQueries: [{ propertyName: "filter", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], usesInheritance: true, ngImport: i0, template: "@let filtered = motionBlurEnabled();\r\n<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <svg part=\"viewport\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <filter [id]=\"_filterId\">\r\n <feGaussianBlur #filter></feGaussianBlur>\r\n </filter>\r\n <foreignObject xmlns=\"http://www.w3.org/1999/xhtml\" width=\"100%\" height=\"100%\" class=\"ngvl__viewport\">\r\n <div class=\"ngvl__scroller-wrapper\" [class.filtered]=\"filtered\" [style.filter]=\"filtered ? _filter : 'unset'\">\r\n <div cdkScrollable #scrollViewport part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\"\r\n [attr.aria-activedescendant]=\"focusedElement()\" tabindex=\"0\" part=\"list\" class=\"ngvl__list\"\r\n [ngClass]=\"actualClasses()\" [ngStyle]=\"listStyles()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </foreignObject>\r\n </svg>\r\n @if (scrollbarEnabled()) {\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [renderer]=\"scrollbarThumbRenderer()\"\r\n [thickness]=\"scrollbarThickness()\" [params]=\"scrollbarThumbParams()\" [loading]=\"loading()\" [overlapping]=\"overlappingScrollbar()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [prepared]=\"prepared\" [interactive]=\"scrollbarInteractive()\"\r\n [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\" [startOffset]=\"startOffset()\" [langTextDir]=\"langTextDir()\"\r\n [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" (onDrag)=\"onScrollBarDragHandler($event)\"\r\n (onDragEnd)=\"onScrollBarDragEndHandler($event)\"></ng-scroll-bar>\r\n }\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.overlapping{position:relative;display:block}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal:not(.overlapping){grid-template-rows:1fr 0}.ngvl__container.horizontal{transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled:not(.overlapping){grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller-wrapper.filtered,.ngvl__container.horizontal .ngvl__scroller{overflow:unset}.ngvl__container.vertical:not(.overlapping){grid-template-columns:1fr 0}.ngvl__container.vertical{transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled:not(.overlapping){grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller-wrapper.filtered,.ngvl__container.vertical .ngvl__scroller{overflow:unset}.ngvl__container .ngvl__scroller-wrapper,.ngvl__container .ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__container .ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__container .ngvl__list.prepared{opacity:1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NgScrollBarComponent, selector: "ng-scroll-bar", inputs: ["loading", "thumbGradientPositions", "size", "thickness", "scrollbarMinSize", "prepared", "
|
|
5930
|
+
], viewQueries: [{ propertyName: "filter", first: true, predicate: ["filter"], descendants: true, isSignal: true }, { propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], usesInheritance: true, ngImport: i0, template: "@let filtered = motionBlurEnabled();\r\n<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <svg part=\"viewport\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <filter [id]=\"_filterId\">\r\n <feGaussianBlur #filter></feGaussianBlur>\r\n </filter>\r\n <foreignObject xmlns=\"http://www.w3.org/1999/xhtml\" width=\"100%\" height=\"100%\" class=\"ngvl__viewport\">\r\n <div class=\"ngvl__scroller-wrapper\" [class.filtered]=\"filtered\" [style.filter]=\"filtered ? _filter : 'unset'\">\r\n <div cdkScrollable #scrollViewport part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\"\r\n [attr.aria-activedescendant]=\"focusedElement()\" tabindex=\"0\" part=\"list\" class=\"ngvl__list\"\r\n [ngClass]=\"actualClasses()\" [ngStyle]=\"listStyles()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </foreignObject>\r\n </svg>\r\n @if (scrollbarEnabled()) {\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [langTextDir]=\"langTextDir()\" [size]=\"thumbSize()\" [renderer]=\"scrollbarThumbRenderer()\"\r\n [thickness]=\"scrollbarThickness()\" [params]=\"scrollbarThumbParams()\" [loading]=\"loading()\" [overlapping]=\"overlappingScrollbar()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [prepared]=\"prepared\" [interactive]=\"scrollbarInteractive()\"\r\n [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\" [startOffset]=\"startOffset()\" [langTextDir]=\"langTextDir()\"\r\n [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" (onDrag)=\"onScrollBarDragHandler($event)\"\r\n (onDragEnd)=\"onScrollBarDragEndHandler($event)\"></ng-scroll-bar>\r\n }\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.overlapping{position:relative;display:block}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal:not(.overlapping){grid-template-rows:1fr 0}.ngvl__container.horizontal{transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled:not(.overlapping){grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller-wrapper.filtered,.ngvl__container.horizontal .ngvl__scroller{overflow:unset}.ngvl__container.vertical:not(.overlapping){grid-template-columns:1fr 0}.ngvl__container.vertical{transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled:not(.overlapping){grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller-wrapper.filtered,.ngvl__container.vertical .ngvl__scroller{overflow:unset}.ngvl__container .ngvl__scroller-wrapper,.ngvl__container .ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__container .ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__container .ngvl__list.prepared{opacity:1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: NgScrollBarComponent, selector: "ng-scroll-bar", inputs: ["loading", "thumbGradientPositions", "size", "thickness", "scrollbarMinSize", "prepared", "interactive", "overlapping", "show", "params", "renderer"], outputs: ["onDrag", "onDragEnd"] }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }, { kind: "directive", type: i4.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }] });
|
|
5826
5931
|
}
|
|
5827
5932
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgScrollerComponent, decorators: [{
|
|
5828
5933
|
type: Component,
|
|
@@ -5830,7 +5935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
5830
5935
|
{ provide: SCROLL_VIEW_INVERSION, useValue: false },
|
|
5831
5936
|
{ provide: SCROLL_VIEW_NORMALIZE_VALUE_FROM_ZERO, useValue: true },
|
|
5832
5937
|
{ provide: SCROLL_VIEW_OVERSCROLL_ENABLED, useValue: true },
|
|
5833
|
-
], standalone: false, template: "@let filtered = motionBlurEnabled();\r\n<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <svg part=\"viewport\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <filter [id]=\"_filterId\">\r\n <feGaussianBlur #filter></feGaussianBlur>\r\n </filter>\r\n <foreignObject xmlns=\"http://www.w3.org/1999/xhtml\" width=\"100%\" height=\"100%\" class=\"ngvl__viewport\">\r\n <div class=\"ngvl__scroller-wrapper\" [class.filtered]=\"filtered\" [style.filter]=\"filtered ? _filter : 'unset'\">\r\n <div cdkScrollable #scrollViewport part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\"\r\n [attr.aria-activedescendant]=\"focusedElement()\" tabindex=\"0\" part=\"list\" class=\"ngvl__list\"\r\n [ngClass]=\"actualClasses()\" [ngStyle]=\"listStyles()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </foreignObject>\r\n </svg>\r\n @if (scrollbarEnabled()) {\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [renderer]=\"scrollbarThumbRenderer()\"\r\n [thickness]=\"scrollbarThickness()\" [params]=\"scrollbarThumbParams()\" [loading]=\"loading()\" [overlapping]=\"overlappingScrollbar()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [prepared]=\"prepared\" [interactive]=\"scrollbarInteractive()\"\r\n [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\" [startOffset]=\"startOffset()\" [langTextDir]=\"langTextDir()\"\r\n [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" (onDrag)=\"onScrollBarDragHandler($event)\"\r\n (onDragEnd)=\"onScrollBarDragEndHandler($event)\"></ng-scroll-bar>\r\n }\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.overlapping{position:relative;display:block}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal:not(.overlapping){grid-template-rows:1fr 0}.ngvl__container.horizontal{transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled:not(.overlapping){grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller-wrapper.filtered,.ngvl__container.horizontal .ngvl__scroller{overflow:unset}.ngvl__container.vertical:not(.overlapping){grid-template-columns:1fr 0}.ngvl__container.vertical{transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled:not(.overlapping){grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller-wrapper.filtered,.ngvl__container.vertical .ngvl__scroller{overflow:unset}.ngvl__container .ngvl__scroller-wrapper,.ngvl__container .ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__container .ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__container .ngvl__list.prepared{opacity:1}\n"] }]
|
|
5938
|
+
], standalone: false, template: "@let filtered = motionBlurEnabled();\r\n<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <svg part=\"viewport\" width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <filter [id]=\"_filterId\">\r\n <feGaussianBlur #filter></feGaussianBlur>\r\n </filter>\r\n <foreignObject xmlns=\"http://www.w3.org/1999/xhtml\" width=\"100%\" height=\"100%\" class=\"ngvl__viewport\">\r\n <div class=\"ngvl__scroller-wrapper\" [class.filtered]=\"filtered\" [style.filter]=\"filtered ? _filter : 'unset'\">\r\n <div cdkScrollable #scrollViewport part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\"\r\n [attr.aria-activedescendant]=\"focusedElement()\" tabindex=\"0\" part=\"list\" class=\"ngvl__list\"\r\n [ngClass]=\"actualClasses()\" [ngStyle]=\"listStyles()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </foreignObject>\r\n </svg>\r\n @if (scrollbarEnabled()) {\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [langTextDir]=\"langTextDir()\" [size]=\"thumbSize()\" [renderer]=\"scrollbarThumbRenderer()\"\r\n [thickness]=\"scrollbarThickness()\" [params]=\"scrollbarThumbParams()\" [loading]=\"loading()\" [overlapping]=\"overlappingScrollbar()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [prepared]=\"prepared\" [interactive]=\"scrollbarInteractive()\"\r\n [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\" [startOffset]=\"startOffset()\" [langTextDir]=\"langTextDir()\"\r\n [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollbarMinSize]=\"scrollbarMinSize()\" (onDrag)=\"onScrollBarDragHandler($event)\"\r\n (onDragEnd)=\"onScrollBarDragEndHandler($event)\"></ng-scroll-bar>\r\n }\r\n</div>", styles: [":host{position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}.ngvl__container{position:relative;overflow:hidden;display:grid;width:100%;height:100%;cursor:grab}.ngvl__container.overlapping{position:relative;display:block}.ngvl__container.grabbing{cursor:grabbing}.ngvl__container.horizontal:not(.overlapping){grid-template-rows:1fr 0}.ngvl__container.horizontal{transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled:not(.overlapping){grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller-wrapper.filtered,.ngvl__container.horizontal .ngvl__scroller{overflow:unset}.ngvl__container.vertical:not(.overlapping){grid-template-columns:1fr 0}.ngvl__container.vertical{transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled:not(.overlapping){grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller-wrapper.filtered,.ngvl__container.vertical .ngvl__scroller{overflow:unset}.ngvl__container .ngvl__scroller-wrapper,.ngvl__container .ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__container .ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__container .ngvl__list.prepared{opacity:1}\n"] }]
|
|
5834
5939
|
}], ctorParameters: () => [], propDecorators: { scrollBar: [{
|
|
5835
5940
|
type: ViewChild,
|
|
5836
5941
|
args: ['scrollBar', { read: NgScrollBarComponent }]
|
|
@@ -5850,6 +5955,7 @@ const createItemData = (data, isVertical, bounds, boundsSize, dynamic, divides,
|
|
|
5850
5955
|
measures: {
|
|
5851
5956
|
position: 0,
|
|
5852
5957
|
scrollSize: 0,
|
|
5958
|
+
maxScrollSize: 0,
|
|
5853
5959
|
size: itemSize,
|
|
5854
5960
|
row: {
|
|
5855
5961
|
size: itemSize,
|
|
@@ -5909,6 +6015,7 @@ const createItemData = (data, isVertical, bounds, boundsSize, dynamic, divides,
|
|
|
5909
6015
|
fullSize: false,
|
|
5910
6016
|
layoutIndexOffset: 0,
|
|
5911
6017
|
totalItems: 0,
|
|
6018
|
+
inverted: false,
|
|
5912
6019
|
},
|
|
5913
6020
|
};
|
|
5914
6021
|
};
|
|
@@ -6135,7 +6242,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
|
|
|
6135
6242
|
*/
|
|
6136
6243
|
class NgPrerenderScrollerComponent extends BaseScrollView {
|
|
6137
6244
|
scrollBar;
|
|
6138
|
-
langTextDir = signal(TextDirections.LTR, ...(ngDevMode ? [{ debugName: "langTextDir" }] : []));
|
|
6139
6245
|
scrollbarEnabled = input(DEFAULT_SCROLLBAR_ENABLED, ...(ngDevMode ? [{ debugName: "scrollbarEnabled" }] : []));
|
|
6140
6246
|
classes = input({}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
6141
6247
|
actualClasses;
|
|
@@ -7549,19 +7655,22 @@ class NgVirtualListComponent {
|
|
|
7549
7655
|
}
|
|
7550
7656
|
const scroller = this._scrollerComponent();
|
|
7551
7657
|
if (!!scroller) {
|
|
7552
|
-
const { width, height } = this._bounds(), { width: elementWidth, height: elementHeight } = element.getBoundingClientRect(), isVertical = this._isVertical, viewportSize = isVertical ? height : width, elementSize = isVertical ? elementHeight : elementWidth;
|
|
7658
|
+
const { width, height } = this._bounds(), { width: elementWidth, height: elementHeight } = element.getBoundingClientRect(), isVertical = this._isVertical, viewportSize = isVertical ? height : width, maxPosition = isVertical ? scroller.scrollHeight : scroller.scrollWidth, elementSize = isVertical ? elementHeight : elementWidth;
|
|
7553
7659
|
let pos = Number.NaN;
|
|
7554
7660
|
switch (align) {
|
|
7555
7661
|
case FocusAlignments.START: {
|
|
7556
|
-
|
|
7662
|
+
const p = position + scroller.startLayoutOffset;
|
|
7663
|
+
pos = scroller.inverted ? (maxPosition - p) : p;
|
|
7557
7664
|
break;
|
|
7558
7665
|
}
|
|
7559
7666
|
case FocusAlignments.CENTER: {
|
|
7560
|
-
|
|
7667
|
+
const p = position - (viewportSize - elementSize) * .5 + scroller.startLayoutOffset;
|
|
7668
|
+
pos = scroller.inverted ? (maxPosition - p) : p;
|
|
7561
7669
|
break;
|
|
7562
7670
|
}
|
|
7563
7671
|
case FocusAlignments.END: {
|
|
7564
|
-
|
|
7672
|
+
const p = position - (viewportSize - elementSize) + scroller.startLayoutOffset;
|
|
7673
|
+
pos = scroller.inverted ? (maxPosition - p) : p;
|
|
7565
7674
|
break;
|
|
7566
7675
|
}
|
|
7567
7676
|
case FocusAlignments.NONE:
|
|
@@ -7573,7 +7682,7 @@ class NgVirtualListComponent {
|
|
|
7573
7682
|
this._trackBox.preventScrollSnapping(true);
|
|
7574
7683
|
const params = {
|
|
7575
7684
|
[this._isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: pos, behavior, snap: false, normalize: true,
|
|
7576
|
-
fireUpdate:
|
|
7685
|
+
fireUpdate: true, blending: false, userAction: false,
|
|
7577
7686
|
duration: this.snapToItem() ? Math.max(this.animationParams().scrollToItem, this.animationParams().navigateToItem) : this.animationParams().navigateToItem,
|
|
7578
7687
|
};
|
|
7579
7688
|
scroller.scrollTo(params);
|
|
@@ -7666,10 +7775,9 @@ class NgVirtualListComponent {
|
|
|
7666
7775
|
this.onSnapItem.emit(id);
|
|
7667
7776
|
})).subscribe();
|
|
7668
7777
|
this._service.$tick.pipe(takeUntilDestroyed(), tap(() => {
|
|
7669
|
-
this.
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
this.checkBoundsOfElements();
|
|
7778
|
+
if (this.dynamicSize() === true) {
|
|
7779
|
+
this.checkBoundsOfElements();
|
|
7780
|
+
}
|
|
7673
7781
|
this._scrollerComponent()?.tick();
|
|
7674
7782
|
})).subscribe();
|
|
7675
7783
|
const $scrollerComponent = toObservable(this._scrollerComponent), $resizeViewport = $scrollerComponent.pipe(takeUntilDestroyed(), filter$1(v => !!v), switchMap$1(scroller => scroller.$resizeViewport)), $resizeContent = $scrollerComponent.pipe(takeUntilDestroyed(), filter$1(v => !!v), switchMap$1(scroller => scroller.$resizeContent));
|
|
@@ -8045,7 +8153,12 @@ class NgVirtualListComponent {
|
|
|
8045
8153
|
const scrollbarEnabled = this.scrollbarEnabled(), spreadingMode = this.spreadingMode();
|
|
8046
8154
|
return isSpreadingMode(spreadingMode, SpreadingModes.INFINITY) ? false : scrollbarEnabled;
|
|
8047
8155
|
}, ...(ngDevMode ? [{ debugName: "_actualScrollbarEnabled" }] : []));
|
|
8048
|
-
const $alignment = toObservable(this._actualAlignment), $precalculatedScrollStartOffset = toObservable(this._precalculatedScrollStartOffset), $precalculatedScrollEndOffset = toObservable(this._precalculatedScrollEndOffset), $listBounds = toObservable(this._listBounds).pipe(filter$1(b => !!b)), $scrollSize = this._$scrollSize.asObservable(), $bufferSize = toObservable(this.bufferSize).pipe(map(v => v < 0 ? DEFAULT_BUFFER_SIZE : v)), $maxBufferSize = toObservable(this.maxBufferSize).pipe(map(v => v < 0 ? DEFAULT_BUFFER_SIZE : v)), $snapToItem = toObservable(this.snapToItem), $snapToItemAlign = toObservable(this.snapToItemAlign), $stickyEnabled = toObservable(this.stickyEnabled), $isLazy = toObservable(this.collectionMode).pipe(map(v => this.getIsLazy(v || DEFAULT_COLLECTION_MODE))), $enabledBufferOptimization = toObservable(this.enabledBufferOptimization), $snappingMethod = toObservable(this.snappingMethod).pipe(map(v => this.getIsSnappingMethodAdvanced(v || DEFAULT_SNAPPING_METHOD))), $collapsingMode = toObservable(this.collapsingMode), $selectingMode = toObservable(this.selectingMode), $selectedIds = toObservable(this.selectedIds), $collapsedIds = toObservable(this.collapsedIds).pipe(distinctUntilChanged(), map(v => Array.isArray(v) ? v : [])), $collapsedItemIds = toObservable(this._collapsedItemIds).pipe(distinctUntilChanged(), map(v => Array.isArray(v) ? v : [])), $itemTransform = toObservable(this.itemTransform), $screenReaderMessage = toObservable(this.screenReaderMessage), $displayItems = this._service.$displayItems, $cacheVersion = this._service.$cacheVersion;
|
|
8156
|
+
const $alignment = toObservable(this._actualAlignment), $precalculatedScrollStartOffset = toObservable(this._precalculatedScrollStartOffset), $precalculatedScrollEndOffset = toObservable(this._precalculatedScrollEndOffset), $listBounds = toObservable(this._listBounds).pipe(filter$1(b => !!b)), $scrollSize = this._$scrollSize.asObservable(), $bufferSize = toObservable(this.bufferSize).pipe(map(v => v < 0 ? DEFAULT_BUFFER_SIZE : v)), $maxBufferSize = toObservable(this.maxBufferSize).pipe(map(v => v < 0 ? DEFAULT_BUFFER_SIZE : v)), $snapToItem = toObservable(this.snapToItem), $snapToItemAlign = toObservable(this.snapToItemAlign), $stickyEnabled = toObservable(this.stickyEnabled), $isLazy = toObservable(this.collectionMode).pipe(map(v => this.getIsLazy(v || DEFAULT_COLLECTION_MODE))), $enabledBufferOptimization = toObservable(this.enabledBufferOptimization), $snappingMethod = toObservable(this.snappingMethod).pipe(map(v => this.getIsSnappingMethodAdvanced(v || DEFAULT_SNAPPING_METHOD))), $collapsingMode = toObservable(this.collapsingMode), $selectingMode = toObservable(this.selectingMode), $selectedIds = toObservable(this.selectedIds), $collapsedIds = toObservable(this.collapsedIds).pipe(distinctUntilChanged(), map(v => Array.isArray(v) ? v : [])), $collapsedItemIds = toObservable(this._collapsedItemIds).pipe(distinctUntilChanged(), map(v => Array.isArray(v) ? v : [])), $langTextDir = toObservable(this.langTextDir), $itemTransform = toObservable(this.itemTransform), $screenReaderMessage = toObservable(this.screenReaderMessage), $displayItems = this._service.$displayItems, $cacheVersion = this._service.$cacheVersion;
|
|
8157
|
+
combineLatest([$isVertical, $langTextDir, $itemTransform]).pipe(takeUntilDestroyed(), debounceTime(0), tap(([isVertical, langTextDir, itemTransform]) => {
|
|
8158
|
+
if (langTextDir === TextDirections.RTL && !isVertical && itemTransform) {
|
|
8159
|
+
throw Error('Currently, converting right-to-left items in horizontal lists is not possible.');
|
|
8160
|
+
}
|
|
8161
|
+
})).subscribe();
|
|
8049
8162
|
$snapToItem.pipe(takeUntilDestroyed(), tap(v => {
|
|
8050
8163
|
this._service.snapToItem = v;
|
|
8051
8164
|
})).subscribe();
|
|
@@ -8106,6 +8219,9 @@ class NgVirtualListComponent {
|
|
|
8106
8219
|
actualItems.push(item);
|
|
8107
8220
|
}
|
|
8108
8221
|
const normalizedCollection = normalizeCollection(actualItems, itemConfigMap, trackBy, divides);
|
|
8222
|
+
if (this._scrollerComponent()?.inverted) {
|
|
8223
|
+
normalizedCollection.reverse();
|
|
8224
|
+
}
|
|
8109
8225
|
this._actualItems.set(normalizedCollection);
|
|
8110
8226
|
})).subscribe();
|
|
8111
8227
|
$isVertical.pipe(takeUntilDestroyed(), tap(v => {
|
|
@@ -8227,20 +8343,21 @@ class NgVirtualListComponent {
|
|
|
8227
8343
|
if (!!scroller) {
|
|
8228
8344
|
const isInfinity = this._isInfinity(), collapsable = collapsedIds.length > 0, cachable = this.cachable, cached = this._cached, waitingCache = cachable && !cached, emitUpdate = !this._readyForShow || waitingCache || collapsable || isChunkLoading, fireUpdate = !this._readyForShow || this._$scrollingTo.getValue(), fireUpdateAtEdges = fireUpdate || !isInfinity, useAnimations = !isInfinity && readyForAnimations && prevScrollable;
|
|
8229
8345
|
if (this._readyForShow || (cachable && cached)) {
|
|
8230
|
-
const currentScrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft);
|
|
8231
|
-
let actualScrollSize = !this._readyForShow && snapScrollToEnd ?
|
|
8346
|
+
const inverted = scroller.inverted, currentScrollSize = (isVertical ? scroller.scrollTop : scroller.scrollLeft), maxScrollSize = (isVertical ? scroller.scrollHeight : scroller.scrollWidth);
|
|
8347
|
+
let actualScrollSize = !this._readyForShow && snapScrollToEnd ? maxScrollSize :
|
|
8232
8348
|
(isVertical ? scroller.scrollTop : scroller.scrollLeft), leftLayoutOffset = 0, displayItems;
|
|
8233
|
-
const { width, height } = bounds,
|
|
8349
|
+
const { width, height } = bounds, opts = {
|
|
8234
8350
|
alignment, bounds: { width, height }, dynamicSize, isVertical, itemSize, minItemSize, maxItemSize, bufferSize, maxBufferSize,
|
|
8235
|
-
scrollSize: actualScrollSize, stickyEnabled, enabledBufferOptimization,
|
|
8351
|
+
scrollSize: inverted ? maxScrollSize - actualScrollSize : actualScrollSize, stickyEnabled, enabledBufferOptimization,
|
|
8352
|
+
snapToItem, snapToItemAlign, inverted, itemTransform,
|
|
8236
8353
|
};
|
|
8237
8354
|
if (snapScrollToEnd && !this._readyForShow) {
|
|
8238
|
-
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: actualScrollSize });
|
|
8355
|
+
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: inverted ? maxScrollSize - actualScrollSize : actualScrollSize });
|
|
8239
8356
|
displayItems = calculatedDisplayItems;
|
|
8240
8357
|
totalSize = calculatedTotalSize1;
|
|
8241
8358
|
leftLayoutOffset = leftLayoutOffset1;
|
|
8242
8359
|
if (!!itemTransform && dynamicSize && this._trackBox.delta !== 0) {
|
|
8243
|
-
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: actualScrollSize + this._trackBox.delta });
|
|
8360
|
+
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize1, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: inverted ? (maxScrollSize - actualScrollSize + this._trackBox.delta) : (actualScrollSize + this._trackBox.delta) });
|
|
8244
8361
|
displayItems = calculatedDisplayItems;
|
|
8245
8362
|
totalSize = calculatedTotalSize1;
|
|
8246
8363
|
leftLayoutOffset = leftLayoutOffset1;
|
|
@@ -8252,7 +8369,7 @@ class NgVirtualListComponent {
|
|
|
8252
8369
|
totalSize = calculatedTotalSize;
|
|
8253
8370
|
leftLayoutOffset = leftLayoutOffset1;
|
|
8254
8371
|
if (!!itemTransform && dynamicSize && this._trackBox.delta !== 0) {
|
|
8255
|
-
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: actualScrollSize + this._trackBox.delta });
|
|
8372
|
+
const { displayItems: calculatedDisplayItems, totalSize: calculatedTotalSize, leftLayoutOffset: leftLayoutOffset1 } = this._trackBox.updateCollection(items, itemConfigMap, { ...opts, scrollSize: inverted ? (maxScrollSize - actualScrollSize + this._trackBox.delta) : (actualScrollSize + this._trackBox.delta) });
|
|
8256
8373
|
displayItems = calculatedDisplayItems;
|
|
8257
8374
|
totalSize = calculatedTotalSize;
|
|
8258
8375
|
leftLayoutOffset = leftLayoutOffset1;
|
|
@@ -8276,18 +8393,48 @@ class NgVirtualListComponent {
|
|
|
8276
8393
|
this.updateOffsetsByAllignment();
|
|
8277
8394
|
scroller.delta = delta;
|
|
8278
8395
|
prevScrollable = scroller.scrollable;
|
|
8279
|
-
if (
|
|
8280
|
-
(snapScrollToStart &&
|
|
8281
|
-
|
|
8396
|
+
if (!scroller.grabbing()) {
|
|
8397
|
+
if ((snapScrollToStart && this._trackBox.isSnappedToStart && scroller.scrollable) ||
|
|
8398
|
+
(snapScrollToStart && currentScrollSize <= MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
|
|
8399
|
+
if (currentScrollSize !== roundedScrollPositionAfterUpdate) {
|
|
8400
|
+
this._trackBox.clearDelta();
|
|
8401
|
+
if (this._readyForShow) {
|
|
8402
|
+
this.emitScrollEvent(true, false, userAction);
|
|
8403
|
+
}
|
|
8404
|
+
this._trackBox.isScrollEnd;
|
|
8405
|
+
const params = {
|
|
8406
|
+
[isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: 0, userAction,
|
|
8407
|
+
fireUpdate: fireUpdateAtEdges, behavior: !useAnimations ? BEHAVIOR_INSTANT : ((this.animationParams().scrollToItem > 0 && this.scrollBehavior() !== BEHAVIOR_INSTANT) ? BEHAVIOR_AUTO : BEHAVIOR_INSTANT),
|
|
8408
|
+
blending: useAnimations && scroller.hasAnimation(this._animationId), duration: this.animationParams().scrollToItem,
|
|
8409
|
+
};
|
|
8410
|
+
const animationId = scroller?.scrollTo?.(params);
|
|
8411
|
+
if (animationId > -1) {
|
|
8412
|
+
this._animationId = animationId;
|
|
8413
|
+
}
|
|
8414
|
+
else {
|
|
8415
|
+
scroller.stopAnimation(this._animationId);
|
|
8416
|
+
}
|
|
8417
|
+
if (emitUpdate) {
|
|
8418
|
+
this._$update.next(getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft));
|
|
8419
|
+
}
|
|
8420
|
+
}
|
|
8421
|
+
return;
|
|
8422
|
+
}
|
|
8423
|
+
if ((snapScrollToEnd && this._trackBox.isSnappedToEnd) || (snapScrollToEnd && !scroller.scrollable) ||
|
|
8424
|
+
(scrollPositionAfterUpdate + MIN_PIXELS_FOR_PREVENT_SNAPPING >= roundedMaxPositionAfterUpdate) ||
|
|
8425
|
+
(roundedScrollPositionAfterUpdate >= scrollPositionAfterUpdate + MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
|
|
8282
8426
|
this._trackBox.clearDelta();
|
|
8427
|
+
if (!this._trackBox.isSnappedToEnd) {
|
|
8428
|
+
this._trackBox.isScrollEnd = true;
|
|
8429
|
+
this._trackBox.isScrollStart = false;
|
|
8430
|
+
}
|
|
8283
8431
|
if (this._readyForShow) {
|
|
8284
|
-
this.emitScrollEvent(true, false,
|
|
8432
|
+
this.emitScrollEvent(true, false, false);
|
|
8285
8433
|
}
|
|
8286
|
-
this._trackBox.isScrollEnd;
|
|
8287
8434
|
const params = {
|
|
8288
|
-
[isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]:
|
|
8289
|
-
fireUpdate: fireUpdateAtEdges, behavior: !useAnimations ? BEHAVIOR_INSTANT : ((this.animationParams().scrollToItem > 0 && this.scrollBehavior() !== BEHAVIOR_INSTANT) ? BEHAVIOR_AUTO : BEHAVIOR_INSTANT),
|
|
8290
|
-
blending: useAnimations && scroller.hasAnimation(this._animationId), duration: this.animationParams().scrollToItem,
|
|
8435
|
+
[isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: roundedMaxPositionAfterUpdate,
|
|
8436
|
+
fireUpdate: fireUpdateAtEdges, behavior: !useAnimations ? BEHAVIOR_INSTANT : ((this.animationParams().scrollToItem > 0 && this.scrollBehavior() !== BEHAVIOR_INSTANT) ? BEHAVIOR_AUTO : BEHAVIOR_INSTANT), userAction: false,
|
|
8437
|
+
blending: useAnimations && scroller.hasAnimation(this._animationId) || cacheChanged, duration: this.animationParams().scrollToItem,
|
|
8291
8438
|
};
|
|
8292
8439
|
const animationId = scroller?.scrollTo?.(params);
|
|
8293
8440
|
if (animationId > -1) {
|
|
@@ -8299,36 +8446,8 @@ class NgVirtualListComponent {
|
|
|
8299
8446
|
if (emitUpdate) {
|
|
8300
8447
|
this._$update.next(getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft));
|
|
8301
8448
|
}
|
|
8449
|
+
return;
|
|
8302
8450
|
}
|
|
8303
|
-
return;
|
|
8304
|
-
}
|
|
8305
|
-
if ((snapScrollToEnd && this._trackBox.isSnappedToEnd) || (snapScrollToEnd && !scroller.scrollable) ||
|
|
8306
|
-
(scrollPositionAfterUpdate + MIN_PIXELS_FOR_PREVENT_SNAPPING >= roundedMaxPositionAfterUpdate) ||
|
|
8307
|
-
(roundedScrollPositionAfterUpdate >= scrollPositionAfterUpdate + MIN_PIXELS_FOR_PREVENT_SNAPPING)) {
|
|
8308
|
-
this._trackBox.clearDelta();
|
|
8309
|
-
if (!this._trackBox.isSnappedToEnd) {
|
|
8310
|
-
this._trackBox.isScrollEnd = true;
|
|
8311
|
-
this._trackBox.isScrollStart = false;
|
|
8312
|
-
}
|
|
8313
|
-
if (this._readyForShow) {
|
|
8314
|
-
this.emitScrollEvent(true, false, false);
|
|
8315
|
-
}
|
|
8316
|
-
const params = {
|
|
8317
|
-
[isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: roundedMaxPositionAfterUpdate,
|
|
8318
|
-
fireUpdate: fireUpdateAtEdges, behavior: !useAnimations ? BEHAVIOR_INSTANT : ((this.animationParams().scrollToItem > 0 && this.scrollBehavior() !== BEHAVIOR_INSTANT) ? BEHAVIOR_AUTO : BEHAVIOR_INSTANT), userAction: false,
|
|
8319
|
-
blending: useAnimations && scroller.hasAnimation(this._animationId) || cacheChanged, duration: this.animationParams().scrollToItem,
|
|
8320
|
-
};
|
|
8321
|
-
const animationId = scroller?.scrollTo?.(params);
|
|
8322
|
-
if (animationId > -1) {
|
|
8323
|
-
this._animationId = animationId;
|
|
8324
|
-
}
|
|
8325
|
-
else {
|
|
8326
|
-
scroller.stopAnimation(this._animationId);
|
|
8327
|
-
}
|
|
8328
|
-
if (emitUpdate) {
|
|
8329
|
-
this._$update.next(getScrollStateVersion(totalSize, this._isVertical ? scroller.scrollTop : scroller.scrollLeft));
|
|
8330
|
-
}
|
|
8331
|
-
return;
|
|
8332
8451
|
}
|
|
8333
8452
|
if (scrollSize !== scrollPositionAfterUpdate &&
|
|
8334
8453
|
((scrollPositionAfterUpdate >= 0 && scrollPositionAfterUpdate < roundedMaxPositionAfterUpdate) ||
|
|
@@ -8360,11 +8479,11 @@ class NgVirtualListComponent {
|
|
|
8360
8479
|
let prevItems = [];
|
|
8361
8480
|
const debouncedUpdate = debounce(update, 0, MAX_NUMBERS_OF_SKIPS_FOR_QUALITY_OPTIMIZATION_LVL1);
|
|
8362
8481
|
$viewInit.pipe(takeUntilDestroyed(), filter$1(v => !!v), switchMap$1(() => {
|
|
8363
|
-
return combineLatest([$trackBy, $isInfinity, $snapScrollToStart, $snapScrollToEnd, $bounds, $listBounds, $
|
|
8482
|
+
return combineLatest([$trackBy, $isInfinity, $snapScrollToStart, $snapScrollToEnd, $bounds, $listBounds, $actualItems, $itemConfigMap, $scrollSize,
|
|
8364
8483
|
$actualItemSize, $actualMinItemSize, $actualMaxItemSize, $collapsedItemIds, $bufferSize, $maxBufferSize, $stickyEnabled, $isVertical,
|
|
8365
8484
|
$dynamicSize, $divides, $snapToItem, $snapToItemAlign, $enabledBufferOptimization, $itemTransform, $alignment,
|
|
8366
8485
|
$precalculatedScrollStartOffset, $precalculatedScrollEndOffset, $cacheVersion, this.$fireUpdate,
|
|
8367
|
-
]).pipe(takeUntilDestroyed(this._destroyRef), tap(([trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds,
|
|
8486
|
+
]).pipe(takeUntilDestroyed(this._destroyRef), tap(([trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds, items, itemConfigMap, scrollSize, itemSize, minItemSize, maxItemSize, collapsedIds, bufferSize, maxBufferSize, stickyEnabled, isVertical, dynamicSize, divides, snapToItem, snapToItemAlign, enabledBufferOptimization, itemTransform, alignment, precalculatedScrollStartOffset, precalculatedScrollEndOffset, cacheVersion,]) => {
|
|
8368
8487
|
let itemsChanged = false;
|
|
8369
8488
|
if (prevItems !== items) {
|
|
8370
8489
|
itemsChanged = true;
|
|
@@ -8375,7 +8494,7 @@ class NgVirtualListComponent {
|
|
|
8375
8494
|
if (enabledOptimization) {
|
|
8376
8495
|
if (useDebouncedUpdate) {
|
|
8377
8496
|
debouncedUpdate.execute({
|
|
8378
|
-
trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds,
|
|
8497
|
+
trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds, items, itemConfigMap, scrollSize, itemSize, minItemSize,
|
|
8379
8498
|
maxItemSize, collapsedIds, bufferSize, maxBufferSize, stickyEnabled, isVertical, dynamicSize, divides, enabledBufferOptimization, itemTransform,
|
|
8380
8499
|
snapToItem, snapToItemAlign, alignment, precalculatedScrollStartOffset, precalculatedScrollEndOffset, cacheVersion, userAction: hasUserAction,
|
|
8381
8500
|
});
|
|
@@ -8385,7 +8504,7 @@ class NgVirtualListComponent {
|
|
|
8385
8504
|
}
|
|
8386
8505
|
if (!isScrolling) {
|
|
8387
8506
|
update({
|
|
8388
|
-
trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds,
|
|
8507
|
+
trackBy, isInfinity, snapScrollToStart, snapScrollToEnd, bounds, listBounds, items, itemConfigMap, scrollSize, itemSize, minItemSize,
|
|
8389
8508
|
maxItemSize, collapsedIds, bufferSize, maxBufferSize, stickyEnabled, isVertical, dynamicSize, divides, enabledBufferOptimization, itemTransform,
|
|
8390
8509
|
snapToItem, snapToItemAlign, alignment, precalculatedScrollStartOffset, precalculatedScrollEndOffset, cacheVersion, userAction: hasUserAction,
|
|
8391
8510
|
});
|
|
@@ -8468,23 +8587,23 @@ class NgVirtualListComponent {
|
|
|
8468
8587
|
if (!!items && items.length) {
|
|
8469
8588
|
const dynamicSize = this.dynamicSize(), itemSize = this._actualItemSize(), minItemSize = this._actualMinItemSize(), maxItemSize = this._actualMaxItemSize(), snapScrollToEnd = this.snapScrollToEnd();
|
|
8470
8589
|
if (dynamicSize) {
|
|
8471
|
-
const { width, height } = this._bounds() || { width: DEFAULT_LIST_SIZE, height: DEFAULT_LIST_SIZE }, itemConfigMap = this.itemConfigMap(), isVertical = this._isVertical, currentScrollSize = isVertical ? scrollerComponent.scrollTop : scrollerComponent.scrollLeft, opts = {
|
|
8472
|
-
alignment: this.actualAlignment(),
|
|
8590
|
+
const { width, height } = this._bounds() || { width: DEFAULT_LIST_SIZE, height: DEFAULT_LIST_SIZE }, itemConfigMap = this.itemConfigMap(), isVertical = this._isVertical, inverted = scrollerComponent.inverted, maxScrollSize = isVertical ? scrollerComponent.scrollHeight : scrollerComponent.scrollWidth, currentScrollSize = isVertical ? scrollerComponent.scrollTop : scrollerComponent.scrollLeft, opts = {
|
|
8591
|
+
alignment: this.actualAlignment(), inverted,
|
|
8473
8592
|
bounds: { width, height }, collection: items, dynamicSize, isVertical: this._isVertical, itemSize, minItemSize, maxItemSize,
|
|
8474
8593
|
bufferSize: this.bufferSize(), maxBufferSize: this.maxBufferSize(), itemTransform: this.itemTransform(),
|
|
8475
|
-
scrollSize: (
|
|
8594
|
+
scrollSize: (inverted ? (maxScrollSize - currentScrollSize) : currentScrollSize),
|
|
8476
8595
|
snapToItem: this.snapToItem(), snapToItemAlign: this.snapToItemAlign(),
|
|
8477
8596
|
stickyEnabled: this.stickyEnabled(), fromItemId: id, enabledBufferOptimization: this.enabledBufferOptimization(),
|
|
8478
8597
|
};
|
|
8479
8598
|
let scrollSize = snapScrollToEnd && this._trackBox.isSnappedToEnd ?
|
|
8480
|
-
|
|
8599
|
+
maxScrollSize :
|
|
8481
8600
|
this._trackBox.getItemPosition(id, itemConfigMap, opts);
|
|
8482
8601
|
if (scrollSize === -1) {
|
|
8483
8602
|
return of([finished, { id, blending, iteration: nextIteration, cb }]).pipe(delay(0));
|
|
8484
8603
|
}
|
|
8485
8604
|
this._trackBox.clearDelta();
|
|
8486
8605
|
const viewportSize = (isVertical ? height : width), { displayItems, totalSize, leftLayoutOffset } = this._trackBox.updateCollection(items, itemConfigMap, {
|
|
8487
|
-
...opts, scrollSize, fromItemId: isLastIteration ? undefined : id,
|
|
8606
|
+
...opts, scrollSize: (inverted ? (maxScrollSize - scrollSize) : scrollSize), fromItemId: isLastIteration ? undefined : id,
|
|
8488
8607
|
}), delta1 = this._trackBox.delta;
|
|
8489
8608
|
const normalizedTotalSize = totalSize < viewportSize ? viewportSize : totalSize;
|
|
8490
8609
|
scrollerComponent.startLayoutOffset = leftLayoutOffset;
|
|
@@ -8496,7 +8615,7 @@ class NgVirtualListComponent {
|
|
|
8496
8615
|
this.tracking();
|
|
8497
8616
|
this.snappingHandler();
|
|
8498
8617
|
this.updateOffsetsByAllignment();
|
|
8499
|
-
scrollSize = this._trackBox.getItemPosition(id, itemConfigMap, { ...opts, scrollSize: actualScrollSize, fromItemId: id });
|
|
8618
|
+
scrollSize = this._trackBox.getItemPosition(id, itemConfigMap, { ...opts, scrollSize: (inverted ? (maxScrollSize - actualScrollSize) : actualScrollSize), fromItemId: id });
|
|
8500
8619
|
if (scrollSize === -1) {
|
|
8501
8620
|
return of([finished, { id, blending, iteration: nextIteration, cb }]).pipe(delay(0));
|
|
8502
8621
|
}
|
|
@@ -8533,17 +8652,18 @@ class NgVirtualListComponent {
|
|
|
8533
8652
|
}
|
|
8534
8653
|
}
|
|
8535
8654
|
}
|
|
8536
|
-
const { width, height } = this._bounds() || { width: DEFAULT_LIST_SIZE, height: DEFAULT_LIST_SIZE }, itemConfigMap = this.itemConfigMap(), items = this._actualItems(), opts = {
|
|
8537
|
-
alignment: this._actualAlignment(),
|
|
8655
|
+
const { width, height } = this._bounds() || { width: DEFAULT_LIST_SIZE, height: DEFAULT_LIST_SIZE }, itemConfigMap = this.itemConfigMap(), items = this._actualItems(), inverted = scrollerComponent.inverted, maxScrollSize = (isVertical ? scrollerComponent.scrollHeight : scrollerComponent.scrollWidth), actualScrollSize = (isVertical ? scrollerComponent.scrollTop : scrollerComponent.scrollLeft), opts = {
|
|
8656
|
+
alignment: this._actualAlignment(), inverted,
|
|
8538
8657
|
bounds: { width, height }, collection: items, dynamicSize, isVertical: this._isVertical, itemSize, minItemSize, maxItemSize,
|
|
8539
8658
|
bufferSize: this.bufferSize(), maxBufferSize: this.maxBufferSize(), itemTransform: this.itemTransform(),
|
|
8540
|
-
scrollSize: (
|
|
8659
|
+
scrollSize: (inverted ? (maxScrollSize - actualScrollSize) : actualScrollSize),
|
|
8541
8660
|
snapToItem, snapToItemAlign, stickyEnabled: this.stickyEnabled(), fromItemId: id,
|
|
8542
8661
|
enabledBufferOptimization: this.enabledBufferOptimization(),
|
|
8543
8662
|
};
|
|
8544
8663
|
this._trackBox.clearDelta();
|
|
8545
8664
|
const viewportSize = (isVertical ? height : width), { displayItems, totalSize, leftLayoutOffset } = this._trackBox.updateCollection(items, itemConfigMap, {
|
|
8546
|
-
...opts, scrollSize
|
|
8665
|
+
...opts, scrollSize: (inverted ? (maxScrollSize - scrollSize) : scrollSize),
|
|
8666
|
+
fromItemId: isLastIteration ? undefined : id,
|
|
8547
8667
|
});
|
|
8548
8668
|
const actualTotalSize = this._isInfinity() ? (totalSize + viewportSize) : totalSize;
|
|
8549
8669
|
const normalizedTotalSize = actualTotalSize < viewportSize ? viewportSize : actualTotalSize;
|
|
@@ -9064,13 +9184,13 @@ class NgVirtualListComponent {
|
|
|
9064
9184
|
}
|
|
9065
9185
|
}
|
|
9066
9186
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9067
|
-
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 }, stickyEnabled: { classPropertyName: "stickyEnabled", publicName: "stickyEnabled", 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 }, overlappingScrollbar: { classPropertyName: "overlappingScrollbar", publicName: "overlappingScrollbar", 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 }, itemTransform: { classPropertyName: "itemTransform", publicName: "itemTransform", isSignal: true, isRequired: false, transformFunction: null }, snapToItem: { classPropertyName: "snapToItem", publicName: "snapToItem", isSignal: true, isRequired: false, transformFunction: null }, snapToItemAlign: { classPropertyName: "snapToItemAlign", publicName: "snapToItemAlign", isSignal: true, isRequired: false, transformFunction: null }, snappingDistance: { classPropertyName: "snappingDistance", publicName: "snappingDistance", isSignal: true, isRequired: false, transformFunction: null }, scrollingOneByOne: { classPropertyName: "scrollingOneByOne", publicName: "scrollingOneByOne", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, zIndexWhenSelecting: { classPropertyName: "zIndexWhenSelecting", publicName: "zIndexWhenSelecting", isSignal: true, isRequired: false, transformFunction: null }, spreadingMode: { classPropertyName: "spreadingMode", publicName: "spreadingMode", isSignal: true, isRequired: false, transformFunction: null }, divides: { classPropertyName: "divides", publicName: "divides", isSignal: true, isRequired: false, transformFunction: null }, motionBlur: { classPropertyName: "motionBlur", publicName: "motionBlur", isSignal: true, isRequired: false, transformFunction: null }, maxMotionBlur: { classPropertyName: "maxMotionBlur", publicName: "maxMotionBlur", isSignal: true, isRequired: false, transformFunction: null }, motionBlurEnabled: { classPropertyName: "motionBlurEnabled", publicName: "motionBlurEnabled", 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 }, minItemSize: { classPropertyName: "minItemSize", publicName: "minItemSize", isSignal: true, isRequired: false, transformFunction: null }, maxItemSize: { classPropertyName: "maxItemSize", publicName: "maxItemSize", 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 }, collapsingMode: { classPropertyName: "collapsingMode", publicName: "collapsingMode", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, selectingMode: { classPropertyName: "selectingMode", publicName: "selectingMode", 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", onSnapItem: "onSnapItem", 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: "@let scrollStartOffset = _actualScrollStartOffset();\r\n@let scrollEndOffset = _actualScrollEndOffset();\r\n@let alignmentScrollStartOffset = _alignmentScrollStartOffset();\r\n@let alignmentScrollEndOffset = _alignmentScrollEndOffset();\r\n\r\n<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()\" [dynamic]=\"dynamicSize()\"\r\n [divides]=\"divides()\" [isVertical]=\"isVertical\" [itemSize]=\"actualItemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset\" [endOffset]=\"scrollEndOffset\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (stickyEnabled()) {\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\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset\"\r\n [endOffset]=\"scrollEndOffset\" [alignmentStartOffset]=\"alignmentScrollStartOffset\" [alignmentEndOffset]=\"alignmentScrollEndOffset\"\r\n [direction]=\"direction()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\" [isInfinity]=\"_isInfinity()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [animationParams]=\"animationParams()\" [focusedElement]=\"focusedElement()\" [loading]=\"loading()\"\r\n [overscrollEnabled]=\"overscrollEnabled()\" [snappingDistance]=\"snappingDistance()\" [overlappingScrollbar]=\"overlappingScrollbar()\"\r\n [scrollbarEnabled]=\"_actualScrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\" [snapToItem]=\"snapToItem()\"\r\n [snapToItemAlign]=\"snapToItemAlign()\" [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollingSettings]=\"scrollingSettings()\" [scrollingOneByOne]=\"scrollingOneByOne()\" [motionBlur]=\"motionBlur()\"\r\n [maxMotionBlur]=\"maxMotionBlur()\" [motionBlurEnabled]=\"motionBlurEnabled()\">\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;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", "overlappingScrollbar", "content", "loading", "classes", "scrollbarMinSize", "scrollbarThickness", "scrollbarThumbRenderer", "scrollbarThumbParams", "motionBlur", "maxMotionBlur", "motionBlurEnabled"], outputs: ["onScrollbarVisible"] }, { kind: "component", type: NgPrerenderContainer, selector: "ng-prerender-container", inputs: ["enabled", "direction", "isVertical", "scrollbarEnabled", "startOffset", "endOffset", "bounds", "dynamic", "itemSize", "trackBy", "divides", "itemRenderer"] }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
9187
|
+
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 }, stickyEnabled: { classPropertyName: "stickyEnabled", publicName: "stickyEnabled", 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 }, overlappingScrollbar: { classPropertyName: "overlappingScrollbar", publicName: "overlappingScrollbar", 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 }, itemTransform: { classPropertyName: "itemTransform", publicName: "itemTransform", isSignal: true, isRequired: false, transformFunction: null }, snapToItem: { classPropertyName: "snapToItem", publicName: "snapToItem", isSignal: true, isRequired: false, transformFunction: null }, snapToItemAlign: { classPropertyName: "snapToItemAlign", publicName: "snapToItemAlign", isSignal: true, isRequired: false, transformFunction: null }, snappingDistance: { classPropertyName: "snappingDistance", publicName: "snappingDistance", isSignal: true, isRequired: false, transformFunction: null }, scrollingOneByOne: { classPropertyName: "scrollingOneByOne", publicName: "scrollingOneByOne", isSignal: true, isRequired: false, transformFunction: null }, alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null }, zIndexWhenSelecting: { classPropertyName: "zIndexWhenSelecting", publicName: "zIndexWhenSelecting", isSignal: true, isRequired: false, transformFunction: null }, spreadingMode: { classPropertyName: "spreadingMode", publicName: "spreadingMode", isSignal: true, isRequired: false, transformFunction: null }, divides: { classPropertyName: "divides", publicName: "divides", isSignal: true, isRequired: false, transformFunction: null }, motionBlur: { classPropertyName: "motionBlur", publicName: "motionBlur", isSignal: true, isRequired: false, transformFunction: null }, maxMotionBlur: { classPropertyName: "maxMotionBlur", publicName: "maxMotionBlur", isSignal: true, isRequired: false, transformFunction: null }, motionBlurEnabled: { classPropertyName: "motionBlurEnabled", publicName: "motionBlurEnabled", 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 }, minItemSize: { classPropertyName: "minItemSize", publicName: "minItemSize", isSignal: true, isRequired: false, transformFunction: null }, maxItemSize: { classPropertyName: "maxItemSize", publicName: "maxItemSize", 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 }, collapsingMode: { classPropertyName: "collapsingMode", publicName: "collapsingMode", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, selectingMode: { classPropertyName: "selectingMode", publicName: "selectingMode", 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", onSnapItem: "onSnapItem", 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: "@let scrollStartOffset = _actualScrollStartOffset();\r\n@let scrollEndOffset = _actualScrollEndOffset();\r\n@let alignmentScrollStartOffset = _alignmentScrollStartOffset();\r\n@let alignmentScrollEndOffset = _alignmentScrollEndOffset();\r\n@let textDir = langTextDir();\r\n\r\n<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()\" [dynamic]=\"dynamicSize()\"\r\n [divides]=\"divides()\" [isVertical]=\"isVertical\" [itemSize]=\"actualItemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset\" [endOffset]=\"scrollEndOffset\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (stickyEnabled()) {\r\n <div localeSensitive [langTextDir]=\"textDir\" #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\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [langTextDir]=\"textDir\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset\"\r\n [endOffset]=\"scrollEndOffset\" [alignmentStartOffset]=\"alignmentScrollStartOffset\" [alignmentEndOffset]=\"alignmentScrollEndOffset\"\r\n [direction]=\"direction()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\" [isInfinity]=\"_isInfinity()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [animationParams]=\"animationParams()\" [focusedElement]=\"focusedElement()\" [loading]=\"loading()\"\r\n [overscrollEnabled]=\"overscrollEnabled()\" [snappingDistance]=\"snappingDistance()\" [overlappingScrollbar]=\"overlappingScrollbar()\"\r\n [scrollbarEnabled]=\"_actualScrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\" [snapToItem]=\"snapToItem()\"\r\n [snapToItemAlign]=\"snapToItemAlign()\" [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollingSettings]=\"scrollingSettings()\" [scrollingOneByOne]=\"scrollingOneByOne()\" [motionBlur]=\"motionBlur()\"\r\n [maxMotionBlur]=\"maxMotionBlur()\" [motionBlurEnabled]=\"motionBlurEnabled()\">\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;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", "overlappingScrollbar", "content", "loading", "classes", "scrollbarMinSize", "scrollbarThickness", "scrollbarThumbRenderer", "scrollbarThumbParams", "motionBlur", "maxMotionBlur", "motionBlurEnabled"], outputs: ["onScrollbarVisible"] }, { kind: "component", type: NgPrerenderContainer, selector: "ng-prerender-container", inputs: ["enabled", "direction", "isVertical", "scrollbarEnabled", "startOffset", "endOffset", "bounds", "dynamic", "itemSize", "trackBy", "divides", "itemRenderer"] }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
9068
9188
|
}
|
|
9069
9189
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: NgVirtualListComponent, decorators: [{
|
|
9070
9190
|
type: Component,
|
|
9071
9191
|
args: [{ selector: 'ng-virtual-list', host: {
|
|
9072
9192
|
'style': 'position: relative;'
|
|
9073
|
-
}, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, providers: [NgVirtualListService, NgVirtualListPublicService], template: "@let scrollStartOffset = _actualScrollStartOffset();\r\n@let scrollEndOffset = _actualScrollEndOffset();\r\n@let alignmentScrollStartOffset = _alignmentScrollStartOffset();\r\n@let alignmentScrollEndOffset = _alignmentScrollEndOffset();\r\n\r\n<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()\" [dynamic]=\"dynamicSize()\"\r\n [divides]=\"divides()\" [isVertical]=\"isVertical\" [itemSize]=\"actualItemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset\" [endOffset]=\"scrollEndOffset\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (stickyEnabled()) {\r\n <div localeSensitive [langTextDir]=\"
|
|
9193
|
+
}, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, providers: [NgVirtualListService, NgVirtualListPublicService], template: "@let scrollStartOffset = _actualScrollStartOffset();\r\n@let scrollEndOffset = _actualScrollEndOffset();\r\n@let alignmentScrollStartOffset = _alignmentScrollStartOffset();\r\n@let alignmentScrollEndOffset = _alignmentScrollEndOffset();\r\n@let textDir = langTextDir();\r\n\r\n<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()\" [dynamic]=\"dynamicSize()\"\r\n [divides]=\"divides()\" [isVertical]=\"isVertical\" [itemSize]=\"actualItemSize()\" [trackBy]=\"trackBy()\"\r\n [itemRenderer]=\"itemRenderer()\" [startOffset]=\"scrollStartOffset\" [endOffset]=\"scrollEndOffset\"\r\n [scrollbarEnabled]=\"scroller.scrollbarShow()\" [enabled]=\"dynamicSize() && snapScrollToEnd()\" />\r\n\r\n@if (stickyEnabled()) {\r\n <div localeSensitive [langTextDir]=\"textDir\" #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\r\n<ng-scroller #scroller class=\"ngvl__list-scroller\" [langTextDir]=\"textDir\" [classes]=\"classes()\" [startOffset]=\"scrollStartOffset\"\r\n [endOffset]=\"scrollEndOffset\" [alignmentStartOffset]=\"alignmentScrollStartOffset\" [alignmentEndOffset]=\"alignmentScrollEndOffset\"\r\n [direction]=\"direction()\" [scrollbarThumbRenderer]=\"scrollbarThumbRenderer()\" [isInfinity]=\"_isInfinity()\"\r\n [scrollbarThickness]=\"scrollbarThickness()\" [scrollbarThumbParams]=\"scrollbarThumbParams()\"\r\n [animationParams]=\"animationParams()\" [focusedElement]=\"focusedElement()\" [loading]=\"loading()\"\r\n [overscrollEnabled]=\"overscrollEnabled()\" [snappingDistance]=\"snappingDistance()\" [overlappingScrollbar]=\"overlappingScrollbar()\"\r\n [scrollbarEnabled]=\"_actualScrollbarEnabled()\" [scrollbarInteractive]=\"scrollbarInteractive()\" [snapToItem]=\"snapToItem()\"\r\n [snapToItemAlign]=\"snapToItemAlign()\" [scrollbarMinSize]=\"scrollbarMinSize()\" [scrollBehavior]=\"scrollBehavior()\"\r\n [scrollingSettings]=\"scrollingSettings()\" [scrollingOneByOne]=\"scrollingOneByOne()\" [motionBlur]=\"motionBlur()\"\r\n [maxMotionBlur]=\"maxMotionBlur()\" [motionBlurEnabled]=\"motionBlurEnabled()\">\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;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"] }]
|
|
9074
9194
|
}], ctorParameters: () => [], propDecorators: { _prerender: [{ type: i0.ViewChild, args: ['prerender', { isSignal: true }] }], _listContainerRef: [{
|
|
9075
9195
|
type: ViewChild,
|
|
9076
9196
|
args: ['renderersContainer', { read: ViewContainerRef }]
|