@progress/kendo-angular-grid 21.1.1-develop.2 → 21.2.0-develop.2

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 (48) hide show
  1. package/esm2022/adaptiveness/adaptive-renderer.component.mjs +850 -756
  2. package/esm2022/aggregates/status-bar.component.mjs +13 -11
  3. package/esm2022/column-menu/column-chooser-content.component.mjs +133 -123
  4. package/esm2022/column-menu/column-list.component.mjs +62 -59
  5. package/esm2022/column-menu/column-menu-autosize-all.component.mjs +12 -11
  6. package/esm2022/column-menu/column-menu-autosize.component.mjs +12 -11
  7. package/esm2022/column-menu/column-menu-item.component.mjs +221 -85
  8. package/esm2022/column-menu/column-menu-position.component.mjs +46 -43
  9. package/esm2022/column-menu/column-menu.component.mjs +401 -315
  10. package/esm2022/editing/add-command.directive.mjs +27 -17
  11. package/esm2022/editing/cancel-command.directive.mjs +27 -17
  12. package/esm2022/editing/edit-command.directive.mjs +27 -17
  13. package/esm2022/editing/form/form-formfield.component.mjs +97 -70
  14. package/esm2022/editing/form/form.component.mjs +77 -61
  15. package/esm2022/editing/remove-command.directive.mjs +27 -17
  16. package/esm2022/editing/save-command.directive.mjs +27 -17
  17. package/esm2022/excel/excel-command.directive.mjs +27 -17
  18. package/esm2022/filtering/cell/filter-cell-operators.component.mjs +20 -17
  19. package/esm2022/filtering/cell/filter-cell.component.mjs +35 -33
  20. package/esm2022/filtering/filter-row.component.mjs +37 -29
  21. package/esm2022/filtering/menu/boolean-filter-menu.component.mjs +34 -31
  22. package/esm2022/filtering/menu/date-filter-menu.component.mjs +52 -49
  23. package/esm2022/filtering/menu/filter-menu-container.component.mjs +97 -89
  24. package/esm2022/filtering/menu/numeric-filter-menu.component.mjs +50 -47
  25. package/esm2022/filtering/menu/string-filter-menu.component.mjs +36 -33
  26. package/esm2022/filtering/multicheckbox-filter.component.mjs +54 -43
  27. package/esm2022/grid.component.mjs +1579 -1483
  28. package/esm2022/grouping/group-header.component.mjs +113 -89
  29. package/esm2022/grouping/group-panel.component.mjs +82 -75
  30. package/esm2022/package-metadata.mjs +2 -2
  31. package/esm2022/pdf/pdf-command.directive.mjs +27 -17
  32. package/esm2022/rendering/cell.component.mjs +411 -365
  33. package/esm2022/rendering/common/col-group.component.mjs +25 -15
  34. package/esm2022/rendering/common/loading.component.mjs +23 -19
  35. package/esm2022/rendering/details/detail-template.directive.mjs +6 -4
  36. package/esm2022/rendering/footer/footer.component.mjs +128 -112
  37. package/esm2022/rendering/header/header.component.mjs +412 -351
  38. package/esm2022/rendering/list.component.mjs +225 -202
  39. package/esm2022/rendering/table-body.component.mjs +553 -493
  40. package/esm2022/rendering/toolbar/toolbar.component.mjs +13 -11
  41. package/esm2022/rendering/toolbar/tools/ai-assistant/ai-assistant.component.mjs +86 -79
  42. package/esm2022/rendering/toolbar/tools/filter-toolbar-tool.component.mjs +54 -51
  43. package/esm2022/rendering/toolbar/tools/group-toolbar-tool.component.mjs +138 -115
  44. package/esm2022/rendering/toolbar/tools/sort-toolbar-tool.component.mjs +72 -65
  45. package/fesm2022/progress-kendo-angular-grid.mjs +6426 -5525
  46. package/package.json +24 -24
  47. package/rendering/details/detail-template.directive.d.ts +6 -4
  48. package/schematics/ngAdd/index.js +7 -7
@@ -31,7 +31,7 @@ import { GroupHeaderComponent } from '../grouping/group-header.component';
31
31
  import { CellComponent } from './cell.component';
32
32
  import { LogicalCellDirective } from '../navigation/logical-cell.directive';
33
33
  import { LogicalRowDirective } from '../navigation/logical-row.directive';
