@progress/kendo-angular-gantt 2.0.0-next.202204011501 → 2.0.0-next.202204121507
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/binding-directives/flat-binding.directive.d.ts +24 -0
- package/binding-directives/hierarchy-binding.directive.d.ts +22 -0
- package/bundles/kendo-angular-gantt.umd.js +1 -1
- package/columns/cell-template.directive.d.ts +28 -0
- package/columns/column-base.d.ts +85 -0
- package/columns/column-group.component.d.ts +103 -0
- package/columns/column-menu-template.directive.d.ts +22 -0
- package/columns/column.component.d.ts +130 -0
- package/columns/columns.d.ts +15 -0
- package/columns/edit-template.directive.d.ts +26 -0
- package/columns/filter-cell-template.directive.d.ts +21 -0
- package/columns/filter-menu-template.directive.d.ts +20 -0
- package/columns/footer-template.directive.d.ts +24 -0
- package/columns/header-template.directive.d.ts +22 -0
- package/columns/span-column.component.d.ts +112 -0
- package/common/default-callbacks.d.ts +25 -0
- package/common/mapping.service.d.ts +38 -0
- package/common/option-changes.service.d.ts +17 -0
- package/common/touch-enabled.d.ts +9 -0
- package/dependencies/dependency-dom.service.d.ts +46 -0
- package/dependencies/dom-dependency-args.d.ts +24 -0
- package/dependencies/gantt-dependency.directive.d.ts +29 -0
- package/dependencies/utils.d.ts +53 -0
- package/dragging/dependency-drag-create.directive.d.ts +75 -0
- package/dragging/drag-validation-tooltip.component.d.ts +32 -0
- package/editing/add-task.component.d.ts +47 -0
- package/editing/dependencies-table.component.d.ts +42 -0
- package/editing/edit-dialog.component.d.ts +33 -0
- package/editing/edit.service.d.ts +44 -0
- package/editing/task-fields.component.d.ts +25 -0
- package/editing/utils.d.ts +10 -0
- package/esm2015/binding-directives/flat-binding.directive.js +34 -0
- package/esm2015/binding-directives/hierarchy-binding.directive.js +32 -0
- package/esm2015/columns/cell-template.directive.js +37 -0
- package/esm2015/columns/column-base.js +52 -0
- package/esm2015/columns/column-group.component.js +94 -0
- package/esm2015/columns/column-menu-template.directive.js +31 -0
- package/esm2015/columns/column.component.js +133 -0
- package/esm2015/columns/columns.js +15 -0
- package/esm2015/columns/edit-template.directive.js +35 -0
- package/esm2015/columns/filter-cell-template.directive.js +30 -0
- package/esm2015/columns/filter-menu-template.directive.js +29 -0
- package/esm2015/columns/footer-template.directive.js +33 -0
- package/esm2015/columns/header-template.directive.js +31 -0
- package/esm2015/columns/span-column.component.js +86 -0
- package/esm2015/common/default-callbacks.js +25 -0
- package/esm2015/common/mapping.service.js +64 -0
- package/esm2015/common/option-changes.service.js +26 -0
- package/esm2015/common/touch-enabled.js +9 -0
- package/esm2015/dependencies/dependency-dom.service.js +70 -0
- package/esm2015/dependencies/dom-dependency-args.js +5 -0
- package/esm2015/dependencies/gantt-dependency.directive.js +82 -0
- package/esm2015/dependencies/utils.js +195 -0
- package/esm2015/dragging/dependency-drag-create.directive.js +318 -0
- package/esm2015/dragging/drag-validation-tooltip.component.js +90 -0
- package/esm2015/editing/add-task.component.js +109 -0
- package/esm2015/editing/dependencies-table.component.js +196 -0
- package/esm2015/editing/edit-dialog.component.js +170 -0
- package/esm2015/editing/edit.service.js +111 -0
- package/esm2015/editing/task-fields.component.js +101 -0
- package/esm2015/editing/utils.js +15 -0
- package/esm2015/expanded-state/expand-event.js +9 -0
- package/esm2015/expanded-state/expandable.directive.js +23 -0
- package/esm2015/gantt.component.js +2227 -0
- package/esm2015/gantt.module.js +264 -0
- package/esm2015/kendo-angular-gantt.js +8 -0
- package/esm2015/localization/custom-messages.component.js +41 -0
- package/esm2015/localization/gantt-localization.service.js +25 -0
- package/esm2015/localization/localized-messages.directive.js +36 -0
- package/esm2015/localization/messages.js +157 -0
- package/esm2015/main.js +37 -0
- package/esm2015/models/cell-content-type.interface.js +5 -0
- package/esm2015/models/class-callbacks.js +5 -0
- package/esm2015/models/column-menu-settings.interface.js +5 -0
- package/esm2015/models/column-reorder-config.js +5 -0
- package/esm2015/models/date-range.interface.js +5 -0
- package/esm2015/models/dependency-type.enum.js +20 -0
- package/esm2015/models/events/cell-click-event.interface.js +5 -0
- package/esm2015/models/events/cell-close-event.interface.js +14 -0
- package/esm2015/models/events/click-event.interface.js +5 -0
- package/esm2015/models/events/column-locked-change-event.interface.js +5 -0
- package/esm2015/models/events/column-reorder-event.interface.js +5 -0
- package/esm2015/models/events/column-resize-event.interface.js +5 -0
- package/esm2015/models/events/column-visibility-change-event.interface.js +5 -0
- package/esm2015/models/events/data-state-change-event.interface.js +5 -0
- package/esm2015/models/events/dependency-add-event.interface.js +5 -0
- package/esm2015/models/events/selected-view-change-event.interface.js +5 -0
- package/esm2015/models/events/task-add-event.interface.js +5 -0
- package/esm2015/models/events/task-click-event.interface.js +5 -0
- package/esm2015/models/events/task-delete-event.interface.js +5 -0
- package/esm2015/models/events/task-edit-event.interface.js +5 -0
- package/esm2015/models/events/task-move-end-event.interface.js +5 -0
- package/esm2015/models/events/task-move-event.interface.js +5 -0
- package/esm2015/models/events/task-move-start-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-end-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-event.interface.js +5 -0
- package/esm2015/models/events/task-resize-start-event.interface.js +5 -0
- package/esm2015/models/filterable-settings.js +5 -0
- package/esm2015/models/gantt-dependency-model-fields.interface.js +13 -0
- package/esm2015/models/gantt-dependency.interface.js +5 -0
- package/esm2015/models/gantt-task-model-fields.interface.js +15 -0
- package/esm2015/models/gantt-task.interface.js +5 -0
- package/esm2015/models/models.js +7 -0
- package/esm2015/models/slot.interface.js +5 -0
- package/esm2015/models/sort-settings.js +17 -0
- package/esm2015/models/splitter-pane-options.interface.js +20 -0
- package/esm2015/models/timeline-options.interface.js +5 -0
- package/esm2015/models/timeline-view.js +5 -0
- package/esm2015/models/toolbar-settings.js +5 -0
- package/esm2015/models/view-item.interface.js +5 -0
- package/esm2015/navigation/navigation-models.js +5 -0
- package/esm2015/navigation/navigation.service.js +265 -0
- package/esm2015/navigation/utils.js +69 -0
- package/esm2015/package-metadata.js +15 -0
- package/esm2015/rendering/gantt-header-table-body.component.js +42 -0
- package/esm2015/rendering/gantt-milestone-task.component.js +107 -0
- package/esm2015/rendering/gantt-summary-task.component.js +158 -0
- package/esm2015/rendering/gantt-task-base.js +148 -0
- package/esm2015/rendering/gantt-task.component.js +204 -0
- package/esm2015/rendering/gantt-tasks-table-body.component.js +160 -0
- package/esm2015/scrolling/drag-scroll-settings.js +20 -0
- package/esm2015/scrolling/scroll-sync.service.js +80 -0
- package/esm2015/scrolling/timeline-scroll.directive.js +75 -0
- package/esm2015/scrolling/timeline-scroll.service.js +39 -0
- package/esm2015/scrolling/utils.js +77 -0
- package/esm2015/selection/selectable.directive.js +112 -0
- package/esm2015/selection/selection-change-event.js +5 -0
- package/esm2015/template-directives/summary-task-template.directive.js +50 -0
- package/esm2015/template-directives/task-content-template.directive.js +45 -0
- package/esm2015/template-directives/task-template.directive.js +48 -0
- package/esm2015/timeline/gantt-timeline.component.js +334 -0
- package/esm2015/timeline/timeline-base-view.service.js +160 -0
- package/esm2015/timeline/timeline-day-view.component.js +38 -0
- package/esm2015/timeline/timeline-day-view.service.js +66 -0
- package/esm2015/timeline/timeline-month-view.component.js +38 -0
- package/esm2015/timeline/timeline-month-view.service.js +64 -0
- package/esm2015/timeline/timeline-view.service.js +35 -0
- package/esm2015/timeline/timeline-week-view.component.js +38 -0
- package/esm2015/timeline/timeline-week-view.service.js +60 -0
- package/esm2015/timeline/view-base.js +45 -0
- package/esm2015/toolbar/toolbar-template.directive.js +127 -0
- package/esm2015/toolbar/toolbar.component.js +94 -0
- package/esm2015/toolbar/view-selector.component.js +96 -0
- package/esm2015/utils.js +293 -0
- package/expanded-state/expand-event.d.ts +13 -0
- package/expanded-state/expandable.directive.d.ts +20 -0
- package/fesm2015/kendo-angular-gantt.js +7706 -0
- package/gantt.component.d.ts +750 -0
- package/gantt.module.d.ts +94 -0
- package/kendo-angular-gantt.d.ts +9 -0
- package/localization/custom-messages.component.d.ts +18 -0
- package/localization/gantt-localization.service.d.ts +18 -0
- package/localization/localized-messages.directive.d.ts +16 -0
- package/localization/messages.d.ts +293 -0
- package/main.d.ts +39 -0
- package/models/cell-content-type.interface.d.ts +10 -0
- package/models/class-callbacks.d.ts +43 -0
- package/models/column-menu-settings.interface.d.ts +26 -0
- package/models/column-reorder-config.d.ts +10 -0
- package/models/date-range.interface.d.ts +19 -0
- package/models/dependency-type.enum.d.ts +19 -0
- package/models/events/cell-click-event.interface.d.ts +43 -0
- package/models/events/cell-close-event.interface.d.ts +48 -0
- package/models/events/click-event.interface.d.ts +23 -0
- package/models/events/column-locked-change-event.interface.d.ts +16 -0
- package/models/events/column-reorder-event.interface.d.ts +10 -0
- package/models/events/column-resize-event.interface.d.ts +10 -0
- package/models/events/column-visibility-change-event.interface.d.ts +14 -0
- package/models/events/data-state-change-event.interface.d.ts +10 -0
- package/models/events/dependency-add-event.interface.d.ts +26 -0
- package/models/events/selected-view-change-event.interface.d.ts +19 -0
- package/models/events/task-add-event.interface.d.ts +31 -0
- package/models/events/task-click-event.interface.d.ts +30 -0
- package/models/events/task-delete-event.interface.d.ts +21 -0
- package/models/events/task-edit-event.interface.d.ts +76 -0
- package/models/events/task-move-end-event.interface.d.ts +12 -0
- package/models/events/task-move-event.interface.d.ts +23 -0
- package/models/events/task-move-start-event.interface.d.ts +15 -0
- package/models/events/task-resize-end-event.interface.d.ts +12 -0
- package/models/events/task-resize-event.interface.d.ts +23 -0
- package/models/events/task-resize-start-event.interface.d.ts +15 -0
- package/models/filterable-settings.d.ts +10 -0
- package/models/gantt-dependency-model-fields.interface.d.ts +35 -0
- package/models/gantt-dependency.interface.d.ts +26 -0
- package/models/gantt-task-model-fields.interface.d.ts +42 -0
- package/models/gantt-task.interface.d.ts +31 -0
- package/models/models.d.ts +42 -0
- package/models/slot.interface.d.ts +31 -0
- package/models/sort-settings.d.ts +42 -0
- package/models/splitter-pane-options.interface.d.ts +54 -0
- package/models/timeline-options.interface.d.ts +41 -0
- package/models/timeline-view.d.ts +8 -0
- package/models/toolbar-settings.d.ts +29 -0
- package/models/view-item.interface.d.ts +35 -0
- package/navigation/navigation-models.d.ts +38 -0
- package/navigation/navigation.service.d.ts +130 -0
- package/navigation/utils.d.ts +26 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +9 -13
- package/rendering/gantt-header-table-body.component.d.ts +14 -0
- package/rendering/gantt-milestone-task.component.d.ts +22 -0
- package/rendering/gantt-summary-task.component.d.ts +25 -0
- package/rendering/gantt-task-base.d.ts +59 -0
- package/rendering/gantt-task.component.d.ts +26 -0
- package/rendering/gantt-tasks-table-body.component.d.ts +33 -0
- package/scrolling/drag-scroll-settings.d.ts +47 -0
- package/scrolling/scroll-sync.service.d.ts +33 -0
- package/scrolling/timeline-scroll.directive.d.ts +27 -0
- package/scrolling/timeline-scroll.service.d.ts +23 -0
- package/scrolling/utils.d.ts +29 -0
- package/selection/selectable.directive.d.ts +45 -0
- package/selection/selection-change-event.d.ts +25 -0
- package/template-directives/summary-task-template.directive.d.ts +41 -0
- package/template-directives/task-content-template.directive.d.ts +36 -0
- package/template-directives/task-template.directive.d.ts +39 -0
- package/timeline/gantt-timeline.component.d.ts +67 -0
- package/timeline/timeline-base-view.service.d.ts +77 -0
- package/timeline/timeline-day-view.component.d.ts +18 -0
- package/timeline/timeline-day-view.service.d.ts +38 -0
- package/timeline/timeline-month-view.component.d.ts +18 -0
- package/timeline/timeline-month-view.service.d.ts +38 -0
- package/timeline/timeline-view.service.d.ts +19 -0
- package/timeline/timeline-week-view.component.d.ts +18 -0
- package/timeline/timeline-week-view.service.d.ts +38 -0
- package/timeline/view-base.d.ts +34 -0
- package/toolbar/toolbar-template.directive.d.ts +112 -0
- package/toolbar/toolbar.component.d.ts +29 -0
- package/toolbar/view-selector.component.d.ts +43 -0
- package/utils.d.ts +166 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Represents a template that defines the text content section of the task component.
|
|
9
|
+
* To define the template, nest an `<ng-template>` tag
|
|
10
|
+
* with the `kendoGanttTaskContentTemplate` directive inside the `<kendo-gantt>` tag.
|
|
11
|
+
*
|
|
12
|
+
* The template context is set to the current data item.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts-preview
|
|
16
|
+
* _@Component({
|
|
17
|
+
* selector: 'my-app',
|
|
18
|
+
* template: `
|
|
19
|
+
* <kendo-gantt [kendoGanttHierarchyBinding]="data">
|
|
20
|
+
* <ng-template kendoGanttTaskContentTemplate let-dataItem>
|
|
21
|
+
* {{ dataItem.title }} - {{ dataItem.completionRatio * 100 }}% complete
|
|
22
|
+
* </ng-template>
|
|
23
|
+
* </kendo-gantt>
|
|
24
|
+
* `
|
|
25
|
+
* })
|
|
26
|
+
* class AppComponent {
|
|
27
|
+
* public data: any[] = sampleTasks;
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export class GanttTaskContentTemplateDirective {
|
|
32
|
+
constructor(templateRef) {
|
|
33
|
+
this.templateRef = templateRef;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
GanttTaskContentTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTaskContentTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
37
|
+
GanttTaskContentTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: GanttTaskContentTemplateDirective, selector: "[kendoGanttTaskContentTemplate]", ngImport: i0 });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTaskContentTemplateDirective, decorators: [{
|
|
39
|
+
type: Directive,
|
|
40
|
+
args: [{
|
|
41
|
+
selector: '[kendoGanttTaskContentTemplate]'
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
44
|
+
type: Optional
|
|
45
|
+
}] }]; } });
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Directive, Optional } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* Represents a template that defines the whole content of the task component.
|
|
9
|
+
* To define the template, nest an `<ng-template>` tag
|
|
10
|
+
* with the `kendoGanttTaskTemplate` directive inside the `<kendo-gantt>` tag.
|
|
11
|
+
*
|
|
12
|
+
* The template context is set to the current data item. The following additional field is passed:
|
|
13
|
+
* - `elementWidth`—The current task wrapper element's calculated width in pixels based on its start and end date.
|
|
14
|
+
* Use it as an alias for a template variable by utilizing the `let-elementWidth="elementWidth"` syntax.
|
|
15
|
+
* Useful for calculations related to rendering custom elements representing the task progress.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts-preview
|
|
19
|
+
* _@Component({
|
|
20
|
+
* selector: 'my-app',
|
|
21
|
+
* template: `
|
|
22
|
+
* <kendo-gantt [kendoGanttHierarchyBinding]="data">
|
|
23
|
+
* <ng-template kendoGanttTaskTemplate let-dataItem let-elementWidth="elementWidth">
|
|
24
|
+
* {{ dataItem.title }} - {{ dataItem.completionRatio * 100 }}% complete
|
|
25
|
+
* </ng-template>
|
|
26
|
+
* </kendo-gantt>
|
|
27
|
+
* `
|
|
28
|
+
* })
|
|
29
|
+
* class AppComponent {
|
|
30
|
+
* public data: any[] = sampleTasks;
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class GanttTaskTemplateDirective {
|
|
35
|
+
constructor(templateRef) {
|
|
36
|
+
this.templateRef = templateRef;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
GanttTaskTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTaskTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
+
GanttTaskTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: GanttTaskTemplateDirective, selector: "[kendoGanttTaskTemplate]", ngImport: i0 });
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTaskTemplateDirective, decorators: [{
|
|
42
|
+
type: Directive,
|
|
43
|
+
args: [{
|
|
44
|
+
selector: '[kendoGanttTaskTemplate]'
|
|
45
|
+
}]
|
|
46
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
47
|
+
type: Optional
|
|
48
|
+
}] }]; } });
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, EventEmitter, HostBinding, Input, Output, ViewChild, ViewContainerRef } from '@angular/core';
|
|
6
|
+
import { Subscription } from 'rxjs';
|
|
7
|
+
import { filter, map, switchMap, take } from 'rxjs/operators';
|
|
8
|
+
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
9
|
+
import { isPresent } from '../utils';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "../scrolling/scroll-sync.service";
|
|
12
|
+
import * as i2 from "../dependencies/dependency-dom.service";
|
|
13
|
+
import * as i3 from "../rendering/gantt-header-table-body.component";
|
|
14
|
+
import * as i4 from "../rendering/gantt-tasks-table-body.component";
|
|
15
|
+
import * as i5 from "../scrolling/timeline-scroll.directive";
|
|
16
|
+
import * as i6 from "@progress/kendo-angular-common";
|
|
17
|
+
import * as i7 from "@angular/common";
|
|
18
|
+
import * as i8 from "../dependencies/gantt-dependency.directive";
|
|
19
|
+
/**
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export class GanttTimelineComponent {
|
|
23
|
+
constructor(scrollSyncService, dependencyDomService, renderer, zone) {
|
|
24
|
+
this.scrollSyncService = scrollSyncService;
|
|
25
|
+
this.dependencyDomService = dependencyDomService;
|
|
26
|
+
this.renderer = renderer;
|
|
27
|
+
this.zone = zone;
|
|
28
|
+
this.hostClass = true;
|
|
29
|
+
this.dependencies = [];
|
|
30
|
+
// as all drag-and-drop operations are on the timeline container, use a single draggable instance
|
|
31
|
+
this.timelineContainerPress = new EventEmitter();
|
|
32
|
+
this.timelineContainerDrag = new EventEmitter();
|
|
33
|
+
this.timelineContainerRelease = new EventEmitter();
|
|
34
|
+
this.subscriptions = new Subscription();
|
|
35
|
+
this.subscriptions.add(
|
|
36
|
+
// task changes indicates change in row content, number, height, etc.
|
|
37
|
+
this.dependencyDomService.taskChanges
|
|
38
|
+
.pipe(filter(args => isPresent(args.timelineRow)), switchMap(args => this.zone.onStable.pipe(take(1), map(() => args))) // ensure the content is rendered
|
|
39
|
+
)
|
|
40
|
+
.subscribe(({ timelineRow }) => {
|
|
41
|
+
const timelineRowHeight = isDocumentAvailable() ? timelineRow.getBoundingClientRect().height : 0;
|
|
42
|
+
this.renderer.setStyle(this.timelineColumns.nativeElement, 'height', `${(this.rows || []).length * timelineRowHeight}px`);
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Specifies whether the draggable will attach or detach its pointer event listeners.
|
|
47
|
+
*/
|
|
48
|
+
get draggableEnabled() {
|
|
49
|
+
return this.renderDependencyDragClues;
|
|
50
|
+
}
|
|
51
|
+
ngAfterViewInit() {
|
|
52
|
+
const timelineHeader = this.timelineHeaderWrap.nativeElement;
|
|
53
|
+
const rightContainer = this.timelineContent.nativeElement;
|
|
54
|
+
this.scrollSyncService.registerElement(rightContainer, 'timeline');
|
|
55
|
+
this.scrollSyncService.registerElement(timelineHeader, 'header');
|
|
56
|
+
this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement);
|
|
57
|
+
}
|
|
58
|
+
ngOnDestroy() {
|
|
59
|
+
this.subscriptions.unsubscribe();
|
|
60
|
+
}
|
|
61
|
+
isNonWorking(item) {
|
|
62
|
+
return item.hasOwnProperty('isWorking') && !item.isWorking;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
GanttTimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTimelineComponent, deps: [{ token: i1.ScrollSyncService }, { token: i2.DependencyDomService }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
66
|
+
GanttTimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: GanttTimelineComponent, selector: "kendo-gantt-timeline", inputs: { rows: "rows", slots: "slots", groupSlots: "groupSlots", tableWidth: "tableWidth", activeView: "activeView", taskContentTemplate: "taskContentTemplate", taskTemplate: "taskTemplate", summaryTaskTemplate: "summaryTaskTemplate", taskClass: "taskClass", renderDependencyDragClues: "renderDependencyDragClues", dragScrollSettings: "dragScrollSettings", selectable: "selectable", isTaskSelected: "isTaskSelected", isExpanded: "isExpanded", dependencies: "dependencies" }, outputs: { timelineContainerPress: "timelineContainerPress", timelineContainerDrag: "timelineContainerDrag", timelineContainerRelease: "timelineContainerRelease" }, host: { properties: { "class.k-gantt-timeline": "this.hostClass" } }, viewQueries: [{ propertyName: "timelineContent", first: true, predicate: ["timelineContent"], descendants: true, static: true }, { propertyName: "timelineColumns", first: true, predicate: ["timelineColumns"], descendants: true, static: true }, { propertyName: "timelineHeaderWrap", first: true, predicate: ["timelineHeaderWrap"], descendants: true, static: true }, { propertyName: "tasksContainer", first: true, predicate: ["tasksContainer"], descendants: true, static: true }, { propertyName: "dragPopupContainer", first: true, predicate: ["dragPopupContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "dependencyDragCreatePolyline", first: true, predicate: ["dependencyDragCreatePolyline"], descendants: true }], ngImport: i0, template: `
|
|
67
|
+
<div class="k-timeline k-grid k-widget">
|
|
68
|
+
<div class="k-grid-header">
|
|
69
|
+
<div #timelineHeaderWrap class="k-grid-header-wrap">
|
|
70
|
+
<table
|
|
71
|
+
role="presentation"
|
|
72
|
+
[style.width.px]="tableWidth"
|
|
73
|
+
>
|
|
74
|
+
<tbody
|
|
75
|
+
kendoGanttHeaderTableBody
|
|
76
|
+
[groupSlots]="groupSlots"
|
|
77
|
+
[slots]="slots">
|
|
78
|
+
</tbody>
|
|
79
|
+
</table>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<!-- tabindex="-1" required for https://bugzilla.mozilla.org/show_bug.cgi?id=1069739 -->
|
|
83
|
+
<div
|
|
84
|
+
#timelineContent
|
|
85
|
+
class="k-grid-content"
|
|
86
|
+
tabindex="-1"
|
|
87
|
+
role="tree"
|
|
88
|
+
aria-roledescription="Timeline"
|
|
89
|
+
kendoGanttTimelineScrollable
|
|
90
|
+
[scrollSettings]="dragScrollSettings"
|
|
91
|
+
kendoDraggable
|
|
92
|
+
[enableDrag]="draggableEnabled"
|
|
93
|
+
(kendoPress)="timelineContainerPress.emit($event)"
|
|
94
|
+
(kendoDrag)="timelineContainerDrag.emit($event)"
|
|
95
|
+
(kendoRelease)="timelineContainerRelease.emit($event)"
|
|
96
|
+
>
|
|
97
|
+
<div class="k-gantt-tables">
|
|
98
|
+
<table
|
|
99
|
+
class="k-gantt-rows"
|
|
100
|
+
[style.width.px]="tableWidth"
|
|
101
|
+
role="presentation"
|
|
102
|
+
>
|
|
103
|
+
<tbody>
|
|
104
|
+
<tr *ngFor="let item of rows; let i = index;"
|
|
105
|
+
[class.k-alt]="i % 2"
|
|
106
|
+
>
|
|
107
|
+
<td></td>
|
|
108
|
+
</tr>
|
|
109
|
+
</tbody>
|
|
110
|
+
</table>
|
|
111
|
+
|
|
112
|
+
<table
|
|
113
|
+
#timelineColumns
|
|
114
|
+
class="k-gantt-columns"
|
|
115
|
+
role="presentation"
|
|
116
|
+
[style.width.px]="tableWidth"
|
|
117
|
+
>
|
|
118
|
+
<colgroup>
|
|
119
|
+
<col *ngFor="let item of slots">
|
|
120
|
+
</colgroup>
|
|
121
|
+
|
|
122
|
+
<tbody>
|
|
123
|
+
<tr>
|
|
124
|
+
<td *ngFor="let item of slots"
|
|
125
|
+
[class.k-nonwork-hour]="isNonWorking(item)"
|
|
126
|
+
>
|
|
127
|
+
</td>
|
|
128
|
+
</tr>
|
|
129
|
+
</tbody>
|
|
130
|
+
</table>
|
|
131
|
+
|
|
132
|
+
<table
|
|
133
|
+
#tasksContainer
|
|
134
|
+
class="k-gantt-tasks"
|
|
135
|
+
role="presentation"
|
|
136
|
+
style="border-collapse: collapse;"
|
|
137
|
+
[style.width.px]="tableWidth"
|
|
138
|
+
>
|
|
139
|
+
<tbody
|
|
140
|
+
kendoGanttTasksTableBody
|
|
141
|
+
[rows]="rows"
|
|
142
|
+
[activeView]="activeView"
|
|
143
|
+
[taskContentTemplate]="taskContentTemplate"
|
|
144
|
+
[taskTemplate]="taskTemplate"
|
|
145
|
+
[summaryTaskTemplate]="summaryTaskTemplate"
|
|
146
|
+
[taskClass]="taskClass"
|
|
147
|
+
[isExpanded]="isExpanded"
|
|
148
|
+
[selectable]="selectable"
|
|
149
|
+
[isTaskSelected]="isTaskSelected"
|
|
150
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
151
|
+
>
|
|
152
|
+
</tbody>
|
|
153
|
+
</table>
|
|
154
|
+
</div>
|
|
155
|
+
<svg class="k-gantt-dependencies-svg">
|
|
156
|
+
<polyline
|
|
157
|
+
*ngFor="let dependency of dependencies"
|
|
158
|
+
kendoGanttDependency
|
|
159
|
+
[dependency]="dependency"
|
|
160
|
+
/>
|
|
161
|
+
<polyline #dependencyDragCreatePolyline />
|
|
162
|
+
</svg>
|
|
163
|
+
|
|
164
|
+
<!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->
|
|
165
|
+
<ng-container #dragPopupContainer></ng-container>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
`, isInline: true, components: [{ type: i3.GanttHeaderTableBodyComponent, selector: "[kendoGanttHeaderTableBody]", inputs: ["groupSlots", "slots"] }, { type: i4.GanttTasksTableBodyComponent, selector: "[kendoGanttTasksTableBody]", inputs: ["selectable", "rows", "activeView", "taskContentTemplate", "taskTemplate", "summaryTaskTemplate", "taskClass", "isExpanded", "isTaskSelected", "renderDependencyDragClues"] }], directives: [{ type: i5.TimelineScrollableDirective, selector: "[kendoGanttTimelineScrollable]", inputs: ["scrollSettings"] }, { type: i6.DraggableDirective, selector: "[kendoDraggable]", inputs: ["enableDrag"], outputs: ["kendoPress", "kendoDrag", "kendoRelease"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i8.GanttDependencyDirective, selector: "[kendoGanttDependency]", inputs: ["dependency"] }] });
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GanttTimelineComponent, decorators: [{
|
|
170
|
+
type: Component,
|
|
171
|
+
args: [{
|
|
172
|
+
selector: 'kendo-gantt-timeline',
|
|
173
|
+
template: `
|
|
174
|
+
<div class="k-timeline k-grid k-widget">
|
|
175
|
+
<div class="k-grid-header">
|
|
176
|
+
<div #timelineHeaderWrap class="k-grid-header-wrap">
|
|
177
|
+
<table
|
|
178
|
+
role="presentation"
|
|
179
|
+
[style.width.px]="tableWidth"
|
|
180
|
+
>
|
|
181
|
+
<tbody
|
|
182
|
+
kendoGanttHeaderTableBody
|
|
183
|
+
[groupSlots]="groupSlots"
|
|
184
|
+
[slots]="slots">
|
|
185
|
+
</tbody>
|
|
186
|
+
</table>
|
|
187
|
+
</div>
|
|
188
|
+
</div>
|
|
189
|
+
<!-- tabindex="-1" required for https://bugzilla.mozilla.org/show_bug.cgi?id=1069739 -->
|
|
190
|
+
<div
|
|
191
|
+
#timelineContent
|
|
192
|
+
class="k-grid-content"
|
|
193
|
+
tabindex="-1"
|
|
194
|
+
role="tree"
|
|
195
|
+
aria-roledescription="Timeline"
|
|
196
|
+
kendoGanttTimelineScrollable
|
|
197
|
+
[scrollSettings]="dragScrollSettings"
|
|
198
|
+
kendoDraggable
|
|
199
|
+
[enableDrag]="draggableEnabled"
|
|
200
|
+
(kendoPress)="timelineContainerPress.emit($event)"
|
|
201
|
+
(kendoDrag)="timelineContainerDrag.emit($event)"
|
|
202
|
+
(kendoRelease)="timelineContainerRelease.emit($event)"
|
|
203
|
+
>
|
|
204
|
+
<div class="k-gantt-tables">
|
|
205
|
+
<table
|
|
206
|
+
class="k-gantt-rows"
|
|
207
|
+
[style.width.px]="tableWidth"
|
|
208
|
+
role="presentation"
|
|
209
|
+
>
|
|
210
|
+
<tbody>
|
|
211
|
+
<tr *ngFor="let item of rows; let i = index;"
|
|
212
|
+
[class.k-alt]="i % 2"
|
|
213
|
+
>
|
|
214
|
+
<td></td>
|
|
215
|
+
</tr>
|
|
216
|
+
</tbody>
|
|
217
|
+
</table>
|
|
218
|
+
|
|
219
|
+
<table
|
|
220
|
+
#timelineColumns
|
|
221
|
+
class="k-gantt-columns"
|
|
222
|
+
role="presentation"
|
|
223
|
+
[style.width.px]="tableWidth"
|
|
224
|
+
>
|
|
225
|
+
<colgroup>
|
|
226
|
+
<col *ngFor="let item of slots">
|
|
227
|
+
</colgroup>
|
|
228
|
+
|
|
229
|
+
<tbody>
|
|
230
|
+
<tr>
|
|
231
|
+
<td *ngFor="let item of slots"
|
|
232
|
+
[class.k-nonwork-hour]="isNonWorking(item)"
|
|
233
|
+
>
|
|
234
|
+
</td>
|
|
235
|
+
</tr>
|
|
236
|
+
</tbody>
|
|
237
|
+
</table>
|
|
238
|
+
|
|
239
|
+
<table
|
|
240
|
+
#tasksContainer
|
|
241
|
+
class="k-gantt-tasks"
|
|
242
|
+
role="presentation"
|
|
243
|
+
style="border-collapse: collapse;"
|
|
244
|
+
[style.width.px]="tableWidth"
|
|
245
|
+
>
|
|
246
|
+
<tbody
|
|
247
|
+
kendoGanttTasksTableBody
|
|
248
|
+
[rows]="rows"
|
|
249
|
+
[activeView]="activeView"
|
|
250
|
+
[taskContentTemplate]="taskContentTemplate"
|
|
251
|
+
[taskTemplate]="taskTemplate"
|
|
252
|
+
[summaryTaskTemplate]="summaryTaskTemplate"
|
|
253
|
+
[taskClass]="taskClass"
|
|
254
|
+
[isExpanded]="isExpanded"
|
|
255
|
+
[selectable]="selectable"
|
|
256
|
+
[isTaskSelected]="isTaskSelected"
|
|
257
|
+
[renderDependencyDragClues]="renderDependencyDragClues"
|
|
258
|
+
>
|
|
259
|
+
</tbody>
|
|
260
|
+
</table>
|
|
261
|
+
</div>
|
|
262
|
+
<svg class="k-gantt-dependencies-svg">
|
|
263
|
+
<polyline
|
|
264
|
+
*ngFor="let dependency of dependencies"
|
|
265
|
+
kendoGanttDependency
|
|
266
|
+
[dependency]="dependency"
|
|
267
|
+
/>
|
|
268
|
+
<polyline #dependencyDragCreatePolyline />
|
|
269
|
+
</svg>
|
|
270
|
+
|
|
271
|
+
<!-- placeholder for the dependency drag popup; its position is not arbitrary - the popup is intended to be absolutely positioned inside the .k-grid-content element -->
|
|
272
|
+
<ng-container #dragPopupContainer></ng-container>
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
`
|
|
276
|
+
}]
|
|
277
|
+
}], ctorParameters: function () { return [{ type: i1.ScrollSyncService }, { type: i2.DependencyDomService }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { timelineContent: [{
|
|
278
|
+
type: ViewChild,
|
|
279
|
+
args: ['timelineContent', { static: true }]
|
|
280
|
+
}], timelineColumns: [{
|
|
281
|
+
type: ViewChild,
|
|
282
|
+
args: ['timelineColumns', { static: true }]
|
|
283
|
+
}], timelineHeaderWrap: [{
|
|
284
|
+
type: ViewChild,
|
|
285
|
+
args: ['timelineHeaderWrap', { static: true }]
|
|
286
|
+
}], tasksContainer: [{
|
|
287
|
+
type: ViewChild,
|
|
288
|
+
args: ['tasksContainer', { static: true }]
|
|
289
|
+
}], dragPopupContainer: [{
|
|
290
|
+
type: ViewChild,
|
|
291
|
+
args: ['dragPopupContainer', { static: false, read: ViewContainerRef }]
|
|
292
|
+
}], dependencyDragCreatePolyline: [{
|
|
293
|
+
type: ViewChild,
|
|
294
|
+
args: ['dependencyDragCreatePolyline', { static: false }]
|
|
295
|
+
}], hostClass: [{
|
|
296
|
+
type: HostBinding,
|
|
297
|
+
args: ['class.k-gantt-timeline']
|
|
298
|
+
}], rows: [{
|
|
299
|
+
type: Input
|
|
300
|
+
}], slots: [{
|
|
301
|
+
type: Input
|
|
302
|
+
}], groupSlots: [{
|
|
303
|
+
type: Input
|
|
304
|
+
}], tableWidth: [{
|
|
305
|
+
type: Input
|
|
306
|
+
}], activeView: [{
|
|
307
|
+
type: Input
|
|
308
|
+
}], taskContentTemplate: [{
|
|
309
|
+
type: Input
|
|
310
|
+
}], taskTemplate: [{
|
|
311
|
+
type: Input
|
|
312
|
+
}], summaryTaskTemplate: [{
|
|
313
|
+
type: Input
|
|
314
|
+
}], taskClass: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], renderDependencyDragClues: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], dragScrollSettings: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], selectable: [{
|
|
321
|
+
type: Input
|
|
322
|
+
}], isTaskSelected: [{
|
|
323
|
+
type: Input
|
|
324
|
+
}], isExpanded: [{
|
|
325
|
+
type: Input
|
|
326
|
+
}], dependencies: [{
|
|
327
|
+
type: Input
|
|
328
|
+
}], timelineContainerPress: [{
|
|
329
|
+
type: Output
|
|
330
|
+
}], timelineContainerDrag: [{
|
|
331
|
+
type: Output
|
|
332
|
+
}], timelineContainerRelease: [{
|
|
333
|
+
type: Output
|
|
334
|
+
}] } });
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { orderBy } from '@progress/kendo-data-query';
|
|
6
|
+
import { isWorkDay, isWorkHour, lastDayOfWeek } from '../utils';
|
|
7
|
+
import { addDays, firstDayInWeek, getDate, firstDayOfMonth, lastDayOfMonth, addMonths, addWeeks } from '@progress/kendo-date-math';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export const DAY_FORMAT = 'E d/MM';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export const HOUR_FORMAT = 'HH:mm aa';
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export const MONTH_FORMAT = 'MMM';
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
export class TimelineBaseViewService {
|
|
24
|
+
constructor(intlService, mapper) {
|
|
25
|
+
this.intlService = intlService;
|
|
26
|
+
this.mapper = mapper;
|
|
27
|
+
this._viewStart = 0;
|
|
28
|
+
}
|
|
29
|
+
get viewStart() {
|
|
30
|
+
return this._viewStart;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param tasks - The tasks which are going to be rendered in the table
|
|
35
|
+
* @returns {Object} - An object containing the range start and end dates
|
|
36
|
+
*/
|
|
37
|
+
getRange(tasks) {
|
|
38
|
+
if (!tasks || !tasks.length) {
|
|
39
|
+
return { start: new Date(), end: new Date() };
|
|
40
|
+
}
|
|
41
|
+
const startResult = orderBy(tasks, [{ field: this.mapper.taskFields.start, dir: 'asc' }]);
|
|
42
|
+
const endResult = orderBy(tasks, [{ field: this.mapper.taskFields.end, dir: 'desc' }]);
|
|
43
|
+
const firstDay = this.intlService.firstDay();
|
|
44
|
+
const rangeStart = this.mapper.extractFromTask(startResult[0], 'start') || new Date();
|
|
45
|
+
const rangeEnd = this.mapper.extractFromTask(endResult[0], 'end') || new Date();
|
|
46
|
+
if (firstDay === rangeEnd.getDay()) {
|
|
47
|
+
rangeEnd.setDate(rangeEnd.getDate() + 7);
|
|
48
|
+
}
|
|
49
|
+
const start = this.getStartOffset(rangeStart);
|
|
50
|
+
const end = this.getEndOffset(rangeEnd);
|
|
51
|
+
this._viewStart = Number(start);
|
|
52
|
+
return {
|
|
53
|
+
start: new Date(start),
|
|
54
|
+
end: new Date(end)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param start - The tasks' range start date
|
|
60
|
+
* @param end - The tasks' range end date
|
|
61
|
+
* @returns {Array<Object>} - A collection containing the hour slots
|
|
62
|
+
*/
|
|
63
|
+
getHours(start, end) {
|
|
64
|
+
const slots = [];
|
|
65
|
+
let workDayStart = this.intlService.parseDate(this.options.workDayStart).getHours();
|
|
66
|
+
let workDayEnd = this.intlService.parseDate(this.options.workDayEnd).getHours();
|
|
67
|
+
// TODO: retrieve from option?
|
|
68
|
+
let hourSpan = 1;
|
|
69
|
+
let startDate = new Date(start);
|
|
70
|
+
const endDate = new Date(end);
|
|
71
|
+
while (startDate < endDate) {
|
|
72
|
+
const slotEnd = new Date(startDate);
|
|
73
|
+
const isWorkSlot = isWorkHour(slotEnd, workDayStart, workDayEnd);
|
|
74
|
+
slotEnd.setHours(slotEnd.getHours() + hourSpan);
|
|
75
|
+
slots.push({
|
|
76
|
+
start: startDate,
|
|
77
|
+
end: slotEnd,
|
|
78
|
+
isWorking: isWorkSlot,
|
|
79
|
+
text: this.intlService.formatDate(startDate, HOUR_FORMAT),
|
|
80
|
+
span: 1
|
|
81
|
+
});
|
|
82
|
+
startDate = slotEnd;
|
|
83
|
+
}
|
|
84
|
+
return slots;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
*
|
|
88
|
+
* @param start - The tasks' range start date
|
|
89
|
+
* @param end - The tasks' range end date
|
|
90
|
+
* @returns {Array<Object>} - A collection containing the day slots
|
|
91
|
+
*/
|
|
92
|
+
getDays(start, end) {
|
|
93
|
+
const slots = [];
|
|
94
|
+
let startDay = new Date(start);
|
|
95
|
+
let endDay = new Date(end);
|
|
96
|
+
while (startDay <= endDay) {
|
|
97
|
+
// Get the days with cleared time values (except for start and end day)
|
|
98
|
+
const nextDay = getDate(addDays(startDay, 1));
|
|
99
|
+
const isWorking = isWorkDay(startDay, this.options.workWeekStart, this.options.workWeekEnd);
|
|
100
|
+
// Need to get the end date with correct hours (important for day view)
|
|
101
|
+
let slotEnd = endDay < nextDay ? endDay : nextDay;
|
|
102
|
+
slots.push({
|
|
103
|
+
start: startDay,
|
|
104
|
+
end: slotEnd,
|
|
105
|
+
isWorking: isWorking,
|
|
106
|
+
text: this.intlService.formatDate(startDay, DAY_FORMAT),
|
|
107
|
+
span: 1
|
|
108
|
+
});
|
|
109
|
+
startDay = nextDay;
|
|
110
|
+
}
|
|
111
|
+
return slots;
|
|
112
|
+
}
|
|
113
|
+
getWeeks(start, end) {
|
|
114
|
+
const weekStart = this.intlService.firstDay();
|
|
115
|
+
const slots = [];
|
|
116
|
+
let startDay = new Date(start);
|
|
117
|
+
let endDay = new Date(end);
|
|
118
|
+
while (startDay <= endDay) {
|
|
119
|
+
const lastWeekDay = lastDayOfWeek(startDay, weekStart);
|
|
120
|
+
const slotEnd = lastWeekDay > endDay ? endDay : lastWeekDay;
|
|
121
|
+
const daySlots = this.getDays(startDay, slotEnd);
|
|
122
|
+
const span = daySlots.length;
|
|
123
|
+
const firstDay = this.intlService.formatDate(firstDayInWeek(getDate(startDay), weekStart), DAY_FORMAT);
|
|
124
|
+
const lastDay = this.intlService.formatDate(addDays(slotEnd, -1), DAY_FORMAT);
|
|
125
|
+
if (span > 0) {
|
|
126
|
+
slots.push({
|
|
127
|
+
start: daySlots[0].start,
|
|
128
|
+
end: daySlots[span - 1].end,
|
|
129
|
+
text: `${firstDay} - ${lastDay}`,
|
|
130
|
+
span: span
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
startDay = firstDayInWeek(addWeeks(slotEnd, 1));
|
|
134
|
+
}
|
|
135
|
+
return slots;
|
|
136
|
+
}
|
|
137
|
+
getMonths(start, end) {
|
|
138
|
+
const slots = [];
|
|
139
|
+
let startDay = new Date(start);
|
|
140
|
+
let endDay = new Date(end);
|
|
141
|
+
while (startDay < endDay) {
|
|
142
|
+
const endMonth = lastDayOfMonth(startDay);
|
|
143
|
+
let slotEnd = endDay < endMonth ? endDay : endMonth;
|
|
144
|
+
const daySlots = this.getDays(startDay, slotEnd);
|
|
145
|
+
const span = daySlots.length;
|
|
146
|
+
const monthStart = firstDayOfMonth(getDate(startDay));
|
|
147
|
+
const shortText = this.intlService.formatDate(monthStart, MONTH_FORMAT);
|
|
148
|
+
if (span > 0) {
|
|
149
|
+
slots.push({
|
|
150
|
+
start: daySlots[0].start,
|
|
151
|
+
end: daySlots[span - 1].end,
|
|
152
|
+
span: span,
|
|
153
|
+
text: shortText
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
startDay = firstDayOfMonth(addMonths(slotEnd, 1));
|
|
157
|
+
}
|
|
158
|
+
return slots;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, forwardRef } from '@angular/core';
|
|
6
|
+
import { ViewBase } from './view-base';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "../common/option-changes.service";
|
|
9
|
+
import * as i2 from "../dependencies/dependency-dom.service";
|
|
10
|
+
export class TimelineDayViewComponent extends ViewBase {
|
|
11
|
+
constructor(optionChangesService, dependencyDomService) {
|
|
12
|
+
super(optionChangesService, dependencyDomService);
|
|
13
|
+
/**
|
|
14
|
+
* The type for this view (`day`).
|
|
15
|
+
*/
|
|
16
|
+
this.type = 'day';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
TimelineDayViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineDayViewComponent, deps: [{ token: i1.OptionChangesService }, { token: i2.DependencyDomService }], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
TimelineDayViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TimelineDayViewComponent, selector: "kendo-gantt-timeline-day-view", providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: ViewBase,
|
|
23
|
+
useExisting: forwardRef(() => TimelineDayViewComponent)
|
|
24
|
+
}
|
|
25
|
+
], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TimelineDayViewComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{
|
|
29
|
+
selector: 'kendo-gantt-timeline-day-view',
|
|
30
|
+
template: '',
|
|
31
|
+
providers: [
|
|
32
|
+
{
|
|
33
|
+
provide: ViewBase,
|
|
34
|
+
useExisting: forwardRef(() => TimelineDayViewComponent)
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}]
|
|
38
|
+
}], ctorParameters: function () { return [{ type: i1.OptionChangesService }, { type: i2.DependencyDomService }]; } });
|