@progress/kendo-angular-grid 19.3.1-develop.3 → 20.0.0-develop.1

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.
Files changed (42) hide show
  1. package/codemods/template-transformer/index.js +94 -0
  2. package/codemods/utils.js +553 -0
  3. package/codemods/v20/grid-kendogridgroupbinding.js +51 -0
  4. package/common/provider.service.d.ts +3 -2
  5. package/databinding.directive.d.ts +0 -3
  6. package/directives.d.ts +3 -4
  7. package/esm2022/common/error-messages.mjs +0 -6
  8. package/esm2022/common/provider.service.mjs +1 -0
  9. package/esm2022/data/data.iterators.mjs +0 -7
  10. package/esm2022/databinding.directive.mjs +4 -4
  11. package/esm2022/directives.mjs +0 -3
  12. package/esm2022/grid.component.mjs +63 -31
  13. package/esm2022/grid.module.mjs +15 -16
  14. package/esm2022/grouping/group-header.component.mjs +6 -3
  15. package/esm2022/index.mjs +0 -1
  16. package/esm2022/navigation/navigation-metadata.mjs +4 -2
  17. package/esm2022/navigation/navigation.service.mjs +4 -2
  18. package/esm2022/package-metadata.mjs +2 -2
  19. package/esm2022/pdf/pdf.component.mjs +16 -0
  20. package/esm2022/pdf/pdf.service.mjs +1 -0
  21. package/esm2022/rendering/list.component.mjs +188 -92
  22. package/esm2022/rendering/table-body.component.mjs +19 -5
  23. package/esm2022/scrolling/row-height.service.mjs +23 -65
  24. package/esm2022/scrolling/scroller.service.mjs +175 -35
  25. package/fesm2022/progress-kendo-angular-grid.mjs +508 -588
  26. package/grid.component.d.ts +6 -6
  27. package/grid.module.d.ts +14 -15
  28. package/grouping/group-header.component.d.ts +1 -1
  29. package/index.d.ts +0 -2
  30. package/navigation/navigation-metadata.d.ts +2 -1
  31. package/package.json +36 -21
  32. package/pdf/pdf.component.d.ts +1 -0
  33. package/pdf/pdf.service.d.ts +1 -0
  34. package/rendering/list.component.d.ts +11 -5
  35. package/rendering/table-body.component.d.ts +3 -2
  36. package/schematics/ngAdd/index.js +4 -4
  37. package/scrolling/row-height.service.d.ts +3 -8
  38. package/scrolling/scroller.service.d.ts +35 -9
  39. package/esm2022/grouping/group-scroll-binding.directive.mjs +0 -347
  40. package/esm2022/grouping/virtual-group-result.interface.mjs +0 -5
  41. package/grouping/group-scroll-binding.directive.d.ts +0 -85
  42. package/grouping/virtual-group-result.interface.d.ts +0 -18
