@progress/kendo-angular-layout 16.0.0-develop.2 → 16.0.0-develop.20

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.
Files changed (181) hide show
  1. package/avatar/avatar.component.d.ts +1 -1
  2. package/avatar/l10n/custom-messages.component.d.ts +1 -1
  3. package/avatar/l10n/localized-messages.directive.d.ts +1 -1
  4. package/avatar/l10n/messages.d.ts +1 -1
  5. package/card/card-actions.component.d.ts +1 -1
  6. package/card/card-body.component.d.ts +1 -1
  7. package/card/card-footer.component.d.ts +1 -1
  8. package/card/card-header.component.d.ts +1 -1
  9. package/card/card.component.d.ts +1 -1
  10. package/card/directives/card-media.directive.d.ts +1 -1
  11. package/card/directives/card-separator.directive.d.ts +1 -1
  12. package/card/directives/card-subtitle.directive.d.ts +1 -1
  13. package/card/directives/card-title.directive.d.ts +1 -1
  14. package/drawer/drawer-container.component.d.ts +1 -1
  15. package/drawer/drawer-content.component.d.ts +1 -1
  16. package/drawer/drawer.component.d.ts +1 -1
  17. package/drawer/item.component.d.ts +1 -1
  18. package/drawer/list.component.d.ts +1 -1
  19. package/drawer/template-directives/drawer-template.directive.d.ts +1 -1
  20. package/drawer/template-directives/footer-template.directive.d.ts +1 -1
  21. package/drawer/template-directives/header-template.directive.d.ts +1 -1
  22. package/drawer/template-directives/item-template.directive.d.ts +1 -1
  23. package/esm2020/avatar/avatar.component.mjs +7 -7
  24. package/esm2020/avatar/l10n/custom-messages.component.mjs +3 -3
  25. package/esm2020/avatar/l10n/localized-messages.directive.mjs +3 -3
  26. package/esm2020/avatar/l10n/messages.mjs +3 -3
  27. package/esm2020/avatar.module.mjs +4 -4
  28. package/esm2020/card/card-actions.component.mjs +4 -4
  29. package/esm2020/card/card-body.component.mjs +3 -3
  30. package/esm2020/card/card-footer.component.mjs +3 -3
  31. package/esm2020/card/card-header.component.mjs +3 -3
  32. package/esm2020/card/card.component.mjs +3 -3
  33. package/esm2020/card/directives/card-media.directive.mjs +3 -3
  34. package/esm2020/card/directives/card-separator.directive.mjs +3 -3
  35. package/esm2020/card/directives/card-subtitle.directive.mjs +3 -3
  36. package/esm2020/card/directives/card-title.directive.mjs +3 -3
  37. package/esm2020/card.module.mjs +4 -4
  38. package/esm2020/drawer/drawer-container.component.mjs +4 -4
  39. package/esm2020/drawer/drawer-content.component.mjs +3 -3
  40. package/esm2020/drawer/drawer.component.mjs +6 -6
  41. package/esm2020/drawer/drawer.service.mjs +3 -3
  42. package/esm2020/drawer/item.component.mjs +8 -6
  43. package/esm2020/drawer/list.component.mjs +5 -5
  44. package/esm2020/drawer/template-directives/drawer-template.directive.mjs +3 -3
  45. package/esm2020/drawer/template-directives/footer-template.directive.mjs +3 -3
  46. package/esm2020/drawer/template-directives/header-template.directive.mjs +3 -3
  47. package/esm2020/drawer/template-directives/item-template.directive.mjs +3 -3
  48. package/esm2020/drawer.module.mjs +4 -4
  49. package/esm2020/expansionpanel/expansionpanel-title.directive.mjs +3 -3
  50. package/esm2020/expansionpanel/expansionpanel.component.mjs +6 -6
  51. package/esm2020/expansionpanel.module.mjs +4 -4
  52. package/esm2020/gridlayout.module.mjs +4 -4
  53. package/esm2020/index.mjs +7 -0
  54. package/esm2020/layout.module.mjs +11 -7
  55. package/esm2020/layouts/grid-layout.component.mjs +3 -3
  56. package/esm2020/layouts/gridlayout-item.component.mjs +3 -3
  57. package/esm2020/layouts/stack-layout.component.mjs +3 -3
  58. package/esm2020/package-metadata.mjs +2 -2
  59. package/esm2020/panelbar/panelbar-content.directive.mjs +3 -3
  60. package/esm2020/panelbar/panelbar-item-template.directive.mjs +3 -3
  61. package/esm2020/panelbar/panelbar-item-title.directive.mjs +3 -3
  62. package/esm2020/panelbar/panelbar-item.component.mjs +14 -20
  63. package/esm2020/panelbar/panelbar.component.mjs +6 -9
  64. package/esm2020/panelbar/panelbar.service.mjs +3 -3
  65. package/esm2020/panelbar.module.mjs +4 -4
  66. package/esm2020/splitter/splitter-bar.component.mjs +6 -6
  67. package/esm2020/splitter/splitter-pane.component.mjs +4 -4
  68. package/esm2020/splitter/splitter.component.mjs +7 -7
  69. package/esm2020/splitter/splitter.service.mjs +3 -3
  70. package/esm2020/splitter.module.mjs +6 -8
  71. package/esm2020/stacklayout.module.mjs +4 -4
  72. package/esm2020/stepper/list.component.mjs +5 -5
  73. package/esm2020/stepper/localization/custom-messages.component.mjs +3 -3
  74. package/esm2020/stepper/localization/localized-messages.directive.mjs +3 -3
  75. package/esm2020/stepper/localization/messages.mjs +3 -3
  76. package/esm2020/stepper/step.component.mjs +6 -6
  77. package/esm2020/stepper/stepper.component.mjs +7 -7
  78. package/esm2020/stepper/stepper.service.mjs +3 -3
  79. package/esm2020/stepper/template-directives/indicator-template.directive.mjs +3 -3
  80. package/esm2020/stepper/template-directives/label-template.directive.mjs +3 -3
  81. package/esm2020/stepper/template-directives/step-template.directive.mjs +3 -3
  82. package/esm2020/stepper.module.mjs +4 -4
  83. package/esm2020/tabstrip/directives/tab-content.directive.mjs +3 -3
  84. package/esm2020/tabstrip/directives/tab-title.directive.mjs +3 -3
  85. package/esm2020/tabstrip/directives/tab.directive.mjs +3 -3
  86. package/esm2020/tabstrip/localization/custom-messages.component.mjs +3 -3
  87. package/esm2020/tabstrip/localization/localized-messages.directive.mjs +3 -3
  88. package/esm2020/tabstrip/localization/messages.mjs +3 -3
  89. package/esm2020/tabstrip/models/tabstrip-tab.component.mjs +3 -3
  90. package/esm2020/tabstrip/rendering/tab.component.mjs +6 -6
  91. package/esm2020/tabstrip/scrollable-button.component.mjs +4 -4
  92. package/esm2020/tabstrip/tabstrip-scroll.service.mjs +3 -3
  93. package/esm2020/tabstrip/tabstrip.component.mjs +8 -10
  94. package/esm2020/tabstrip/tabstrip.service.mjs +3 -3
  95. package/esm2020/tabstrip.module.mjs +4 -4
  96. package/esm2020/tilelayout/dragging-service.mjs +3 -3
  97. package/esm2020/tilelayout/keyboard-navigation.service.mjs +3 -5
  98. package/esm2020/tilelayout/tilelayout-item-body.component.mjs +3 -3
  99. package/esm2020/tilelayout/tilelayout-item-header.component.mjs +3 -3
  100. package/esm2020/tilelayout/tilelayout-item.component.mjs +6 -6
  101. package/esm2020/tilelayout/tilelayout-resize-handle.directive.mjs +3 -3
  102. package/esm2020/tilelayout/tilelayout.component.mjs +6 -6
  103. package/esm2020/tilelayout.module.mjs +4 -4
  104. package/esm2020/timeline/events/navigation-direction.mjs +5 -0
  105. package/esm2020/timeline/localization/custom-messages.component.mjs +41 -0
  106. package/esm2020/timeline/localization/localized-messages.directive.mjs +37 -0
  107. package/esm2020/timeline/localization/messages.mjs +25 -0
  108. package/esm2020/timeline/models/anchor-target.mjs +5 -0
  109. package/esm2020/timeline/models/default-model-fields.mjs +16 -0
  110. package/esm2020/timeline/models/model-fields.mjs +5 -0
  111. package/esm2020/timeline/models/timeline-event.mjs +5 -0
  112. package/esm2020/timeline/templates/timeline-card-actions.directive.mjs +29 -0
  113. package/esm2020/timeline/templates/timeline-card-body.directive.mjs +29 -0
  114. package/esm2020/timeline/templates/timeline-card-header.directive.mjs +29 -0
  115. package/esm2020/timeline/timeline-card.component.mjs +400 -0
  116. package/esm2020/timeline/timeline-horizontal.component.mjs +723 -0
  117. package/esm2020/timeline/timeline-vertical.component.mjs +175 -0
  118. package/esm2020/timeline/timeline.component.mjs +418 -0
  119. package/esm2020/timeline/timeline.service.mjs +31 -0
  120. package/esm2020/timeline/util.mjs +26 -0
  121. package/esm2020/timeline.module.mjs +65 -0
  122. package/expansionpanel/expansionpanel-title.directive.d.ts +1 -1
  123. package/expansionpanel/expansionpanel.component.d.ts +1 -1
  124. package/fesm2015/progress-kendo-angular-layout.mjs +2527 -608
  125. package/fesm2020/progress-kendo-angular-layout.mjs +2258 -366
  126. package/index.d.ts +10 -0
  127. package/layout.module.d.ts +2 -1
  128. package/layouts/grid-layout.component.d.ts +1 -1
  129. package/layouts/gridlayout-item.component.d.ts +1 -1
  130. package/layouts/stack-layout.component.d.ts +1 -1
  131. package/package.json +13 -13
  132. package/panelbar/panelbar-content.directive.d.ts +1 -1
  133. package/panelbar/panelbar-item-template.directive.d.ts +1 -1
  134. package/panelbar/panelbar-item-title.directive.d.ts +1 -1
  135. package/panelbar/panelbar-item.component.d.ts +1 -2
  136. package/panelbar/panelbar.component.d.ts +1 -1
  137. package/splitter/splitter-bar.component.d.ts +1 -1
  138. package/splitter/splitter-pane.component.d.ts +1 -1
  139. package/splitter/splitter.component.d.ts +1 -1
  140. package/stepper/list.component.d.ts +1 -1
  141. package/stepper/localization/custom-messages.component.d.ts +1 -1
  142. package/stepper/localization/localized-messages.directive.d.ts +1 -1
  143. package/stepper/localization/messages.d.ts +1 -1
  144. package/stepper/step.component.d.ts +1 -1
  145. package/stepper/stepper.component.d.ts +1 -1
  146. package/stepper/template-directives/indicator-template.directive.d.ts +1 -1
  147. package/stepper/template-directives/label-template.directive.d.ts +1 -1
  148. package/stepper/template-directives/step-template.directive.d.ts +1 -1
  149. package/tabstrip/directives/tab-content.directive.d.ts +1 -1
  150. package/tabstrip/directives/tab-title.directive.d.ts +1 -1
  151. package/tabstrip/directives/tab.directive.d.ts +1 -1
  152. package/tabstrip/localization/custom-messages.component.d.ts +1 -1
  153. package/tabstrip/localization/localized-messages.directive.d.ts +1 -1
  154. package/tabstrip/localization/messages.d.ts +1 -1
  155. package/tabstrip/models/tabstrip-tab.component.d.ts +1 -1
  156. package/tabstrip/rendering/tab.component.d.ts +1 -1
  157. package/tabstrip/scrollable-button.component.d.ts +1 -1
  158. package/tabstrip/tabstrip.component.d.ts +1 -1
  159. package/tilelayout/tilelayout-item-body.component.d.ts +1 -1
  160. package/tilelayout/tilelayout-item-header.component.d.ts +1 -1
  161. package/tilelayout/tilelayout-item.component.d.ts +1 -1
  162. package/tilelayout/tilelayout-resize-handle.directive.d.ts +1 -1
  163. package/tilelayout/tilelayout.component.d.ts +1 -1
  164. package/timeline/events/navigation-direction.d.ts +5 -0
  165. package/timeline/localization/custom-messages.component.d.ts +17 -0
  166. package/timeline/localization/localized-messages.directive.d.ts +16 -0
  167. package/timeline/localization/messages.d.ts +21 -0
  168. package/timeline/models/anchor-target.d.ts +5 -0
  169. package/{progress-kendo-angular-layout.d.ts → timeline/models/default-model-fields.d.ts} +3 -3
  170. package/timeline/models/model-fields.d.ts +51 -0
  171. package/timeline/models/timeline-event.d.ts +49 -0
  172. package/timeline/templates/timeline-card-actions.directive.d.ts +20 -0
  173. package/timeline/templates/timeline-card-body.directive.d.ts +20 -0
  174. package/timeline/templates/timeline-card-header.directive.d.ts +20 -0
  175. package/timeline/timeline-card.component.d.ts +59 -0
  176. package/timeline/timeline-horizontal.component.d.ts +110 -0
  177. package/timeline/timeline-vertical.component.d.ts +41 -0
  178. package/timeline/timeline.component.d.ts +185 -0
  179. package/timeline/timeline.service.d.ts +17 -0
  180. package/timeline/util.d.ts +18 -0
  181. 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.2.10", ngImport: i0, type: TimelineVerticalComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
69
+ TimelineVerticalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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.2.10", 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 false
45
+ */
46
+ this.alterMode = false;
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 supported only in `vertical` mode.
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 supported only in `horizontal` mode.
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) || !isPresent(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.2.10", ngImport: i0, type: TimelineComponent, deps: [{ token: i1.TimelineService }], target: i0.ɵɵFactoryTarget.Component });
257
+ TimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", 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.2.10", 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.2.10", ngImport: i0, type: TimelineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
28
+ TimelineService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TimelineService });
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", 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;