34
- import { NgIf, NgFor, NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
34
+ import { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
35
35
  import * as i0 from "@angular/core";
36
36
  import * as i1 from "./details/details.service";
37
37
  import * as i2 from "../grouping/groups.service";
@@ -176,15 +176,19 @@ export class TableBodyComponent {
176
176
  return this.selectionService.settings?.isRowSelectable(args) || this.cellSelectionService.settings?.isRowSelectable(args);
177
177
  }
178
178
  trackByWrapper(index, item) {
179
- if (item.type === 'data') {
180
- item.isEditing = this.editService.hasEdited(item.index);
181
- }
182
179
  return this.trackBy(index, item);
183
180
  }
184
181
  trackByColumns(index, item) {
185
182
  return this.virtualColumns ? index : item;
186
183
  }
187
184
  ngDoCheck() {
185
+ if (this.rowsToRender) {
186
+ this.rowsToRender.forEach((item) => {
187
+ if (item.type === 'data') {
188
+ item.isEditing = this.editService.hasEdited(item.index);
189
+ }
190
+ });
191
+ }
188
192
  if (this.hasGroupHeaderColumn) {
189
193
  this.groupHeaderColumns = columnsToRender(this.skipGroupDecoration ? this.columns : this.columns.toArray().slice(1));
190
194
  }
@@ -493,8 +497,8 @@ export class TableBodyComponent {
493
497
  }
494
498
  }
495
499
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", 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 });
496
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.14", 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: `
497
- <ng-container *ngIf="editService.hasNewItem">
500
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", 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: `
501
+ @if (editService.hasNewItem) {
498
502
  <tr class="k-grid-add-row k-grid-edit-row k-master-row"
499
503
  [style.height.px]="rowHeight"
500
504
  kendoGridLogicalRow
@@ -503,200 +507,220 @@ export class TableBodyComponent {
503
507
  [logicalCellsCount]="columns.length"
504
508
  [logicalSlaveCellsCount]="unlockedColumnsCount()"
505
509
  [totalColumns]="totalColumns">
506
- <ng-container *ngIf="!skipGroupDecoration">
507
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups" role="presentation"></td>
508
- </ng-container>
509
- <td class="k-hierarchy-cell k-table-td"
510
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
511
- kendoGridLogicalCell
512
- [logicalRowIndex]="addRowLogicalIndex()"
513
- [logicalColIndex]="0"
514
- aria-selected="false"
515
- >
516
- </td>
517
- <ng-container *ngIf="isStackedMode; else columnsTemplate">
518
- <td *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;"
519
- class="k-table-td"
520
- kendoGridCell
521
- [rowIndex]="-1"
522
- [columnIndex]="0"
523
- [isNew]="true"
524
- [columns]="allColumns"
525
- [dataItem]="newDataItem"
526
- kendoGridLogicalCell
527
- [logicalRowIndex]="addRowLogicalIndex()"
528
- [logicalColIndex]="0">
529
- </td>
530
- </ng-container>
531
- <ng-template #columnsTemplate>
532
- <td *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;"
533
- class="k-table-td"
534
- kendoGridCell
535
- [rowIndex]="-1"
536
- [columnIndex]="lockedColumnsCount + columnIndex"
537
- [isNew]="true"
538
- [column]="column"
539
- [dataItem]="newDataItem"
540
- [class.k-grid-content-sticky]="column.sticky"
541
- [ngClass]="column.cssClass"
542
- [style.left]="column.sticky ? '0' : undefined"
543
- [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
544
- [attr.colspan]="column.colspan"
545
- [attr.role]="column.tableCellsRole"
510
+ @if (!skipGroupDecoration) {
511
+ @for (g of groups; track $index) {
512
+ <td class="k-group-cell k-table-td k-table-group-td" role="presentation"></td>
513
+ }
514
+ }
515
+ @if (detailTemplate?.templateRef && !isStackedMode) {
516
+ <td class="k-hierarchy-cell k-table-td"
546
517
  kendoGridLogicalCell
547
518
  [logicalRowIndex]="addRowLogicalIndex()"
548
- [logicalColIndex]="logicalColIndex(column)"
549
- [colSpan]="column.colspan">
519
+ [logicalColIndex]="0"
520
+ aria-selected="false"
521
+ >
550
522
  </td>
551
- </ng-template>
552
- </tr>
553
- </ng-container>
554
- <tr *ngIf="!rowsToRender?.length" class="k-grid-norecords" role="row">
555
- <td [attr.colspan]="colSpan" class="k-table-td">
556
- <ng-template
557
- *ngIf="noRecordsTemplate?.templateRef"
558
- [templateContext]="{
559
- templateRef: noRecordsTemplate?.templateRef
560
- }">
561
- </ng-template>
562
- <ng-container *ngIf="!noRecordsTemplate?.templateRef">
563
- {{noRecordsText}}
564
- </ng-container>
565
- </td>
566
- </tr>
567
- <ng-container *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;">
568
- <tr *ngIf="item.type === 'group'"
569
- [style.height.px]="rowHeight"
570
- kendoGridGroupHeader
571
- [columns]="columns"
572
- [groups]="groups"
573
- [item]="$any(item)"
574
- [hasDetails]="!!detailTemplate?.templateRef"
575
- [skipGroupDecoration]="skipGroupDecoration"
576
- [hasGroupHeaderColumn]="hasGroupHeaderColumn"
577
- [groupHeaderColumns]="groupHeaderColumns"
578
- [rowIndex]="rowIndex + 1"
579
- [totalColumnsCount]="totalColumnsCount"
580
- kendoGridLogicalRow
581
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
582
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
583
- [totalColumns]="totalColumns"
584
- [logicalCellsCount]="columns.length"
585
- [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
523
+ }
524
+ @if (isStackedMode) {
525
+ @for (item of rowsToRender; track trackByWrapper($index, item); let rowIndex = $index) {
526
+ <td
527
+ class="k-table-td"
528
+ kendoGridCell
529
+ [rowIndex]="-1"
530
+ [columnIndex]="0"
531
+ [isNew]="true"
532
+ [columns]="allColumns"
533
+ [dataItem]="newDataItem"
534
+ kendoGridLogicalCell
535
+ [logicalRowIndex]="addRowLogicalIndex()"
536
+ [logicalColIndex]="0">
537
+ </td>
538
+ }
539
+ } @else {
540
+ @for (column of columns; track virtualColumns ? $index : column; let columnIndex = $index) {
541
+ <td
542
+ class="k-table-td"
543
+ kendoGridCell
544
+ [rowIndex]="-1"
545
+ [columnIndex]="lockedColumnsCount + columnIndex"
546
+ [isNew]="true"
547
+ [column]="column"
548
+ [dataItem]="newDataItem"
549
+ [class.k-grid-content-sticky]="column.sticky"
550
+ [ngClass]="column.cssClass"
551
+ [style.left]="column.sticky ? '0' : undefined"
552
+ [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
553
+ [attr.colspan]="column.colspan"
554
+ [attr.role]="column.tableCellsRole"
555
+ kendoGridLogicalCell
556
+ [logicalRowIndex]="addRowLogicalIndex()"
557
+ [logicalColIndex]="logicalColIndex(column)"
558
+ [colSpan]="column.colspan">
559
+ </td>
560
+ }
561
+ }
586
562
  </tr>
587
- <tr *ngIf="item.showDataItem"
588
- [style.height.px]="rowHeight"
589
- kendoGridLogicalRow
590
- [dataRowIndex]="$any(item).index"
591
- [dataItem]="item.data"
592
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
593
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
594
- [totalColumns]="totalColumns"
595
- [logicalCellsCount]="columns.length"
596
- [logicalSlaveCellsCount]="unlockedColumnsCount(item)"
597
- class="{{ isOdd(item) ? 'k-table-alt-row' : ''}}"
598
- [class.k-grid-row-sticky]="rowSticky ? rowSticky({ dataItem: item.data, index: $any(item).index }) : false"
599
- [ngClass]="rowClass({ dataItem: item.data, index: $any(item).index })"
600
- [class.k-master-row]="true"
601
- [class.k-expanded]="item.isExpanded && !isStackedMode"
602
- [class.k-grid-edit-row]="isEditingRow($any(item).index)"
603
- [attr.aria-selected]="(lockedColumnsCount < 1 || isStackedMode) ? isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item) : undefined"
604
- [attr.data-kendo-grid-item-index]="$any(item).index"
605
- [class.k-selected]="isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item)"
606
- [class.k-highlighted]="item.isHighlighted">
607
- <ng-container *ngIf="!skipGroupDecoration">
608
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups" role="presentation"></td>
609
- </ng-container>
610
- <td class="k-hierarchy-cell k-table-td"
611
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
612
- kendoGridLogicalCell
613
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
614
- [logicalColIndex]="0"
615
- [dataRowIndex]="$any(item).index"
616
- [dataItem]="item.data"
617
- [detailExpandCell]="true"
618
- aria-selected="false"
619
- role="gridcell"
620
- [attr.aria-expanded]="item.isExpanded">
621
- <a
622
- *ngIf="detailTemplate.showIf(item.data, $any(item).index)"
623
- [attr.title]="detailButtonTitle(item)"
624
- [attr.aria-label]="detailButtonTitle(item)"
625
- href="#" tabindex="-1" (click)="toggleRow($any(item).index, item.data)">
626
- <kendo-icon-wrapper
627
- [name]="detailButtonIconName(item)"
628
- [svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
629
- </a>
563
+ }
564
+ @if (!rowsToRender?.length) {
565
+ <tr class="k-grid-norecords" role="row">
566
+ <td [attr.colspan]="colSpan" class="k-table-td">
567
+ @if (noRecordsTemplate?.templateRef) {
568
+ <ng-template
569
+ [templateContext]="{
570
+ templateRef: noRecordsTemplate?.templateRef
571
+ }">
572
+ </ng-template>
573
+ } @else {
574
+ {{noRecordsText}}
575
+ }
630
576
  </td>
631
- <ng-container *ngIf="isStackedMode; else columnsTemplate">
632
- <td kendoGridCell
633
- [rowIndex]="$any(item).index"
634
- [detailTemplate]="detailTemplate"
635
- [item]="item"
636
- [columnIndex]="0"
637
- [attr.data-kendo-grid-column-index]="0"
577
+ </tr>
578
+ }
579
+ @for (item of rowsToRender; track trackByWrapper($index, item); let rowIndex = $index) {
580
+ @if (item.type === 'group') {
581
+ <tr
582
+ [style.height.px]="rowHeight"
583
+ kendoGridGroupHeader
638
584
  [columns]="columns"
639
- [dataItem]="item.data"
640
- [isLoading]="isLoading"
641
- [isVirtual]="isVirtual"
642
- [loadingTemplate]="cellLoadingTemplate"
643
- kendoGridLogicalCell
585
+ [groups]="groups"
586
+ [item]="$any(item)"
587
+ [hasDetails]="!!detailTemplate?.templateRef"
588
+ [skipGroupDecoration]="skipGroupDecoration"
589
+ [hasGroupHeaderColumn]="hasGroupHeaderColumn"
590
+ [groupHeaderColumns]="groupHeaderColumns"
591
+ [rowIndex]="rowIndex + 1"
592
+ [totalColumnsCount]="totalColumnsCount"
593
+ kendoGridLogicalRow
644
594
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
645
- [logicalColIndex]="0"
595
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
596
+ [totalColumns]="totalColumns"
597
+ [logicalCellsCount]="columns.length"
598
+ [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
599
+ </tr>
600
+ }
601
+ @if (item.showDataItem) {
602
+ <tr
603
+ [style.height.px]="rowHeight"
604
+ kendoGridLogicalRow
646
605
  [dataRowIndex]="$any(item).index"
647
606
  [dataItem]="item.data"
648
- [colIndex]="0"
649
- class="k-table-td"
650
- [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag">
651
- </td>
652
- </ng-container>
653
- <ng-template #columnsTemplate>
654
- <ng-container *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;">
655
- <td *ngIf="!item.cells?.[lockedColumnsCount + columnIndex]?.skip"
656
- kendoGridCell
607
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
608
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
609
+ [totalColumns]="totalColumns"
610
+ [logicalCellsCount]="columns.length"
611
+ [logicalSlaveCellsCount]="unlockedColumnsCount(item)"
612
+ class="{{ isOdd(item) ? 'k-table-alt-row' : ''}}"
613
+ [class.k-grid-row-sticky]="rowSticky ? rowSticky({ dataItem: item.data, index: $any(item).index }) : false"
614
+ [ngClass]="rowClass({ dataItem: item.data, index: $any(item).index })"
615
+ [class.k-master-row]="true"
616
+ [class.k-expanded]="item.isExpanded && !isStackedMode"
617
+ [class.k-grid-edit-row]="isEditingRow($any(item).index)"
618
+ [attr.aria-selected]="(lockedColumnsCount < 1 || isStackedMode) ? isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item) : undefined"
619
+ [attr.data-kendo-grid-item-index]="$any(item).index"
620
+ [class.k-selected]="isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item)"
621
+ [class.k-highlighted]="item.isHighlighted">
622
+ @if (!skipGroupDecoration) {
623
+ @for (g of groups; track $index) {
624
+ <td class="k-group-cell k-table-td k-table-group-td" role="presentation"></td>
625
+ }
626
+ }
627
+ @if (detailTemplate?.templateRef && !isStackedMode) {
628
+ <td class="k-hierarchy-cell k-table-td"
629
+ kendoGridLogicalCell
630
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
631
+ [logicalColIndex]="0"
632
+ [dataRowIndex]="$any(item).index"
633
+ [dataItem]="item.data"
634
+ [detailExpandCell]="true"
635
+ aria-selected="false"
636
+ role="gridcell"
637
+ [attr.aria-expanded]="item.isExpanded">
638
+ @if (detailTemplate.showIf(item.data, $any(item).index)) {
639
+ <a
640
+ [attr.title]="detailButtonTitle(item)"
641
+ [attr.aria-label]="detailButtonTitle(item)"
642
+ href="#" tabindex="-1" (click)="toggleRow($any(item).index, item.data)">
643
+ <kendo-icon-wrapper
644
+ [name]="detailButtonIconName(item)"
645
+ [svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
646
+ </a>
647
+ }
648
+ </td>
649
+ }
650
+ @if (isStackedMode) {
651
+ <td kendoGridCell
657
652
  [rowIndex]="$any(item).index"
658
- [columnIndex]="lockedColumnsCount + columnIndex"
659
- [attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
660
- [column]="column"
661
- [columns]="allColumns"
653
+ [detailTemplate]="detailTemplate"
654
+ [item]="item"
655
+ [columnIndex]="0"
656
+ [attr.data-kendo-grid-column-index]="0"
657
+ [columns]="columns"
662
658
  [dataItem]="item.data"
663
659
  [isLoading]="isLoading"
664
660
  [isVirtual]="isVirtual"
665
661
  [loadingTemplate]="cellLoadingTemplate"
666
662
  kendoGridLogicalCell
667
663
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
668
- [logicalColIndex]="logicalColIndex(column)"
664
+ [logicalColIndex]="0"
669
665
  [dataRowIndex]="$any(item).index"
670
666
  [dataItem]="item.data"
671
- [colIndex]="columnIndex"
672
- [colSpan]="column.colspan"
673
- [rowSpan]="item.cells[lockedColumnsCount + columnIndex]?.rowspan"
674
- [attr.role]="column.tableCellsRole"
667
+ [colIndex]="0"
675
668
  class="k-table-td"
676
- [attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
677
- [class.k-grid-content-sticky]="column.sticky"
678
- [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
679
- [ngClass]="column.cssClass"
680
- [class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
681
- [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
682
- [attr.colspan]="column.colspan"
683
- [class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
684
- [class.k-highlighted]="item.cells[lockedColumnsCount + columnIndex]?.isHighlighted">
669
+ [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag">
685
670
  </td>
686
- </ng-container>
687
- </ng-template>
688
- </tr>
689
- <tr *ngIf="item.showDetailRow"
690
- class="k-detail-row"
691
- [style.height.px]="detailRowHeight"
692
- kendoGridLogicalRow
693
- [dataRowIndex]="$any(item).index"
694
- [dataItem]="item.data"
695
- [logicalRowIndex]="isStackedMode ? logicalRowIndex(rowIndex) : logicalRowIndex(rowIndex) + 1"
696
- [logicalSlaveRow]="false"
697
- [logicalCellsCount]="1">
698
- <ng-container *ngIf="!isStackedMode">
699
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups"></td>
671
+ } @else {
672
+ @for (column of columns; track virtualColumns ? $index : column; let columnIndex = $index) {
673
+ @if (!item.cells?.[lockedColumnsCount + columnIndex]?.skip) {
674
+ <td
675
+ kendoGridCell
676
+ [rowIndex]="$any(item).index"
677
+ [columnIndex]="lockedColumnsCount + columnIndex"
678
+ [attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
679
+ [column]="column"
680
+ [columns]="allColumns"
681
+ [dataItem]="item.data"
682
+ [isLoading]="isLoading"
683
+ [isVirtual]="isVirtual"
684
+ [loadingTemplate]="cellLoadingTemplate"
685
+ kendoGridLogicalCell
686
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
687
+ [logicalColIndex]="logicalColIndex(column)"
688
+ [dataRowIndex]="$any(item).index"
689
+ [dataItem]="item.data"
690
+ [colIndex]="columnIndex"
691
+ [colSpan]="column.colspan"
692
+ [rowSpan]="item.cells[lockedColumnsCount + columnIndex]?.rowspan"
693
+ [attr.role]="column.tableCellsRole"
694
+ class="k-table-td"
695
+ [attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
696
+ [class.k-grid-content-sticky]="column.sticky"
697
+ [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
698
+ [ngClass]="column.cssClass"
699
+ [class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
700
+ [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
701
+ [attr.colspan]="column.colspan"
702
+ [class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
703
+ [class.k-highlighted]="item.cells[lockedColumnsCount + columnIndex]?.isHighlighted">
704
+ </td>
705
+ }
706
+ }
707
+ }
708
+ </tr>
709
+ }
710
+ @if (item.showDetailRow) {
711
+ <tr
712
+ class="k-detail-row"
713
+ [style.height.px]="detailRowHeight"
714
+ kendoGridLogicalRow
715
+ [dataRowIndex]="$any(item).index"
716
+ [dataItem]="item.data"
717
+ [logicalRowIndex]="isStackedMode ? logicalRowIndex(rowIndex) : logicalRowIndex(rowIndex) + 1"
718
+ [logicalSlaveRow]="false"
719
+ [logicalCellsCount]="1">
720
+ @if (!isStackedMode) {
721
+ @for (g of groups; track $index) {
722
+ <td class="k-group-cell k-table-td k-table-group-td"></td>
723
+ }
700
724
  <td class="k-hierarchy-cell k-table-td"></td>
701
725
  <td class="k-detail-cell k-table-td"
702
726
  [attr.colspan]="columnsSpan"
@@ -717,8 +741,7 @@ export class TableBodyComponent {
717
741
  }">
718
742
  </ng-template>
719
743
  </td>
720
- </ng-container>
721
- <ng-container *ngIf="isStackedMode">
744
+ } @else {
722
745
  <td class="k-detail-cell k-table-td"
723
746
  [attr.colspan]="columnsSpan"
724
747
  kendoGridLogicalCell
@@ -739,83 +762,92 @@ export class TableBodyComponent {
739
762
  }">
740
763
  </ng-template>
741
764
  </td>
742
- </ng-container>
743
- </tr>
744
- <tr *ngIf="item.type === 'footer'"
745
- class="k-group-footer"
746
- [style.height.px]="rowHeight"
747
- kendoGridLogicalRow
748
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
749
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
750
- [totalColumns]="totalColumns"
751
- [logicalCellsCount]="columns.length"
752
- [logicalSlaveCellsCount]="unlockedColumnsCount(item)">
753
- <ng-container *ngIf="!skipGroupDecoration">
754
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups"></td>
755
- </ng-container>
756
- <td class="k-hierarchy-cell k-table-td"
757
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
758
- kendoGridLogicalCell
765
+ }
766
+ </tr>
767
+ }
768
+ @if (item.type === 'footer') {
769
+ <tr
770
+ class="k-group-footer"
771
+ [style.height.px]="rowHeight"
772
+ kendoGridLogicalRow
759
773
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
760
- [logicalColIndex]="0"
761
- aria-selected="false">
762
- </td>
774
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
775
+ [totalColumns]="totalColumns"
776
+ [logicalCellsCount]="columns.length"
777
+ [logicalSlaveCellsCount]="unlockedColumnsCount(item)">
778
+ @if (!skipGroupDecoration) {
779
+ @for (g of groups; track $index) {
780
+ <td class="k-group-cell k-table-td k-table-group-td"></td>
781
+ }
782
+ }
783
+ @if (detailTemplate?.templateRef && !isStackedMode) {
784
+ <td class="k-hierarchy-cell k-table-td"
785
+ kendoGridLogicalCell
786
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
787
+ [logicalColIndex]="0"
788
+ aria-selected="false">
789
+ </td>
790
+ }
763
791
 
764
- <ng-container *ngIf="!isStackedMode">
765
- <td kendoGridLogicalCell
792
+ @if (!isStackedMode) {
793
+ @for (column of footerColumns; track virtualColumns ? $index : column; let columnIndex = $index) {
794
+ <td kendoGridLogicalCell
795
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
796
+ [logicalColIndex]="logicalColIndex(column)"
797
+ [attr.data-skip]="skipGroupDecoration"
798
+ class="k-table-td">
799
+ <ng-template
800
+ [templateContext]="{
801
+ templateRef: $any(column).groupFooterTemplateRef,
802
+ group: $any(item.data),
803
+ field: $any(column).field,
804
+ column: column,
805
+ aggregates: $any(item.data)?.aggregates,
806
+ $implicit: $any(item.data)?.aggregates
807
+ }">
808
+ </ng-template>
809
+ </td>
810
+ }
811
+ } @else {
812
+ <td kendoGridLogicalCell
766
813
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
767
- [logicalColIndex]="logicalColIndex(column)"
768
- [attr.data-skip]="skipGroupDecoration"
769
- class="k-table-td"
770
- *ngFor="let column of footerColumns; let columnIndex = index; trackBy: trackByColumns;">
771
- <ng-template
772
- [templateContext]="{
773
- templateRef: $any(column).groupFooterTemplateRef,
774
- group: $any(item.data),
775
- field: $any(column).field,
776
- column: column,
777
- aggregates: $any(item.data)?.aggregates,
778
- $implicit: $any(item.data)?.aggregates
779
- }">
780
- </ng-template>
781
- </td>
782
- </ng-container>
783
-
784
- <ng-container *ngIf="isStackedMode">
785
- <td kendoGridLogicalCell
786
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
787
- [logicalColIndex]="hasDetailTemplate ? 1 : 0"
788
- [attr.data-skip]="skipGroupDecoration"
789
- class="k-table-td">
790
- <div class="k-grid-column-template">
791
- <ng-container *ngFor="let col of footerColumns">
792
- <div class="k-column-template-item" *ngIf="$any(col).groupFooterTemplateRef">
793
- <ng-template
794
- [templateContext]="{
795
- templateRef: $any(col).groupFooterTemplateRef,
796
- group: $any(item.data),
797
- field: $any(col).field,
798
- column: col,
799
- aggregates: $any(item.data)?.aggregates,
800
- $implicit: $any(item.data)?.aggregates
801
- }">
802
- </ng-template>
803
- </div>
804
- </ng-container>
805
- </div>
806
- </td>
807
- </ng-container>
808
- </tr>
809
- </ng-container>
810
- <kendo-resize-sensor *ngIf="rowSticky" (resize)="resizeHandler()"></kendo-resize-sensor>
811
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: LogicalRowDirective, selector: "[kendoGridLogicalRow]", inputs: ["logicalRowIndex", "logicalSlaveRow", "logicalCellsCount", "logicalSlaveCellsCount", "dataRowIndex", "dataItem", "totalColumns"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: LogicalCellDirective, selector: "[kendoGridLogicalCell]", inputs: ["logicalColIndex", "logicalRowIndex", "logicalSlaveCell", "colIndex", "colSpan", "rowSpan", "groupItem", "dataRowIndex", "dataItem", "detailExpandCell", "headerLabelText"] }, { kind: "component", type: CellComponent, selector: "[kendoGridCell]", inputs: ["column", "columns", "columnIndex", "isNew", "isLoading", "isVirtual", "loadingTemplate", "detailTemplate", "item", "rowIndex", "dataItem"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: GroupHeaderComponent, selector: "[kendoGridGroupHeader]", inputs: ["rowIndex", "logicalRowIndex", "item", "skipGroupDecoration", "hasDetails", "totalColumnsCount", "hasGroupHeaderColumn", "groupHeaderColumns", "columns", "groups"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
814
+ [logicalColIndex]="hasDetailTemplate ? 1 : 0"
815
+ [attr.data-skip]="skipGroupDecoration"
816
+ class="k-table-td">
817
+ <div class="k-grid-column-template">
818
+ @for (col of footerColumns; track $index) {
819
+ @if ($any(col).groupFooterTemplateRef) {
820
+ <div class="k-column-template-item">
821
+ <ng-template
822
+ [templateContext]="{
823
+ templateRef: $any(col).groupFooterTemplateRef,
824
+ group: $any(item.data),
825
+ field: $any(col).field,
826
+ column: col,
827
+ aggregates: $any(item.data)?.aggregates,
828
+ $implicit: $any(item.data)?.aggregates
829
+ }">
830
+ </ng-template>
831
+ </div>
832
+ }
833
+ }
834
+ </div>
835
+ </td>
836
+ }
837
+ </tr>
838
+ }
839
+ }
840
+ @if (rowSticky) {
841
+ <kendo-resize-sensor (resize)="resizeHandler()"></kendo-resize-sensor>
842
+ }
843
+ `, isInline: true, dependencies: [{ kind: "directive", type: LogicalRowDirective, selector: "[kendoGridLogicalRow]", inputs: ["logicalRowIndex", "logicalSlaveRow", "logicalCellsCount", "logicalSlaveCellsCount", "dataRowIndex", "dataItem", "totalColumns"] }, { kind: "directive", type: LogicalCellDirective, selector: "[kendoGridLogicalCell]", inputs: ["logicalColIndex", "logicalRowIndex", "logicalSlaveCell", "colIndex", "colSpan", "rowSpan", "groupItem", "dataRowIndex", "dataItem", "detailExpandCell", "headerLabelText"] }, { kind: "component", type: CellComponent, selector: "[kendoGridCell]", inputs: ["column", "columns", "columnIndex", "isNew", "isLoading", "isVirtual", "loadingTemplate", "detailTemplate", "item", "rowIndex", "dataItem"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: TemplateContextDirective, selector: "[templateContext]", inputs: ["templateContext"] }, { kind: "component", type: GroupHeaderComponent, selector: "[kendoGridGroupHeader]", inputs: ["rowIndex", "logicalRowIndex", "item", "skipGroupDecoration", "hasDetails", "totalColumnsCount", "hasGroupHeaderColumn", "groupHeaderColumns", "columns", "groups"] }, { kind: "component", type: IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
812
844
  }
813
845
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TableBodyComponent, decorators: [{
814
846
  type: Component,
815
847
  args: [{
816
848
  selector: '[kendoGridTableBody]',
817
849
  template: `
818
- <ng-container *ngIf="editService.hasNewItem">
850
+ @if (editService.hasNewItem) {
819
851
  <tr class="k-grid-add-row k-grid-edit-row k-master-row"
820
852
  [style.height.px]="rowHeight"
821
853
  kendoGridLogicalRow
@@ -824,200 +856,220 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
824
856
  [logicalCellsCount]="columns.length"
825
857
  [logicalSlaveCellsCount]="unlockedColumnsCount()"
826
858
  [totalColumns]="totalColumns">
827
- <ng-container *ngIf="!skipGroupDecoration">
828
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups" role="presentation"></td>
829
- </ng-container>
830
- <td class="k-hierarchy-cell k-table-td"
831
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
832
- kendoGridLogicalCell
833
- [logicalRowIndex]="addRowLogicalIndex()"
834
- [logicalColIndex]="0"
835
- aria-selected="false"
836
- >
837
- </td>
838
- <ng-container *ngIf="isStackedMode; else columnsTemplate">
839
- <td *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;"
840
- class="k-table-td"
841
- kendoGridCell
842
- [rowIndex]="-1"
843
- [columnIndex]="0"
844
- [isNew]="true"
845
- [columns]="allColumns"
846
- [dataItem]="newDataItem"
847
- kendoGridLogicalCell
848
- [logicalRowIndex]="addRowLogicalIndex()"
849
- [logicalColIndex]="0">
850
- </td>
851
- </ng-container>
852
- <ng-template #columnsTemplate>
853
- <td *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;"
854
- class="k-table-td"
855
- kendoGridCell
856
- [rowIndex]="-1"
857
- [columnIndex]="lockedColumnsCount + columnIndex"
858
- [isNew]="true"
859
- [column]="column"
860
- [dataItem]="newDataItem"
861
- [class.k-grid-content-sticky]="column.sticky"
862
- [ngClass]="column.cssClass"
863
- [style.left]="column.sticky ? '0' : undefined"
864
- [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
865
- [attr.colspan]="column.colspan"
866
- [attr.role]="column.tableCellsRole"
859
+ @if (!skipGroupDecoration) {
860
+ @for (g of groups; track $index) {
861
+ <td class="k-group-cell k-table-td k-table-group-td" role="presentation"></td>
862
+ }
863
+ }
864
+ @if (detailTemplate?.templateRef && !isStackedMode) {
865
+ <td class="k-hierarchy-cell k-table-td"
867
866
  kendoGridLogicalCell
868
867
  [logicalRowIndex]="addRowLogicalIndex()"
869
- [logicalColIndex]="logicalColIndex(column)"
870
- [colSpan]="column.colspan">
868
+ [logicalColIndex]="0"
869
+ aria-selected="false"
870
+ >
871
871
  </td>
872
- </ng-template>
873
- </tr>
874
- </ng-container>
875
- <tr *ngIf="!rowsToRender?.length" class="k-grid-norecords" role="row">
876
- <td [attr.colspan]="colSpan" class="k-table-td">
877
- <ng-template
878
- *ngIf="noRecordsTemplate?.templateRef"
879
- [templateContext]="{
880
- templateRef: noRecordsTemplate?.templateRef
881
- }">
882
- </ng-template>
883
- <ng-container *ngIf="!noRecordsTemplate?.templateRef">
884
- {{noRecordsText}}
885
- </ng-container>
886
- </td>
887
- </tr>
888
- <ng-container *ngFor="let item of rowsToRender; trackBy: trackByWrapper; let rowIndex = index;">
889
- <tr *ngIf="item.type === 'group'"
890
- [style.height.px]="rowHeight"
891
- kendoGridGroupHeader
892
- [columns]="columns"
893
- [groups]="groups"
894
- [item]="$any(item)"
895
- [hasDetails]="!!detailTemplate?.templateRef"
896
- [skipGroupDecoration]="skipGroupDecoration"
897
- [hasGroupHeaderColumn]="hasGroupHeaderColumn"
898
- [groupHeaderColumns]="groupHeaderColumns"
899
- [rowIndex]="rowIndex + 1"
900
- [totalColumnsCount]="totalColumnsCount"
901
- kendoGridLogicalRow
902
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
903
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
904
- [totalColumns]="totalColumns"
905
- [logicalCellsCount]="columns.length"
906
- [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
872
+ }
873
+ @if (isStackedMode) {
874
+ @for (item of rowsToRender; track trackByWrapper($index, item); let rowIndex = $index) {
875
+ <td
876
+ class="k-table-td"
877
+ kendoGridCell
878
+ [rowIndex]="-1"
879
+ [columnIndex]="0"
880
+ [isNew]="true"
881
+ [columns]="allColumns"
882
+ [dataItem]="newDataItem"
883
+ kendoGridLogicalCell
884
+ [logicalRowIndex]="addRowLogicalIndex()"
885
+ [logicalColIndex]="0">
886
+ </td>
887
+ }
888
+ } @else {
889
+ @for (column of columns; track virtualColumns ? $index : column; let columnIndex = $index) {
890
+ <td
891
+ class="k-table-td"
892
+ kendoGridCell
893
+ [rowIndex]="-1"
894
+ [columnIndex]="lockedColumnsCount + columnIndex"
895
+ [isNew]="true"
896
+ [column]="column"
897
+ [dataItem]="newDataItem"
898
+ [class.k-grid-content-sticky]="column.sticky"
899
+ [ngClass]="column.cssClass"
900
+ [style.left]="column.sticky ? '0' : undefined"
901
+ [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
902
+ [attr.colspan]="column.colspan"
903
+ [attr.role]="column.tableCellsRole"
904
+ kendoGridLogicalCell
905
+ [logicalRowIndex]="addRowLogicalIndex()"
906
+ [logicalColIndex]="logicalColIndex(column)"
907
+ [colSpan]="column.colspan">
908
+ </td>
909
+ }
910
+ }
907
911
  </tr>
908
- <tr *ngIf="item.showDataItem"
909
- [style.height.px]="rowHeight"
910
- kendoGridLogicalRow
911
- [dataRowIndex]="$any(item).index"
912
- [dataItem]="item.data"
913
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
914
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
915
- [totalColumns]="totalColumns"
916
- [logicalCellsCount]="columns.length"
917
- [logicalSlaveCellsCount]="unlockedColumnsCount(item)"
918
- class="{{ isOdd(item) ? 'k-table-alt-row' : ''}}"
919
- [class.k-grid-row-sticky]="rowSticky ? rowSticky({ dataItem: item.data, index: $any(item).index }) : false"
920
- [ngClass]="rowClass({ dataItem: item.data, index: $any(item).index })"
921
- [class.k-master-row]="true"
922
- [class.k-expanded]="item.isExpanded && !isStackedMode"
923
- [class.k-grid-edit-row]="isEditingRow($any(item).index)"
924
- [attr.aria-selected]="(lockedColumnsCount < 1 || isStackedMode) ? isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item) : undefined"
925
- [attr.data-kendo-grid-item-index]="$any(item).index"
926
- [class.k-selected]="isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item)"
927
- [class.k-highlighted]="item.isHighlighted">
928
- <ng-container *ngIf="!skipGroupDecoration">
929
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups" role="presentation"></td>
930
- </ng-container>
931
- <td class="k-hierarchy-cell k-table-td"
932
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
933
- kendoGridLogicalCell
934
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
935
- [logicalColIndex]="0"
936
- [dataRowIndex]="$any(item).index"
937
- [dataItem]="item.data"
938
- [detailExpandCell]="true"
939
- aria-selected="false"
940
- role="gridcell"
941
- [attr.aria-expanded]="item.isExpanded">
942
- <a
943
- *ngIf="detailTemplate.showIf(item.data, $any(item).index)"
944
- [attr.title]="detailButtonTitle(item)"
945
- [attr.aria-label]="detailButtonTitle(item)"
946
- href="#" tabindex="-1" (click)="toggleRow($any(item).index, item.data)">
947
- <kendo-icon-wrapper
948
- [name]="detailButtonIconName(item)"
949
- [svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
950
- </a>
912
+ }
913
+ @if (!rowsToRender?.length) {
914
+ <tr class="k-grid-norecords" role="row">
915
+ <td [attr.colspan]="colSpan" class="k-table-td">
916
+ @if (noRecordsTemplate?.templateRef) {
917
+ <ng-template
918
+ [templateContext]="{
919
+ templateRef: noRecordsTemplate?.templateRef
920
+ }">
921
+ </ng-template>
922
+ } @else {
923
+ {{noRecordsText}}
924
+ }
951
925
  </td>
952
- <ng-container *ngIf="isStackedMode; else columnsTemplate">
953
- <td kendoGridCell
954
- [rowIndex]="$any(item).index"
955
- [detailTemplate]="detailTemplate"
956
- [item]="item"
957
- [columnIndex]="0"
958
- [attr.data-kendo-grid-column-index]="0"
926
+ </tr>
927
+ }
928
+ @for (item of rowsToRender; track trackByWrapper($index, item); let rowIndex = $index) {
929
+ @if (item.type === 'group') {
930
+ <tr
931
+ [style.height.px]="rowHeight"
932
+ kendoGridGroupHeader
959
933
  [columns]="columns"
960
- [dataItem]="item.data"
961
- [isLoading]="isLoading"
962
- [isVirtual]="isVirtual"
963
- [loadingTemplate]="cellLoadingTemplate"
964
- kendoGridLogicalCell
934
+ [groups]="groups"
935
+ [item]="$any(item)"
936
+ [hasDetails]="!!detailTemplate?.templateRef"
937
+ [skipGroupDecoration]="skipGroupDecoration"
938
+ [hasGroupHeaderColumn]="hasGroupHeaderColumn"
939
+ [groupHeaderColumns]="groupHeaderColumns"
940
+ [rowIndex]="rowIndex + 1"
941
+ [totalColumnsCount]="totalColumnsCount"
942
+ kendoGridLogicalRow
965
943
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
966
- [logicalColIndex]="0"
944
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
945
+ [totalColumns]="totalColumns"
946
+ [logicalCellsCount]="columns.length"
947
+ [logicalSlaveCellsCount]="groupHeaderSlaveCellsCount">
948
+ </tr>
949
+ }
950
+ @if (item.showDataItem) {
951
+ <tr
952
+ [style.height.px]="rowHeight"
953
+ kendoGridLogicalRow
967
954
  [dataRowIndex]="$any(item).index"
968
955
  [dataItem]="item.data"
969
- [colIndex]="0"
970
- class="k-table-td"
971
- [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag">
972
- </td>
973
- </ng-container>
974
- <ng-template #columnsTemplate>
975
- <ng-container *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;">
976
- <td *ngIf="!item.cells?.[lockedColumnsCount + columnIndex]?.skip"
977
- kendoGridCell
956
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
957
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
958
+ [totalColumns]="totalColumns"
959
+ [logicalCellsCount]="columns.length"
960
+ [logicalSlaveCellsCount]="unlockedColumnsCount(item)"
961
+ class="{{ isOdd(item) ? 'k-table-alt-row' : ''}}"
962
+ [class.k-grid-row-sticky]="rowSticky ? rowSticky({ dataItem: item.data, index: $any(item).index }) : false"
963
+ [ngClass]="rowClass({ dataItem: item.data, index: $any(item).index })"
964
+ [class.k-master-row]="true"
965
+ [class.k-expanded]="item.isExpanded && !isStackedMode"
966
+ [class.k-grid-edit-row]="isEditingRow($any(item).index)"
967
+ [attr.aria-selected]="(lockedColumnsCount < 1 || isStackedMode) ? isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item) : undefined"
968
+ [attr.data-kendo-grid-item-index]="$any(item).index"
969
+ [class.k-selected]="isSelectable({ dataItem: item.data, index: $any(item).index }) && isRowSelected(item)"
970
+ [class.k-highlighted]="item.isHighlighted">
971
+ @if (!skipGroupDecoration) {
972
+ @for (g of groups; track $index) {
973
+ <td class="k-group-cell k-table-td k-table-group-td" role="presentation"></td>
974
+ }
975
+ }
976
+ @if (detailTemplate?.templateRef && !isStackedMode) {
977
+ <td class="k-hierarchy-cell k-table-td"
978
+ kendoGridLogicalCell
979
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
980
+ [logicalColIndex]="0"
981
+ [dataRowIndex]="$any(item).index"
982
+ [dataItem]="item.data"
983
+ [detailExpandCell]="true"
984
+ aria-selected="false"
985
+ role="gridcell"
986
+ [attr.aria-expanded]="item.isExpanded">
987
+ @if (detailTemplate.showIf(item.data, $any(item).index)) {
988
+ <a
989
+ [attr.title]="detailButtonTitle(item)"
990
+ [attr.aria-label]="detailButtonTitle(item)"
991
+ href="#" tabindex="-1" (click)="toggleRow($any(item).index, item.data)">
992
+ <kendo-icon-wrapper
993
+ [name]="detailButtonIconName(item)"
994
+ [svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
995
+ </a>
996
+ }
997
+ </td>
998
+ }
999
+ @if (isStackedMode) {
1000
+ <td kendoGridCell
978
1001
  [rowIndex]="$any(item).index"
979
- [columnIndex]="lockedColumnsCount + columnIndex"
980
- [attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
981
- [column]="column"
982
- [columns]="allColumns"
1002
+ [detailTemplate]="detailTemplate"
1003
+ [item]="item"
1004
+ [columnIndex]="0"
1005
+ [attr.data-kendo-grid-column-index]="0"
1006
+ [columns]="columns"
983
1007
  [dataItem]="item.data"
984
1008
  [isLoading]="isLoading"
985
1009
  [isVirtual]="isVirtual"
986
1010
  [loadingTemplate]="cellLoadingTemplate"
987
1011
  kendoGridLogicalCell
988
1012
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
989
- [logicalColIndex]="logicalColIndex(column)"
1013
+ [logicalColIndex]="0"
990
1014
  [dataRowIndex]="$any(item).index"
991
1015
  [dataItem]="item.data"
992
- [colIndex]="columnIndex"
993
- [colSpan]="column.colspan"
994
- [rowSpan]="item.cells[lockedColumnsCount + columnIndex]?.rowspan"
995
- [attr.role]="column.tableCellsRole"
1016
+ [colIndex]="0"
996
1017
  class="k-table-td"
997
- [attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
998
- [class.k-grid-content-sticky]="column.sticky"
999
- [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
1000
- [ngClass]="column.cssClass"
1001
- [class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
1002
- [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
1003
- [attr.colspan]="column.colspan"
1004
- [class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
1005
- [class.k-highlighted]="item.cells[lockedColumnsCount + columnIndex]?.isHighlighted">
1018
+ [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag">
1006
1019
  </td>
1007
- </ng-container>
1008
- </ng-template>
1009
- </tr>
1010
- <tr *ngIf="item.showDetailRow"
1011
- class="k-detail-row"
1012
- [style.height.px]="detailRowHeight"
1013
- kendoGridLogicalRow
1014
- [dataRowIndex]="$any(item).index"
1015
- [dataItem]="item.data"
1016
- [logicalRowIndex]="isStackedMode ? logicalRowIndex(rowIndex) : logicalRowIndex(rowIndex) + 1"
1017
- [logicalSlaveRow]="false"
1018
- [logicalCellsCount]="1">
1019
- <ng-container *ngIf="!isStackedMode">
1020
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups"></td>
1020
+ } @else {
1021
+ @for (column of columns; track virtualColumns ? $index : column; let columnIndex = $index) {
1022
+ @if (!item.cells?.[lockedColumnsCount + columnIndex]?.skip) {
1023
+ <td
1024
+ kendoGridCell
1025
+ [rowIndex]="$any(item).index"
1026
+ [columnIndex]="lockedColumnsCount + columnIndex"
1027
+ [attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
1028
+ [column]="column"
1029
+ [columns]="allColumns"
1030
+ [dataItem]="item.data"
1031
+ [isLoading]="isLoading"
1032
+ [isVirtual]="isVirtual"
1033
+ [loadingTemplate]="cellLoadingTemplate"
1034
+ kendoGridLogicalCell
1035
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
1036
+ [logicalColIndex]="logicalColIndex(column)"
1037
+ [dataRowIndex]="$any(item).index"
1038
+ [dataItem]="item.data"
1039
+ [colIndex]="columnIndex"
1040
+ [colSpan]="column.colspan"
1041
+ [rowSpan]="item.cells[lockedColumnsCount + columnIndex]?.rowspan"
1042
+ [attr.role]="column.tableCellsRole"
1043
+ class="k-table-td"
1044
+ [attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
1045
+ [class.k-grid-content-sticky]="column.sticky"
1046
+ [class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
1047
+ [ngClass]="column.cssClass"
1048
+ [class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
1049
+ [ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
1050
+ [attr.colspan]="column.colspan"
1051
+ [class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
1052
+ [class.k-highlighted]="item.cells[lockedColumnsCount + columnIndex]?.isHighlighted">
1053
+ </td>
1054
+ }
1055
+ }
1056
+ }
1057
+ </tr>
1058
+ }
1059
+ @if (item.showDetailRow) {
1060
+ <tr
1061
+ class="k-detail-row"
1062
+ [style.height.px]="detailRowHeight"
1063
+ kendoGridLogicalRow
1064
+ [dataRowIndex]="$any(item).index"
1065
+ [dataItem]="item.data"
1066
+ [logicalRowIndex]="isStackedMode ? logicalRowIndex(rowIndex) : logicalRowIndex(rowIndex) + 1"
1067
+ [logicalSlaveRow]="false"
1068
+ [logicalCellsCount]="1">
1069
+ @if (!isStackedMode) {
1070
+ @for (g of groups; track $index) {
1071
+ <td class="k-group-cell k-table-td k-table-group-td"></td>
1072
+ }
1021
1073
  <td class="k-hierarchy-cell k-table-td"></td>
1022
1074
  <td class="k-detail-cell k-table-td"
1023
1075
  [attr.colspan]="columnsSpan"
@@ -1038,8 +1090,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
1038
1090
  }">
1039
1091
  </ng-template>
1040
1092
  </td>
1041
- </ng-container>
1042
- <ng-container *ngIf="isStackedMode">
1093
+ } @else {
1043
1094
  <td class="k-detail-cell k-table-td"
1044
1095
  [attr.colspan]="columnsSpan"
1045
1096
  kendoGridLogicalCell
@@ -1060,79 +1111,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
1060
1111
  }">
1061
1112
  </ng-template>
1062
1113
  </td>
1063
- </ng-container>
1064
- </tr>
1065
- <tr *ngIf="item.type === 'footer'"
1066
- class="k-group-footer"
1067
- [style.height.px]="rowHeight"
1068
- kendoGridLogicalRow
1069
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
1070
- [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
1071
- [totalColumns]="totalColumns"
1072
- [logicalCellsCount]="columns.length"
1073
- [logicalSlaveCellsCount]="unlockedColumnsCount(item)">
1074
- <ng-container *ngIf="!skipGroupDecoration">
1075
- <td class="k-group-cell k-table-td k-table-group-td" *ngFor="let g of groups"></td>
1076
- </ng-container>
1077
- <td class="k-hierarchy-cell k-table-td"
1078
- *ngIf="detailTemplate?.templateRef && !isStackedMode"
1079
- kendoGridLogicalCell
1114
+ }
1115
+ </tr>
1116
+ }
1117
+ @if (item.type === 'footer') {
1118
+ <tr
1119
+ class="k-group-footer"
1120
+ [style.height.px]="rowHeight"
1121
+ kendoGridLogicalRow
1080
1122
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
1081
- [logicalColIndex]="0"
1082
- aria-selected="false">
1083
- </td>
1123
+ [logicalSlaveRow]="lockedColumnsCount > 0 && !isStackedMode"
1124
+ [totalColumns]="totalColumns"
1125
+ [logicalCellsCount]="columns.length"
1126
+ [logicalSlaveCellsCount]="unlockedColumnsCount(item)">
1127
+ @if (!skipGroupDecoration) {
1128
+ @for (g of groups; track $index) {
1129
+ <td class="k-group-cell k-table-td k-table-group-td"></td>
1130
+ }
1131
+ }
1132
+ @if (detailTemplate?.templateRef && !isStackedMode) {
1133
+ <td class="k-hierarchy-cell k-table-td"
1134
+ kendoGridLogicalCell
1135
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
1136
+ [logicalColIndex]="0"
1137
+ aria-selected="false">
1138
+ </td>
1139
+ }
1084
1140
 
1085
- <ng-container *ngIf="!isStackedMode">
1086
- <td kendoGridLogicalCell
1141
+ @if (!isStackedMode) {
1142
+ @for (column of footerColumns; track virtualColumns ? $index : column; let columnIndex = $index) {
1143
+ <td kendoGridLogicalCell
1144
+ [logicalRowIndex]="logicalRowIndex(rowIndex)"
1145
+ [logicalColIndex]="logicalColIndex(column)"
1146
+ [attr.data-skip]="skipGroupDecoration"
1147
+ class="k-table-td">
1148
+ <ng-template
1149
+ [templateContext]="{
1150
+ templateRef: $any(column).groupFooterTemplateRef,
1151
+ group: $any(item.data),
1152
+ field: $any(column).field,
1153
+ column: column,
1154
+ aggregates: $any(item.data)?.aggregates,
1155
+ $implicit: $any(item.data)?.aggregates
1156
+ }">
1157
+ </ng-template>
1158
+ </td>
1159
+ }
1160
+ } @else {
1161
+ <td kendoGridLogicalCell
1087
1162
  [logicalRowIndex]="logicalRowIndex(rowIndex)"
1088
- [logicalColIndex]="logicalColIndex(column)"
1089
- [attr.data-skip]="skipGroupDecoration"
1090
- class="k-table-td"
1091
- *ngFor="let column of footerColumns; let columnIndex = index; trackBy: trackByColumns;">
1092
- <ng-template
1093
- [templateContext]="{
1094
- templateRef: $any(column).groupFooterTemplateRef,
1095
- group: $any(item.data),
1096
- field: $any(column).field,
1097
- column: column,
1098
- aggregates: $any(item.data)?.aggregates,
1099
- $implicit: $any(item.data)?.aggregates
1100
- }">
1101
- </ng-template>
1102
- </td>
1103
- </ng-container>
1104
-
1105
- <ng-container *ngIf="isStackedMode">
1106
- <td kendoGridLogicalCell
1107
- [logicalRowIndex]="logicalRowIndex(rowIndex)"
1108
- [logicalColIndex]="hasDetailTemplate ? 1 : 0"
1109
- [attr.data-skip]="skipGroupDecoration"
1110
- class="k-table-td">
1111
- <div class="k-grid-column-template">
1112
- <ng-container *ngFor="let col of footerColumns">
1113
- <div class="k-column-template-item" *ngIf="$any(col).groupFooterTemplateRef">
1114
- <ng-template
1115
- [templateContext]="{
1116
- templateRef: $any(col).groupFooterTemplateRef,
1117
- group: $any(item.data),
1118
- field: $any(col).field,
1119
- column: col,
1120
- aggregates: $any(item.data)?.aggregates,
1121
- $implicit: $any(item.data)?.aggregates
1122
- }">
1123
- </ng-template>
1124
- </div>
1125
- </ng-container>
1126
- </div>
1127
- </td>
1128
- </ng-container>
1129
- </tr>
1130
- </ng-container>
1131
- <kendo-resize-sensor *ngIf="rowSticky" (resize)="resizeHandler()"></kendo-resize-sensor>
1163
+ [logicalColIndex]="hasDetailTemplate ? 1 : 0"
1164
+ [attr.data-skip]="skipGroupDecoration"
1165
+ class="k-table-td">
1166
+ <div class="k-grid-column-template">
1167
+ @for (col of footerColumns; track $index) {
1168
+ @if ($any(col).groupFooterTemplateRef) {
1169
+ <div class="k-column-template-item">
1170
+ <ng-template
1171
+ [templateContext]="{
1172
+ templateRef: $any(col).groupFooterTemplateRef,
1173
+ group: $any(item.data),
1174
+ field: $any(col).field,
1175
+ column: col,
1176
+ aggregates: $any(item.data)?.aggregates,
1177
+ $implicit: $any(item.data)?.aggregates
1178
+ }">
1179
+ </ng-template>
1180
+ </div>
1181
+ }
1182
+ }
1183
+ </div>
1184
+ </td>
1185
+ }
1186
+ </tr>
1187
+ }
1188
+ }
1189
+ @if (rowSticky) {
1190
+ <kendo-resize-sensor (resize)="resizeHandler()"></kendo-resize-sensor>
1191
+ }
1132
1192
  `,
1133
1193
  standalone: true,
1134
1194
  imports: [
1135
- NgIf, LogicalRowDirective, NgFor, LogicalCellDirective, CellComponent, NgClass, NgStyle, TemplateContextDirective,
1195
+ LogicalRowDirective, LogicalCellDirective, CellComponent, NgClass, NgStyle, TemplateContextDirective,
1136
1196
  GroupHeaderComponent, IconWrapperComponent, NgTemplateOutlet, ResizeSensorComponent
1137
1197
  ]
1138
1198
  }]