@progress/kendo-angular-gantt
Version:
Kendo UI Angular Gantt
158 lines (157 loc) • 7.25 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 { ChangeDetectorRef, Component, forwardRef, HostBinding, Input, TemplateRef } from '@angular/core';
import { MappingService } from '../common/mapping.service';
import { NavigationService } from '../navigation/navigation.service';
import { DependencyDomService } from '../dependencies/dependency-dom.service';
import { OptionChangesService } from '../common/option-changes.service';
import { TimelineViewService } from './../timeline/timeline-view.service';
import { GanttTaskBase } from './gantt-task-base';
import { isPresent } from '../utils';
import { NgClass, NgTemplateOutlet } from '@angular/common';
import { touchEnabled } from '@progress/kendo-common';
import * as i0 from "@angular/core";
import * as i1 from "../common/mapping.service";
import * as i2 from "./../timeline/timeline-view.service";
import * as i3 from "../dependencies/dependency-dom.service";
import * as i4 from "../common/option-changes.service";
import * as i5 from "../navigation/navigation.service";
/**
* @hidden
*/
export class GanttSummaryTaskComponent extends GanttTaskBase {
summaryWrapperClass = true;
template;
isExpanded;
touchEnabled = touchEnabled;
get ariaExpanded() {
// if no callback is provided, all child items are displayed and the item is regarded as expanded
// replicates the TreeList aria-expanded behavior
const isExpanded = !isPresent(this.isExpanded) || this.isExpanded(this.dataItem);
return String(isExpanded);
}
constructor(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService) {
super(mapper, timelineViewService, dependencyDomService, optionChangesService, cdr, navigationService);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttSummaryTaskComponent, deps: [{ token: i1.MappingService }, { token: i2.TimelineViewService }, { token: i3.DependencyDomService }, { token: i4.OptionChangesService }, { token: i0.ChangeDetectorRef }, { token: i5.NavigationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: GanttSummaryTaskComponent, isStandalone: true, selector: "kendo-gantt-summary-task", inputs: { template: "template", isExpanded: "isExpanded" }, host: { properties: { "class.k-summary-wrap": "this.summaryWrapperClass" } }, providers: [
{
provide: GanttTaskBase,
useExisting: forwardRef(() => GanttSummaryTaskComponent)
}
], usesInheritance: true, ngImport: i0, template: `
<div
#task
role="treeitem"
class="k-task k-task-summary"
[ngClass]="taskClass(dataItem)"
[style.width.px]="taskWidth"
[attr.title]="mapper.extractFromTask(dataItem, 'title')"
[class.k-selected]="isSelected(dataItem)"
[attr.aria-selected]="ariaSelected"
[attr.aria-expanded]="ariaExpanded"
[attr.aria-level]="level + 1"
>
(!template) {
<div
class="k-task-summary-progress"
[style.width.px]="taskWidth">
<div
class="k-task-summary-complete"
[style.width.px]="completionOverlayWidth"
>
</div>
</div>
} {
<ng-template
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
$implicit: dataItem,
elementWidth: taskWidth
}"
></ng-template>
}
</div>
(renderDependencyDragClues) {
<div
class="k-task-dot k-task-start k-touch-action-none"
[class.k-display-block]="touchEnabled"
>
</div>
<div
class="k-task-dot k-task-end k-touch-action-none"
[class.k-display-block]="touchEnabled"
>
</div>
}
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: GanttSummaryTaskComponent, decorators: [{
type: Component,
args: [{
selector: 'kendo-gantt-summary-task',
providers: [
{
provide: GanttTaskBase,
useExisting: forwardRef(() => GanttSummaryTaskComponent)
}
],
template: `
<div
#task
role="treeitem"
class="k-task k-task-summary"
[ngClass]="taskClass(dataItem)"
[style.width.px]="taskWidth"
[attr.title]="mapper.extractFromTask(dataItem, 'title')"
[class.k-selected]="isSelected(dataItem)"
[attr.aria-selected]="ariaSelected"
[attr.aria-expanded]="ariaExpanded"
[attr.aria-level]="level + 1"
>
(!template) {
<div
class="k-task-summary-progress"
[style.width.px]="taskWidth">
<div
class="k-task-summary-complete"
[style.width.px]="completionOverlayWidth"
>
</div>
</div>
} {
<ng-template
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{
$implicit: dataItem,
elementWidth: taskWidth
}"
></ng-template>
}
</div>
(renderDependencyDragClues) {
<div
class="k-task-dot k-task-start k-touch-action-none"
[class.k-display-block]="touchEnabled"
>
</div>
<div
class="k-task-dot k-task-end k-touch-action-none"
[class.k-display-block]="touchEnabled"
>
</div>
}
`,
standalone: true,
imports: [NgClass, NgTemplateOutlet]
}]
}], ctorParameters: () => [{ type: i1.MappingService }, { type: i2.TimelineViewService }, { type: i3.DependencyDomService }, { type: i4.OptionChangesService }, { type: i0.ChangeDetectorRef }, { type: i5.NavigationService }], propDecorators: { summaryWrapperClass: [{
type: HostBinding,
args: ['class.k-summary-wrap']
}], template: [{
type: Input
}], isExpanded: [{
type: Input
}] } });