@progress/kendo-angular-grid 18.0.1-develop.2 → 18.1.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.
- package/columns/cell-rowspan.d.ts +10 -0
- package/columns/column-base.d.ts +8 -2
- package/editing-directives/local-row-edit.service.d.ts +1 -1
- package/esm2022/aggregates/selection-aggregate.service.mjs +1 -1
- package/esm2022/columns/cell-rowspan.mjs +5 -0
- package/esm2022/columns/column-base.mjs +13 -2
- package/esm2022/dragdrop/draggable-column.directive.mjs +2 -2
- package/esm2022/editing-directives/local-row-edit.service.mjs +1 -1
- package/esm2022/grid.component.mjs +6 -3
- package/esm2022/grouping/group-panel.component.mjs +1 -1
- package/esm2022/navigation/logical-cell.directive.mjs +7 -1
- package/esm2022/navigation/navigation.service.mjs +27 -35
- package/esm2022/package-metadata.mjs +2 -2
- package/esm2022/pdf/pdf.component.mjs +1 -1
- package/esm2022/rendering/cell.component.mjs +1 -1
- package/esm2022/rendering/common/col-group.component.mjs +1 -1
- package/esm2022/rendering/footer/footer.component.mjs +1 -1
- package/esm2022/rendering/header/header.component.mjs +2 -2
- package/esm2022/rendering/list.component.mjs +14 -5
- package/esm2022/rendering/rowspan.service.mjs +24 -0
- package/esm2022/rendering/table-body.component.mjs +106 -64
- package/esm2022/selection/selection-default.mjs +1 -1
- package/fesm2022/progress-kendo-angular-grid.mjs +202 -123
- package/index.d.ts +1 -0
- package/navigation/logical-cell.directive.d.ts +1 -0
- package/navigation/navigation.service.d.ts +2 -0
- package/package.json +19 -19
- package/pdf/pdf.component.d.ts +1 -1
- package/rendering/cell.component.d.ts +1 -1
- package/rendering/common/col-group.component.d.ts +1 -1
- package/rendering/footer/footer.component.d.ts +1 -1
- package/rendering/header/header.component.d.ts +1 -1
- package/rendering/list.component.d.ts +4 -1
- package/rendering/rowspan.service.d.ts +14 -0
- package/rendering/table-body.component.d.ts +9 -2
- package/schematics/ngAdd/index.js +4 -4
|
@@ -32,6 +32,7 @@ import { CellComponent } from './cell.component';
|
|
|
32
32
|
import { LogicalCellDirective } from '../navigation/logical-cell.directive';
|
|
33
33
|
import { LogicalRowDirective } from '../navigation/logical-row.directive';
|
|
34
34
|
import { NgIf, NgFor, NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
|
|
35
|
+
import { RowspanService } from './rowspan.service';
|
|
35
36
|
import * as i0 from "@angular/core";
|
|
36
37
|
import * as i1 from "./details/details.service";
|
|
37
38
|
import * as i2 from "../grouping/groups.service";
|
|
@@ -43,6 +44,7 @@ import * as i7 from "../selection/selection.service";
|
|
|
43
44
|
import * as i8 from "../selection/cell-selection.service";
|
|
44
45
|
import * as i9 from "../common/column-info.service";
|
|
45
46
|
import * as i10 from "../navigation/navigation.service";
|
|
47
|
+
import * as i11 from "./rowspan.service";
|
|
46
48
|
const columnCellIndex = (cell, cells) => {
|
|
47
49
|
let cellIndex = 0;
|
|
48
50
|
for (let idx = 0; idx < cells.length; idx++) {
|
|
@@ -71,6 +73,7 @@ export class TableBodyComponent {
|
|
|
71
73
|
cellSelectionService;
|
|
72
74
|
columnInfoService;
|
|
73
75
|
navigationService;
|
|
76
|
+
rowspanService;
|
|
74
77
|
columns = [];
|
|
75
78
|
allColumns;
|
|
76
79
|
groups = [];
|
|
@@ -93,6 +96,7 @@ export class TableBodyComponent {
|
|
|
93
96
|
trackBy = defaultTrackBy;
|
|
94
97
|
rowSticky;
|
|
95
98
|
totalColumns;
|
|
99
|
+
rowClass = () => null;
|
|
96
100
|
hostClass = true;
|
|
97
101
|
groupHeaderSlaveCellsCount;
|
|
98
102
|
groupHeaderColumns;
|
|
@@ -103,8 +107,9 @@ export class TableBodyComponent {
|
|
|
103
107
|
clickTimeout;
|
|
104
108
|
minusIcon = minusIcon;
|
|
105
109
|
plusIcon = plusIcon;
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
dataArray;
|
|
111
|
+
rerender = false;
|
|
112
|
+
constructor(detailsService, groupsService, changeNotification, editService, ctx, ngZone, renderer, element, domEvents, selectionService, cellSelectionService, columnInfoService, navigationService, rowspanService) {
|
|
108
113
|
this.detailsService = detailsService;
|
|
109
114
|
this.groupsService = groupsService;
|
|
110
115
|
this.changeNotification = changeNotification;
|
|
@@ -118,6 +123,7 @@ export class TableBodyComponent {
|
|
|
118
123
|
this.cellSelectionService = cellSelectionService;
|
|
119
124
|
this.columnInfoService = columnInfoService;
|
|
120
125
|
this.navigationService = navigationService;
|
|
126
|
+
this.rowspanService = rowspanService;
|
|
121
127
|
this.noRecordsText = this.ctx.localization.get('noRecords');
|
|
122
128
|
this.cellKeydownSubscription = this.navigationService.cellKeydown.subscribe((args) => this.cellKeydownHandler(args));
|
|
123
129
|
this.trackByWrapper = this.trackByWrapper.bind(this);
|
|
@@ -126,6 +132,12 @@ export class TableBodyComponent {
|
|
|
126
132
|
get newDataItem() {
|
|
127
133
|
return this.editService.newDataItem;
|
|
128
134
|
}
|
|
135
|
+
get cachedDataArray() {
|
|
136
|
+
if (!this.dataArray) {
|
|
137
|
+
this.dataArray = this.data.map(item => item);
|
|
138
|
+
}
|
|
139
|
+
return this.dataArray;
|
|
140
|
+
}
|
|
129
141
|
// Number of unlocked columns in the next table, if any
|
|
130
142
|
unlockedColumnsCount(item) {
|
|
131
143
|
const allColumns = this.allColumns || this.columns;
|
|
@@ -139,6 +151,24 @@ export class TableBodyComponent {
|
|
|
139
151
|
const headerFooterColumnsCount = this.totalColumnsCount - this.lockedColumnsCount - (this.allColumns || this.columns).length;
|
|
140
152
|
return item && this.isDataItem(item) ? contentColumnsCount : headerFooterColumnsCount;
|
|
141
153
|
}
|
|
154
|
+
shouldSkipCell(rowIndex, colIndex) {
|
|
155
|
+
return this.rowspanService.shouldSkip(rowIndex, colIndex);
|
|
156
|
+
}
|
|
157
|
+
getRowspan(row, column, colIndex) {
|
|
158
|
+
if (this.rerender) {
|
|
159
|
+
this.dataArray = null;
|
|
160
|
+
this.rerender = false;
|
|
161
|
+
}
|
|
162
|
+
const rowspan = column.cellRowspan(row, column, this.cachedDataArray);
|
|
163
|
+
if (rowspan > 1) {
|
|
164
|
+
this.rowspanService.addCells(row.index, colIndex, rowspan);
|
|
165
|
+
}
|
|
166
|
+
this.ngZone.runOutsideAngular(() => setTimeout(() => {
|
|
167
|
+
this.rerender = true;
|
|
168
|
+
this.rowspanService.reset();
|
|
169
|
+
}));
|
|
170
|
+
return rowspan;
|
|
171
|
+
}
|
|
142
172
|
isAriaSelected(item, column) {
|
|
143
173
|
return this.cellSelectionService.isCellSelected(item, column) ||
|
|
144
174
|
this.isRowSelected(item) ? 'true' : 'false';
|
|
@@ -442,7 +472,7 @@ export class TableBodyComponent {
|
|
|
442
472
|
});
|
|
443
473
|
}
|
|
444
474
|
}
|
|
445
|
-
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 });
|
|
475
|
+
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 }, { token: i11.RowspanService }], target: i0.ɵɵFactoryTarget.Component });
|
|
446
476
|
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", data: "data", skip: "skip", selectable: "selectable", filterable: "filterable", noRecordsText: "noRecordsText", isLocked: "isLocked", isLoading: "isLoading", isVirtual: "isVirtual", cellLoadingTemplate: "cellLoadingTemplate", skipGroupDecoration: "skipGroupDecoration", showGroupFooters: "showGroupFooters", 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: `
|
|
447
477
|
<ng-container *ngIf="editService.hasNewItem">
|
|
448
478
|
<tr class="k-grid-add-row k-grid-edit-row k-master-row"
|
|
@@ -558,35 +588,41 @@ export class TableBodyComponent {
|
|
|
558
588
|
[svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
|
|
559
589
|
</a>
|
|
560
590
|
</td>
|
|
561
|
-
<
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
591
|
+
<ng-container *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;">
|
|
592
|
+
<td *ngIf="column.cellRowspan ? !shouldSkipCell(rowIndex, lockedColumnsCount + columnIndex) : true"
|
|
593
|
+
kendoGridCell
|
|
594
|
+
[rowIndex]="$any(item).index"
|
|
595
|
+
[columnIndex]="lockedColumnsCount + columnIndex"
|
|
596
|
+
[attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
|
|
597
|
+
[column]="column"
|
|
598
|
+
[dataItem]="item.data"
|
|
599
|
+
[isLoading]="isLoading"
|
|
600
|
+
[isVirtual]="isVirtual"
|
|
601
|
+
[loadingTemplate]="cellLoadingTemplate"
|
|
602
|
+
kendoGridLogicalCell
|
|
603
|
+
[logicalRowIndex]="logicalRowIndex(rowIndex)"
|
|
604
|
+
[logicalColIndex]="logicalColIndex(column)"
|
|
605
|
+
[dataRowIndex]="$any(item).index"
|
|
606
|
+
[dataItem]="item.data"
|
|
607
|
+
[colIndex]="columnIndex"
|
|
608
|
+
[colSpan]="column.colspan"
|
|
609
|
+
[rowSpan]="column.cellRowspan ? getRowspan({
|
|
610
|
+
index: rowIndex,
|
|
611
|
+
dataItem: item
|
|
612
|
+
}, column, lockedColumnsCount + columnIndex) : 1"
|
|
613
|
+
[attr.role]="column.tableCellsRole"
|
|
614
|
+
class="k-table-td"
|
|
615
|
+
[attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
|
|
616
|
+
[class.k-grid-content-sticky]="column.sticky"
|
|
617
|
+
[class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
|
|
618
|
+
[ngClass]="column.cssClass"
|
|
619
|
+
[class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
|
|
620
|
+
[ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
|
|
621
|
+
[attr.colspan]="column.colspan"
|
|
622
|
+
[class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
|
|
623
|
+
>
|
|
624
|
+
</td>
|
|
625
|
+
</ng-container>
|
|
590
626
|
</tr>
|
|
591
627
|
<tr *ngIf="isDataItem(item) &&
|
|
592
628
|
(!$any(item).group || isDataItemInExpandedGroup($any(item))) &&
|
|
@@ -787,35 +823,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
787
823
|
[svgIcon]="detailButtonSvgIcon(item)"></kendo-icon-wrapper>
|
|
788
824
|
</a>
|
|
789
825
|
</td>
|
|
790
|
-
<
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
826
|
+
<ng-container *ngFor="let column of columns; let columnIndex = index; trackBy: trackByColumns;">
|
|
827
|
+
<td *ngIf="column.cellRowspan ? !shouldSkipCell(rowIndex, lockedColumnsCount + columnIndex) : true"
|
|
828
|
+
kendoGridCell
|
|
829
|
+
[rowIndex]="$any(item).index"
|
|
830
|
+
[columnIndex]="lockedColumnsCount + columnIndex"
|
|
831
|
+
[attr.data-kendo-grid-column-index]="lockedColumnsCount + columnIndex"
|
|
832
|
+
[column]="column"
|
|
833
|
+
[dataItem]="item.data"
|
|
834
|
+
[isLoading]="isLoading"
|
|
835
|
+
[isVirtual]="isVirtual"
|
|
836
|
+
[loadingTemplate]="cellLoadingTemplate"
|
|
837
|
+
kendoGridLogicalCell
|
|
838
|
+
[logicalRowIndex]="logicalRowIndex(rowIndex)"
|
|
839
|
+
[logicalColIndex]="logicalColIndex(column)"
|
|
840
|
+
[dataRowIndex]="$any(item).index"
|
|
841
|
+
[dataItem]="item.data"
|
|
842
|
+
[colIndex]="columnIndex"
|
|
843
|
+
[colSpan]="column.colspan"
|
|
844
|
+
[rowSpan]="column.cellRowspan ? getRowspan({
|
|
845
|
+
index: rowIndex,
|
|
846
|
+
dataItem: item
|
|
847
|
+
}, column, lockedColumnsCount + columnIndex) : 1"
|
|
848
|
+
[attr.role]="column.tableCellsRole"
|
|
849
|
+
class="k-table-td"
|
|
850
|
+
[attr.aria-selected]="lockedColumnsCount < 1 && isSelectable({ dataItem: item.data, index: $any(item).index }) ? isAriaSelected(item, column) : undefined"
|
|
851
|
+
[class.k-grid-content-sticky]="column.sticky"
|
|
852
|
+
[class.k-touch-action-none]="isSelectable({ dataItem: item.data, index: $any(item).index }) && $any(selectable).drag"
|
|
853
|
+
[ngClass]="column.cssClass"
|
|
854
|
+
[class.k-grid-edit-cell]="isEditingCell($any(item).index, column)"
|
|
855
|
+
[ngStyle]="column.sticky ? addStickyColumnStyles(column) : column.style"
|
|
856
|
+
[attr.colspan]="column.colspan"
|
|
857
|
+
[class.k-selected]="isSelectable && cellSelectionService.isCellSelected(item, column)"
|
|
858
|
+
>
|
|
859
|
+
</td>
|
|
860
|
+
</ng-container>
|
|
819
861
|
</tr>
|
|
820
862
|
<tr *ngIf="isDataItem(item) &&
|
|
821
863
|
(!$any(item).group || isDataItemInExpandedGroup($any(item))) &&
|
|
@@ -902,7 +944,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
902
944
|
GroupHeaderComponent, IconWrapperComponent, NgTemplateOutlet, ResizeSensorComponent
|
|
903
945
|
]
|
|
904
946
|
}]
|
|
905
|
-
}], ctorParameters: function () { return [{ type: i1.DetailsService }, { type: i2.GroupsService }, { type: i3.ChangeNotificationService }, { type: i4.EditService }, { type: i5.ContextService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i6.DomEventsService }, { type: i7.SelectionService }, { type: i8.CellSelectionService }, { type: i9.ColumnInfoService }, { type: i10.NavigationService }]; }, propDecorators: { columns: [{
|
|
947
|
+
}], ctorParameters: function () { return [{ type: i1.DetailsService }, { type: i2.GroupsService }, { type: i3.ChangeNotificationService }, { type: i4.EditService }, { type: i5.ContextService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i6.DomEventsService }, { type: i7.SelectionService }, { type: i8.CellSelectionService }, { type: i9.ColumnInfoService }, { type: i10.NavigationService }, { type: i11.RowspanService }]; }, propDecorators: { columns: [{
|
|
906
948
|
type: Input
|
|
907
949
|
}], allColumns: [{
|
|
908
950
|
type: Input
|
|
@@ -946,9 +988,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
946
988
|
type: Input
|
|
947
989
|
}], totalColumns: [{
|
|
948
990
|
type: Input
|
|
991
|
+
}], rowClass: [{
|
|
992
|
+
type: Input
|
|
949
993
|
}], hostClass: [{
|
|
950
994
|
type: HostBinding,
|
|
951
995
|
args: ['class.k-table-tbody']
|
|
952
|
-
}], rowClass: [{
|
|
953
|
-
type: Input
|
|
954
996
|
}] } });
|
|
@@ -72,7 +72,7 @@ export class Selection {
|
|
|
72
72
|
this.ctx.grid.rowSelected = (row) => this.rowSelectionState.has(this.getItemKey(row));
|
|
73
73
|
}
|
|
74
74
|
if (!isPresent(this.ctx.grid.isRowSelectable)) {
|
|
75
|
-
this.ctx.grid.isRowSelectable = (
|
|
75
|
+
this.ctx.grid.isRowSelectable = () => Boolean(this.ctx.grid.selectable);
|
|
76
76
|
}
|
|
77
77
|
if (!isPresent(this.ctx.grid.cellSelected)) {
|
|
78
78
|
this.ctx.grid.cellSelected = (row, column, colIndex) => {
|