@progress/kendo-angular-gantt
Version:
Kendo UI Angular Gantt
62 lines (59 loc) • 3.03 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Component, HostBinding, Input } from "@angular/core";
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class GanttHeaderTableBodyComponent {
tbodyClass = true;
groupSlots;
slots;
trackBySlotIndex(index, item) {
// Combine index with timestamp to ensure uniqueness
// even when multiple slots have the same start time
return `${index}-${item.start.getTime()}`;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttHeaderTableBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GanttHeaderTableBodyComponent, isStandalone: true, selector: "[kendoGanttHeaderTableBody]", inputs: { groupSlots: "groupSlots", slots: "slots" }, host: { properties: { "class.k-table-tbody": "this.tbodyClass" } }, ngImport: i0, template: `
<tr class="k-table-row">
@for (item of groupSlots; track trackBySlotIndex($index, item)) {
<td [attr.colspan]="item.span" class="k-header k-table-td">{{ item.text }}</td>
}
</tr>
<tr class="k-table-row">
@for (item of slots; track trackBySlotIndex($index, item)) {
<td class="k-header k-table-td" [attr.colspan]="item.span === 7 ? item.span : 1" [attr.title]="item.text">{{ item.text }}</td>
}
</tr>
`, isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttHeaderTableBodyComponent, decorators: [{
type: Component,
args: [{
// eslint-disable-next-line @angular-eslint/component-selector
selector: '[kendoGanttHeaderTableBody]',
template: `
<tr class="k-table-row">
@for (item of groupSlots; track trackBySlotIndex($index, item)) {
<td [attr.colspan]="item.span" class="k-header k-table-td">{{ item.text }}</td>
}
</tr>
<tr class="k-table-row">
@for (item of slots; track trackBySlotIndex($index, item)) {
<td class="k-header k-table-td" [attr.colspan]="item.span === 7 ? item.span : 1" [attr.title]="item.text">{{ item.text }}</td>
}
</tr>
`,
standalone: true
}]
}], propDecorators: { tbodyClass: [{
type: HostBinding,
args: ['class.k-table-tbody']
}], groupSlots: [{
type: Input
}], slots: [{
type: Input
}] } });