ng-virtual-list 19.7.11 → 19.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -599,7 +599,7 @@ Inputs
|
|
|
599
599
|
| items | [IVirtualListCollection](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/collection.model.ts) | Collection of list items. The collection of elements must be immutable. |
|
|
600
600
|
| itemSize | number? = 24 | If direction = 'vertical', then the height of a typical element. If direction = 'horizontal', then the width of a typical element. Ignored if the dynamicSize property is true. |
|
|
601
601
|
| bufferSize | number? = 2 | Number of elements outside the scope of visibility. Default value is 2. |
|
|
602
|
-
| maxBufferSize | number? =
|
|
602
|
+
| maxBufferSize | number? = 10 | Maximum number of elements outside the scope of visibility. Default value is 10. If maxBufferSize is set to be greater than bufferSize, then adaptive buffer mode is enabled. The greater the scroll size, the more elements are allocated for rendering. |
|
|
603
603
|
| itemRenderer | TemplateRef | Rendering element template. |
|
|
604
604
|
| methodForSelecting | [MethodForSelecting](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/enums/method-for-selecting.ts) | Method for selecting list items. Default value is 'none'. 'select' - List items are selected one by one. 'multi-select' - Multiple selection of list items. 'none' - List items are not selectable. |
|
|
605
605
|
| itemConfigMap | [IVirtualListItemConfigMap?](https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/models/item-config-map.model.ts) | Sets `sticky` position and `selectable` for the list item element. If `sticky` position is greater than `0`, then `sticky` position is applied. If the `sticky` value is greater than `0`, then the `sticky` position mode is enabled for the element. `1` - position start, `2` - position end. Default value is `0`. `selectable` determines whether an element can be selected or not. Default value is `true`. |
|
|
@@ -66,7 +66,7 @@ var SnappingMethods;
|
|
|
66
66
|
|
|
67
67
|
const DEFAULT_ITEM_SIZE = 24;
|
|
68
68
|
const DEFAULT_BUFFER_SIZE = 2;
|
|
69
|
-
const DEFAULT_MAX_BUFFER_SIZE =
|
|
69
|
+
const DEFAULT_MAX_BUFFER_SIZE = 10;
|
|
70
70
|
const DEFAULT_LIST_SIZE = 400;
|
|
71
71
|
const DEFAULT_SNAP = false;
|
|
72
72
|
const DEFAULT_SELECT_BY_CLICK = true;
|
|
@@ -165,6 +165,7 @@ class NgVirtualListService {
|
|
|
165
165
|
collapseByClick = DEFAULT_COLLAPSE_BY_CLICK;
|
|
166
166
|
_trackBox;
|
|
167
167
|
listElement = null;
|
|
168
|
+
collection = [];
|
|
168
169
|
constructor() {
|
|
169
170
|
this._$methodOfSelecting.pipe(takeUntilDestroyed(), tap(v => {
|
|
170
171
|
switch (v) {
|
|
@@ -208,6 +209,9 @@ class NgVirtualListService {
|
|
|
208
209
|
this.select(data);
|
|
209
210
|
}
|
|
210
211
|
}
|
|
212
|
+
update() {
|
|
213
|
+
this._trackBox?.changes();
|
|
214
|
+
}
|
|
211
215
|
/**
|
|
212
216
|
* Selects a list item
|
|
213
217
|
* @param data
|
|
@@ -299,6 +303,14 @@ class NgVirtualListService {
|
|
|
299
303
|
}
|
|
300
304
|
}
|
|
301
305
|
}
|
|
306
|
+
itemToFocus;
|
|
307
|
+
focus(element) {
|
|
308
|
+
element.focus({ preventScroll: true });
|
|
309
|
+
if (element.parentElement) {
|
|
310
|
+
const pos = parseFloat(element.parentElement?.getAttribute('position') ?? '0');
|
|
311
|
+
this.itemToFocus?.(element, pos);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
302
314
|
initialize(trackBox) {
|
|
303
315
|
this._trackBox = trackBox;
|
|
304
316
|
}
|
|
@@ -316,7 +328,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
316
328
|
}]
|
|
317
329
|
}], ctorParameters: () => [] });
|
|
318
330
|
|
|
319
|
-
const ATTR_AREA_SELECTED = 'area-selected', TABINDEX = 'index', KEY_SPACE = " ", KEY_ARR_LEFT = "ArrowLeft", KEY_ARR_UP = "ArrowUp", KEY_ARR_RIGHT = "ArrowRight", KEY_ARR_DOWN = "ArrowDown", EVENT_FOCUS_IN = 'focusin', EVENT_FOCUS_OUT = 'focusout', EVENT_KEY_DOWN = 'keydown';
|
|
331
|
+
const ATTR_AREA_SELECTED = 'area-selected', TABINDEX = 'ng-vl-index', KEY_SPACE = " ", KEY_ARR_LEFT = "ArrowLeft", KEY_ARR_UP = "ArrowUp", KEY_ARR_RIGHT = "ArrowRight", KEY_ARR_DOWN = "ArrowDown", EVENT_FOCUS_IN = 'focusin', EVENT_FOCUS_OUT = 'focusout', EVENT_KEY_DOWN = 'keydown';
|
|
332
|
+
const getElementByIndex = (index) => {
|
|
333
|
+
return `[${TABINDEX}="${index}"]`;
|
|
334
|
+
};
|
|
320
335
|
/**
|
|
321
336
|
* Virtual list item component
|
|
322
337
|
* @link https://github.com/DjonnyX/ng-virtual-list/blob/19.x/projects/ng-virtual-list/src/lib/components/ng-virtual-list-item.component.ts
|
|
@@ -473,20 +488,30 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
|
|
|
473
488
|
})).subscribe();
|
|
474
489
|
}
|
|
475
490
|
focusNext() {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
491
|
+
if (this._service.listElement) {
|
|
492
|
+
const tabIndex = this._data?.config?.tabIndex ?? 0, length = this._service.collection?.length ?? 0;
|
|
493
|
+
let index = tabIndex;
|
|
494
|
+
while (index <= length) {
|
|
495
|
+
index++;
|
|
496
|
+
const el = this._service.listElement.querySelector(getElementByIndex(index));
|
|
497
|
+
if (el) {
|
|
498
|
+
this._service.focus(el);
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
481
501
|
}
|
|
482
502
|
}
|
|
483
503
|
}
|
|
484
504
|
focusPrev() {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
505
|
+
if (this._service.listElement) {
|
|
506
|
+
const tabIndex = this._data?.config?.tabIndex ?? 0;
|
|
507
|
+
let index = tabIndex;
|
|
508
|
+
while (index >= 0) {
|
|
509
|
+
index--;
|
|
510
|
+
const el = this._service.listElement.querySelector(getElementByIndex(index));
|
|
511
|
+
if (el) {
|
|
512
|
+
this._service.focus(el);
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
490
515
|
}
|
|
491
516
|
}
|
|
492
517
|
}
|
|
@@ -505,6 +530,7 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
|
|
|
505
530
|
const styles = this._elementRef.nativeElement.style;
|
|
506
531
|
styles.zIndex = data.config.zIndex;
|
|
507
532
|
if (data.config.snapped) {
|
|
533
|
+
this._elementRef.nativeElement.setAttribute('position', data.config.sticky === 1 ? '0' : `${data.config.isVertical ? data.measures.y : data.measures.x}`);
|
|
508
534
|
styles.transform = data.config.sticky === 1 ? ZEROS_TRANSLATE_3D : `${TRANSLATE_3D}(${data.config.isVertical ? 0 : data.measures.x}${PX}, ${data.config.isVertical ? data.measures.y : 0}${PX} , 0)`;
|
|
509
535
|
;
|
|
510
536
|
if (!data.config.isSnappingMethodAdvanced) {
|
|
@@ -514,9 +540,11 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
|
|
|
514
540
|
else {
|
|
515
541
|
styles.position = POSITION_ABSOLUTE;
|
|
516
542
|
if (regular) {
|
|
543
|
+
this._elementRef.nativeElement.setAttribute('position', '0');
|
|
517
544
|
styles.transform = `${TRANSLATE_3D}(${data.config.isVertical ? 0 : data.measures.delta}${PX}, ${data.config.isVertical ? data.measures.delta : 0}${PX} , 0)`;
|
|
518
545
|
}
|
|
519
546
|
else {
|
|
547
|
+
this._elementRef.nativeElement.setAttribute('position', `${data.config.isVertical ? data.measures.y : data.measures.x}`);
|
|
520
548
|
styles.transform = `${TRANSLATE_3D}(${data.config.isVertical ? 0 : data.measures.x}${PX}, ${data.config.isVertical ? data.measures.y : 0}${PX} , 0)`;
|
|
521
549
|
}
|
|
522
550
|
}
|
|
@@ -587,14 +615,14 @@ class NgVirtualListItemComponent extends BaseVirtualListItemComponent {
|
|
|
587
615
|
this._service.itemClick(this._data);
|
|
588
616
|
}
|
|
589
617
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
590
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgVirtualListItemComponent, isStandalone: true, selector: "ng-virtual-list-item", host: { attributes: { "role": "listitem" }, classAttribute: "ngvl__item" }, usesInheritance: true, ngImport: i0, template: "@let item = data();\r\n@let _config = config();\r\n@let _part = part();\r\n@let _measures = measures();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n <div #listItem [part]=\"_part\" [attr.index]=\"
|
|
618
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgVirtualListItemComponent, isStandalone: true, selector: "ng-virtual-list-item", host: { attributes: { "role": "listitem" }, classAttribute: "ngvl__item" }, usesInheritance: true, ngImport: i0, template: "@let item = data();\r\n@let _config = config();\r\n@let _part = part();\r\n@let _measures = measures();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n <div #listItem [part]=\"_part\" [attr.ng-vl-index]=\"_config.tabIndex || -1\" tabindex=\"0\" class=\"ngvl-item__container\"\r\n [ngClass]=\"{'snapped': item.config.snapped, 'snapped-out': item.config.snappedOut, 'focus': focus()}\" (click)=\"onClickHandler()\">\r\n @if (renderer) {\r\n <ng-container [ngTemplateOutlet]=\"renderer\"\r\n [ngTemplateOutletContext]=\"{data: item.data, measures: _measures, config: _config}\" />\r\n }\r\n </div>\r\n}", styles: [":host{display:block;position:absolute;left:0;top:0;box-sizing:border-box;overflow:hidden}.ngvl-item__container{margin:0;padding:0;overflow:hidden;background-color:#fff;width:inherit;height:inherit;box-sizing:border-box}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
591
619
|
}
|
|
592
620
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListItemComponent, decorators: [{
|
|
593
621
|
type: Component,
|
|
594
622
|
args: [{ selector: 'ng-virtual-list-item', imports: [CommonModule], host: {
|
|
595
623
|
'class': 'ngvl__item',
|
|
596
624
|
'role': 'listitem',
|
|
597
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let item = data();\r\n@let _config = config();\r\n@let _part = part();\r\n@let _measures = measures();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n <div #listItem [part]=\"_part\" [attr.index]=\"
|
|
625
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let item = data();\r\n@let _config = config();\r\n@let _part = part();\r\n@let _measures = measures();\r\n@let renderer = itemRenderer();\r\n\r\n@if (item) {\r\n <div #listItem [part]=\"_part\" [attr.ng-vl-index]=\"_config.tabIndex || -1\" tabindex=\"0\" class=\"ngvl-item__container\"\r\n [ngClass]=\"{'snapped': item.config.snapped, 'snapped-out': item.config.snappedOut, 'focus': focus()}\" (click)=\"onClickHandler()\">\r\n @if (renderer) {\r\n <ng-container [ngTemplateOutlet]=\"renderer\"\r\n [ngTemplateOutletContext]=\"{data: item.data, measures: _measures, config: _config}\" />\r\n }\r\n </div>\r\n}", styles: [":host{display:block;position:absolute;left:0;top:0;box-sizing:border-box;overflow:hidden}.ngvl-item__container{margin:0;padding:0;overflow:hidden;background-color:#fff;width:inherit;height:inherit;box-sizing:border-box}\n"] }]
|
|
598
626
|
}], ctorParameters: () => [] });
|
|
599
627
|
|
|
600
628
|
/**
|
|
@@ -1017,22 +1045,26 @@ class Tracker {
|
|
|
1017
1045
|
snapedComponent.instance.show();
|
|
1018
1046
|
}
|
|
1019
1047
|
}
|
|
1020
|
-
comp.instance.item = item;
|
|
1021
1048
|
if (snapedComponent) {
|
|
1022
1049
|
if (item['config']['snapped'] || item['config']['snappedOut']) {
|
|
1050
|
+
comp.instance.item = null;
|
|
1023
1051
|
comp.instance.hide();
|
|
1024
1052
|
}
|
|
1025
1053
|
else {
|
|
1054
|
+
comp.instance.item = item;
|
|
1026
1055
|
comp.instance.show();
|
|
1027
1056
|
}
|
|
1028
1057
|
}
|
|
1029
1058
|
else {
|
|
1059
|
+
comp.instance.item = item;
|
|
1030
1060
|
comp.instance.show();
|
|
1031
1061
|
}
|
|
1032
1062
|
untrackedItems.splice(indexByUntrackedItems, 1);
|
|
1033
1063
|
continue;
|
|
1034
1064
|
}
|
|
1035
1065
|
}
|
|
1066
|
+
}
|
|
1067
|
+
else {
|
|
1036
1068
|
this._trackMap.delete(itemTrackingProperty);
|
|
1037
1069
|
}
|
|
1038
1070
|
}
|
|
@@ -1041,9 +1073,8 @@ class Tracker {
|
|
|
1041
1073
|
}
|
|
1042
1074
|
}
|
|
1043
1075
|
for (let i = 0, l = newTrackItems.length; i < l; i++) {
|
|
1044
|
-
const item = newTrackItems[i], itemTrackingProperty = item[idPropName];
|
|
1045
1076
|
if (untrackedItems.length > 0) {
|
|
1046
|
-
const comp = untrackedItems.shift(), item =
|
|
1077
|
+
const comp = untrackedItems.shift(), item = newTrackItems[i], itemTrackingProperty = item[idPropName];
|
|
1047
1078
|
if (comp) {
|
|
1048
1079
|
if (snapedComponent) {
|
|
1049
1080
|
if (item['config']['snapped'] || item['config']['snappedOut']) {
|
|
@@ -1052,16 +1083,18 @@ class Tracker {
|
|
|
1052
1083
|
snapedComponent.instance.show();
|
|
1053
1084
|
}
|
|
1054
1085
|
}
|
|
1055
|
-
comp.instance.item = item;
|
|
1056
1086
|
if (snapedComponent) {
|
|
1057
1087
|
if (item['config']['snapped'] || item['config']['snappedOut']) {
|
|
1088
|
+
comp.instance.item = null;
|
|
1058
1089
|
comp.instance.hide();
|
|
1059
1090
|
}
|
|
1060
1091
|
else {
|
|
1092
|
+
comp.instance.item = item;
|
|
1061
1093
|
comp.instance.show();
|
|
1062
1094
|
}
|
|
1063
1095
|
}
|
|
1064
1096
|
else {
|
|
1097
|
+
comp.instance.item = item;
|
|
1065
1098
|
comp.instance.show();
|
|
1066
1099
|
}
|
|
1067
1100
|
if (this._trackMap) {
|
|
@@ -1073,6 +1106,7 @@ class Tracker {
|
|
|
1073
1106
|
if (untrackedItems.length) {
|
|
1074
1107
|
for (let i = 0, l = untrackedItems.length; i < l; i++) {
|
|
1075
1108
|
const comp = untrackedItems[i];
|
|
1109
|
+
comp.instance.item = null;
|
|
1076
1110
|
comp.instance.hide();
|
|
1077
1111
|
}
|
|
1078
1112
|
}
|
|
@@ -1757,7 +1791,7 @@ class TrackBox extends CacheMap {
|
|
|
1757
1791
|
snappedOut: false,
|
|
1758
1792
|
dynamic: dynamicSize,
|
|
1759
1793
|
isSnappingMethodAdvanced,
|
|
1760
|
-
tabIndex:
|
|
1794
|
+
tabIndex: items.length,
|
|
1761
1795
|
zIndex: '1',
|
|
1762
1796
|
};
|
|
1763
1797
|
const itemData = items[i];
|
|
@@ -1765,7 +1799,6 @@ class TrackBox extends CacheMap {
|
|
|
1765
1799
|
endStickyItemIndex = i;
|
|
1766
1800
|
endStickyItemSize = size;
|
|
1767
1801
|
displayItems.push(endStickyItem);
|
|
1768
|
-
count++;
|
|
1769
1802
|
break;
|
|
1770
1803
|
}
|
|
1771
1804
|
}
|
|
@@ -1801,6 +1834,7 @@ class TrackBox extends CacheMap {
|
|
|
1801
1834
|
tabIndex: count,
|
|
1802
1835
|
zIndex: '0',
|
|
1803
1836
|
};
|
|
1837
|
+
count++;
|
|
1804
1838
|
if (snapped) {
|
|
1805
1839
|
config.zIndex = '2';
|
|
1806
1840
|
}
|
|
@@ -1823,7 +1857,6 @@ class TrackBox extends CacheMap {
|
|
|
1823
1857
|
nextEndSticky.measures.delta = isVertical ? (item.measures.y - scrollSize) : (item.measures.x - scrollSize);
|
|
1824
1858
|
}
|
|
1825
1859
|
displayItems.push(item);
|
|
1826
|
-
count++;
|
|
1827
1860
|
}
|
|
1828
1861
|
renderItems -= 1;
|
|
1829
1862
|
pos += size;
|
|
@@ -2178,6 +2211,14 @@ class NgVirtualListComponent {
|
|
|
2178
2211
|
this._scrollSize.set(actualScrollSize);
|
|
2179
2212
|
}
|
|
2180
2213
|
};
|
|
2214
|
+
itemToFocus = (element, position) => {
|
|
2215
|
+
const container = this._container()?.nativeElement;
|
|
2216
|
+
if (container) {
|
|
2217
|
+
const { width, height } = this._bounds(), { width: elementWidth, height: elementHeight } = element.getBoundingClientRect(), isVertical = this._isVertical, pos = isVertical ? position - (height - elementHeight) * .5 : position - (width - elementWidth) * .5;
|
|
2218
|
+
const params = { [this._isVertical ? TOP_PROP_NAME : LEFT_PROP_NAME]: pos, behavior: 'instant' };
|
|
2219
|
+
container.scrollTo(params);
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2181
2222
|
_elementRef = inject((ElementRef));
|
|
2182
2223
|
_initialized;
|
|
2183
2224
|
$initialized;
|
|
@@ -2206,6 +2247,7 @@ class NgVirtualListComponent {
|
|
|
2206
2247
|
? 0 : NgVirtualListComponent.__nextId + 1;
|
|
2207
2248
|
this._id = NgVirtualListComponent.__nextId;
|
|
2208
2249
|
this._service.initialize(this._trackBox);
|
|
2250
|
+
this._service.itemToFocus = this.itemToFocus;
|
|
2209
2251
|
this._initialized = signal(false);
|
|
2210
2252
|
this.$initialized = toObservable(this._initialized);
|
|
2211
2253
|
this._trackBox.displayComponents = this._displayComponents;
|
|
@@ -2296,6 +2338,7 @@ class NgVirtualListComponent {
|
|
|
2296
2338
|
bounds: { width, height }, dynamicSize, isVertical, itemSize,
|
|
2297
2339
|
bufferSize, maxBufferSize, scrollSize: actualScrollSize, snap, enabledBufferOptimization,
|
|
2298
2340
|
}, { displayItems, totalSize } = this._trackBox.updateCollection(items, itemConfigMap, opts);
|
|
2341
|
+
this._service.collection = displayItems;
|
|
2299
2342
|
this.resetBoundsSize(isVertical, totalSize);
|
|
2300
2343
|
this.createDisplayComponentsIfNeed(displayItems);
|
|
2301
2344
|
this.tracking();
|
|
@@ -2499,6 +2542,7 @@ class NgVirtualListComponent {
|
|
|
2499
2542
|
const { displayItems, totalSize } = this._trackBox.updateCollection(items, itemConfigMap, {
|
|
2500
2543
|
...opts, scrollSize, fromItemId: isLastIteration ? undefined : id,
|
|
2501
2544
|
}), delta = this._trackBox.delta;
|
|
2545
|
+
this._service.collection = displayItems;
|
|
2502
2546
|
this._trackBox.clearDelta();
|
|
2503
2547
|
let actualScrollSize = scrollSize + delta;
|
|
2504
2548
|
this.resetBoundsSize(isVertical, totalSize);
|
|
@@ -2616,11 +2660,13 @@ class NgVirtualListComponent {
|
|
|
2616
2660
|
}
|
|
2617
2661
|
}
|
|
2618
2662
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2619
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgVirtualListComponent, isStandalone: true, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, 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 }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse" }, providers: [NgVirtualListService], viewQueries: [{ propertyName: "_snappedContainer", first: true, predicate: ["snapped"], descendants: true, isSignal: true }, { propertyName: "_container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "_list", first: true, predicate: ["list"], 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: "@if (snap()) {\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n}\r\n<div #container part=\"scroller\" class=\"ngvl__scroller\">\r\n <div [attr.aria-orientation]=\"orientation\" #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </div>\r\n</div>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.horizontal) .ngvl__list{display:inline-flex}:host(.horizontal) .ngvl__scroller{overflow:auto hidden}:host(.vertical) .ngvl__scroller{overflow:hidden auto}:host(.vertical){height:320px}.ngvl__scroller{overflow:auto;width:100%;height:100%}.ngvl__list-snapper{pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
2663
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgVirtualListComponent, isStandalone: true, selector: "ng-virtual-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, 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 }, enabledBufferOptimization: { classPropertyName: "enabledBufferOptimization", publicName: "enabledBufferOptimization", isSignal: true, isRequired: false, transformFunction: null }, itemRenderer: { classPropertyName: "itemRenderer", publicName: "itemRenderer", isSignal: true, isRequired: true, transformFunction: null }, itemConfigMap: { classPropertyName: "itemConfigMap", publicName: "itemConfigMap", isSignal: true, isRequired: false, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, dynamicSize: { classPropertyName: "dynamicSize", publicName: "dynamicSize", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, bufferSize: { classPropertyName: "bufferSize", publicName: "bufferSize", isSignal: true, isRequired: false, transformFunction: null }, maxBufferSize: { classPropertyName: "maxBufferSize", publicName: "maxBufferSize", isSignal: true, isRequired: false, transformFunction: null }, snappingMethod: { classPropertyName: "snappingMethod", publicName: "snappingMethod", isSignal: true, isRequired: false, transformFunction: null }, methodForSelecting: { classPropertyName: "methodForSelecting", publicName: "methodForSelecting", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onScroll: "onScroll", onScrollEnd: "onScrollEnd", onViewportChange: "onViewportChange", onItemClick: "onItemClick", onSelect: "onSelect", onCollapse: "onCollapse" }, host: { styleAttribute: "position: relative;" }, providers: [NgVirtualListService], viewQueries: [{ propertyName: "_snappedContainer", first: true, predicate: ["snapped"], descendants: true, isSignal: true }, { propertyName: "_container", first: true, predicate: ["container"], descendants: true, isSignal: true }, { propertyName: "_list", first: true, predicate: ["list"], 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: "@if (snap()) {\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n}\r\n<div #container part=\"scroller\" class=\"ngvl__scroller\">\r\n <div [attr.aria-orientation]=\"orientation\" #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </div>\r\n</div>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.horizontal) .ngvl__list{display:inline-flex}:host(.horizontal) .ngvl__scroller{overflow:auto hidden}:host(.vertical) .ngvl__scroller{overflow:hidden auto}:host(.vertical){height:320px}.ngvl__scroller{overflow:auto;width:100%;height:100%}.ngvl__list-snapper{pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.ShadowDom });
|
|
2620
2664
|
}
|
|
2621
2665
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgVirtualListComponent, decorators: [{
|
|
2622
2666
|
type: Component,
|
|
2623
|
-
args: [{ selector: 'ng-virtual-list', imports: [CommonModule],
|
|
2667
|
+
args: [{ selector: 'ng-virtual-list', imports: [CommonModule], host: {
|
|
2668
|
+
'style': 'position: relative;'
|
|
2669
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.ShadowDom, providers: [NgVirtualListService], template: "@if (snap()) {\r\n <div #snapped part=\"snapped-item\" class=\"ngvl__list-snapper\">\r\n <ng-container #snapRendererContainer></ng-container>\r\n </div>\r\n}\r\n<div #container part=\"scroller\" class=\"ngvl__scroller\">\r\n <div [attr.aria-orientation]=\"orientation\" #list part=\"list\" class=\"ngvl__list\">\r\n <ng-container #renderersContainer></ng-container>\r\n </div>\r\n</div>", styles: [":host{position:relative;display:block;width:400px;overflow:hidden}:host(.horizontal){height:48px}:host(.horizontal) .ngvl__list{display:inline-flex}:host(.horizontal) .ngvl__scroller{overflow:auto hidden}:host(.vertical) .ngvl__scroller{overflow:hidden auto}:host(.vertical){height:320px}.ngvl__scroller{overflow:auto;width:100%;height:100%}.ngvl__list-snapper{pointer-events:none;position:absolute;list-style:none;left:0;top:0;z-index:1}.ngvl__list{position:relative;list-style:none;padding:0;margin:0;width:100%;height:100%}\n"] }]
|
|
2624
2670
|
}], ctorParameters: () => [], propDecorators: { _listContainerRef: [{
|
|
2625
2671
|
type: ViewChild,
|
|
2626
2672
|
args: ['renderersContainer', { read: ViewContainerRef }]
|