@progress/kendo-angular-layout 21.4.1-develop.1 → 22.0.0-develop.1

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 (182) hide show
  1. package/avatar/l10n/messages.d.ts +1 -1
  2. package/fesm2022/progress-kendo-angular-layout.mjs +290 -290
  3. package/package.json +12 -20
  4. package/stepper/localization/messages.d.ts +1 -1
  5. package/tabstrip/localization/messages.d.ts +1 -1
  6. package/timeline/localization/messages.d.ts +1 -1
  7. package/esm2022/avatar/avatar.component.mjs +0 -406
  8. package/esm2022/avatar/l10n/custom-messages.component.mjs +0 -53
  9. package/esm2022/avatar/l10n/localized-messages.directive.mjs +0 -40
  10. package/esm2022/avatar/l10n/messages.mjs +0 -27
  11. package/esm2022/avatar/models/fill.mjs +0 -5
  12. package/esm2022/avatar/models/models.mjs +0 -9
  13. package/esm2022/avatar/models/rounded.mjs +0 -5
  14. package/esm2022/avatar/models/shape.mjs +0 -5
  15. package/esm2022/avatar/models/size.mjs +0 -5
  16. package/esm2022/avatar/models/theme-color.mjs +0 -5
  17. package/esm2022/avatar.module.mjs +0 -38
  18. package/esm2022/card/card-actions.component.mjs +0 -177
  19. package/esm2022/card/card-body.component.mjs +0 -37
  20. package/esm2022/card/card-footer.component.mjs +0 -37
  21. package/esm2022/card/card-header.component.mjs +0 -38
  22. package/esm2022/card/card.component.mjs +0 -118
  23. package/esm2022/card/directives/card-media.directive.mjs +0 -33
  24. package/esm2022/card/directives/card-separator.directive.mjs +0 -61
  25. package/esm2022/card/directives/card-subtitle.directive.mjs +0 -31
  26. package/esm2022/card/directives/card-title.directive.mjs +0 -31
  27. package/esm2022/card/models/actions-layout.mjs +0 -5
  28. package/esm2022/card/models/card-action.mjs +0 -21
  29. package/esm2022/card.module.mjs +0 -45
  30. package/esm2022/common/direction.mjs +0 -5
  31. package/esm2022/common/dom-queries.mjs +0 -47
  32. package/esm2022/common/orientation.mjs +0 -5
  33. package/esm2022/common/preventable-event.mjs +0 -31
  34. package/esm2022/common/styling-classes.mjs +0 -5
  35. package/esm2022/common/util.mjs +0 -85
  36. package/esm2022/directives.mjs +0 -174
  37. package/esm2022/drawer/animations.mjs +0 -146
  38. package/esm2022/drawer/drawer-container.component.mjs +0 -135
  39. package/esm2022/drawer/drawer-content.component.mjs +0 -39
  40. package/esm2022/drawer/drawer.component.mjs +0 -471
  41. package/esm2022/drawer/drawer.service.mjs +0 -105
  42. package/esm2022/drawer/events/drawer-list-select.event.mjs +0 -29
  43. package/esm2022/drawer/events/select-event.mjs +0 -33
  44. package/esm2022/drawer/item.component.mjs +0 -210
  45. package/esm2022/drawer/list.component.mjs +0 -165
  46. package/esm2022/drawer/models/constants.mjs +0 -8
  47. package/esm2022/drawer/models/drawer-animation.interface.mjs +0 -5
  48. package/esm2022/drawer/models/drawer-item-expand.interface.mjs +0 -5
  49. package/esm2022/drawer/models/drawer-item.interface.mjs +0 -5
  50. package/esm2022/drawer/models/drawer-view-item.interface.mjs +0 -5
  51. package/esm2022/drawer/models/mode.mjs +0 -5
  52. package/esm2022/drawer/models/position.mjs +0 -5
  53. package/esm2022/drawer/template-directives/drawer-template.directive.mjs +0 -43
  54. package/esm2022/drawer/template-directives/footer-template.directive.mjs +0 -36
  55. package/esm2022/drawer/template-directives/header-template.directive.mjs +0 -36
  56. package/esm2022/drawer/template-directives/item-template.directive.mjs +0 -44
  57. package/esm2022/drawer/template-directives.mjs +0 -8
  58. package/esm2022/drawer/types.mjs +0 -5
  59. package/esm2022/drawer/util.mjs +0 -16
  60. package/esm2022/drawer.module.mjs +0 -43
  61. package/esm2022/expansionpanel/animations.mjs +0 -23
  62. package/esm2022/expansionpanel/events/action-event.mjs +0 -21
  63. package/esm2022/expansionpanel/expansionpanel-title.directive.mjs +0 -38
  64. package/esm2022/expansionpanel/expansionpanel.component.mjs +0 -515
  65. package/esm2022/expansionpanel.module.mjs +0 -38
  66. package/esm2022/gridlayout.module.mjs +0 -38
  67. package/esm2022/index.mjs +0 -89
  68. package/esm2022/layout.module.mjs +0 -89
  69. package/esm2022/layouts/grid-layout.component.mjs +0 -179
  70. package/esm2022/layouts/gridlayout-item.component.mjs +0 -82
  71. package/esm2022/layouts/models/gridlayout-gap-settings.mjs +0 -5
  72. package/esm2022/layouts/models/gridlayout-row-col-size.mjs +0 -5
  73. package/esm2022/layouts/models/layout-align-settings.mjs +0 -5
  74. package/esm2022/layouts/models/layout-horizontal-align.mjs +0 -5
  75. package/esm2022/layouts/models/layout-vertical-align.mjs +0 -5
  76. package/esm2022/layouts/models.mjs +0 -10
  77. package/esm2022/layouts/stack-layout.component.mjs +0 -161
  78. package/esm2022/layouts/util.mjs +0 -101
  79. package/esm2022/package-metadata.mjs +0 -16
  80. package/esm2022/panelbar/events/collapse-event.mjs +0 -14
  81. package/esm2022/panelbar/events/expand-event.mjs +0 -14
  82. package/esm2022/panelbar/events/item-click-event.mjs +0 -17
  83. package/esm2022/panelbar/events/select-event.mjs +0 -14
  84. package/esm2022/panelbar/events/state-change-event.mjs +0 -13
  85. package/esm2022/panelbar/events.mjs +0 -9
  86. package/esm2022/panelbar/panelbar-content.directive.mjs +0 -36
  87. package/esm2022/panelbar/panelbar-expand-mode.mjs +0 -29
  88. package/esm2022/panelbar/panelbar-item-model.mjs +0 -5
  89. package/esm2022/panelbar/panelbar-item-template.directive.mjs +0 -37
  90. package/esm2022/panelbar/panelbar-item-title.directive.mjs +0 -42
  91. package/esm2022/panelbar/panelbar-item.component.mjs +0 -722
  92. package/esm2022/panelbar/panelbar.component.mjs +0 -705
  93. package/esm2022/panelbar/panelbar.service.mjs +0 -53
  94. package/esm2022/panelbar.module.mjs +0 -41
  95. package/esm2022/progress-kendo-angular-layout.mjs +0 -8
  96. package/esm2022/splitter/splitter-bar.component.mjs +0 -338
  97. package/esm2022/splitter/splitter-pane.component.mjs +0 -324
  98. package/esm2022/splitter/splitter.component.mjs +0 -301
  99. package/esm2022/splitter/splitter.service.mjs +0 -205
  100. package/esm2022/splitter/util.mjs +0 -34
  101. package/esm2022/splitter.module.mjs +0 -38
  102. package/esm2022/stacklayout.module.mjs +0 -37
  103. package/esm2022/stepper/events/activate-event.mjs +0 -33
  104. package/esm2022/stepper/list.component.mjs +0 -185
  105. package/esm2022/stepper/localization/custom-messages.component.mjs +0 -52
  106. package/esm2022/stepper/localization/localized-messages.directive.mjs +0 -41
  107. package/esm2022/stepper/localization/messages.mjs +0 -27
  108. package/esm2022/stepper/models/constants.mjs +0 -8
  109. package/esm2022/stepper/models/orientation.mjs +0 -5
  110. package/esm2022/stepper/models/step-predicate.mjs +0 -5
  111. package/esm2022/stepper/models/step-type.mjs +0 -5
  112. package/esm2022/stepper/models/stepper-step.interface.mjs +0 -5
  113. package/esm2022/stepper/step.component.mjs +0 -396
  114. package/esm2022/stepper/stepper.component.mjs +0 -423
  115. package/esm2022/stepper/stepper.service.mjs +0 -186
  116. package/esm2022/stepper/template-directives/indicator-template.directive.mjs +0 -37
  117. package/esm2022/stepper/template-directives/label-template.directive.mjs +0 -37
  118. package/esm2022/stepper/template-directives/step-template.directive.mjs +0 -39
  119. package/esm2022/stepper/template-directives.mjs +0 -7
  120. package/esm2022/stepper/types.mjs +0 -5
  121. package/esm2022/stepper.module.mjs +0 -41
  122. package/esm2022/tabstrip/constants.mjs +0 -29
  123. package/esm2022/tabstrip/directives/tab-content.directive.mjs +0 -39
  124. package/esm2022/tabstrip/directives/tab-title.directive.mjs +0 -37
  125. package/esm2022/tabstrip/directives/tab.directive.mjs +0 -24
  126. package/esm2022/tabstrip/events/select-event.mjs +0 -25
  127. package/esm2022/tabstrip/events/tabclose-event.mjs +0 -23
  128. package/esm2022/tabstrip/events/tabscroll-event.mjs +0 -23
  129. package/esm2022/tabstrip/events.mjs +0 -7
  130. package/esm2022/tabstrip/localization/custom-messages.component.mjs +0 -53
  131. package/esm2022/tabstrip/localization/localized-messages.directive.mjs +0 -39
  132. package/esm2022/tabstrip/localization/messages.mjs +0 -39
  133. package/esm2022/tabstrip/models/button-state-change.mjs +0 -5
  134. package/esm2022/tabstrip/models/scroll-button-type.mjs +0 -5
  135. package/esm2022/tabstrip/models/scroll-buttons-visibility.mjs +0 -5
  136. package/esm2022/tabstrip/models/scrollable-settings.mjs +0 -23
  137. package/esm2022/tabstrip/models/size.mjs +0 -5
  138. package/esm2022/tabstrip/models/tab-alignment.mjs +0 -5
  139. package/esm2022/tabstrip/models/tab-position.mjs +0 -5
  140. package/esm2022/tabstrip/models/tabstrip-tab.component.mjs +0 -130
  141. package/esm2022/tabstrip/rendering/tab.component.mjs +0 -182
  142. package/esm2022/tabstrip/scrollable-button.component.mjs +0 -182
  143. package/esm2022/tabstrip/tabstrip-scroll.service.mjs +0 -176
  144. package/esm2022/tabstrip/tabstrip.component.mjs +0 -954
  145. package/esm2022/tabstrip/tabstrip.service.mjs +0 -155
  146. package/esm2022/tabstrip/util.mjs +0 -120
  147. package/esm2022/tabstrip.module.mjs +0 -41
  148. package/esm2022/tilelayout/constants.mjs +0 -70
  149. package/esm2022/tilelayout/dragging-service.mjs +0 -421
  150. package/esm2022/tilelayout/keyboard-navigation.service.mjs +0 -189
  151. package/esm2022/tilelayout/models/dragging-config.interface.mjs +0 -5
  152. package/esm2022/tilelayout/models/flowmode.type.mjs +0 -5
  153. package/esm2022/tilelayout/models/gap.interface.mjs +0 -5
  154. package/esm2022/tilelayout/models/navigation.interface.mjs +0 -5
  155. package/esm2022/tilelayout/reorder-event.mjs +0 -43
  156. package/esm2022/tilelayout/resize-event.mjs +0 -37
  157. package/esm2022/tilelayout/tilelayout-item-body.component.mjs +0 -45
  158. package/esm2022/tilelayout/tilelayout-item-header.component.mjs +0 -43
  159. package/esm2022/tilelayout/tilelayout-item.component.mjs +0 -322
  160. package/esm2022/tilelayout/tilelayout-resize-handle.directive.mjs +0 -61
  161. package/esm2022/tilelayout/tilelayout.component.mjs +0 -388
  162. package/esm2022/tilelayout/util.mjs +0 -138
  163. package/esm2022/tilelayout.module.mjs +0 -40
  164. package/esm2022/timeline/events/navigation-direction.mjs +0 -5
  165. package/esm2022/timeline/localization/custom-messages.component.mjs +0 -43
  166. package/esm2022/timeline/localization/localized-messages.directive.mjs +0 -39
  167. package/esm2022/timeline/localization/messages.mjs +0 -33
  168. package/esm2022/timeline/models/anchor-target.mjs +0 -5
  169. package/esm2022/timeline/models/default-model-fields.mjs +0 -16
  170. package/esm2022/timeline/models/events-order.mjs +0 -5
  171. package/esm2022/timeline/models/model-fields.mjs +0 -5
  172. package/esm2022/timeline/models/timeline-event.mjs +0 -5
  173. package/esm2022/timeline/templates/timeline-card-actions.directive.mjs +0 -40
  174. package/esm2022/timeline/templates/timeline-card-body.directive.mjs +0 -40
  175. package/esm2022/timeline/templates/timeline-card-header.directive.mjs +0 -41
  176. package/esm2022/timeline/timeline-card.component.mjs +0 -451
  177. package/esm2022/timeline/timeline-horizontal.component.mjs +0 -781
  178. package/esm2022/timeline/timeline-vertical.component.mjs +0 -203
  179. package/esm2022/timeline/timeline.component.mjs +0 -491
  180. package/esm2022/timeline/timeline.service.mjs +0 -32
  181. package/esm2022/timeline/util.mjs +0 -26
  182. package/esm2022/timeline.module.mjs +0 -41