@@ -76,8 +76,8 @@ export const SCROLLER_FACTORY_TOKEN = new InjectionToken('grid-scroll-service-fa
76
76
  /**
77
77
  * @hidden
78
78
  */
79
- export function DEFAULT_SCROLLER_FACTORY(observable) {
80
- return new ScrollerService(observable);
79
+ export function DEFAULT_SCROLLER_FACTORY(observable, ctx) {
80
+ return new ScrollerService(observable, ctx);
81
81
  }
82
82
  const wheelDeltaY = (e) => {
83
83
  const deltaY = e.wheelDeltaY;
@@ -94,7 +94,7 @@ const preventLockedScroll = (args, element) => {
94
94
  const scrollTop = element.scrollTop;
95
95
  const allowScroll = (scrollTop === 0 && 0 < delta) || (element.scrollHeight <= element.offsetHeight + scrollTop && delta < 0);
96
96
  if (!allowScroll) {
97
- event.preventDefault();
97
+ args.preventDefault();
98
98
  }
99
99
  };
100
100
  const translateY = (renderer, value) => el => renderer.setStyle(el, "transform", `translateY(${value}px)`);
@@ -150,9 +150,9 @@ export class ListComponent {
150
150
  contentScroll = new EventEmitter();
151
151
  pageChange = new EventEmitter();
152
152
  scrollBottom = new EventEmitter();
153
- totalHeight;
154
153
  columnsStartIdx = 0;
155
154
  allItems = [];
155
+ itemsToRender = [];
156
156
  get showFooter() {
157
157
  return this.groupable && this.groupable.showFooter;
158
158
  }
@@ -178,6 +178,7 @@ export class ListComponent {
178
178
  columnsEndIdx;
179
179
  viewportColumnsWidth;
180
180
  scrollLeft = 0;
181
+ virtualPageSize;
181
182
  observer;
182
183
  get lockedLeafColumns() {
183
184
  return this.columns.lockedLeafColumns;
@@ -211,6 +212,8 @@ export class ListComponent {
211
212
  columnUpdateFrame;
212
213
  hasLockedContainer;
213
214
  minRowHeight;
215
+ handleSkipOnData = false;
216
+ scrollToIndex = null;
214
217
  constructor(scrollerFactory, detailsService, changeNotification, suspendService, groupsService, ngZone, renderer, scrollSyncService, resizeService, editService, supportService, navigationService, scrollRequestService, ctx, columnResizingService, changeDetector, pdfService, columnInfo, dataMappingService) {
215
218
  this.changeNotification = changeNotification;
216
219
  this.suspendService = suspendService;
@@ -228,14 +231,24 @@ export class ListComponent {
228
231
  this.pdfService = pdfService;
229
232
  this.columnInfo = columnInfo;
230
233
  this.dataMappingService = dataMappingService;
231
- this.scroller = scrollerFactory(this.dispatcher);
232
- this.subscriptions = detailsService.changes.subscribe(x => this.detailExpand(x));
234
+ this.scroller = this.ctx.scroller = scrollerFactory(this.dispatcher, this.ctx);
235
+ this.subscriptions = detailsService.changes.subscribe(() => this.detailExpand());
233
236
  this.subscriptions.add(scrollRequestService.requests.subscribe(req => isPresent(req.adjustIndex) ? this.scrollTo(req.request, req.adjustIndex) : this.scrollToItem(req.request)));
237
+ this.subscriptions.add(this.pdfService.restoreDOMVirtualization.subscribe(() => {
238
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
239
+ this.init();
240
+ this.setScrollerOptions();
241
+ this.scroller.update();
242
+ });
243
+ }));
234
244
  }
235
245
  ngOnInit() {
236
246
  this.minRowHeight = this.isVirtual ? this.rowHeight || calcRowHeight(this.table.nativeElement) : this.rowHeight;
237
247
  this.init();
238
248
  this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowSync.bind(this)));
249
+ this.subscriptions.add(this.groupsService.changes.subscribe(() => {
250
+ this.skipScroll = this.isVirtual;
251
+ }));
239
252
  this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowNavigationLocked.bind(this)));
240
253
  this.subscriptions.add(merge(this.columns.changes, this.resizeService.changes).subscribe(() => {
241
254
  if (this.virtualColumns) {
@@ -254,48 +267,110 @@ export class ListComponent {
254
267
  const changesInSkip = changes['skip'];
255
268
  const hasInitialSkip = changesInSkip && changesInSkip.firstChange && changesInSkip.currentValue > 0;
256
269
  if (hasInitialSkip) {
257
- this.handleInitialScrollToSkip();
270
+ this.handleSkipOnData = true;
271
+ }
272
+ if (isChanged('isVirtual', changes)) {
273
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
274
+ this.scroller.reset();
275
+ this.rowHeightService = this.scroller.rowHeightService = new RowHeightService(this.total, this.rowHeight || this.minRowHeight);
276
+ this.setScrollerOptions();
277
+ this.scroller.update();
278
+ });
258
279
  }
259
280
  if (isChanged("skip", changes) && !this.rebind) {
260
281
  this.skipScroll = true;
261
- this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
282
+ this.container.nativeElement.scrollTop = (this.isVirtual && this.ctx.grid?.pageable) ? 0 : this.rowHeightService.offset(this.skip);
262
283
  }
263
284
  if (anyChanged(['total', 'take'], changes)) {
264
285
  this.init();
265
286
  }
266
287
  this.rebind = false;
267
288
  }
289
+ zoneSub;
290
+ get totalIsAllItems() {
291
+ return this.isVirtual && (Boolean(this.ctx.grid?.pageable || this.ctx.grid?.group?.length));
292
+ }
268
293
  ngDoCheck() {
269
294
  if (this.virtualColumns && (!this.viewportColumns || this.viewportWidthChange())) {
270
295
  this.updateViewportColumns();
271
296
  }
272
- const shouldCalculatePageSize = isDocumentAvailable() && this.isVirtual && this.ctx.grid && !isPresent(this.ctx.grid.pageSize);
273
- if (shouldCalculatePageSize) {
274
- const calculatedPageSize = this.calcVirtualPageSize();
297
+ if (!isPresent(this.virtualPageSize) && !this.ctx.grid?.pageable && isPresent(this.ctx.grid?.pageSize)) {
298
+ this.virtualPageSize = this.ctx.grid.pageSize;
299
+ }
300
+ const shouldCalculatePageSize = isDocumentAvailable() && this.isVirtual && !isPresent(this.virtualPageSize) && (!isPresent(this.ctx.grid?.pageSize) || this.ctx.grid?.pageable);
301
+ const previousTotal = this.allItems.length;
302
+ this.allItems = this.dataMappingService.dataMapper(this.data, this.nonLockedColumnsToRender, this.lockedLeafColumns, this.detailTemplate, this.showFooter);
303
+ if (!this.isVirtual || (this.isVirtual && !this.ctx.grid?.pageable && !this.ctx.grid?.group?.length)) {
304
+ this.itemsToRender = this.allItems;
305
+ }
306
+ const totalChanged = previousTotal !== this.allItems.length;
307
+ if (this.totalIsAllItems && totalChanged) {
308
+ this.scroller.reset(this.skipScroll);
309
+ this.scroller.total = this.allItems.length;
310
+ }
311
+ if (shouldCalculatePageSize || !isPresent(this.scroller.rowHeightService)) {
312
+ const calculatedPageSize = this.virtualPageSize ?? this.calcVirtualPageSize();
275
313
  if (calculatedPageSize > 0) {
276
314
  this.ngZone.onStable.pipe(take(1)).subscribe(() => {
277
- this.ctx.grid.pageSize = calculatedPageSize;
278
- this.ngZone.run(() => {
279
- this.pageChange.emit({
280
- skip: this.skip || 0,
281
- take: calculatedPageSize
315
+ if (!isPresent(this.ctx.grid?.pageSize)) {
316
+ this.ctx.grid.pageSize = calculatedPageSize;
317
+ this.ngZone.run(() => {
318
+ this.pageChange.emit({
319
+ skip: this.skip || 0,
320
+ take: calculatedPageSize
321
+ });
282
322
  });
283
- });
323
+ }
324
+ if (this.ctx.grid?.pageable || this.ctx.grid?.group?.length) {
325
+ this.virtualPageSize = this.scroller.virtualPageSize = calculatedPageSize;
326
+ this.ngZone.run(() => this.itemsToRender = this.allItems.slice(this.scroller.virtualSkip, this.scroller.virtualSkip + this.virtualPageSize));
327
+ }
284
328
  });
285
329
  }
286
330
  }
287
- this.allItems = this.dataMappingService.dataMapper(this.data, this.nonLockedColumnsToRender, this.lockedLeafColumns, this.detailTemplate, this.showFooter);
331
+ if (!this.zoneSub) {
332
+ this.zoneSub = this.ngZone.onStable.subscribe(() => {
333
+ if (!this.scroller.rowHeightService) {
334
+ const total = this.isVirtual && (this.ctx.grid?.pageable || this.ctx.grid?.group?.length) ? this.allItems.length : this.total;
335
+ this.scroller.rowHeightService = this.rowHeightService = new RowHeightService(total, this.rowHeight || this.minRowHeight);
336
+ }
337
+ if (this.allItems.length && this.handleSkipOnData && this.isVirtual && this.skip > 0 && this.total > 0) {
338
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => {
339
+ this.scroller.adjustScroll(this.scroller.rowHeightService.offset(this.skip), true);
340
+ this.handleSkipOnData = false;
341
+ });
342
+ }
343
+ if (this.isVirtual && this.ctx.grid?.group?.length && this.scroller.total !== this.allItems.length) {
344
+ this.scroller.total = this.allItems.length;
345
+ this.rowHeightService = this.scroller.rowHeightService = new RowHeightService(this.scroller.total, this.rowHeight || this.minRowHeight);
346
+ }
347
+ this.isVirtual && this.scroller.update();
348
+ // Item outside of the viewport is scrolled to programmatically.
349
+ // RowHeightService offset for given index still may not match the current scrollTop
350
+ // depending on the varying row heights, so we need to adjust the scroll position.
351
+ if (isPresent(this.scrollToIndex)) {
352
+ const offset = this.scroller.rowHeightService.offset(this.scrollToIndex);
353
+ if (offset > this.container.nativeElement.scrollTop) {
354
+ this.scroller.adjustScroll(offset - this.container.nativeElement.scrollTop);
355
+ }
356
+ this.scrollToIndex = null;
357
+ }
358
+ if (this.isVirtual) {
359
+ this.ctx.grid?.updateNavigationMetadata();
360
+ this.resetNavigationViewport();
361
+ }
362
+ this.zoneSub.unsubscribe();
363
+ this.zoneSub = null;
364
+ });
365
+ }
288
366
  }
289
367
  ngAfterViewInit() {
290
368
  if (!isDocumentAvailable()) {
291
369
  return;
292
370
  }
293
- if (this.skip && this.isVirtual) {
294
- this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip);
295
- }
296
- this.resetNavigationViewport();
297
371
  this.attachContainerScroll();
298
372
  this.initResizeService();
373
+ this.setScrollerOptions();
299
374
  }
300
375
  ngAfterViewChecked() {
301
376
  const isLocked = this.isLocked;
@@ -313,6 +388,10 @@ export class ListComponent {
313
388
  if (this.subscriptions) {
314
389
  this.subscriptions.unsubscribe();
315
390
  }
391
+ if (this.zoneSub) {
392
+ this.zoneSub.unsubscribe();
393
+ this.zoneSub = null;
394
+ }
316
395
  if (this.resizeService) {
317
396
  this.resizeService.destroy();
318
397
  }
@@ -323,10 +402,16 @@ export class ListComponent {
323
402
  if (this.suspendService.scroll) {
324
403
  return;
325
404
  }
326
- this.rowHeightService = new RowHeightService(this.total, this.rowHeight || this.minRowHeight, this.detailRowHeight);
327
- this.totalHeight = this.rowHeightService.totalHeight();
405
+ const total = this.isVirtual && this.ctx.grid?.pageable ? this.ctx.grid.pageSize : this.total;
406
+ this.rowHeightService = this.scroller.rowHeightService = new RowHeightService(total, this.rowHeight || this.minRowHeight);
328
407
  if (!isUniversal()) {
329
- this.ngZone.runOutsideAngular(this.createScroller.bind(this));
408
+ if (this.skipScroll) {
409
+ this.setScrollerOptions();
410
+ this.scroller.update();
411
+ }
412
+ else {
413
+ this.ngZone.runOutsideAngular(this.createScroller.bind(this));
414
+ }
330
415
  }
331
416
  }
332
417
  lockedScroll() {
@@ -390,14 +475,47 @@ export class ListComponent {
390
475
  get isStacked() {
391
476
  return this.ctx.grid?.isStacked;
392
477
  }
393
- detailExpand({ index, expand }) {
394
- if (expand) {
395
- this.rowHeightService.expandDetail(index);
478
+ resetNavigationViewport() {
479
+ if (!isDocumentAvailable) {
480
+ return;
396
481
  }
397
- else {
398
- this.rowHeightService.collapseDetail(index);
482
+ if (this.skipScroll || this.scroller.scrollSyncing) {
483
+ this.ngZone.runOutsideAngular(() => {
484
+ setTimeout(() => {
485
+ this.skipScroll = this.scroller.scrollSyncing = false;
486
+ });
487
+ });
488
+ return;
489
+ }
490
+ if (!this.container || !this.navigationService.tableEnabled ||
491
+ !this.navigationService.needsViewport() || this.allItems.length === 0) {
492
+ return;
399
493
  }
400
- this.totalHeight = this.rowHeightService.totalHeight();
494
+ const { scrollTop, offsetHeight } = this.container.nativeElement;
495
+ const scrollBottom = scrollTop + offsetHeight;
496
+ const firstItemIndex = this.rowHeightService.index(scrollTop);
497
+ const lastItemIndex = this.rowHeightService.index(scrollBottom);
498
+ const lastItemOffset = this.rowHeightService.offset(lastItemIndex);
499
+ let viewportStart = firstItemIndex;
500
+ let viewportEnd = lastItemIndex;
501
+ if (isPresent(this.detailTemplate)) {
502
+ viewportStart *= 2;
503
+ viewportEnd *= 2;
504
+ const firstItemHeight = this.rowHeightService.offset(firstItemIndex);
505
+ if (firstItemHeight + this.rowHeight < scrollTop) {
506
+ viewportStart++;
507
+ }
508
+ const lastItemHeight = this.rowHeightService.height(lastItemIndex);
509
+ const lastItemExpanded = this.scroller.isExpanded(lastItemIndex);
510
+ const lastItemDetailOverflows = lastItemOffset + lastItemHeight > scrollBottom;
511
+ if (lastItemExpanded && !lastItemDetailOverflows) {
512
+ viewportEnd++;
513
+ }
514
+ }
515
+ const offset = this.isVirtual && this.ctx.grid?.pageable ? this.skip : 0;
516
+ this.navigationService.setViewport(viewportStart + offset, viewportEnd + offset);
517
+ }
518
+ detailExpand() {
401
519
  this.resetNavigationViewport();
402
520
  }
403
521
  attachContainerScroll() {
@@ -441,12 +559,16 @@ export class ListComponent {
441
559
  this.scrollerSubscription.add(observable.pipe(filter((x) => x instanceof ScrollBottomAction))
442
560
  .subscribe(() => this.scrollBottom.emit()));
443
561
  }
444
- scroll({ offset = 0 }) {
562
+ scroll(scrollActionArgs) {
563
+ this.skipScroll = false;
445
564
  if (this.isVirtual) {
446
565
  [
447
566
  maybeNativeElement(this.table),
448
567
  maybeNativeElement(this.lockedTable)
449
- ].filter(isPresent).forEach(translateY(this.renderer, offset));
568
+ ].filter(isPresent).forEach(translateY(this.renderer, scrollActionArgs.offset));
569
+ if (this.virtualPageSize && scrollActionArgs.changeVirtualData && (this.ctx.grid.pageable || this.ctx.grid.group?.length)) {
570
+ this.ngZone.run(() => this.itemsToRender = this.allItems.slice(this.scroller.virtualSkip, this.scroller.virtualSkip + this.virtualPageSize));
571
+ }
450
572
  }
451
573
  this.resetNavigationViewport();
452
574
  }
@@ -456,24 +578,13 @@ export class ListComponent {
456
578
  this.lockedContainer.nativeElement.scrollTop = scrollTop;
457
579
  }
458
580
  }
459
- handleInitialScrollToSkip() {
460
- const shouldScroll = () => this.isVirtual && this.skip > 0 && this.total > 0;
461
- const sub = this.changeNotification.changes
462
- .pipe(filter(shouldScroll))
463
- .subscribe(() => {
464
- this.scrollTo({ row: this.skip });
465
- sub.unsubscribe();
466
- });
467
- }
468
581
  handleRowSync() {
469
582
  const isLocked = () => isPresent(this.lockedContainer);
470
583
  const onStable = () => this.ngZone.onStable.asObservable().pipe(take(1));
471
584
  return merge(this.changeNotification.changes, this.groupsService.changes
472
585
  .pipe(filter(isLocked), switchMapTo(onStable())), this.editService.changed, this.resizeService.changes, this.columnResizingService.changes
473
586
  .pipe(filter(change => change.type === 'end')), this.supportService.changes)
474
- .pipe(tap(() => {
475
- this.resetNavigationViewport();
476
- }), filter(isLocked))
587
+ .pipe(filter(isLocked))
477
588
  .subscribe(() => {
478
589
  const scrollTop = this.container.nativeElement.scrollTop;
479
590
  const scrollLeft = this.container.nativeElement.scrollLeft;
@@ -502,9 +613,9 @@ export class ListComponent {
502
613
  if (isPresent(this.detailTemplate) && adjustIndexForDetailTemplate) {
503
614
  itemIndex = Math.floor(itemIndex / 2);
504
615
  }
505
- const offset = this.rowHeightService.offset(itemIndex, !adjustIndexForDetailTemplate);
616
+ const offset = this.rowHeightService.offset(itemIndex);
506
617
  this.container.nativeElement.scrollTop = offset;
507
- this.resetNavigationViewport();
618
+ this.scrollToIndex = itemIndex;
508
619
  }
509
620
  scrollTo({ row, column }, adjustIndex = false) {
510
621
  if (isNumber(row)) {
@@ -557,39 +668,8 @@ export class ListComponent {
557
668
  return dataAttribute && +dataAttribute === this.ctx.grid.skip + dataItemIndex;
558
669
  });
559
670
  row && row.scrollIntoView();
560
- this.isVirtual && this.resetNavigationViewport();
561
- }
562
- }
563
- resetNavigationViewport() {
564
- if (!isDocumentAvailable) {
565
- return;
566
- }
567
- if (!this.container || !this.navigationService.tableEnabled ||
568
- !this.navigationService.needsViewport() || this.data.length === 0) {
569
- return;
570
- }
571
- const { scrollTop, offsetHeight } = this.container.nativeElement;
572
- const scrollBottom = scrollTop + offsetHeight;
573
- const firstItemIndex = this.rowHeightService.index(scrollTop);
574
- const lastItemIndex = this.rowHeightService.index(scrollBottom);
575
- const lastItemOffset = this.rowHeightService.offset(lastItemIndex);
576
- let viewportStart = firstItemIndex;
577
- let viewportEnd = lastItemIndex;
578
- if (isPresent(this.detailTemplate)) {
579
- viewportStart *= 2;
580
- viewportEnd *= 2;
581
- const firstItemHeight = this.rowHeightService.offset(firstItemIndex);
582
- if (firstItemHeight + this.rowHeight < scrollTop) {
583
- viewportStart++;
584
- }
585
- const lastItemHeight = this.rowHeightService.height(lastItemIndex);
586
- const lastItemExpanded = this.rowHeightService.isExpanded(lastItemIndex);
587
- const lastItemDetailOverflows = lastItemOffset + lastItemHeight > scrollBottom;
588
- if (lastItemExpanded && !lastItemDetailOverflows) {
589
- viewportEnd++;
590
- }
671
+ this.resetNavigationViewport();
591
672
  }
592
- this.navigationService.setViewport(viewportStart, viewportEnd);
593
673
  }
594
674
  cleanupScroller() {
595
675
  if (this.scrollerSubscription) {
@@ -693,6 +773,14 @@ export class ListComponent {
693
773
  }
694
774
  return 0;
695
775
  };
776
+ setScrollerOptions() {
777
+ this.scroller.scrollableVirtual = this.isVirtual;
778
+ this.scroller.table = this.table.nativeElement;
779
+ this.scroller.tableBody = this.table.nativeElement.tBodies[0];
780
+ this.scroller.container = this.container.nativeElement;
781
+ this.scroller.scrollHeightContainer = this.container.nativeElement.querySelector('.k-height-container');
782
+ this.scroller.total = this.isVirtual && !this.ctx.grid?.pageable ? this.total : this.allItems.length;
783
+ }
696
784
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListComponent, deps: [{ token: SCROLLER_FACTORY_TOKEN }, { token: i1.DetailsService }, { token: i2.ChangeNotificationService }, { token: i3.SuspendService }, { token: i4.GroupsService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i5.ScrollSyncService }, { token: i6.ResizeService }, { token: i7.EditService }, { token: i8.BrowserSupportService }, { token: i9.NavigationService }, { token: i10.ScrollRequestService }, { token: i11.ContextService }, { token: i12.ColumnResizingService }, { token: i0.ChangeDetectorRef }, { token: i13.PDFService }, { token: i14.ColumnInfoService }, { token: i15.DataMappingService }], target: i0.ɵɵFactoryTarget.Component });
697
785
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ListComponent, isStandalone: true, selector: "kendo-grid-list", inputs: { data: "data", groups: "groups", total: "total", rowHeight: "rowHeight", detailRowHeight: "detailRowHeight", take: "take", skip: "skip", columns: "columns", detailTemplate: "detailTemplate", noRecordsTemplate: "noRecordsTemplate", selectable: "selectable", groupable: "groupable", filterable: "filterable", rowClass: "rowClass", rowSticky: "rowSticky", loading: "loading", trackBy: "trackBy", virtualColumns: "virtualColumns", isVirtual: "isVirtual", cellLoadingTemplate: "cellLoadingTemplate", loadingTemplate: "loadingTemplate", sort: "sort", size: "size" }, outputs: { contentScroll: "contentScroll", pageChange: "pageChange", scrollBottom: "scrollBottom" }, host: { properties: { "class.k-grid-container": "this.hostClass", "attr.role": "this.hostRole" } }, providers: [
698
786
  {
@@ -730,7 +818,9 @@ export class ListComponent {
730
818
  role="presentation"
731
819
  [groups]="groups"
732
820
  [isLocked]="true"
733
- [rowsToRender]="allItems"
821
+ [rowsToRender]="itemsToRender"
822
+ [rowHeight]="rowHeight"
823
+ [detailRowHeight]="detailRowHeight"
734
824
  [noRecordsText]="''"
735
825
  [columns]="$any(lockedLeafColumns)"
736
826
  [totalColumnsCount]="leafColumns.length"
@@ -748,8 +838,8 @@ export class ListComponent {
748
838
  </table>
749
839
  <kendo-resize-sensor></kendo-resize-sensor>
750
840
  </div>
751
- <div *ngIf="isVirtual" class="k-height-container" role="presentation">
752
- <div [style.height.px]="totalHeight"></div>
841
+ <div class="k-height-container" *ngIf="isVirtual" role="presentation">
842
+ <div></div>
753
843
  </div>
754
844
  </div>
755
845
  <div
@@ -777,7 +867,7 @@ export class ListComponent {
777
867
  <tbody kendoGridTableBody
778
868
  role="rowgroup"
779
869
  [skipGroupDecoration]="isLocked"
780
- [rowsToRender]="allItems"
870
+ [rowsToRender]="itemsToRender"
781
871
  [groups]="groups"
782
872
  [columns]="$any(nonLockedColumnsToRender)"
783
873
  [allColumns]="$any(nonLockedLeafColumns)"
@@ -795,20 +885,22 @@ export class ListComponent {
795
885
  [virtualColumns]="virtualColumns"
796
886
  [isLoading]="loading"
797
887
  [isVirtual]="isVirtual"
798
- [cellLoadingTemplate]="cellLoadingTemplate">
888
+ [cellLoadingTemplate]="cellLoadingTemplate"
889
+ [rowHeight]="rowHeight"
890
+ [detailRowHeight]="detailRowHeight">
799
891
  </tbody>
800
892
  </table>
801
893
  <kendo-resize-sensor *ngIf="isLocked"></kendo-resize-sensor>
802
894
  </div>
803
895
  <kendo-resize-sensor *ngIf="isLocked || virtualColumns"></kendo-resize-sensor>
804
896
  <div *ngIf="isVirtual" class="k-height-container" role="presentation">
805
- <div [style.height.px]="totalHeight"></div>
897
+ <div></div>
806
898
  </div>
807
899
  <div *ngIf="virtualColumns && !isStacked" class="k-width-container" role="presentation">
808
900
  <div [style.width.px]="totalWidth"></div>
809
901
  </div>
810
902
  </div>
811
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "directive", type: TableDirective, selector: "[kendoGridResizableTable]", inputs: ["locked", "virtualColumns"] }, { kind: "directive", type: GridTableDirective, selector: "[kendoGridTable]", inputs: ["size"] }, { kind: "component", type: ColGroupComponent, selector: "[kendoGridColGroup]", inputs: ["columns", "groups", "detailTemplate", "sort"] }, { kind: "component", type: TableBodyComponent, selector: "[kendoGridTableBody]", inputs: ["columns", "allColumns", "groups", "detailTemplate", "noRecordsTemplate", "rowsToRender", "skip", "selectable", "filterable", "noRecordsText", "isLocked", "isLoading", "isVirtual", "cellLoadingTemplate", "skipGroupDecoration", "lockedColumnsCount", "totalColumnsCount", "virtualColumns", "trackBy", "rowSticky", "totalColumns", "rowClass"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "directive", type: ResizableContainerDirective, selector: "[kendoGridResizableContainer]", inputs: ["lockedWidth", "kendoGridResizableContainer"] }] });
903
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "directive", type: TableDirective, selector: "[kendoGridResizableTable]", inputs: ["locked", "virtualColumns"] }, { kind: "directive", type: GridTableDirective, selector: "[kendoGridTable]", inputs: ["size"] }, { kind: "component", type: ColGroupComponent, selector: "[kendoGridColGroup]", inputs: ["columns", "groups", "detailTemplate", "sort"] }, { kind: "component", type: TableBodyComponent, selector: "[kendoGridTableBody]", inputs: ["columns", "allColumns", "groups", "detailTemplate", "noRecordsTemplate", "rowsToRender", "skip", "selectable", "filterable", "noRecordsText", "isLocked", "isLoading", "isVirtual", "cellLoadingTemplate", "skipGroupDecoration", "lockedColumnsCount", "totalColumnsCount", "virtualColumns", "trackBy", "rowSticky", "totalColumns", "rowClass", "rowHeight", "detailRowHeight"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }, { kind: "directive", type: ResizableContainerDirective, selector: "[kendoGridResizableContainer]", inputs: ["lockedWidth", "kendoGridResizableContainer"] }] });
812
904
  }
813
905
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ListComponent, decorators: [{
814
906
  type: Component,
@@ -851,7 +943,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
851
943
  role="presentation"
852
944
  [groups]="groups"
853
945
  [isLocked]="true"
854
- [rowsToRender]="allItems"
946
+ [rowsToRender]="itemsToRender"
947
+ [rowHeight]="rowHeight"
948
+ [detailRowHeight]="detailRowHeight"
855
949
  [noRecordsText]="''"
856
950
  [columns]="$any(lockedLeafColumns)"
857
951
  [totalColumnsCount]="leafColumns.length"
@@ -869,8 +963,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
869
963
  </table>
870
964
  <kendo-resize-sensor></kendo-resize-sensor>
871
965
  </div>
872
- <div *ngIf="isVirtual" class="k-height-container" role="presentation">
873
- <div [style.height.px]="totalHeight"></div>
966
+ <div class="k-height-container" *ngIf="isVirtual" role="presentation">
967
+ <div></div>
874
968
  </div>
875
969
  </div>
876
970
  <div
@@ -898,7 +992,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
898
992
  <tbody kendoGridTableBody
899
993
  role="rowgroup"
900
994
  [skipGroupDecoration]="isLocked"
901
- [rowsToRender]="allItems"
995
+ [rowsToRender]="itemsToRender"
902
996
  [groups]="groups"
903
997
  [columns]="$any(nonLockedColumnsToRender)"
904
998
  [allColumns]="$any(nonLockedLeafColumns)"
@@ -916,14 +1010,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
916
1010
  [virtualColumns]="virtualColumns"
917
1011
  [isLoading]="loading"
918
1012
  [isVirtual]="isVirtual"
919
- [cellLoadingTemplate]="cellLoadingTemplate">
1013
+ [cellLoadingTemplate]="cellLoadingTemplate"
1014
+ [rowHeight]="rowHeight"
1015
+ [detailRowHeight]="detailRowHeight">
920
1016
  </tbody>
921
1017
  </table>
922
1018
  <kendo-resize-sensor *ngIf="isLocked"></kendo-resize-sensor>
923
1019
  </div>
924
1020
  <kendo-resize-sensor *ngIf="isLocked || virtualColumns"></kendo-resize-sensor>
925
1021
  <div *ngIf="isVirtual" class="k-height-container" role="presentation">
926
- <div [style.height.px]="totalHeight"></div>
1022
+ <div></div>
927
1023
  </div>
928
1024
  <div *ngIf="virtualColumns && !isStacked" class="k-width-container" role="presentation">
929
1025
  <div [style.width.px]="totalWidth"></div>
@@ -96,6 +96,8 @@ export class TableBodyComponent {
96
96
  rowSticky;
97
97
  totalColumns;
98
98
  rowClass = () => null;
99
+ rowHeight;
100
+ detailRowHeight;
99
101
  hostClass = true;
100
102
  groupHeaderSlaveCellsCount;
101
103
  groupHeaderColumns;
@@ -208,7 +210,8 @@ export class TableBodyComponent {
208
210
  }
209
211
  }
210
212
  logicalRowIndex(rowIndex) {
211
- let pos = this.skip + rowIndex;
213
+ const skip = this.skip + (this.ctx.scroller?.virtualSkip ?? 0);
214
+ let pos = rowIndex + skip;
212
215
  if (this.hasDetailTemplate && !this.isStackedMode) {
213
216
  pos *= 2;
214
217
  }
@@ -300,9 +303,6 @@ export class TableBodyComponent {
300
303
  }, []);
301
304
  return colsToRender;
302
305
  }
303
- showGroupHeader(item) {
304
- return !item.data.skipHeader;
305
- }
306
306
  addStickyColumnStyles(column) {
307
307
  const stickyStyles = this.columnInfoService.stickyColumnsStyles(column);
308
308
  return { ...column.style, ...stickyStyles };
@@ -466,9 +466,10 @@ export class TableBodyComponent {
466
466
  }
467
467
  }
468
468
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableBodyComponent, deps: [{ token: i1.DetailsService }, { token: i2.GroupsService }, { token: i3.ChangeNotificationService }, { token: i4.EditService }, { token: i5.ContextService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i6.DomEventsService }, { token: i7.SelectionService }, { token: i8.CellSelectionService }, { token: i9.ColumnInfoService }, { token: i10.NavigationService }], target: i0.ɵɵFactoryTarget.Component });
469
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableBodyComponent, isStandalone: true, selector: "[kendoGridTableBody]", inputs: { columns: "columns", allColumns: "allColumns", groups: "groups", detailTemplate: "detailTemplate", noRecordsTemplate: "noRecordsTemplate", rowsToRender: "rowsToRender", skip: "skip", selectable: "selectable", filterable: "filterable", noRecordsText: "noRecordsText", isLocked: "isLocked", isLoading: "isLoading", isVirtual: "isVirtual", cellLoadingTemplate: "cellLoadingTemplate", skipGroupDecoration: "skipGroupDecoration", lockedColumnsCount: "lockedColumnsCount", totalColumnsCount: "totalColumnsCount", virtualColumns: "virtualColumns", trackBy: "trackBy", rowSticky: "rowSticky", totalColumns: "totalColumns", rowClass: "rowClass" }, host: { properties: { "class.k-table-tbody": "this.hostClass" } }, usesOnChanges: true, ngImport: i0, template: `
469
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableBodyComponent, isStandalone: true, selector: "[kendoGridTableBody]", inputs: { columns: "columns", allColumns: "allColumns", groups: "groups", detailTemplate: "detailTemplate", noRecordsTemplate: "noRecordsTemplate", rowsToRender: "rowsToRender", skip: "skip", selectable: "selectable", filterable: "filterable", noRecordsText: "noRecordsText", isLocked: "isLocked", isLoading: "isLoading", isVirtual: "isVirtual", cellLoadingTemplate: "cellLoadingTemplate", skipGroupDecoration: "skipGroupDecoration", lockedColumnsCount: "lockedColumnsCount", totalColumnsCount: "totalColumnsCount", virtualColumns: "virtualColumns", trackBy: "trackBy", rowSticky: "rowSticky", totalColumns: "totalColumns", rowClass: "rowClass", rowHeight: "rowHeight", detailRowHeight: "detailRowHeight" }, host: { properties: { "class.k-table-tbody": "this.hostClass" } }, usesOnChanges: true, ngImport: i0, template: `
470
470
  <ng-container *ngIf="editService.hasNewItem">
471
471
  <tr class="k-grid-add-row k-grid-edit-row k-master-row"
472
+ [style.height.px]="rowHeight"
472
473
  kendoGridLogicalRow
473
474
  [logicalRowIndex]="addRowLogicalIndex()"
474
475
  [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
@@ -538,6 +539,7 @@ export class TableBodyComponent {
538
539
  </tr>
539
540
  <ng-container *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;">
540
541
  <tr *ngIf="item.type === 'group'"
542
+ [style.height.px]="rowHeight"
541
543
  kendoGridGroupHeader
542
544
  [columns]="columns"
543
545
  [groups]="groups"
@@ -556,6 +558,7 @@ export class TableBodyComponent {
556
558
  [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
557
559
  </tr>
558
560
  <tr *ngIf="item.showDataItem"
561
+ [style.height.px]="rowHeight"
559
562
  kendoGridLogicalRow
560
563
  [dataRowIndex]="$any(item).index"
561
564
  [dataItem]="item.data"
@@ -657,6 +660,7 @@ export class TableBodyComponent {
657
660
  </tr>
658
661
  <tr *ngIf="item.showDetailRow"
659
662
  class="k-detail-row"
663
+ [style.height.px]="detailRowHeight"
660
664
  kendoGridLogicalRow
661
665
  [dataRowIndex]="$any(item).index"
662
666
  [dataItem]="item.data"
@@ -711,6 +715,7 @@ export class TableBodyComponent {
711
715
  </tr>
712
716
  <tr *ngIf="item.type === 'footer'"
713
717
  class="k-group-footer"
718
+ [style.height.px]="rowHeight"
714
719
  kendoGridLogicalRow
715
720
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
716
721
  [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
@@ -784,6 +789,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
784
789
  template: `
785
790
  <ng-container *ngIf="editService.hasNewItem">
786
791
  <tr class="k-grid-add-row k-grid-edit-row k-master-row"
792
+ [style.height.px]="rowHeight"
787
793
  kendoGridLogicalRow
788
794
  [logicalRowIndex]="addRowLogicalIndex()"
789
795
  [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
@@ -853,6 +859,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
853
859
  </tr>
854
860
  <ng-container *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;">
855
861
  <tr *ngIf="item.type === 'group'"
862
+ [style.height.px]="rowHeight"
856
863
  kendoGridGroupHeader
857
864
  [columns]="columns"
858
865
  [groups]="groups"
@@ -871,6 +878,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
871
878
  [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
872
879
  </tr>
873
880
  <tr *ngIf="item.showDataItem"
881
+ [style.height.px]="rowHeight"
874
882
  kendoGridLogicalRow
875
883
  [dataRowIndex]="$any(item).index"
876
884
  [dataItem]="item.data"
@@ -972,6 +980,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
972
980
  </tr>
973
981
  <tr *ngIf="item.showDetailRow"
974
982
  class="k-detail-row"
983
+ [style.height.px]="detailRowHeight"
975
984
  kendoGridLogicalRow
976
985
  [dataRowIndex]="$any(item).index"
977
986
  [dataItem]="item.data"
@@ -1026,6 +1035,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1026
1035
  </tr>
1027
1036
  <tr *ngIf="item.type === 'footer'"
1028
1037
  class="k-group-footer"
1038
+ [style.height.px]="rowHeight"
1029
1039
  kendoGridLogicalRow
1030
1040
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
1031
1041
  [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
@@ -1141,6 +1151,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1141
1151
  type: Input
1142
1152
  }], rowClass: [{
1143
1153
  type: Input
1154
+ }], rowHeight: [{
1155
+ type: Input
1156
+ }], detailRowHeight: [{
1157
+ type: Input
1144
1158
  }], hostClass: [{
1145
1159
  type: HostBinding,
1146
1160
  args: ['class.k-table-tbody']