@c8y/ngx-components 1021.22.92 → 1021.22.94
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/core/common/virtual-scroll/virtual-scroller-wrapper.component.d.ts +7 -1
- package/core/common/virtual-scroll/virtual-scroller-wrapper.component.d.ts.map +1 -1
- package/esm2022/core/common/virtual-scroll/virtual-scroller-wrapper.component.mjs +25 -6
- package/fesm2022/c8y-ngx-components.mjs +22 -5
- package/fesm2022/c8y-ngx-components.mjs.map +1 -1
- package/locales/fr.po +2 -2
- package/locales/pt_BR.po +95 -95
- package/package.json +1 -1
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
1
2
|
import { TemplateRef } from '@angular/core';
|
|
2
3
|
import { Observable } from 'rxjs';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class VirtualScrollerWrapperComponent {
|
|
6
|
+
virtualScrollViewport: CdkVirtualScrollViewport;
|
|
5
7
|
items: any;
|
|
6
8
|
itemHeight: any;
|
|
7
9
|
containerHeight: any;
|
|
8
10
|
template: TemplateRef<any>;
|
|
9
|
-
items$: Observable<unknown>;
|
|
10
11
|
filterPipe: import("rxjs").UnaryFunction<Observable<unknown>, Observable<unknown>>;
|
|
11
12
|
strategy: 'fixed' | 'window';
|
|
13
|
+
items$: Observable<unknown>;
|
|
14
|
+
private checkViewportSize$;
|
|
15
|
+
private readonly destroyRef;
|
|
16
|
+
constructor();
|
|
12
17
|
trackByFn: (i: any, item: any) => any;
|
|
18
|
+
ngAfterViewChecked(): void;
|
|
13
19
|
apply(): void;
|
|
14
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualScrollerWrapperComponent, never>;
|
|
15
21
|
static ɵcmp: i0.ɵɵComponentDeclaration<VirtualScrollerWrapperComponent, "c8y-virtual-scroller-wrapper", never, { "items": { "alias": "items"; "required": false; }; "itemHeight": { "alias": "itemHeight"; "required": false; }; "containerHeight": { "alias": "containerHeight"; "required": false; }; "template": { "alias": "template"; "required": false; }; "filterPipe": { "alias": "filterPipe"; "required": false; }; "strategy": { "alias": "strategy"; "required": false; }; "trackByFn": { "alias": "trackByFn"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-scroller-wrapper.component.d.ts","sourceRoot":"","sources":["../../../../core/common/virtual-scroll/virtual-scroller-wrapper.component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"virtual-scroller-wrapper.component.d.ts","sourceRoot":"","sources":["../../../../core/common/virtual-scroll/virtual-scroller-wrapper.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAwC,WAAW,EAAa,MAAM,eAAe,CAAC;AAE7F,OAAO,EAAE,UAAU,EAAqB,MAAM,MAAM,CAAC;;AAGrD,qBAIa,+BAA+B;IAE1C,qBAAqB,EAAE,wBAAwB,CAAC;IAEvC,KAAK,MAAC;IACN,UAAU,MAAC;IACX,eAAe,MAAC;IAChB,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3B,UAAU,yEAAe;IACzB,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC;IAEtC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAE5B,OAAO,CAAC,kBAAkB,CAAuB;IAEjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAsB;;IAYxC,SAAS,6BAEhB;IAEF,kBAAkB,IAAI,IAAI;IAM1B,KAAK;yCArCM,+BAA+B;2CAA/B,+BAA+B;CA2C3C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
2
|
+
import { Component, DestroyRef, inject, Input, TemplateRef, ViewChild } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { of, pipe, Subject } from 'rxjs';
|
|
5
|
+
import { debounceTime, map, tap } from 'rxjs/operators';
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
import * as i1 from "@angular/common";
|
|
6
8
|
import * as i2 from "@angular/cdk/scrolling";
|
|
@@ -8,20 +10,37 @@ import * as i3 from "./virtual-scroll-window.directive";
|
|
|
8
10
|
export class VirtualScrollerWrapperComponent {
|
|
9
11
|
constructor() {
|
|
10
12
|
this.filterPipe = pipe(tap());
|
|
13
|
+
this.checkViewportSize$ = new Subject();
|
|
14
|
+
this.destroyRef = inject(DestroyRef);
|
|
11
15
|
this.trackByFn = (i, item) => {
|
|
12
16
|
return item.id;
|
|
13
17
|
};
|
|
18
|
+
this.checkViewportSize$
|
|
19
|
+
.pipe(debounceTime(25), takeUntilDestroyed(this.destroyRef))
|
|
20
|
+
.subscribe(() => {
|
|
21
|
+
if (this.virtualScrollViewport) {
|
|
22
|
+
this.virtualScrollViewport.checkViewportSize();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
ngAfterViewChecked() {
|
|
27
|
+
if (this.virtualScrollViewport) {
|
|
28
|
+
this.checkViewportSize$.next();
|
|
29
|
+
}
|
|
14
30
|
}
|
|
15
31
|
apply() {
|
|
16
32
|
this.items$ = of(this.items).pipe(src => this.filterPipe(src), map(item => item));
|
|
17
33
|
}
|
|
18
34
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: VirtualScrollerWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
19
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: VirtualScrollerWrapperComponent, selector: "c8y-virtual-scroller-wrapper", inputs: { items: "items", itemHeight: "itemHeight", containerHeight: "containerHeight", template: "template", filterPipe: "filterPipe", strategy: "strategy", trackByFn: "trackByFn" }, ngImport: i0, template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i3.VirtualScrollWindowDirective, selector: "cdk-virtual-scroll-viewport[windowVirtualScrollStrategy]", inputs: ["itemSizePx", "minBufferPx", "maxBufferPx", "offsetSizePx"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
|
|
35
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: VirtualScrollerWrapperComponent, selector: "c8y-virtual-scroller-wrapper", inputs: { items: "items", itemHeight: "itemHeight", containerHeight: "containerHeight", template: "template", filterPipe: "filterPipe", strategy: "strategy", trackByFn: "trackByFn" }, viewQueries: [{ propertyName: "virtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i3.VirtualScrollWindowDirective, selector: "cdk-virtual-scroll-viewport[windowVirtualScrollStrategy]", inputs: ["itemSizePx", "minBufferPx", "maxBufferPx", "offsetSizePx"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
|
|
20
36
|
}
|
|
21
37
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: VirtualScrollerWrapperComponent, decorators: [{
|
|
22
38
|
type: Component,
|
|
23
39
|
args: [{ selector: 'c8y-virtual-scroller-wrapper', template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n" }]
|
|
24
|
-
}], propDecorators: {
|
|
40
|
+
}], ctorParameters: () => [], propDecorators: { virtualScrollViewport: [{
|
|
41
|
+
type: ViewChild,
|
|
42
|
+
args: [CdkVirtualScrollViewport]
|
|
43
|
+
}], items: [{
|
|
25
44
|
type: Input
|
|
26
45
|
}], itemHeight: [{
|
|
27
46
|
type: Input
|
|
@@ -36,4 +55,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
36
55
|
}], trackByFn: [{
|
|
37
56
|
type: Input
|
|
38
57
|
}] } });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
58
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlydHVhbC1zY3JvbGxlci13cmFwcGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2NvcmUvY29tbW9uL3ZpcnR1YWwtc2Nyb2xsL3ZpcnR1YWwtc2Nyb2xsZXItd3JhcHBlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9jb3JlL2NvbW1vbi92aXJ0dWFsLXNjcm9sbC92aXJ0dWFsLXNjcm9sbGVyLXdyYXBwZXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDbEUsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FB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VtcGxhdGVPdXRsZXQ9XCJ0ZW1wbGF0ZTsgY29udGV4dDogeyRpbXBsaWNpdDogaXRlbSwgaW5kZXg6IGl9XCI+PC9uZy1jb250YWluZXI+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9jZGstdmlydHVhbC1zY3JvbGwtdmlld3BvcnQ+XG4gICAgPC9uZy1jb250YWluZXI+XG5cbiAgICA8bmctY29udGFpbmVyICpuZ1N3aXRjaENhc2U9XCInZml4ZWQnXCI+XG4gICAgICA8Y2RrLXZpcnR1YWwtc2Nyb2xsLXZpZXdwb3J0IFtpdGVtU2l6ZV09XCJpdGVtSGVpZ2h0XCIgW3N0eWxlLmhlaWdodF09XCJjb250YWluZXJIZWlnaHQgKyAncHgnXCIgY2xhc3M9XCJpbm5lci1zY3JvbGxcIj5cbiAgICAgICAgPGRpdiAqY2RrVmlydHVhbEZvcj1cImxldCBpdGVtIG9mIGl0ZW1zOyBpbmRleCBhcyBpOyB0cmFja0J5OiB0cmFja0J5Rm5cIiA+XG4gICAgICAgICAgPG5nLWNvbnRhaW5lciAqbmdUZW1wbGF0ZU91dGxldD1cInRlbXBsYXRlOyBjb250ZXh0OiB7JGltcGxpY2l0OiBpdGVtLCBpbmRleDogaX1cIj48L25nLWNvbnRhaW5lcj5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2Nkay12aXJ0dWFsLXNjcm9sbC12aWV3cG9ydD5cbiAgICA8L25nLWNvbnRhaW5lcj5cbjwvbmctY29udGFpbmVyPlxuIl19
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, SecurityContext, TemplateRef, APP_INITIALIZER, Self, SkipSelf,
|
|
2
|
+
import { Directive, Input, Injector, InjectionToken, Injectable, Optional, Inject, isDevMode, inject, Pipe, EventEmitter, NgModule, LOCALE_ID, EnvironmentInjector, HostListener, NgModuleRef, createNgModule, Component, Output, HostBinding, forwardRef, DestroyRef, ViewChild, SecurityContext, TemplateRef, APP_INITIALIZER, Self, SkipSelf, Attribute, ContentChild, ViewContainerRef, ContentChildren, ElementRef, ViewChildren, createComponent, runInInjectionContext, importProvidersFrom, ChangeDetectionStrategy, SimpleChange, signal, Type } from '@angular/core';
|
|
3
3
|
import * as i2$2 from 'ngx-bootstrap/dropdown';
|
|
4
4
|
import { BsDropdownModule, BsDropdownDirective } from 'ngx-bootstrap/dropdown';
|
|
5
5
|
import * as i3$1 from '@angular/cdk/a11y';
|
|
@@ -16,7 +16,7 @@ import * as i4 from '@c8y/ngx-components/api';
|
|
|
16
16
|
import { DataModule } from '@c8y/ngx-components/api';
|
|
17
17
|
import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
18
18
|
import * as i2$1 from '@angular/cdk/scrolling';
|
|
19
|
-
import { VIRTUAL_SCROLL_STRATEGY, ScrollingModule } from '@angular/cdk/scrolling';
|
|
19
|
+
import { VIRTUAL_SCROLL_STRATEGY, CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
|
20
20
|
import * as i2 from '@angular/common';
|
|
21
21
|
import { formatDate, registerLocaleData, DOCUMENT, DatePipe as DatePipe$1, DATE_PIPE_DEFAULT_TIMEZONE, DATE_PIPE_DEFAULT_OPTIONS, NgIf, NgClass, NgTemplateOutlet, DecimalPipe, NgStyle, CommonModule as CommonModule$1, NgFor, AsyncPipe } from '@angular/common';
|
|
22
22
|
import * as i2$3 from 'ngx-bootstrap/tooltip';
|
|
@@ -30,6 +30,7 @@ import * as i3 from 'ngx-bootstrap/datepicker';
|
|
|
30
30
|
import { BsDatepickerModule, BsDatepickerDirective } from 'ngx-bootstrap/datepicker';
|
|
31
31
|
import { defineLocale, enGbLocale, zhCnLocale, ptBrLocale, plLocale, nlLocale, koLocale, jaLocale, frLocale, esLocale, deLocale } from 'ngx-bootstrap/chronos';
|
|
32
32
|
import { compare, coerce } from 'semver';
|
|
33
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
33
34
|
import saveAs$1, { saveAs } from 'file-saver';
|
|
34
35
|
import * as i1$2 from '@angular/platform-browser';
|
|
35
36
|
import { BlobReader, ZipReader, BlobWriter, ZipWriter } from '@zip.js/zip.js';
|
|
@@ -52,7 +53,6 @@ import { CdkStepper, STEP_STATE, CdkStepperModule, CdkStep, STEPPER_GLOBAL_OPTIO
|
|
|
52
53
|
import * as i1$5 from '@angular/cdk/bidi';
|
|
53
54
|
import { getThemePreference, setThemePreference, applyTheme } from '@c8y/bootstrap';
|
|
54
55
|
import * as mimeDB from 'mime-db';
|
|
55
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
56
56
|
import * as i6 from '@ngx-formly/core';
|
|
57
57
|
import { FormlyModule, FieldArrayType, FieldType, FieldWrapper, FORMLY_CONFIG, ɵdefineHiddenProp as _defineHiddenProp } from '@ngx-formly/core';
|
|
58
58
|
import * as i5$2 from '@ngx-formly/core/select';
|
|
@@ -5759,20 +5759,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
5759
5759
|
class VirtualScrollerWrapperComponent {
|
|
5760
5760
|
constructor() {
|
|
5761
5761
|
this.filterPipe = pipe(tap());
|
|
5762
|
+
this.checkViewportSize$ = new Subject();
|
|
5763
|
+
this.destroyRef = inject(DestroyRef);
|
|
5762
5764
|
this.trackByFn = (i, item) => {
|
|
5763
5765
|
return item.id;
|
|
5764
5766
|
};
|
|
5767
|
+
this.checkViewportSize$
|
|
5768
|
+
.pipe(debounceTime(25), takeUntilDestroyed(this.destroyRef))
|
|
5769
|
+
.subscribe(() => {
|
|
5770
|
+
if (this.virtualScrollViewport) {
|
|
5771
|
+
this.virtualScrollViewport.checkViewportSize();
|
|
5772
|
+
}
|
|
5773
|
+
});
|
|
5774
|
+
}
|
|
5775
|
+
ngAfterViewChecked() {
|
|
5776
|
+
if (this.virtualScrollViewport) {
|
|
5777
|
+
this.checkViewportSize$.next();
|
|
5778
|
+
}
|
|
5765
5779
|
}
|
|
5766
5780
|
apply() {
|
|
5767
5781
|
this.items$ = of(this.items).pipe(src => this.filterPipe(src), map(item => item));
|
|
5768
5782
|
}
|
|
5769
5783
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: VirtualScrollerWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5770
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: VirtualScrollerWrapperComponent, selector: "c8y-virtual-scroller-wrapper", inputs: { items: "items", itemHeight: "itemHeight", containerHeight: "containerHeight", template: "template", filterPipe: "filterPipe", strategy: "strategy", trackByFn: "trackByFn" }, ngImport: i0, template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: VirtualScrollWindowDirective, selector: "cdk-virtual-scroll-viewport[windowVirtualScrollStrategy]", inputs: ["itemSizePx", "minBufferPx", "maxBufferPx", "offsetSizePx"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
|
|
5784
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: VirtualScrollerWrapperComponent, selector: "c8y-virtual-scroller-wrapper", inputs: { items: "items", itemHeight: "itemHeight", containerHeight: "containerHeight", template: "template", filterPipe: "filterPipe", strategy: "strategy", trackByFn: "trackByFn" }, viewQueries: [{ propertyName: "virtualScrollViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], ngImport: i0, template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2$1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: VirtualScrollWindowDirective, selector: "cdk-virtual-scroll-viewport[windowVirtualScrollStrategy]", inputs: ["itemSizePx", "minBufferPx", "maxBufferPx", "offsetSizePx"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }] }); }
|
|
5771
5785
|
}
|
|
5772
5786
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: VirtualScrollerWrapperComponent, decorators: [{
|
|
5773
5787
|
type: Component,
|
|
5774
5788
|
args: [{ selector: 'c8y-virtual-scroller-wrapper', template: "<ng-container *ngIf=\"items$ |async as items\" [ngSwitch]=\"strategy\">\n <ng-container *ngSwitchCase=\"'window'\">\n <cdk-virtual-scroll-viewport windowVirtualScrollStrategy [itemSizePx]=\"itemHeight\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\">\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'fixed'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.height]=\"containerHeight + 'px'\" class=\"inner-scroll\">\n <div *cdkVirtualFor=\"let item of items; index as i; trackBy: trackByFn\" >\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: item, index: i}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n </ng-container>\n</ng-container>\n" }]
|
|
5775
|
-
}], propDecorators: {
|
|
5789
|
+
}], ctorParameters: () => [], propDecorators: { virtualScrollViewport: [{
|
|
5790
|
+
type: ViewChild,
|
|
5791
|
+
args: [CdkVirtualScrollViewport]
|
|
5792
|
+
}], items: [{
|
|
5776
5793
|
type: Input
|
|
5777
5794
|
}], itemHeight: [{
|
|
5778
5795
|
type: Input
|