@progress/kendo-angular-layout 16.0.0-develop.2 → 16.0.0-develop.5
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/avatar/avatar.component.d.ts +1 -1
- package/avatar/l10n/custom-messages.component.d.ts +1 -1
- package/avatar/l10n/localized-messages.directive.d.ts +1 -1
- package/avatar/l10n/messages.d.ts +1 -1
- package/card/card-actions.component.d.ts +1 -1
- package/card/card-body.component.d.ts +1 -1
- package/card/card-footer.component.d.ts +1 -1
- package/card/card-header.component.d.ts +1 -1
- package/card/card.component.d.ts +1 -1
- package/card/directives/card-media.directive.d.ts +1 -1
- package/card/directives/card-separator.directive.d.ts +1 -1
- package/card/directives/card-subtitle.directive.d.ts +1 -1
- package/card/directives/card-title.directive.d.ts +1 -1
- package/drawer/drawer-container.component.d.ts +1 -1
- package/drawer/drawer-content.component.d.ts +1 -1
- package/drawer/drawer.component.d.ts +1 -1
- package/drawer/item.component.d.ts +1 -1
- package/drawer/list.component.d.ts +1 -1
- package/drawer/template-directives/drawer-template.directive.d.ts +1 -1
- package/drawer/template-directives/footer-template.directive.d.ts +1 -1
- package/drawer/template-directives/header-template.directive.d.ts +1 -1
- package/drawer/template-directives/item-template.directive.d.ts +1 -1
- package/esm2020/avatar/avatar.component.mjs +7 -7
- package/esm2020/avatar/l10n/custom-messages.component.mjs +3 -3
- package/esm2020/avatar/l10n/localized-messages.directive.mjs +3 -3
- package/esm2020/avatar/l10n/messages.mjs +3 -3
- package/esm2020/avatar.module.mjs +4 -4
- package/esm2020/card/card-actions.component.mjs +4 -4
- package/esm2020/card/card-body.component.mjs +3 -3
- package/esm2020/card/card-footer.component.mjs +3 -3
- package/esm2020/card/card-header.component.mjs +3 -3
- package/esm2020/card/card.component.mjs +3 -3
- package/esm2020/card/directives/card-media.directive.mjs +3 -3
- package/esm2020/card/directives/card-separator.directive.mjs +3 -3
- package/esm2020/card/directives/card-subtitle.directive.mjs +3 -3
- package/esm2020/card/directives/card-title.directive.mjs +3 -3
- package/esm2020/card.module.mjs +4 -4
- package/esm2020/drawer/drawer-container.component.mjs +4 -4
- package/esm2020/drawer/drawer-content.component.mjs +3 -3
- package/esm2020/drawer/drawer.component.mjs +6 -6
- package/esm2020/drawer/drawer.service.mjs +3 -3
- package/esm2020/drawer/item.component.mjs +6 -6
- package/esm2020/drawer/list.component.mjs +5 -5
- package/esm2020/drawer/template-directives/drawer-template.directive.mjs +3 -3
- package/esm2020/drawer/template-directives/footer-template.directive.mjs +3 -3
- package/esm2020/drawer/template-directives/header-template.directive.mjs +3 -3
- package/esm2020/drawer/template-directives/item-template.directive.mjs +3 -3
- package/esm2020/drawer.module.mjs +4 -4
- package/esm2020/expansionpanel/expansionpanel-title.directive.mjs +3 -3
- package/esm2020/expansionpanel/expansionpanel.component.mjs +6 -6
- package/esm2020/expansionpanel.module.mjs +4 -4
- package/esm2020/gridlayout.module.mjs +4 -4
- package/esm2020/index.mjs +7 -0
- package/esm2020/layout.module.mjs +11 -7
- package/esm2020/layouts/grid-layout.component.mjs +3 -3
- package/esm2020/layouts/gridlayout-item.component.mjs +3 -3
- package/esm2020/layouts/stack-layout.component.mjs +3 -3
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/panelbar/panelbar-content.directive.mjs +3 -3
- package/esm2020/panelbar/panelbar-item-template.directive.mjs +3 -3
- package/esm2020/panelbar/panelbar-item-title.directive.mjs +3 -3
- package/esm2020/panelbar/panelbar-item.component.mjs +6 -6
- package/esm2020/panelbar/panelbar.component.mjs +6 -6
- package/esm2020/panelbar/panelbar.service.mjs +3 -3
- package/esm2020/panelbar.module.mjs +4 -4
- package/esm2020/splitter/splitter-bar.component.mjs +6 -6
- package/esm2020/splitter/splitter-pane.component.mjs +4 -4
- package/esm2020/splitter/splitter.component.mjs +7 -7
- package/esm2020/splitter/splitter.service.mjs +3 -3
- package/esm2020/splitter.module.mjs +6 -8
- package/esm2020/stacklayout.module.mjs +4 -4
- package/esm2020/stepper/list.component.mjs +5 -5
- package/esm2020/stepper/localization/custom-messages.component.mjs +3 -3
- package/esm2020/stepper/localization/localized-messages.directive.mjs +3 -3
- package/esm2020/stepper/localization/messages.mjs +3 -3
- package/esm2020/stepper/step.component.mjs +6 -6
- package/esm2020/stepper/stepper.component.mjs +7 -7
- package/esm2020/stepper/stepper.service.mjs +3 -3
- package/esm2020/stepper/template-directives/indicator-template.directive.mjs +3 -3
- package/esm2020/stepper/template-directives/label-template.directive.mjs +3 -3
- package/esm2020/stepper/template-directives/step-template.directive.mjs +3 -3
- package/esm2020/stepper.module.mjs +4 -4
- package/esm2020/tabstrip/directives/tab-content.directive.mjs +3 -3
- package/esm2020/tabstrip/directives/tab-title.directive.mjs +3 -3
- package/esm2020/tabstrip/directives/tab.directive.mjs +3 -3
- package/esm2020/tabstrip/localization/custom-messages.component.mjs +3 -3
- package/esm2020/tabstrip/localization/localized-messages.directive.mjs +3 -3
- package/esm2020/tabstrip/localization/messages.mjs +3 -3
- package/esm2020/tabstrip/models/tabstrip-tab.component.mjs +3 -3
- package/esm2020/tabstrip/rendering/tab.component.mjs +6 -6
- package/esm2020/tabstrip/scrollable-button.component.mjs +4 -4
- package/esm2020/tabstrip/tabstrip-scroll.service.mjs +3 -3
- package/esm2020/tabstrip/tabstrip.component.mjs +8 -8
- package/esm2020/tabstrip/tabstrip.service.mjs +3 -3
- package/esm2020/tabstrip.module.mjs +4 -4
- package/esm2020/tilelayout/dragging-service.mjs +3 -3
- package/esm2020/tilelayout/keyboard-navigation.service.mjs +3 -5
- package/esm2020/tilelayout/tilelayout-item-body.component.mjs +3 -3
- package/esm2020/tilelayout/tilelayout-item-header.component.mjs +3 -3
- package/esm2020/tilelayout/tilelayout-item.component.mjs +6 -6
- package/esm2020/tilelayout/tilelayout-resize-handle.directive.mjs +3 -3
- package/esm2020/tilelayout/tilelayout.component.mjs +6 -6
- package/esm2020/tilelayout.module.mjs +4 -4
- package/esm2020/timeline/events/navigation-direction.mjs +5 -0
- package/esm2020/timeline/localization/custom-messages.component.mjs +41 -0
- package/esm2020/timeline/localization/localized-messages.directive.mjs +37 -0
- package/esm2020/timeline/localization/messages.mjs +25 -0
- package/esm2020/timeline/models/anchor-target.mjs +5 -0
- package/esm2020/timeline/models/default-model-fields.mjs +16 -0
- package/esm2020/timeline/models/model-fields.mjs +5 -0
- package/esm2020/timeline/models/timeline-event.mjs +5 -0
- package/esm2020/timeline/templates/timeline-card-actions.directive.mjs +29 -0
- package/esm2020/timeline/templates/timeline-card-body.directive.mjs +29 -0
- package/esm2020/timeline/templates/timeline-card-header.directive.mjs +29 -0
- package/esm2020/timeline/timeline-card.component.mjs +402 -0
- package/esm2020/timeline/timeline-horizontal.component.mjs +722 -0
- package/esm2020/timeline/timeline-vertical.component.mjs +175 -0
- package/esm2020/timeline/timeline.component.mjs +418 -0
- package/esm2020/timeline/timeline.service.mjs +31 -0
- package/esm2020/timeline/util.mjs +26 -0
- package/esm2020/timeline.module.mjs +65 -0
- package/expansionpanel/expansionpanel-title.directive.d.ts +1 -1
- package/expansionpanel/expansionpanel.component.d.ts +1 -1
- package/fesm2015/progress-kendo-angular-layout.mjs +2513 -584
- package/fesm2020/progress-kendo-angular-layout.mjs +2249 -347
- package/index.d.ts +10 -0
- package/layout.module.d.ts +2 -1
- package/layouts/grid-layout.component.d.ts +1 -1
- package/layouts/gridlayout-item.component.d.ts +1 -1
- package/layouts/stack-layout.component.d.ts +1 -1
- package/package.json +13 -13
- package/panelbar/panelbar-content.directive.d.ts +1 -1
- package/panelbar/panelbar-item-template.directive.d.ts +1 -1
- package/panelbar/panelbar-item-title.directive.d.ts +1 -1
- package/panelbar/panelbar-item.component.d.ts +1 -1
- package/panelbar/panelbar.component.d.ts +1 -1
- package/splitter/splitter-bar.component.d.ts +1 -1
- package/splitter/splitter-pane.component.d.ts +1 -1
- package/splitter/splitter.component.d.ts +1 -1
- package/stepper/list.component.d.ts +1 -1
- package/stepper/localization/custom-messages.component.d.ts +1 -1
- package/stepper/localization/localized-messages.directive.d.ts +1 -1
- package/stepper/localization/messages.d.ts +1 -1
- package/stepper/step.component.d.ts +1 -1
- package/stepper/stepper.component.d.ts +1 -1
- package/stepper/template-directives/indicator-template.directive.d.ts +1 -1
- package/stepper/template-directives/label-template.directive.d.ts +1 -1
- package/stepper/template-directives/step-template.directive.d.ts +1 -1
- package/tabstrip/directives/tab-content.directive.d.ts +1 -1
- package/tabstrip/directives/tab-title.directive.d.ts +1 -1
- package/tabstrip/directives/tab.directive.d.ts +1 -1
- package/tabstrip/localization/custom-messages.component.d.ts +1 -1
- package/tabstrip/localization/localized-messages.directive.d.ts +1 -1
- package/tabstrip/localization/messages.d.ts +1 -1
- package/tabstrip/models/tabstrip-tab.component.d.ts +1 -1
- package/tabstrip/rendering/tab.component.d.ts +1 -1
- package/tabstrip/scrollable-button.component.d.ts +1 -1
- package/tabstrip/tabstrip.component.d.ts +1 -1
- package/tilelayout/tilelayout-item-body.component.d.ts +1 -1
- package/tilelayout/tilelayout-item-header.component.d.ts +1 -1
- package/tilelayout/tilelayout-item.component.d.ts +1 -1
- package/tilelayout/tilelayout-resize-handle.directive.d.ts +1 -1
- package/tilelayout/tilelayout.component.d.ts +1 -1
- package/timeline/events/navigation-direction.d.ts +5 -0
- package/timeline/localization/custom-messages.component.d.ts +17 -0
- package/timeline/localization/localized-messages.directive.d.ts +16 -0
- package/timeline/localization/messages.d.ts +21 -0
- package/timeline/models/anchor-target.d.ts +5 -0
- package/{progress-kendo-angular-layout.d.ts → timeline/models/default-model-fields.d.ts} +3 -3
- package/timeline/models/model-fields.d.ts +51 -0
- package/timeline/models/timeline-event.d.ts +49 -0
- package/timeline/templates/timeline-card-actions.directive.d.ts +20 -0
- package/timeline/templates/timeline-card-body.directive.d.ts +20 -0
- package/timeline/templates/timeline-card-header.directive.d.ts +20 -0
- package/timeline/timeline-card.component.d.ts +59 -0
- package/timeline/timeline-horizontal.component.d.ts +110 -0
- package/timeline/timeline-vertical.component.d.ts +41 -0
- package/timeline/timeline.component.d.ts +186 -0
- package/timeline/timeline.service.d.ts +17 -0
- package/timeline/util.d.ts +18 -0
- package/timeline.module.d.ts +31 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 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, Input, QueryList, Renderer2, ViewChildren } from '@angular/core';
|
|
6
|
+
import { guid } from '@progress/kendo-angular-common';
|
|
7
|
+
import { Subscription } from 'rxjs';
|
|
8
|
+
import { TimelineCardBodyTemplateDirective } from './templates/timeline-card-body.directive';
|
|
9
|
+
import { TimelineCardHeaderTemplateDirective } from './templates/timeline-card-header.directive';
|
|
10
|
+
import { TimelineCardActionsTemplateDirective } from './templates/timeline-card-actions.directive';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
import * as i1 from "@angular/common";
|
|
13
|
+
import * as i2 from "./timeline-card.component";
|
|
14
|
+
import * as i3 from "@progress/kendo-angular-intl";
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export class TimelineVerticalComponent {
|
|
19
|
+
constructor(renderer) {
|
|
20
|
+
this.renderer = renderer;
|
|
21
|
+
this.events = [];
|
|
22
|
+
this.subscriptions = new Subscription();
|
|
23
|
+
}
|
|
24
|
+
ngAfterViewInit() {
|
|
25
|
+
this.ariaDescribedByAllEvents();
|
|
26
|
+
this.subscriptions.add(this.innerDateElementRefs.changes.subscribe(() => {
|
|
27
|
+
if (this.innerDateElementRefs?.length > 0) {
|
|
28
|
+
this.ariaDescribedByAllEvents();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.removeAriaDescribedBy();
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
expand(index) {
|
|
36
|
+
if (index < 0 || index >= this.cards.length) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.cards.get(index).expand();
|
|
40
|
+
}
|
|
41
|
+
collapse(index) {
|
|
42
|
+
if (index < 0 || index >= this.cards.length) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.cards.get(index).collapse();
|
|
46
|
+
}
|
|
47
|
+
ariaDescribedByAllEvents() {
|
|
48
|
+
this.cards?.forEach((card, index) => {
|
|
49
|
+
const innerCard = card.element.nativeElement.querySelector('.k-card');
|
|
50
|
+
const innerDate = this.dateElementRefs.get(index).nativeElement.querySelector('.k-timeline-date');
|
|
51
|
+
if (innerDate) {
|
|
52
|
+
this.assignAriaDescribedBy(innerCard, innerDate);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
removeAriaDescribedBy() {
|
|
57
|
+
this.cards?.forEach(card => {
|
|
58
|
+
const innerCard = card.element.nativeElement.querySelector('.k-card');
|
|
59
|
+
this.renderer.removeAttribute(innerCard, 'aria-describedby');
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
assignAriaDescribedBy(cardElement, dateElement) {
|
|
63
|
+
const dateLabelId = `k-${guid()}`;
|
|
64
|
+
this.renderer.setAttribute(dateElement, 'id', dateLabelId);
|
|
65
|
+
this.renderer.setAttribute(cardElement, 'aria-describedby', dateLabelId);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
TimelineVerticalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineVerticalComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
69
|
+
TimelineVerticalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: TimelineVerticalComponent, selector: "kendo-timeline-vertical", inputs: { events: "events", alterMode: "alterMode", collapsibleEvents: "collapsibleEvents", navigable: "navigable", showDateLabels: "showDateLabels", animationDuration: "animationDuration", eventWidth: "eventWidth", dateFormat: "dateFormat", headerTemplate: "headerTemplate", bodyTemplate: "bodyTemplate", actionsTemplate: "actionsTemplate" }, providers: [], viewQueries: [{ propertyName: "cards", predicate: ["card"], descendants: true }, { propertyName: "dateElementRefs", predicate: ["dateWrap"], descendants: true }, { propertyName: "innerDateElementRefs", predicate: ["innerDate"], descendants: true }], exportAs: ["kendoTimelineVertical"], ngImport: i0, template: `
|
|
70
|
+
<ul *ngIf="events && events.length > 0">
|
|
71
|
+
<ng-container *ngFor="let event of events; let i = index">
|
|
72
|
+
<li class="k-timeline-flag-wrap" *ngIf="event.flag">
|
|
73
|
+
<span class="k-timeline-flag">{{ event.flag }}</span>
|
|
74
|
+
</li>
|
|
75
|
+
<li class="k-timeline-event" [ngClass]="{ 'k-reverse': alterMode && i % 2 === 0 }">
|
|
76
|
+
<div class="k-timeline-date-wrap" #dateWrap>
|
|
77
|
+
<span *ngIf="showDateLabels" class="k-timeline-date" #innerDate>
|
|
78
|
+
{{ event.date | kendoDate: dateFormat }}
|
|
79
|
+
</span>
|
|
80
|
+
</div>
|
|
81
|
+
<span class="k-timeline-circle"></span>
|
|
82
|
+
<kendo-timeline-card
|
|
83
|
+
#card
|
|
84
|
+
[event]="event"
|
|
85
|
+
[expanded]="event.expanded || !collapsibleEvents"
|
|
86
|
+
[collapsible]="collapsibleEvents"
|
|
87
|
+
[reversed]="alterMode && i % 2 === 0"
|
|
88
|
+
[tabIndex]="'0'"
|
|
89
|
+
[navigable]="navigable"
|
|
90
|
+
[animationDuration]="animationDuration"
|
|
91
|
+
[headerTemplate]="headerTemplate"
|
|
92
|
+
[bodyTemplate]="bodyTemplate"
|
|
93
|
+
[actionsTemplate]="actionsTemplate"
|
|
94
|
+
[index]="i"
|
|
95
|
+
[eventWidth]="eventWidth"
|
|
96
|
+
orientation="vertical"
|
|
97
|
+
>
|
|
98
|
+
</kendo-timeline-card>
|
|
99
|
+
</li>
|
|
100
|
+
</ng-container>
|
|
101
|
+
</ul>
|
|
102
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.TimelineCardComponent, selector: "kendo-timeline-card", inputs: ["event", "expanded", "collapsible", "reversed", "orientation", "navigable", "tabIndex", "animationDuration", "index", "eventWidth", "eventHeight", "headerTemplate", "bodyTemplate", "actionsTemplate", "calloutStyle"], exportAs: ["kendoTimelineCard"] }, { kind: "pipe", type: i3.DatePipe, name: "kendoDate" }] });
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineVerticalComponent, decorators: [{
|
|
104
|
+
type: Component,
|
|
105
|
+
args: [{
|
|
106
|
+
providers: [],
|
|
107
|
+
exportAs: 'kendoTimelineVertical',
|
|
108
|
+
selector: 'kendo-timeline-vertical',
|
|
109
|
+
template: `
|
|
110
|
+
<ul *ngIf="events && events.length > 0">
|
|
111
|
+
<ng-container *ngFor="let event of events; let i = index">
|
|
112
|
+
<li class="k-timeline-flag-wrap" *ngIf="event.flag">
|
|
113
|
+
<span class="k-timeline-flag">{{ event.flag }}</span>
|
|
114
|
+
</li>
|
|
115
|
+
<li class="k-timeline-event" [ngClass]="{ 'k-reverse': alterMode && i % 2 === 0 }">
|
|
116
|
+
<div class="k-timeline-date-wrap" #dateWrap>
|
|
117
|
+
<span *ngIf="showDateLabels" class="k-timeline-date" #innerDate>
|
|
118
|
+
{{ event.date | kendoDate: dateFormat }}
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
<span class="k-timeline-circle"></span>
|
|
122
|
+
<kendo-timeline-card
|
|
123
|
+
#card
|
|
124
|
+
[event]="event"
|
|
125
|
+
[expanded]="event.expanded || !collapsibleEvents"
|
|
126
|
+
[collapsible]="collapsibleEvents"
|
|
127
|
+
[reversed]="alterMode && i % 2 === 0"
|
|
128
|
+
[tabIndex]="'0'"
|
|
129
|
+
[navigable]="navigable"
|
|
130
|
+
[animationDuration]="animationDuration"
|
|
131
|
+
[headerTemplate]="headerTemplate"
|
|
132
|
+
[bodyTemplate]="bodyTemplate"
|
|
133
|
+
[actionsTemplate]="actionsTemplate"
|
|
134
|
+
[index]="i"
|
|
135
|
+
[eventWidth]="eventWidth"
|
|
136
|
+
orientation="vertical"
|
|
137
|
+
>
|
|
138
|
+
</kendo-timeline-card>
|
|
139
|
+
</li>
|
|
140
|
+
</ng-container>
|
|
141
|
+
</ul>
|
|
142
|
+
`,
|
|
143
|
+
}]
|
|
144
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { events: [{
|
|
145
|
+
type: Input
|
|
146
|
+
}], alterMode: [{
|
|
147
|
+
type: Input
|
|
148
|
+
}], collapsibleEvents: [{
|
|
149
|
+
type: Input
|
|
150
|
+
}], navigable: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], showDateLabels: [{
|
|
153
|
+
type: Input
|
|
154
|
+
}], animationDuration: [{
|
|
155
|
+
type: Input
|
|
156
|
+
}], eventWidth: [{
|
|
157
|
+
type: Input
|
|
158
|
+
}], dateFormat: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], headerTemplate: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}], bodyTemplate: [{
|
|
163
|
+
type: Input
|
|
164
|
+
}], actionsTemplate: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], cards: [{
|
|
167
|
+
type: ViewChildren,
|
|
168
|
+
args: ['card']
|
|
169
|
+
}], dateElementRefs: [{
|
|
170
|
+
type: ViewChildren,
|
|
171
|
+
args: ['dateWrap']
|
|
172
|
+
}], innerDateElementRefs: [{
|
|
173
|
+
type: ViewChildren,
|
|
174
|
+
args: ['innerDate']
|
|
175
|
+
}] } });
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 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, ContentChildren, EventEmitter, HostBinding, Input, Output, QueryList, ViewChild } from '@angular/core';
|
|
6
|
+
import { defaultModelFields } from './models/default-model-fields';
|
|
7
|
+
import { processItems } from './util';
|
|
8
|
+
import { TimelineHorizontalComponent } from './timeline-horizontal.component';
|
|
9
|
+
import { TimelineVerticalComponent } from './timeline-vertical.component';
|
|
10
|
+
import { TimelineService } from './timeline.service';
|
|
11
|
+
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import { TimelineCardBodyTemplateDirective } from './templates/timeline-card-body.directive';
|
|
13
|
+
import { TimelineCardHeaderTemplateDirective } from './templates/timeline-card-header.directive';
|
|
14
|
+
import { Subscription } from 'rxjs';
|
|
15
|
+
import { TimelineCardActionsTemplateDirective } from './templates/timeline-card-actions.directive';
|
|
16
|
+
import { isPresent } from '@progress/kendo-angular-common';
|
|
17
|
+
import * as i0 from "@angular/core";
|
|
18
|
+
import * as i1 from "./timeline.service";
|
|
19
|
+
import * as i2 from "@angular/common";
|
|
20
|
+
import * as i3 from "./timeline-vertical.component";
|
|
21
|
+
import * as i4 from "./timeline-horizontal.component";
|
|
22
|
+
import * as i5 from "./localization/localized-messages.directive";
|
|
23
|
+
const DEFAULT_HORIZONTAL_ANIMATION_DURATION = 400;
|
|
24
|
+
const DEFAULT_VERTICAL_ANIMATION_DURATION = 300;
|
|
25
|
+
const DEFAULT_EVENT_WIDTH = 400;
|
|
26
|
+
const DEFAULT_EVENT_HEIGHT = 600;
|
|
27
|
+
const DEFAULT_DATE_FORMAT = 'MMMM dd, yyyy';
|
|
28
|
+
/**
|
|
29
|
+
* Represents the [Kendo UI Timeline component for Angular]({% slug overview_timeline %}).
|
|
30
|
+
*/
|
|
31
|
+
export class TimelineComponent {
|
|
32
|
+
constructor(timelineService) {
|
|
33
|
+
this.timelineService = timelineService;
|
|
34
|
+
/**
|
|
35
|
+
* Specifies the orientation of the axis.
|
|
36
|
+
*
|
|
37
|
+
* @default 'vertical'
|
|
38
|
+
*/
|
|
39
|
+
this.orientation = 'vertical';
|
|
40
|
+
/**
|
|
41
|
+
* Specifies whether to render events alternatingly on both sides of the axis.
|
|
42
|
+
* Applicable when `orientation` is set to `vertical`.
|
|
43
|
+
*
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
this.alterMode = true;
|
|
47
|
+
/**
|
|
48
|
+
* Specifies whether the event cards can be collapsed.
|
|
49
|
+
*
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
this.collapsibleEvents = true;
|
|
53
|
+
/**
|
|
54
|
+
* Specifies whether the user can use dedicated shortcuts to interact with the Timeline.
|
|
55
|
+
*
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
this.navigable = true;
|
|
59
|
+
/**
|
|
60
|
+
* Specifies whether an event's date label will be visible.
|
|
61
|
+
*
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
this.showDateLabels = true;
|
|
65
|
+
this.hostClass = true;
|
|
66
|
+
/**
|
|
67
|
+
* Fires when a card is toggled.
|
|
68
|
+
* > This event is emitted in vertical mode only.
|
|
69
|
+
*/
|
|
70
|
+
this.onToggle = new EventEmitter();
|
|
71
|
+
/**
|
|
72
|
+
* Fires when a card's action is clicked.
|
|
73
|
+
*/
|
|
74
|
+
this.onActionClick = new EventEmitter();
|
|
75
|
+
/**
|
|
76
|
+
* Fires when the left or right arrow is clicked.
|
|
77
|
+
* > This event is emitted in horizontal mode only.
|
|
78
|
+
*/
|
|
79
|
+
this.onNavigate = new EventEmitter();
|
|
80
|
+
this._events = [];
|
|
81
|
+
this._modelFields = defaultModelFields;
|
|
82
|
+
this._eventWidth = DEFAULT_EVENT_WIDTH;
|
|
83
|
+
this._eventHeight = DEFAULT_EVENT_HEIGHT;
|
|
84
|
+
this._dateFormat = DEFAULT_DATE_FORMAT;
|
|
85
|
+
this.originalData = [];
|
|
86
|
+
this.subscriptions = new Subscription();
|
|
87
|
+
this.timelineService.timeline = this;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* An array of event instances which will be shown by the Timeline.
|
|
91
|
+
*/
|
|
92
|
+
set events(events) {
|
|
93
|
+
if (!isPresent(events)) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.originalData = events;
|
|
97
|
+
this._events = processItems(this.originalData, this.modelFields);
|
|
98
|
+
this._events.sort((a, b) => {
|
|
99
|
+
return a.date.getTime() - b.date.getTime();
|
|
100
|
+
});
|
|
101
|
+
if (this._events.length > 0) {
|
|
102
|
+
let flag = this._events[0].date.getFullYear() - 1;
|
|
103
|
+
this._events.forEach((event) => {
|
|
104
|
+
if (event.date.getFullYear() !== flag) {
|
|
105
|
+
flag = event.date.getFullYear();
|
|
106
|
+
event.flag = flag;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
get events() {
|
|
112
|
+
return this._events;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The names of the model fields from which the Timeline will read its data.
|
|
116
|
+
*/
|
|
117
|
+
set modelFields(value) {
|
|
118
|
+
this._modelFields = { ...defaultModelFields, ...value };
|
|
119
|
+
if (this.originalData) {
|
|
120
|
+
this.events = this.originalData;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
get modelFields() {
|
|
124
|
+
return this._modelFields;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Sets a specific width for the event.
|
|
128
|
+
* This setting is supported only in vertical mode.
|
|
129
|
+
*
|
|
130
|
+
* @default 400
|
|
131
|
+
*/
|
|
132
|
+
get eventWidth() {
|
|
133
|
+
return this._eventWidth;
|
|
134
|
+
}
|
|
135
|
+
set eventWidth(value) {
|
|
136
|
+
if (value) {
|
|
137
|
+
this._eventWidth = value;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this._eventWidth = DEFAULT_EVENT_WIDTH;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Sets a specific height for the event.
|
|
145
|
+
* > This setting is supported only in horizontal mode.
|
|
146
|
+
*
|
|
147
|
+
* @default 600
|
|
148
|
+
*/
|
|
149
|
+
get eventHeight() {
|
|
150
|
+
return this._eventHeight;
|
|
151
|
+
}
|
|
152
|
+
set eventHeight(value) {
|
|
153
|
+
if (value) {
|
|
154
|
+
this._eventHeight = value;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this._eventHeight = DEFAULT_EVENT_HEIGHT;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @hidden
|
|
162
|
+
*/
|
|
163
|
+
get animationDuration() {
|
|
164
|
+
if (typeof this.animation === 'number') {
|
|
165
|
+
return this.animation;
|
|
166
|
+
}
|
|
167
|
+
if (typeof this.animation === 'boolean' && this.animation) {
|
|
168
|
+
return this.orientation === 'horizontal' ? DEFAULT_HORIZONTAL_ANIMATION_DURATION : DEFAULT_VERTICAL_ANIMATION_DURATION;
|
|
169
|
+
}
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Specifies the date format for displaying the event date.
|
|
174
|
+
*
|
|
175
|
+
* @default 'MMMM dd, yyyy'
|
|
176
|
+
*/
|
|
177
|
+
set dateFormat(value) {
|
|
178
|
+
if (isPresent(value) && value !== '') {
|
|
179
|
+
this._dateFormat = value;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this._dateFormat = DEFAULT_DATE_FORMAT;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
get dateFormat() {
|
|
186
|
+
return this._dateFormat;
|
|
187
|
+
}
|
|
188
|
+
get verticalClass() {
|
|
189
|
+
return this.orientation === 'vertical';
|
|
190
|
+
}
|
|
191
|
+
get horizontalClass() {
|
|
192
|
+
return this.orientation === 'horizontal';
|
|
193
|
+
}
|
|
194
|
+
get alternatingClass() {
|
|
195
|
+
return this.alterMode === true && this.orientation === 'vertical';
|
|
196
|
+
}
|
|
197
|
+
get collapsibleClass() {
|
|
198
|
+
return this.collapsibleEvents === true && this.orientation === 'vertical';
|
|
199
|
+
}
|
|
200
|
+
ngAfterContentInit() {
|
|
201
|
+
this.initTemplates();
|
|
202
|
+
}
|
|
203
|
+
ngOnDestroy() {
|
|
204
|
+
this.subscriptions.unsubscribe();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Switches to the previous portion of events.
|
|
208
|
+
* > This method is supported only in horizontal mode.
|
|
209
|
+
*/
|
|
210
|
+
previous() {
|
|
211
|
+
this.timelineHorizontal?.previous();
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Switches to the next portion of events.
|
|
215
|
+
* > This method is supported only in horizontal mode.
|
|
216
|
+
*/
|
|
217
|
+
next() {
|
|
218
|
+
this.timelineHorizontal?.next();
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Open event details.
|
|
222
|
+
* > This method is supported only in horizontal mode.
|
|
223
|
+
*/
|
|
224
|
+
open(index) {
|
|
225
|
+
this.timelineHorizontal?.open(index);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Expands an event.
|
|
229
|
+
* > This method is supported only in vertical mode.
|
|
230
|
+
*/
|
|
231
|
+
expand(index) {
|
|
232
|
+
this.timelineVertical?.expand(index);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Collapses an event.
|
|
236
|
+
* > This method is supported only in vertical mode.
|
|
237
|
+
*/
|
|
238
|
+
collapse(index) {
|
|
239
|
+
this.timelineVertical?.collapse(index);
|
|
240
|
+
}
|
|
241
|
+
initTemplates() {
|
|
242
|
+
this.headerTemplate = this.cardHeaderTemplate?.first;
|
|
243
|
+
this.bodyTemplate = this.cardBodyTemplate?.first;
|
|
244
|
+
this.actionsTemplate = this.cardActionsTemplate?.first;
|
|
245
|
+
this.subscriptions.add(this.cardHeaderTemplate?.changes.subscribe(() => {
|
|
246
|
+
this.headerTemplate = this.cardHeaderTemplate?.first || null;
|
|
247
|
+
}));
|
|
248
|
+
this.subscriptions.add(this.cardBodyTemplate?.changes.subscribe(() => {
|
|
249
|
+
this.bodyTemplate = this.cardBodyTemplate?.first || null;
|
|
250
|
+
}));
|
|
251
|
+
this.subscriptions.add(this.cardActionsTemplate?.changes.subscribe(() => {
|
|
252
|
+
this.actionsTemplate = this.cardActionsTemplate?.first || null;
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
TimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineComponent, deps: [{ token: i1.TimelineService }], target: i0.ɵɵFactoryTarget.Component });
|
|
257
|
+
TimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: TimelineComponent, selector: "kendo-timeline", inputs: { events: "events", modelFields: "modelFields", orientation: "orientation", alterMode: "alterMode", collapsibleEvents: "collapsibleEvents", navigable: "navigable", showDateLabels: "showDateLabels", animation: "animation", eventWidth: "eventWidth", eventHeight: "eventHeight", dateFormat: "dateFormat" }, outputs: { onToggle: "onToggle", onActionClick: "onActionClick", onNavigate: "onNavigate" }, host: { properties: { "class.k-timeline": "this.hostClass", "class.k-timeline-vertical": "this.verticalClass", "class.k-timeline-horizontal": "this.horizontalClass", "class.k-timeline-alternating": "this.alternatingClass", "class.k-timeline-collapsible": "this.collapsibleClass" } }, providers: [
|
|
258
|
+
TimelineService,
|
|
259
|
+
LocalizationService,
|
|
260
|
+
{
|
|
261
|
+
provide: L10N_PREFIX,
|
|
262
|
+
useValue: 'kendo.timeline'
|
|
263
|
+
}
|
|
264
|
+
], queries: [{ propertyName: "cardHeaderTemplate", predicate: TimelineCardHeaderTemplateDirective }, { propertyName: "cardBodyTemplate", predicate: TimelineCardBodyTemplateDirective }, { propertyName: "cardActionsTemplate", predicate: TimelineCardActionsTemplateDirective }], viewQueries: [{ propertyName: "timelineHorizontal", first: true, predicate: TimelineHorizontalComponent, descendants: true }, { propertyName: "timelineVertical", first: true, predicate: TimelineVerticalComponent, descendants: true }], exportAs: ["kendoTimeline"], ngImport: i0, template: `
|
|
265
|
+
<ng-container kendoTimelineLocalizedMessages
|
|
266
|
+
i18n-previous="kendo.timeline.previous|The title of the previous button in horizontal orientation."
|
|
267
|
+
previous="previous"
|
|
268
|
+
>
|
|
269
|
+
</ng-container>
|
|
270
|
+
<ng-container kendoTimelineLocalizedMessages
|
|
271
|
+
i18n-next="kendo.timeline.next|The title of the next button in horizontal orientation."
|
|
272
|
+
next="next"
|
|
273
|
+
>
|
|
274
|
+
</ng-container>
|
|
275
|
+
<kendo-timeline-vertical
|
|
276
|
+
*ngIf="orientation === 'vertical'"
|
|
277
|
+
[events]="events"
|
|
278
|
+
[alterMode]="alterMode"
|
|
279
|
+
[collapsibleEvents]="collapsibleEvents"
|
|
280
|
+
[navigable]="navigable"
|
|
281
|
+
[showDateLabels]="showDateLabels"
|
|
282
|
+
[animationDuration]="animationDuration"
|
|
283
|
+
[eventWidth]="eventWidth"
|
|
284
|
+
[dateFormat]="dateFormat"
|
|
285
|
+
[headerTemplate]="headerTemplate"
|
|
286
|
+
[bodyTemplate]="bodyTemplate"
|
|
287
|
+
[actionsTemplate]="actionsTemplate"
|
|
288
|
+
>
|
|
289
|
+
</kendo-timeline-vertical>
|
|
290
|
+
<kendo-timeline-horizontal
|
|
291
|
+
*ngIf="orientation === 'horizontal'"
|
|
292
|
+
[events]="events"
|
|
293
|
+
[collapsibleEvents]="false"
|
|
294
|
+
[navigable]="navigable"
|
|
295
|
+
[showDateLabels]="showDateLabels"
|
|
296
|
+
[animationDuration]="animationDuration"
|
|
297
|
+
[eventHeight]="eventHeight"
|
|
298
|
+
[dateFormat]="dateFormat"
|
|
299
|
+
[headerTemplate]="headerTemplate"
|
|
300
|
+
[bodyTemplate]="bodyTemplate"
|
|
301
|
+
[actionsTemplate]="actionsTemplate"
|
|
302
|
+
>
|
|
303
|
+
</kendo-timeline-horizontal>
|
|
304
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.TimelineVerticalComponent, selector: "kendo-timeline-vertical", inputs: ["events", "alterMode", "collapsibleEvents", "navigable", "showDateLabels", "animationDuration", "eventWidth", "dateFormat", "headerTemplate", "bodyTemplate", "actionsTemplate"], exportAs: ["kendoTimelineVertical"] }, { kind: "component", type: i4.TimelineHorizontalComponent, selector: "kendo-timeline-horizontal", inputs: ["events", "alterMode", "collapsibleEvents", "navigable", "showDateLabels", "animationDuration", "eventHeight", "dateFormat", "headerTemplate", "bodyTemplate", "actionsTemplate"], exportAs: ["kendoTimelineHorizontal"] }, { kind: "directive", type: i5.LocalizedTimelineMessagesDirective, selector: "[kendoTimelineLocalizedMessages]" }] });
|
|
305
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineComponent, decorators: [{
|
|
306
|
+
type: Component,
|
|
307
|
+
args: [{
|
|
308
|
+
providers: [
|
|
309
|
+
TimelineService,
|
|
310
|
+
LocalizationService,
|
|
311
|
+
{
|
|
312
|
+
provide: L10N_PREFIX,
|
|
313
|
+
useValue: 'kendo.timeline'
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
exportAs: 'kendoTimeline',
|
|
317
|
+
selector: 'kendo-timeline',
|
|
318
|
+
template: `
|
|
319
|
+
<ng-container kendoTimelineLocalizedMessages
|
|
320
|
+
i18n-previous="kendo.timeline.previous|The title of the previous button in horizontal orientation."
|
|
321
|
+
previous="previous"
|
|
322
|
+
>
|
|
323
|
+
</ng-container>
|
|
324
|
+
<ng-container kendoTimelineLocalizedMessages
|
|
325
|
+
i18n-next="kendo.timeline.next|The title of the next button in horizontal orientation."
|
|
326
|
+
next="next"
|
|
327
|
+
>
|
|
328
|
+
</ng-container>
|
|
329
|
+
<kendo-timeline-vertical
|
|
330
|
+
*ngIf="orientation === 'vertical'"
|
|
331
|
+
[events]="events"
|
|
332
|
+
[alterMode]="alterMode"
|
|
333
|
+
[collapsibleEvents]="collapsibleEvents"
|
|
334
|
+
[navigable]="navigable"
|
|
335
|
+
[showDateLabels]="showDateLabels"
|
|
336
|
+
[animationDuration]="animationDuration"
|
|
337
|
+
[eventWidth]="eventWidth"
|
|
338
|
+
[dateFormat]="dateFormat"
|
|
339
|
+
[headerTemplate]="headerTemplate"
|
|
340
|
+
[bodyTemplate]="bodyTemplate"
|
|
341
|
+
[actionsTemplate]="actionsTemplate"
|
|
342
|
+
>
|
|
343
|
+
</kendo-timeline-vertical>
|
|
344
|
+
<kendo-timeline-horizontal
|
|
345
|
+
*ngIf="orientation === 'horizontal'"
|
|
346
|
+
[events]="events"
|
|
347
|
+
[collapsibleEvents]="false"
|
|
348
|
+
[navigable]="navigable"
|
|
349
|
+
[showDateLabels]="showDateLabels"
|
|
350
|
+
[animationDuration]="animationDuration"
|
|
351
|
+
[eventHeight]="eventHeight"
|
|
352
|
+
[dateFormat]="dateFormat"
|
|
353
|
+
[headerTemplate]="headerTemplate"
|
|
354
|
+
[bodyTemplate]="bodyTemplate"
|
|
355
|
+
[actionsTemplate]="actionsTemplate"
|
|
356
|
+
>
|
|
357
|
+
</kendo-timeline-horizontal>
|
|
358
|
+
`,
|
|
359
|
+
}]
|
|
360
|
+
}], ctorParameters: function () { return [{ type: i1.TimelineService }]; }, propDecorators: { events: [{
|
|
361
|
+
type: Input
|
|
362
|
+
}], modelFields: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], orientation: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], alterMode: [{
|
|
367
|
+
type: Input
|
|
368
|
+
}], collapsibleEvents: [{
|
|
369
|
+
type: Input
|
|
370
|
+
}], navigable: [{
|
|
371
|
+
type: Input
|
|
372
|
+
}], showDateLabels: [{
|
|
373
|
+
type: Input
|
|
374
|
+
}], animation: [{
|
|
375
|
+
type: Input
|
|
376
|
+
}], eventWidth: [{
|
|
377
|
+
type: Input
|
|
378
|
+
}], eventHeight: [{
|
|
379
|
+
type: Input
|
|
380
|
+
}], dateFormat: [{
|
|
381
|
+
type: Input
|
|
382
|
+
}], hostClass: [{
|
|
383
|
+
type: HostBinding,
|
|
384
|
+
args: ['class.k-timeline']
|
|
385
|
+
}], verticalClass: [{
|
|
386
|
+
type: HostBinding,
|
|
387
|
+
args: ['class.k-timeline-vertical']
|
|
388
|
+
}], horizontalClass: [{
|
|
389
|
+
type: HostBinding,
|
|
390
|
+
args: ['class.k-timeline-horizontal']
|
|
391
|
+
}], alternatingClass: [{
|
|
392
|
+
type: HostBinding,
|
|
393
|
+
args: ['class.k-timeline-alternating']
|
|
394
|
+
}], collapsibleClass: [{
|
|
395
|
+
type: HostBinding,
|
|
396
|
+
args: ['class.k-timeline-collapsible']
|
|
397
|
+
}], timelineHorizontal: [{
|
|
398
|
+
type: ViewChild,
|
|
399
|
+
args: [TimelineHorizontalComponent]
|
|
400
|
+
}], timelineVertical: [{
|
|
401
|
+
type: ViewChild,
|
|
402
|
+
args: [TimelineVerticalComponent]
|
|
403
|
+
}], cardHeaderTemplate: [{
|
|
404
|
+
type: ContentChildren,
|
|
405
|
+
args: [TimelineCardHeaderTemplateDirective, { descendants: false }]
|
|
406
|
+
}], cardBodyTemplate: [{
|
|
407
|
+
type: ContentChildren,
|
|
408
|
+
args: [TimelineCardBodyTemplateDirective, { descendants: false }]
|
|
409
|
+
}], cardActionsTemplate: [{
|
|
410
|
+
type: ContentChildren,
|
|
411
|
+
args: [TimelineCardActionsTemplateDirective, { descendants: false }]
|
|
412
|
+
}], onToggle: [{
|
|
413
|
+
type: Output
|
|
414
|
+
}], onActionClick: [{
|
|
415
|
+
type: Output
|
|
416
|
+
}], onNavigate: [{
|
|
417
|
+
type: Output
|
|
418
|
+
}] } });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Injectable } from "@angular/core";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export class TimelineService {
|
|
11
|
+
onToggle(event) {
|
|
12
|
+
if (this.timeline) {
|
|
13
|
+
this.timeline['onToggle']?.emit(event);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
onActionClick(event) {
|
|
17
|
+
if (this.timeline) {
|
|
18
|
+
this.timeline['onActionClick']?.emit(event);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
onNavigate(event) {
|
|
22
|
+
if (this.timeline) {
|
|
23
|
+
this.timeline['onNavigate']?.emit(event);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
TimelineService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
28
|
+
TimelineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineService });
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineService, decorators: [{
|
|
30
|
+
type: Injectable
|
|
31
|
+
}] });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export const processItems = (items, fields) => {
|
|
9
|
+
return items.map((item) => parseItem(item, fields));
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export const parseItem = (item, fields) => ({
|
|
15
|
+
title: item[fields.title] || item.title,
|
|
16
|
+
date: item[fields.date] || item.date,
|
|
17
|
+
subtitle: item[fields.subtitle] || item.subtitle,
|
|
18
|
+
description: item[fields.description] || item.description,
|
|
19
|
+
expanded: item[fields.expanded] || item.expanded,
|
|
20
|
+
images: item[fields.images] || item.images,
|
|
21
|
+
actions: item[fields.actions] || item.actions,
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export const MAX_VISIBLE_EVENTS = 3;
|