@@ -1,203 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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 { TimelineCardComponent } from './timeline-card.component';
8
- import { Subscription } from 'rxjs';
9
- import { TimelineCardBodyTemplateDirective } from './templates/timeline-card-body.directive';
10
- import { TimelineCardHeaderTemplateDirective } from './templates/timeline-card-header.directive';
11
- import { TimelineCardActionsTemplateDirective } from './templates/timeline-card-actions.directive';
12
- import { DatePipe } from '@progress/kendo-angular-intl';
13
- import { NgClass } from '@angular/common';
14
- import * as i0 from "@angular/core";
15
- /**
16
- * @hidden
17
- */
18
- export class TimelineVerticalComponent {
19
- renderer;
20
- events = [];
21
- alterMode;
22
- collapsibleEvents;
23
- navigable;
24
- showDateLabels;
25
- animationDuration;
26
- eventWidth;
27
- dateFormat;
28
- headerTemplate;
29
- bodyTemplate;
30
- actionsTemplate;
31
- cards;
32
- dateElementRefs;
33
- innerDateElementRefs;
34
- subscriptions = new Subscription();
35
- constructor(renderer) {
36
- this.renderer = renderer;
37
- }
38
- ngAfterViewInit() {
39
- this.ariaDescribedByAllEvents();
40
- this.subscriptions.add(this.innerDateElementRefs.changes.subscribe(() => {
41
- if (this.innerDateElementRefs?.length > 0) {
42
- this.ariaDescribedByAllEvents();
43
- }
44
- else {
45
- this.removeAriaDescribedBy();
46
- }
47
- }));
48
- }
49
- expand(index) {
50
- if (index < 0 || index >= this.cards.length) {
51
- return;
52
- }
53
- this.cards.get(index).expand();
54
- }
55
- collapse(index) {
56
- if (index < 0 || index >= this.cards.length) {
57
- return;
58
- }
59
- this.cards.get(index).collapse();
60
- }
61
- ariaDescribedByAllEvents() {
62
- this.cards?.forEach((card, index) => {
63
- const innerCard = card.element.nativeElement.querySelector('.k-card');
64
- const innerDate = this.dateElementRefs.get(index).nativeElement.querySelector('.k-timeline-date');
65
- if (innerDate) {
66
- this.assignAriaDescribedBy(innerCard, innerDate);
67
- }
68
- });
69
- }
70
- removeAriaDescribedBy() {
71
- this.cards?.forEach(card => {
72
- const innerCard = card.element.nativeElement.querySelector('.k-card');
73
- this.renderer.removeAttribute(innerCard, 'aria-describedby');
74
- });
75
- }
76
- assignAriaDescribedBy(cardElement, dateElement) {
77
- const dateLabelId = `k-${guid()}`;
78
- this.renderer.setAttribute(dateElement, 'id', dateLabelId);
79
- this.renderer.setAttribute(cardElement, 'aria-describedby', dateLabelId);
80
- }
81
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimelineVerticalComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
82
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TimelineVerticalComponent, isStandalone: true, 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: `
83
- @if (events && events.length > 0) {
84
- <ul>
85
- @for (event of events; track event; let i = $index) {
86
- @if (event.flag) {
87
- <li class="k-timeline-flag-wrap">
88
- <span class="k-timeline-flag">{{ event.flag }}</span>
89
- </li>
90
- }
91
- <li class="k-timeline-event" [ngClass]="{ 'k-reverse': alterMode && i % 2 === 0 }">
92
- <div class="k-timeline-date-wrap" #dateWrap>
93
- @if (showDateLabels) {
94
- <span class="k-timeline-date" #innerDate>
95
- {{ event.date | kendoDate: dateFormat }}
96
- </span>
97
- }
98
- </div>
99
- <span class="k-timeline-circle"></span>
100
- <kendo-timeline-card
101
- #card
102
- [event]="event"
103
- [expanded]="event.expanded || !collapsibleEvents"
104
- [collapsible]="collapsibleEvents"
105
- [reversed]="alterMode && i % 2 === 0"
106
- [tabIndex]="'0'"
107
- [navigable]="navigable"
108
- [animationDuration]="animationDuration"
109
- [headerTemplate]="headerTemplate"
110
- [bodyTemplate]="bodyTemplate"
111
- [actionsTemplate]="actionsTemplate"
112
- [index]="i"
113
- [eventWidth]="eventWidth"
114
- orientation="vertical"
115
- >
116
- </kendo-timeline-card>
117
- </li>
118
- }
119
- </ul>
120
- }
121
- `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: 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: DatePipe, name: "kendoDate" }] });
122
- }
123
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimelineVerticalComponent, decorators: [{
124
- type: Component,
125
- args: [{
126
- providers: [],
127
- exportAs: 'kendoTimelineVertical',
128
- selector: 'kendo-timeline-vertical',
129
- template: `
130
- @if (events && events.length > 0) {
131
- <ul>
132
- @for (event of events; track event; let i = $index) {
133
- @if (event.flag) {
134
- <li class="k-timeline-flag-wrap">
135
- <span class="k-timeline-flag">{{ event.flag }}</span>
136
- </li>
137
- }
138
- <li class="k-timeline-event" [ngClass]="{ 'k-reverse': alterMode && i % 2 === 0 }">
139
- <div class="k-timeline-date-wrap" #dateWrap>
140
- @if (showDateLabels) {
141
- <span class="k-timeline-date" #innerDate>
142
- {{ event.date | kendoDate: dateFormat }}
143
- </span>
144
- }
145
- </div>
146
- <span class="k-timeline-circle"></span>
147
- <kendo-timeline-card
148
- #card
149
- [event]="event"
150
- [expanded]="event.expanded || !collapsibleEvents"
151
- [collapsible]="collapsibleEvents"
152
- [reversed]="alterMode && i % 2 === 0"
153
- [tabIndex]="'0'"
154
- [navigable]="navigable"
155
- [animationDuration]="animationDuration"
156
- [headerTemplate]="headerTemplate"
157
- [bodyTemplate]="bodyTemplate"
158
- [actionsTemplate]="actionsTemplate"
159
- [index]="i"
160
- [eventWidth]="eventWidth"
161
- orientation="vertical"
162
- >
163
- </kendo-timeline-card>
164
- </li>
165
- }
166
- </ul>
167
- }
168
- `,
169
- standalone: true,
170
- imports: [NgClass, TimelineCardComponent, DatePipe]
171
- }]
172
- }], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { events: [{
173
- type: Input
174
- }], alterMode: [{
175
- type: Input
176
- }], collapsibleEvents: [{
177
- type: Input
178
- }], navigable: [{
179
- type: Input
180
- }], showDateLabels: [{
181
- type: Input
182
- }], animationDuration: [{
183
- type: Input
184
- }], eventWidth: [{
185
- type: Input
186
- }], dateFormat: [{
187
- type: Input
188
- }], headerTemplate: [{
189
- type: Input
190
- }], bodyTemplate: [{
191
- type: Input
192
- }], actionsTemplate: [{
193
- type: Input
194
- }], cards: [{
195
- type: ViewChildren,
196
- args: ['card']
197
- }], dateElementRefs: [{
198
- type: ViewChildren,
199
- args: ['dateWrap']
200
- }], innerDateElementRefs: [{
201
- type: ViewChildren,
202
- args: ['innerDate']
203
- }] } });
@@ -1,491 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 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 { LocalizedTimelineMessagesDirective } from './localization/localized-messages.directive';
18
- import * as i0 from "@angular/core";
19
- import * as i1 from "./timeline.service";
20
- const DEFAULT_HORIZONTAL_ANIMATION_DURATION = 400;
21
- const DEFAULT_VERTICAL_ANIMATION_DURATION = 300;
22
- const DEFAULT_EVENT_WIDTH = 400;
23
- const DEFAULT_EVENT_HEIGHT = 600;
24
- const DEFAULT_DATE_FORMAT = 'MMMM dd, yyyy';
25
- /**
26
- * Represents the [Kendo UI Timeline component for Angular]({% slug overview_timeline %}).
27
- *
28
- * @remarks
29
- * Supported children components are: {@link TimelineCustomMessagesComponent}.
30
- */
31
- export class TimelineComponent {
32
- timelineService;
33
- /**
34
- * An array of event instances which will be shown by the Timeline.
35
- */
36
- set events(events) {
37
- if (!isPresent(events)) {
38
- return;
39
- }
40
- this.originalData = events;
41
- this._events = processItems(this.originalData, this.modelFields);
42
- this.updateEvents();
43
- }
44
- get events() {
45
- return this._events;
46
- }
47
- /**
48
- * The names of the model fields from which the Timeline will read its data.
49
- */
50
- set modelFields(value) {
51
- this._modelFields = { ...defaultModelFields, ...value };
52
- if (this.originalData) {
53
- this.events = this.originalData;
54
- }
55
- }
56
- get modelFields() {
57
- return this._modelFields;
58
- }
59
- /**
60
- * Specifies the orientation of the axis.
61
- *
62
- * @default 'vertical'
63
- */
64
- orientation = 'vertical';
65
- /**
66
- * Specifies whether to render events alternatingly on both sides of the axis.
67
- * Applicable when `orientation` is set to `vertical`.
68
- *
69
- * @default false
70
- */
71
- alterMode = false;
72
- /**
73
- * Specifies whether the event cards can be collapsed.
74
- *
75
- * @default true
76
- */
77
- collapsibleEvents = true;
78
- /**
79
- * Specifies whether the user can use dedicated shortcuts to interact with the Timeline.
80
- *
81
- * @default true
82
- */
83
- navigable = true;
84
- /**
85
- * Specifies whether an event's date label will be visible.
86
- *
87
- * @default true
88
- */
89
- showDateLabels = true;
90
- /**
91
- * Specifies the time for sliding to the next event in `horizontal` mode and the time for collapsing the event in `vertical` mode.
92
- * The default animation duration values are `300ms` for `horizontal` mode and `400ms` for `vertical` mode.
93
- *
94
- * @default true
95
- */
96
- animation;
97
- /**
98
- * Specifies the order of the Timeline events.
99
- * `asc` - chronological order
100
- * `desc` - reverse-chronological order
101
- *
102
- * @default 'asc'
103
- */
104
- set eventsOrder(order) {
105
- if (order === this._eventsOrder) {
106
- return;
107
- }
108
- this._eventsOrder = order;
109
- this.updateEvents();
110
- }
111
- get eventsOrder() {
112
- return this._eventsOrder;
113
- }
114
- /**
115
- * Sets a specific width for the event.
116
- * This setting is supported only in `vertical` mode.
117
- *
118
- * @default 400
119
- */
120
- get eventWidth() {
121
- return this._eventWidth;
122
- }
123
- set eventWidth(value) {
124
- if (value) {
125
- this._eventWidth = value;
126
- }
127
- else {
128
- this._eventWidth = DEFAULT_EVENT_WIDTH;
129
- }
130
- }
131
- /**
132
- * Sets a specific height for the event.
133
- * This setting is supported only in `horizontal` mode.
134
- *
135
- * @default 600
136
- */
137
- get eventHeight() {
138
- return this._eventHeight;
139
- }
140
- set eventHeight(value) {
141
- if (value) {
142
- this._eventHeight = value;
143
- }
144
- else {
145
- this._eventHeight = DEFAULT_EVENT_HEIGHT;
146
- }
147
- }
148
- /**
149
- * @hidden
150
- */
151
- get animationDuration() {
152
- if (typeof this.animation === 'number') {
153
- return this.animation;
154
- }
155
- if ((typeof this.animation === 'boolean' && this.animation) || !isPresent(this.animation)) {
156
- return this.orientation === 'horizontal' ? DEFAULT_HORIZONTAL_ANIMATION_DURATION : DEFAULT_VERTICAL_ANIMATION_DURATION;
157
- }
158
- return 0;
159
- }
160
- /**
161
- * Specifies the date format for displaying the event date.
162
- *
163
- * @default 'MMMM dd, yyyy'
164
- */
165
- set dateFormat(value) {
166
- if (isPresent(value) && value !== '') {
167
- this._dateFormat = value;
168
- }
169
- else {
170
- this._dateFormat = DEFAULT_DATE_FORMAT;
171
- }
172
- }
173
- get dateFormat() {
174
- return this._dateFormat;
175
- }
176
- hostClass = true;
177
- get verticalClass() {
178
- return this.orientation === 'vertical';
179
- }
180
- get horizontalClass() {
181
- return this.orientation === 'horizontal';
182
- }
183
- get alternatingClass() {
184
- return this.alterMode === true && this.orientation === 'vertical';
185
- }
186
- get collapsibleClass() {
187
- return this.collapsibleEvents === true && this.orientation === 'vertical';
188
- }
189
- /**
190
- * @hidden
191
- */
192
- timelineHorizontal;
193
- /**
194
- * @hidden
195
- */
196
- timelineVertical;
197
- /**
198
- * @hidden
199
- */
200
- cardHeaderTemplate;
201
- /**
202
- * @hidden
203
- */
204
- cardBodyTemplate;
205
- /**
206
- * @hidden
207
- */
208
- cardActionsTemplate;
209
- /**
210
- * Fires when a card is toggled.
211
- * This event is supported only in `vertical` mode.
212
- */
213
- onToggle = new EventEmitter();
214
- /**
215
- * Fires when a card's action is clicked.
216
- */
217
- onActionClick = new EventEmitter();
218
- /**
219
- * Fires when the left or right arrow is clicked.
220
- * This event is supported only in `horizontal` mode.
221
- */
222
- onNavigate = new EventEmitter();
223
- /**
224
- * @hidden
225
- */
226
- headerTemplate;
227
- /**
228
- * @hidden
229
- */
230
- bodyTemplate;
231
- /**
232
- * @hidden
233
- */
234
- actionsTemplate;
235
- _events = [];
236
- _modelFields = defaultModelFields;
237
- _eventWidth = DEFAULT_EVENT_WIDTH;
238
- _eventHeight = DEFAULT_EVENT_HEIGHT;
239
- _dateFormat = DEFAULT_DATE_FORMAT;
240
- originalData = [];
241
- _eventsOrder = 'asc';
242
- subscriptions = new Subscription();
243
- constructor(timelineService) {
244
- this.timelineService = timelineService;
245
- this.timelineService.timeline = this;
246
- }
247
- ngAfterContentInit() {
248
- this.initTemplates();
249
- }
250
- ngOnDestroy() {
251
- this.subscriptions.unsubscribe();
252
- }
253
- /**
254
- * Switches to the previous portion of events.
255
- * This method is supported only in `horizontal` mode.
256
- */
257
- previous() {
258
- this.timelineHorizontal?.previous();
259
- }
260
- /**
261
- * Switches to the next portion of events.
262
- * This method is supported only in `horizontal` mode.
263
- */
264
- next() {
265
- this.timelineHorizontal?.next();
266
- }
267
- /**
268
- * Open event details.
269
- * This method is supported only in `horizontal` mode.
270
- */
271
- open(index) {
272
- this.timelineHorizontal?.open(index);
273
- }
274
- /**
275
- * Expands an event.
276
- * This method is supported only in `vertical` mode.
277
- */
278
- expand(index) {
279
- this.timelineVertical?.expand(index);
280
- }
281
- /**
282
- * Collapses an event.
283
- * This method is supported only in `vertical` mode.
284
- */
285
- collapse(index) {
286
- this.timelineVertical?.collapse(index);
287
- }
288
- updateEvents() {
289
- const sortOrder = this._eventsOrder === 'asc' ? 1 : -1;
290
- this._events = [...this._events].sort((a, b) => {
291
- return sortOrder * (a.date.getTime() - b.date.getTime());
292
- });
293
- if (this._events.length > 0) {
294
- let flag = this._events[0].date.getFullYear() - sortOrder;
295
- this._events.forEach((event) => {
296
- if (event.date.getFullYear() === flag) {
297
- event.flag = null;
298
- }
299
- else {
300
- flag = event.date.getFullYear();
301
- event.flag = flag;
302
- }
303
- });
304
- }
305
- }
306
- initTemplates() {
307
- this.headerTemplate = this.cardHeaderTemplate?.first;
308
- this.bodyTemplate = this.cardBodyTemplate?.first;
309
- this.actionsTemplate = this.cardActionsTemplate?.first;
310
- this.subscriptions.add(this.cardHeaderTemplate?.changes.subscribe(() => {
311
- this.headerTemplate = this.cardHeaderTemplate?.first || null;
312
- }));
313
- this.subscriptions.add(this.cardBodyTemplate?.changes.subscribe(() => {
314
- this.bodyTemplate = this.cardBodyTemplate?.first || null;
315
- }));
316
- this.subscriptions.add(this.cardActionsTemplate?.changes.subscribe(() => {
317
- this.actionsTemplate = this.cardActionsTemplate?.first || null;
318
- }));
319
- }
320
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimelineComponent, deps: [{ token: i1.TimelineService }], target: i0.ɵɵFactoryTarget.Component });
321
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: TimelineComponent, isStandalone: true, selector: "kendo-timeline", inputs: { events: "events", modelFields: "modelFields", orientation: "orientation", alterMode: "alterMode", collapsibleEvents: "collapsibleEvents", navigable: "navigable", showDateLabels: "showDateLabels", animation: "animation", eventsOrder: "eventsOrder", 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: [
322
- TimelineService,
323
- LocalizationService,
324
- {
325
- provide: L10N_PREFIX,
326
- useValue: 'kendo.timeline'
327
- }
328
- ], 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: `
329
- <ng-container kendoTimelineLocalizedMessages
330
- i18n-previous="kendo.timeline.previous|The title of the previous button in horizontal orientation."
331
- previous="previous"
332
- >
333
- </ng-container>
334
- <ng-container kendoTimelineLocalizedMessages
335
- i18n-next="kendo.timeline.next|The title of the next button in horizontal orientation."
336
- next="next"
337
- >
338
- </ng-container>
339
- @if (orientation === 'vertical') {
340
- <kendo-timeline-vertical
341
- [events]="events"
342
- [alterMode]="alterMode"
343
- [collapsibleEvents]="collapsibleEvents"
344
- [navigable]="navigable"
345
- [showDateLabels]="showDateLabels"
346
- [animationDuration]="animationDuration"
347
- [eventWidth]="eventWidth"
348
- [dateFormat]="dateFormat"
349
- [headerTemplate]="headerTemplate"
350
- [bodyTemplate]="bodyTemplate"
351
- [actionsTemplate]="actionsTemplate"
352
- >
353
- </kendo-timeline-vertical>
354
- }
355
- @if (orientation === 'horizontal') {
356
- <kendo-timeline-horizontal
357
- [events]="events"
358
- [collapsibleEvents]="false"
359
- [navigable]="navigable"
360
- [showDateLabels]="showDateLabels"
361
- [animationDuration]="animationDuration"
362
- [eventHeight]="eventHeight"
363
- [dateFormat]="dateFormat"
364
- [headerTemplate]="headerTemplate"
365
- [bodyTemplate]="bodyTemplate"
366
- [actionsTemplate]="actionsTemplate"
367
- >
368
- </kendo-timeline-horizontal>
369
- }
370
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedTimelineMessagesDirective, selector: "[kendoTimelineLocalizedMessages]" }, { kind: "component", type: TimelineVerticalComponent, selector: "kendo-timeline-vertical", inputs: ["events", "alterMode", "collapsibleEvents", "navigable", "showDateLabels", "animationDuration", "eventWidth", "dateFormat", "headerTemplate", "bodyTemplate", "actionsTemplate"], exportAs: ["kendoTimelineVertical"] }, { kind: "component", type: TimelineHorizontalComponent, selector: "kendo-timeline-horizontal", inputs: ["events", "alterMode", "collapsibleEvents", "navigable", "showDateLabels", "animationDuration", "eventHeight", "dateFormat", "headerTemplate", "bodyTemplate", "actionsTemplate"], exportAs: ["kendoTimelineHorizontal"] }] });
371
- }
372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TimelineComponent, decorators: [{
373
- type: Component,
374
- args: [{
375
- providers: [
376
- TimelineService,
377
- LocalizationService,
378
- {
379
- provide: L10N_PREFIX,
380
- useValue: 'kendo.timeline'
381
- }
382
- ],
383
- exportAs: 'kendoTimeline',
384
- selector: 'kendo-timeline',
385
- template: `
386
- <ng-container kendoTimelineLocalizedMessages
387
- i18n-previous="kendo.timeline.previous|The title of the previous button in horizontal orientation."
388
- previous="previous"
389
- >
390
- </ng-container>
391
- <ng-container kendoTimelineLocalizedMessages
392
- i18n-next="kendo.timeline.next|The title of the next button in horizontal orientation."
393
- next="next"
394
- >
395
- </ng-container>
396
- @if (orientation === 'vertical') {
397
- <kendo-timeline-vertical
398
- [events]="events"
399
- [alterMode]="alterMode"
400
- [collapsibleEvents]="collapsibleEvents"
401
- [navigable]="navigable"
402
- [showDateLabels]="showDateLabels"
403
- [animationDuration]="animationDuration"
404
- [eventWidth]="eventWidth"
405
- [dateFormat]="dateFormat"
406
- [headerTemplate]="headerTemplate"
407
- [bodyTemplate]="bodyTemplate"
408
- [actionsTemplate]="actionsTemplate"
409
- >
410
- </kendo-timeline-vertical>
411
- }
412
- @if (orientation === 'horizontal') {
413
- <kendo-timeline-horizontal
414
- [events]="events"
415
- [collapsibleEvents]="false"
416
- [navigable]="navigable"
417
- [showDateLabels]="showDateLabels"
418
- [animationDuration]="animationDuration"
419
- [eventHeight]="eventHeight"
420
- [dateFormat]="dateFormat"
421
- [headerTemplate]="headerTemplate"
422
- [bodyTemplate]="bodyTemplate"
423
- [actionsTemplate]="actionsTemplate"
424
- >
425
- </kendo-timeline-horizontal>
426
- }
427
- `,
428
- standalone: true,
429
- imports: [LocalizedTimelineMessagesDirective, TimelineVerticalComponent, TimelineHorizontalComponent]
430
- }]
431
- }], ctorParameters: () => [{ type: i1.TimelineService }], propDecorators: { events: [{
432
- type: Input
433
- }], modelFields: [{
434
- type: Input
435
- }], orientation: [{
436
- type: Input
437
- }], alterMode: [{
438
- type: Input
439
- }], collapsibleEvents: [{
440
- type: Input
441
- }], navigable: [{
442
- type: Input
443
- }], showDateLabels: [{
444
- type: Input
445
- }], animation: [{
446
- type: Input
447
- }], eventsOrder: [{
448
- type: Input
449
- }], eventWidth: [{
450
- type: Input
451
- }], eventHeight: [{
452
- type: Input
453
- }], dateFormat: [{
454
- type: Input
455
- }], hostClass: [{
456
- type: HostBinding,
457
- args: ['class.k-timeline']
458
- }], verticalClass: [{
459
- type: HostBinding,
460
- args: ['class.k-timeline-vertical']
461
- }], horizontalClass: [{
462
- type: HostBinding,
463
- args: ['class.k-timeline-horizontal']
464
- }], alternatingClass: [{
465
- type: HostBinding,
466
- args: ['class.k-timeline-alternating']
467
- }], collapsibleClass: [{
468
- type: HostBinding,
469
- args: ['class.k-timeline-collapsible']
470
- }], timelineHorizontal: [{
471
- type: ViewChild,
472
- args: [TimelineHorizontalComponent]
473
- }], timelineVertical: [{
474
- type: ViewChild,
475
- args: [TimelineVerticalComponent]
476
- }], cardHeaderTemplate: [{
477
- type: ContentChildren,
478
- args: [TimelineCardHeaderTemplateDirective, { descendants: false }]
479
- }], cardBodyTemplate: [{
480
- type: ContentChildren,
481
- args: [TimelineCardBodyTemplateDirective, { descendants: false }]
482
- }], cardActionsTemplate: [{
483
- type: ContentChildren,
484
- args: [TimelineCardActionsTemplateDirective, { descendants: false }]
485
- }], onToggle: [{
486
- type: Output
487
- }], onActionClick: [{
488
- type: Output
489
- }], onNavigate: [{
490
- type: Output
491
- }] } });