ng-virtual-list 20.10.1 → 20.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/fesm2022/ng-virtual-list.mjs +92 -47
- package/fesm2022/ng-virtual-list.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -740,9 +740,9 @@ Properties
|
|
|
740
740
|
| 19.x | 19.10.0 | [19.x](https://github.com/DjonnyX/ng-virtual-list/tree/19.x) | [19.10.0](https://www.npmjs.com/package/ng-virtual-list/v/19.10.0) |
|
|
741
741
|
| 18.x | 18.10.0 | [18.x](https://github.com/DjonnyX/ng-virtual-list/tree/18.x) | [18.10.0](https://www.npmjs.com/package/ng-virtual-list/v/18.10.0) |
|
|
742
742
|
| 17.x | 17.10.0 | [17.x](https://github.com/DjonnyX/ng-virtual-list/tree/17.x) | [17.10.0](https://www.npmjs.com/package/ng-virtual-list/v/17.10.0) |
|
|
743
|
-
| 16.x | 16.
|
|
744
|
-
| 15.x | 15.
|
|
745
|
-
| 14.x | 14.
|
|
743
|
+
| 16.x | 16.9.6 | [16.x](https://github.com/DjonnyX/ng-virtual-list/tree/16.x) | [16.9.6](https://www.npmjs.com/package/ng-virtual-list/v/16.9.6) |
|
|
744
|
+
| 15.x | 15.9.6 | [15.x](https://github.com/DjonnyX/ng-virtual-list/tree/15.x) | [15.9.6](https://www.npmjs.com/package/ng-virtual-list/v/15.9.6) |
|
|
745
|
+
| 14.x | 14.9.6 | [14.x](https://github.com/DjonnyX/ng-virtual-list/tree/14.x) | [14.9.6](https://www.npmjs.com/package/ng-virtual-list/v/14.9.6) |
|
|
746
746
|
|
|
747
747
|
<br/>
|
|
748
748
|
|
|
@@ -3444,8 +3444,9 @@ class NgScrollView {
|
|
|
3444
3444
|
this._$scroll.next(userAction);
|
|
3445
3445
|
}
|
|
3446
3446
|
onDragStart() { }
|
|
3447
|
-
reset() {
|
|
3448
|
-
this.
|
|
3447
|
+
reset(offset = 0) {
|
|
3448
|
+
this.stopScrolling();
|
|
3449
|
+
this.move(this.isVertical(), offset);
|
|
3449
3450
|
}
|
|
3450
3451
|
ngOnDestroy() {
|
|
3451
3452
|
if (this._animator) {
|
|
@@ -3811,11 +3812,13 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
3811
3812
|
this.updateScrollBar();
|
|
3812
3813
|
}
|
|
3813
3814
|
reset() {
|
|
3814
|
-
super.reset();
|
|
3815
|
+
super.reset(this.startOffset());
|
|
3816
|
+
this.totalSize = 0;
|
|
3815
3817
|
if (this.scrollBar) {
|
|
3816
3818
|
this.scrollBar.stopScrolling();
|
|
3817
3819
|
}
|
|
3818
|
-
this.
|
|
3820
|
+
this.refresh(true, true);
|
|
3821
|
+
this.prepared = false;
|
|
3819
3822
|
}
|
|
3820
3823
|
refresh(fireUpdate = false, updateScrollbar = true) {
|
|
3821
3824
|
this.scrollLimits();
|
|
@@ -3880,19 +3883,19 @@ class NgScrollerComponent extends NgScrollView {
|
|
|
3880
3883
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: NgScrollerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3881
3884
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.17", type: NgScrollerComponent, isStandalone: true, selector: "ng-scroller", inputs: { scrollbarEnabled: { classPropertyName: "scrollbarEnabled", publicName: "scrollbarEnabled", isSignal: true, isRequired: false, transformFunction: null }, scrollbarInteractive: { classPropertyName: "scrollbarInteractive", publicName: "scrollbarInteractive", isSignal: true, isRequired: false, transformFunction: null }, focusedElement: { classPropertyName: "focusedElement", publicName: "focusedElement", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", 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 }, scrollbarTheme: { classPropertyName: "scrollbarTheme", publicName: "scrollbarTheme", isSignal: true, isRequired: false, transformFunction: null }, scrollbarMinSize: { classPropertyName: "scrollbarMinSize", publicName: "scrollbarMinSize", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
3882
3885
|
{ provide: SCROLL_VIEW_INVERSION, useValue: false },
|
|
3883
|
-
], viewQueries: [{ propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], usesInheritance: true, ngImport: i0, template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"prepared\"\r\n [interactive]=\"scrollbarInteractive()\" [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\"\r\n [startOffset]=\"startOffset()\" [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollBehavior]=\"scrollBehavior()\" [scrollbarMinSize]=\"scrollbarMinSize()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\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.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr 0;transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr 0;transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}
|
|
3886
|
+
], viewQueries: [{ propertyName: "scrollBar", first: true, predicate: ["scrollBar"], descendants: true, read: NgScrollBarComponent }], usesInheritance: true, ngImport: i0, template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"prepared\"\r\n [interactive]=\"scrollbarInteractive()\" [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\"\r\n [startOffset]=\"startOffset()\" [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollBehavior]=\"scrollBehavior()\" [scrollbarMinSize]=\"scrollbarMinSize()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\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.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr 0;transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr 0;transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: LocaleSensitiveDirective, selector: "[localeSensitive]", inputs: ["langTextDir", "listDir"] }, { kind: "component", type: NgScrollBarComponent, selector: "ng-scroll-bar", inputs: ["loading", "thumbGradientPositions", "size", "theme", "startOffset", "endOffset", "scrollbarMinSize", "prepared", "interactive", "show"], outputs: ["onDrag"] }] });
|
|
3884
3887
|
}
|
|
3885
3888
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: NgScrollerComponent, decorators: [{
|
|
3886
3889
|
type: Component,
|
|
3887
3890
|
args: [{ selector: 'ng-scroller', imports: [CommonModule, CdkScrollable, LocaleSensitiveDirective, NgScrollBarComponent], providers: [
|
|
3888
3891
|
{ provide: SCROLL_VIEW_INVERSION, useValue: false },
|
|
3889
|
-
], schemas: [NO_ERRORS_SCHEMA], template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"prepared\"\r\n [interactive]=\"scrollbarInteractive()\" [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\"\r\n [startOffset]=\"startOffset()\" [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollBehavior]=\"scrollBehavior()\" [scrollbarMinSize]=\"scrollbarMinSize()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\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.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr 0;transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr 0;transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}
|
|
3892
|
+
], schemas: [NO_ERRORS_SCHEMA], template: "<div localeSensitive [langTextDir]=\"langTextDir()\" [listDir]=\"direction()\" class=\"ngvl__container\"\r\n [ngClass]=\"containerClasses()\">\r\n <div #scrollViewport cdkScrollable part=\"scroller\" class=\"ngvl__scroller\">\r\n <div #scrollContent [attr.aria-orientation]=\"direction()\" [attr.aria-activedescendant]=\"focusedElement()\"\r\n tabindex=\"0\" part=\"list\" class=\"ngvl__list\" [ngClass]=\"actualClasses()\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n @let prepared = preparedSignal();\r\n <ng-scroll-bar #scrollBar [direction]=\"direction()\" [size]=\"thumbSize()\" [theme]=\"scrollbarTheme()\"\r\n [thumbGradientPositions]=\"thumbGradientPositions()\" [loading]=\"loading()\" [prepared]=\"prepared\"\r\n [interactive]=\"scrollbarInteractive()\" [show]=\"scrollbarShow() && scrollbarEnabled() && prepared\"\r\n [startOffset]=\"startOffset()\" [endOffset]=\"endOffset()\" [overscrollEnabled]=\"overscrollEnabled()\"\r\n [scrollBehavior]=\"scrollBehavior()\" [scrollbarMinSize]=\"scrollbarMinSize()\"\r\n (onDrag)=\"onScrollBarDragHandler($event)\"></ng-scroll-bar>\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.grabbing{cursor:grabbing}.ngvl__container.horizontal{grid-template-rows:1fr 0;transition:grid-template-rows .1s ease-out}.ngvl__container.horizontal.scrollable.enabled{grid-template-rows:1fr auto}.ngvl__container.horizontal .ngvl__list{display:inline-flex}.ngvl__container.horizontal .ngvl__scroller{overflow:hidden}.ngvl__container.vertical{grid-template-columns:1fr 0;transition:grid-template-columns .1s ease-out}.ngvl__container.vertical.scrollable.enabled{grid-template-columns:1fr auto}.ngvl__container.vertical .ngvl__scroller{overflow:hidden}.ngvl__scroller{display:block;position:relative;overflow:hidden;width:100%;height:100%}.ngvl__list{position:absolute;list-style:none;padding:0;margin:0;width:100%;height:100%;opacity:0}.ngvl__list.prepared{opacity:1;overflow:hidden}\n"] }]
|
|
3890
3893
|
}], ctorParameters: () => [], propDecorators: { scrollBar: [{
|
|
3891
3894
|
type: ViewChild,
|
|
3892
3895
|
args: ['scrollBar', { read: NgScrollBarComponent }]
|
|
3893
3896
|
}], scrollbarEnabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarEnabled", required: false }] }], scrollbarInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarInteractive", required: false }] }], focusedElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedElement", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], classes: [{ type: i0.Input, args: [{ isSignal: true, alias: "classes", required: false }] }], startOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "startOffset", required: false }] }], endOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "endOffset", required: false }] }], scrollbarTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarTheme", required: false }] }], scrollbarMinSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollbarMinSize", required: false }] }] } });
|
|
3894
3897
|
|
|
3895
|
-
const MIN_SCROLL_TO_START_PIXELS = 10, RANGE_DISPLAY_ITEMS_END_OFFSET = 20,
|
|
3898
|
+
const MIN_SCROLL_TO_START_PIXELS = 10, RANGE_DISPLAY_ITEMS_END_OFFSET = 20, DEFAULT_INIT_ITERATIONS = 30, ROLE_LIST = 'list', ROLE_LIST_BOX = 'listbox', ITEM_ID = 'item-id', ITEM_CONTAINER = 'ngvl-item__container', READY_TO_START = 'ready-to-start', WAIT_FOR_PREPARATION = 'wait-for-preparation';
|
|
3896
3899
|
const validateScrollIteration = (value) => {
|
|
3897
3900
|
return Number.isNaN(value) || (value < 0) ? 0 : value > MAX_SCROLL_TO_ITERATIONS ? MAX_SCROLL_TO_ITERATIONS : value;
|
|
3898
3901
|
}, validateId = (id) => {
|
|
@@ -4814,55 +4817,92 @@ class NgVirtualListComponent {
|
|
|
4814
4817
|
this._service.clickDistance = dist;
|
|
4815
4818
|
});
|
|
4816
4819
|
let prepared = false, readyToStart = false, isUserScrolling = false;
|
|
4817
|
-
const $updateComplete = this.$update.pipe(takeUntilDestroyed(),
|
|
4820
|
+
const $updateComplete = this.$update.pipe(takeUntilDestroyed(), switchMap$1(() => {
|
|
4818
4821
|
this._$updateIteration.next(this._$updateIteration.getValue() + 1);
|
|
4819
|
-
|
|
4820
|
-
|
|
4822
|
+
const iterations = Math.min(DEFAULT_INIT_ITERATIONS, this.items().length || 1);
|
|
4823
|
+
if (this._$updateIteration.getValue() <= iterations) {
|
|
4824
|
+
const scroller = this._scrollerComponent();
|
|
4825
|
+
if (!!scroller) {
|
|
4826
|
+
const isVerrtical = this._isVertical, actualScrollSize = isVerrtical ? (scroller?.actualScrollHeight ?? 0) : (scroller?.actualScrollWidth ?? 0), params = {
|
|
4827
|
+
[isVerrtical ? TOP_PROP_NAME : LEFT_PROP_NAME]: actualScrollSize,
|
|
4828
|
+
blending: false, fireUpdate: true, userAction: false, behavior: BEHAVIOR_INSTANT,
|
|
4829
|
+
};
|
|
4830
|
+
scroller.stopScrolling();
|
|
4831
|
+
scroller.scrollTo(params);
|
|
4832
|
+
this._service.update();
|
|
4833
|
+
}
|
|
4834
|
+
return of(false);
|
|
4821
4835
|
}
|
|
4822
|
-
|
|
4823
|
-
$
|
|
4824
|
-
|
|
4825
|
-
|
|
4836
|
+
return of(true);
|
|
4837
|
+
}), debounceTime(200), distinctUntilChanged()), $items = toObservable(this.items).pipe(map(i => !i ? [] : i)), $dynamicSize = toObservable(this.dynamicSize);
|
|
4838
|
+
const $snapScrollToBottom = toObservable(this.snapScrollToBottom), $waitForPreparation = toObservable(this.waitForPreparation);
|
|
4839
|
+
combineLatest([$dynamicSize, $snapScrollToBottom, $waitForPreparation]).pipe(takeUntilDestroyed(), switchMap$1(([dynamicSize, snapScrollToBottom, waitForPreparation]) => {
|
|
4840
|
+
if (!dynamicSize || !snapScrollToBottom || !waitForPreparation) {
|
|
4826
4841
|
prepared = readyToStart = true;
|
|
4827
4842
|
const scrollerComponent = this._scrollerComponent();
|
|
4828
4843
|
if (scrollerComponent) {
|
|
4829
4844
|
scrollerComponent.prepared = true;
|
|
4830
4845
|
}
|
|
4831
4846
|
this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: false });
|
|
4832
|
-
this._service.update(
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4847
|
+
this._service.update();
|
|
4848
|
+
this._$show.next(true);
|
|
4849
|
+
return of(false);
|
|
4850
|
+
}
|
|
4851
|
+
if (!!dynamicSize && !!snapScrollToBottom && !!waitForPreparation) {
|
|
4852
|
+
this._$updateIteration.next(0);
|
|
4853
|
+
return this.$prepared.pipe(takeUntilDestroyed(this._destroyRef), distinctUntilChanged(), switchMap$1(v => {
|
|
4854
|
+
if (!v) {
|
|
4855
|
+
this._$show.next(false);
|
|
4856
|
+
readyToStart = isUserScrolling = prepared = false;
|
|
4857
|
+
this.cacheClean();
|
|
4842
4858
|
const scrollerComponent = this._scrollerComponent();
|
|
4843
4859
|
if (scrollerComponent) {
|
|
4844
|
-
scrollerComponent.prepared =
|
|
4860
|
+
scrollerComponent.prepared = false;
|
|
4861
|
+
scrollerComponent.stopScrolling();
|
|
4845
4862
|
}
|
|
4846
|
-
this.classes.set({ prepared: v, [READY_TO_START]: false, [WAIT_FOR_PREPARATION]:
|
|
4863
|
+
this.classes.set({ prepared: v, [READY_TO_START]: false, [WAIT_FOR_PREPARATION]: false });
|
|
4864
|
+
this._$updateIteration.next(0);
|
|
4865
|
+
this._service.update(true);
|
|
4866
|
+
return of(false);
|
|
4847
4867
|
}
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4868
|
+
return of(true).pipe(takeUntilDestroyed(this._destroyRef), switchMap$1(v => {
|
|
4869
|
+
const waitForPreparation = this.waitForPreparation();
|
|
4870
|
+
if (waitForPreparation) {
|
|
4871
|
+
return $updateComplete.pipe(takeUntilDestroyed(this._destroyRef), filter$1(v => !!v), take(1), tap(() => {
|
|
4872
|
+
prepared = readyToStart = true;
|
|
4873
|
+
const waitForPreparation = this.waitForPreparation(), scrollerComponent = this._scrollerComponent();
|
|
4874
|
+
if (scrollerComponent) {
|
|
4875
|
+
scrollerComponent.prepared = true;
|
|
4876
|
+
scrollerComponent.stopScrolling();
|
|
4877
|
+
}
|
|
4878
|
+
this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: waitForPreparation });
|
|
4879
|
+
this._service.update(true);
|
|
4880
|
+
this._$show.next(true);
|
|
4881
|
+
}));
|
|
4882
|
+
}
|
|
4883
|
+
prepared = readyToStart = true;
|
|
4884
|
+
const scrollerComponent = this._scrollerComponent();
|
|
4885
|
+
if (scrollerComponent) {
|
|
4886
|
+
scrollerComponent.prepared = true;
|
|
4887
|
+
scrollerComponent.stopScrolling();
|
|
4888
|
+
}
|
|
4889
|
+
this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: waitForPreparation });
|
|
4890
|
+
this._service.update(true);
|
|
4891
|
+
this._$show.next(true);
|
|
4892
|
+
return of(false);
|
|
4893
|
+
}));
|
|
4864
4894
|
}));
|
|
4865
|
-
}
|
|
4895
|
+
}
|
|
4896
|
+
prepared = readyToStart = true;
|
|
4897
|
+
const scrollerComponent = this._scrollerComponent();
|
|
4898
|
+
if (scrollerComponent) {
|
|
4899
|
+
scrollerComponent.prepared = true;
|
|
4900
|
+
scrollerComponent.stopScrolling();
|
|
4901
|
+
}
|
|
4902
|
+
this.classes.set({ prepared: true, [READY_TO_START]: true, [WAIT_FOR_PREPARATION]: false });
|
|
4903
|
+
this._service.update(true);
|
|
4904
|
+
this._$show.next(true);
|
|
4905
|
+
return of(false);
|
|
4866
4906
|
})).subscribe();
|
|
4867
4907
|
this._service.$focusedId.pipe(takeUntilDestroyed(), tap(v => {
|
|
4868
4908
|
this.focusedElement.set(v ?? undefined);
|
|
@@ -4870,7 +4910,7 @@ class NgVirtualListComponent {
|
|
|
4870
4910
|
toObservable(this._list).pipe(takeUntilDestroyed(), filter$1(v => !!v), tap(v => {
|
|
4871
4911
|
this._service.listElement = v.nativeElement;
|
|
4872
4912
|
})).subscribe();
|
|
4873
|
-
const $defaultItemValue = toObservable(this.defaultItemValue), $
|
|
4913
|
+
const $defaultItemValue = toObservable(this.defaultItemValue), $trackBy = toObservable(this.trackBy), $selectByClick = toObservable(this.selectByClick), $collapseByClick = toObservable(this.collapseByClick), $isScrollStart = toObservable(this._isScrollStart), $isScrollFinished = toObservable(this._isScrollFinished), $scrollStartOffset = toObservable(this.scrollStartOffset), $scrollEndOffset = toObservable(this.scrollEndOffset), $isVertical = toObservable(this.direction).pipe(map(v => this.getIsVertical(v || DEFAULT_DIRECTION)));
|
|
4874
4914
|
$snapScrollToBottom.pipe(takeUntilDestroyed(), tap(v => {
|
|
4875
4915
|
this._service.snapScrollToBottom = v;
|
|
4876
4916
|
})).subscribe();
|
|
@@ -5046,7 +5086,7 @@ class NgVirtualListComponent {
|
|
|
5046
5086
|
this._isScrollFinished.set(scrollPosition >= roundedMaxPosition);
|
|
5047
5087
|
}
|
|
5048
5088
|
}
|
|
5049
|
-
actualScrollSize = (isVertical ? scroller.
|
|
5089
|
+
actualScrollSize = (isVertical ? scroller.actualScrollTop ?? 0 : scroller.actualScrollLeft ?? 0);
|
|
5050
5090
|
const delta = this._trackBox.delta, roundedActualScrollSize = Math.round(actualScrollSize), scrollPositionAfterUpdate = actualScrollSize + delta, roundedScrollPositionAfterUpdate = Math.round(scrollPositionAfterUpdate), roundedMaxPositionAfterUpdate = Math.round(totalSize - viewportSize);
|
|
5051
5091
|
if (this._isSnappingMethodAdvanced) {
|
|
5052
5092
|
this.updateRegularRenderer();
|
|
@@ -5084,7 +5124,9 @@ class NgVirtualListComponent {
|
|
|
5084
5124
|
scroller.scrollTo(params);
|
|
5085
5125
|
}
|
|
5086
5126
|
}
|
|
5087
|
-
|
|
5127
|
+
if (!prepared && !readyToStart) {
|
|
5128
|
+
this._$update.next();
|
|
5129
|
+
}
|
|
5088
5130
|
}
|
|
5089
5131
|
};
|
|
5090
5132
|
combineLatest([$snapScrollToBottom, $bounds, $listBounds, $scrollEndOffset, $actualItems, $itemConfigMap, $scrollSize, $itemSize,
|
|
@@ -5223,6 +5265,9 @@ class NgVirtualListComponent {
|
|
|
5223
5265
|
})).subscribe();
|
|
5224
5266
|
const $scrollTo = this.$scrollTo;
|
|
5225
5267
|
combineLatest([$scroller, $trackBy, $scrollTo]).pipe(takeUntilDestroyed(), filter$1(([scroller]) => scroller !== undefined), map(([scroller, trackBy, event]) => ({ scroller: scroller, trackBy, event })), switchMap$1(({ scroller, trackBy, event }) => {
|
|
5268
|
+
if (!prepared || !readyToStart) {
|
|
5269
|
+
return of([false]);
|
|
5270
|
+
}
|
|
5226
5271
|
const scrollerComponent = this._scrollerComponent(), { id, iteration = 0, blending = false, isLastIteration = false, scrollCalled = false, cb, } = event;
|
|
5227
5272
|
if (scrollerComponent) {
|
|
5228
5273
|
const items = this._actualItems();
|
|
@@ -5291,7 +5336,7 @@ class NgVirtualListComponent {
|
|
|
5291
5336
|
return of([true, { id, scroller: scrollerComponent, cb }]);
|
|
5292
5337
|
}), takeUntilDestroyed(), filter$1(params => !!params), tap(([finished, params]) => {
|
|
5293
5338
|
if (!finished) {
|
|
5294
|
-
if (params) {
|
|
5339
|
+
if (!!params) {
|
|
5295
5340
|
this._$scrollTo.next(params);
|
|
5296
5341
|
}
|
|
5297
5342
|
return;
|