@progress/kendo-angular-layout 16.0.0-develop.4 → 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.
Files changed (44) hide show
  1. package/esm2020/index.mjs +7 -0
  2. package/esm2020/layout.module.mjs +7 -3
  3. package/esm2020/package-metadata.mjs +2 -2
  4. package/esm2020/timeline/events/navigation-direction.mjs +5 -0
  5. package/esm2020/timeline/localization/custom-messages.component.mjs +41 -0
  6. package/esm2020/timeline/localization/localized-messages.directive.mjs +37 -0
  7. package/esm2020/timeline/localization/messages.mjs +25 -0
  8. package/esm2020/timeline/models/anchor-target.mjs +5 -0
  9. package/esm2020/timeline/models/default-model-fields.mjs +16 -0
  10. package/esm2020/timeline/models/model-fields.mjs +5 -0
  11. package/esm2020/timeline/models/timeline-event.mjs +5 -0
  12. package/esm2020/timeline/templates/timeline-card-actions.directive.mjs +29 -0
  13. package/esm2020/timeline/templates/timeline-card-body.directive.mjs +29 -0
  14. package/esm2020/timeline/templates/timeline-card-header.directive.mjs +29 -0
  15. package/esm2020/timeline/timeline-card.component.mjs +402 -0
  16. package/esm2020/timeline/timeline-horizontal.component.mjs +722 -0
  17. package/esm2020/timeline/timeline-vertical.component.mjs +175 -0
  18. package/esm2020/timeline/timeline.component.mjs +418 -0
  19. package/esm2020/timeline/timeline.service.mjs +31 -0
  20. package/esm2020/timeline/util.mjs +26 -0
  21. package/esm2020/timeline.module.mjs +65 -0
  22. package/fesm2015/progress-kendo-angular-layout.mjs +1996 -63
  23. package/fesm2020/progress-kendo-angular-layout.mjs +1969 -63
  24. package/index.d.ts +10 -0
  25. package/layout.module.d.ts +2 -1
  26. package/package.json +7 -7
  27. package/timeline/events/navigation-direction.d.ts +5 -0
  28. package/timeline/localization/custom-messages.component.d.ts +17 -0
  29. package/timeline/localization/localized-messages.directive.d.ts +16 -0
  30. package/timeline/localization/messages.d.ts +21 -0
  31. package/timeline/models/anchor-target.d.ts +5 -0
  32. package/timeline/models/default-model-fields.d.ts +9 -0
  33. package/timeline/models/model-fields.d.ts +51 -0
  34. package/timeline/models/timeline-event.d.ts +49 -0
  35. package/timeline/templates/timeline-card-actions.directive.d.ts +20 -0
  36. package/timeline/templates/timeline-card-body.directive.d.ts +20 -0
  37. package/timeline/templates/timeline-card-header.directive.d.ts +20 -0
  38. package/timeline/timeline-card.component.d.ts +59 -0
  39. package/timeline/timeline-horizontal.component.d.ts +110 -0
  40. package/timeline/timeline-vertical.component.d.ts +41 -0
  41. package/timeline/timeline.component.d.ts +186 -0
  42. package/timeline/timeline.service.d.ts +17 -0
  43. package/timeline/util.d.ts +18 -0
  44. package/timeline.module.d.ts +31 -0
@@ -0,0 +1,402 @@
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, ElementRef, HostBinding, HostListener, Input, Renderer2, ViewChild } from '@angular/core';
6
+ import { chevronRightIcon } from '@progress/kendo-svg-icons';
7
+ import { Keys, isChanged } from '@progress/kendo-angular-common';
8
+ import { animate, state, style, transition, trigger } from '@angular/animations';
9
+ import { TimelineService } from './timeline.service';
10
+ import { TimelineCardHeaderTemplateDirective } from './templates/timeline-card-header.directive';
11
+ import { TimelineCardBodyTemplateDirective } from './templates/timeline-card-body.directive';
12
+ import { TimelineCardActionsTemplateDirective } from './templates/timeline-card-actions.directive';
13
+ import * as i0 from "@angular/core";
14
+ import * as i1 from "./timeline.service";
15
+ import * as i2 from "@angular/common";
16
+ import * as i3 from "../card/card.component";
17
+ import * as i4 from "../card/card-header.component";
18
+ import * as i5 from "../card/card-body.component";
19
+ import * as i6 from "../card/card-actions.component";
20
+ import * as i7 from "../card/directives/card-title.directive";
21
+ import * as i8 from "../card/directives/card-subtitle.directive";
22
+ import * as i9 from "../card/directives/card-media.directive";
23
+ import * as i10 from "@progress/kendo-angular-buttons";
24
+ /**
25
+ * @hidden
26
+ */
27
+ export class TimelineCardComponent {
28
+ constructor(element, timelineService, renderer) {
29
+ this.element = element;
30
+ this.timelineService = timelineService;
31
+ this.renderer = renderer;
32
+ this.expanded = false;
33
+ this.collapsible = true;
34
+ this.reversed = false;
35
+ this.hostClass = true;
36
+ this.calloutSvgIcon = chevronRightIcon;
37
+ this.calloutFontIcon = 'arrow-chevron-right';
38
+ this.animationState = this.expanded ? 'expanded' : 'collapsed';
39
+ this.animationInProgress = false;
40
+ }
41
+ set calloutStyle(value) {
42
+ // applies only to horizontal orientation where the callout points upwards
43
+ if (!this.calloutElementRef || !this.calloutElementRef.nativeElement.classList.contains('k-callout-n')) {
44
+ return;
45
+ }
46
+ this.calloutElementRef.nativeElement.style.left = value?.left;
47
+ }
48
+ get collapsedClass() {
49
+ return !this.expanded && !this.animationInProgress && this.animationState === 'collapsed';
50
+ }
51
+ onComponentKeyDown(event) {
52
+ if (!this.navigable) {
53
+ return;
54
+ }
55
+ if (event.keyCode === Keys.Space || event.keyCode === Keys.Enter) {
56
+ event.preventDefault();
57
+ if (this.collapsible && this.orientation === 'vertical') {
58
+ this.expanded = !this.expanded;
59
+ }
60
+ }
61
+ }
62
+ get role() {
63
+ return this.orientation === 'vertical' ? 'button' : 'tabpanel';
64
+ }
65
+ get ariaLive() {
66
+ return this.orientation === 'vertical' ? 'polite' : null;
67
+ }
68
+ get ariaExpanded() {
69
+ return this.orientation === 'vertical' ? this.expanded : null;
70
+ }
71
+ ngAfterViewInit() {
72
+ this.makeOverflowVisible();
73
+ }
74
+ ngOnChanges(changes) {
75
+ if (isChanged('collapsible', changes, false)) {
76
+ if (!this.collapsible) {
77
+ this.expanded = true;
78
+ }
79
+ }
80
+ }
81
+ toggle() {
82
+ if (this.orientation === 'vertical') {
83
+ this.expanded = this.collapsible ? !this.expanded : true;
84
+ this.timelineService.onToggle(this.index);
85
+ }
86
+ }
87
+ expand() {
88
+ if (!this.expanded) {
89
+ this.expanded = true;
90
+ this.timelineService.onToggle(this.index);
91
+ }
92
+ }
93
+ collapse() {
94
+ if (!this.collapsible || !this.expanded) {
95
+ return;
96
+ }
97
+ this.expanded = false;
98
+ this.timelineService.onToggle(this.index);
99
+ }
100
+ onActionClick(event) {
101
+ event.stopPropagation();
102
+ this.timelineService.onActionClick(this.index);
103
+ }
104
+ animationStart() {
105
+ this.animationInProgress = true;
106
+ }
107
+ animationDone(event) {
108
+ this.animationInProgress = false;
109
+ if (event.toState === 'expanded' && event.fromState !== 'expanded') {
110
+ this.animationState = 'expanded';
111
+ this.makeOverflowVisible();
112
+ }
113
+ else if (event.toState === 'collapsed' && event.fromState !== 'collapsed') {
114
+ this.animationState = 'collapsed';
115
+ }
116
+ }
117
+ makeOverflowVisible() {
118
+ if (this.orientation === 'vertical') {
119
+ return;
120
+ }
121
+ const cardBody = this.element?.nativeElement.querySelector('.k-card-body');
122
+ if (cardBody) {
123
+ this.renderer.setStyle(cardBody, 'overflow', 'auto');
124
+ }
125
+ }
126
+ }
127
+ TimelineCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineCardComponent, deps: [{ token: i0.ElementRef }, { token: i1.TimelineService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
128
+ TimelineCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: TimelineCardComponent, selector: "kendo-timeline-card", inputs: { event: "event", expanded: "expanded", collapsible: "collapsible", reversed: "reversed", orientation: "orientation", navigable: "navigable", tabIndex: "tabIndex", animationDuration: "animationDuration", index: "index", eventWidth: "eventWidth", eventHeight: "eventHeight", headerTemplate: "headerTemplate", bodyTemplate: "bodyTemplate", actionsTemplate: "actionsTemplate", calloutStyle: "calloutStyle" }, host: { listeners: { "keydown": "onComponentKeyDown($event)" }, properties: { "class.k-timeline-card": "this.hostClass", "class.k-collapsed": "this.collapsedClass" } }, providers: [], viewQueries: [{ propertyName: "calloutElementRef", first: true, predicate: ["callout"], descendants: true }], exportAs: ["kendoTimelineCard"], usesOnChanges: true, ngImport: i0, template: `
129
+ <kendo-card
130
+ [ngStyle]="{ 'height': orientation === 'horizontal' ? eventHeight + 'px' : null }"
131
+ [width]="orientation === 'horizontal' ? 'auto' : eventWidth + 'px'"
132
+ class="k-card-with-callout k-card-vertical"
133
+ (click)="toggle()"
134
+ [attr.role]="role"
135
+ [attr.aria-live]="ariaLive"
136
+ [attr.aria-expanded]="ariaExpanded"
137
+ [attr.tabindex]="tabIndex"
138
+ >
139
+ <span
140
+ #callout
141
+ *ngIf="event"
142
+ class="k-timeline-card-callout k-card-callout"
143
+ [ngClass]="{
144
+ 'k-callout-n': orientation === 'horizontal',
145
+ 'k-callout-w': orientation === 'vertical' && !this.reversed,
146
+ 'k-callout-e': orientation === 'vertical' && this.reversed
147
+ }"
148
+ >
149
+ </span>
150
+ <div *ngIf="event" class="k-card-inner">
151
+ <kendo-card-header>
152
+ <ng-template
153
+ *ngIf="headerTemplate"
154
+ [ngTemplateOutlet]="headerTemplate?.templateRef"
155
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
156
+ >
157
+ </ng-template>
158
+
159
+ <div kendoCardTitle *ngIf="!headerTemplate">
160
+ <span class="k-event-title">{{ event.title }}</span>
161
+ <button
162
+ kendoButton
163
+ *ngIf="collapsible && orientation === 'vertical'"
164
+ [icon]="calloutFontIcon"
165
+ [svgIcon]="calloutSvgIcon"
166
+ class="k-event-collapse"
167
+ fillMode="flat"
168
+ [attr.aria-hidden]="true"
169
+ tabindex="-1"
170
+ type="button"
171
+ ></button>
172
+ </div>
173
+ <div kendoCardSubtitle *ngIf="!headerTemplate">{{ event.subtitle }}</div>
174
+ </kendo-card-header>
175
+
176
+ <kendo-card-body
177
+ *ngIf="event.description || event.images"
178
+ [@toggle]="{value: expanded ? 'expanded' : 'collapsed', params: {animationDuration: this.animationDuration || 0}}"
179
+ (@toggle.start)="animationStart()"
180
+ (@toggle.done)="animationDone($event)"
181
+ >
182
+ <ng-template
183
+ *ngIf="bodyTemplate"
184
+ [ngTemplateOutlet]="bodyTemplate?.templateRef"
185
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
186
+ >
187
+ </ng-template>
188
+
189
+ <div *ngIf="!bodyTemplate" class="k-card-description">
190
+ <p *ngIf="event.description">{{ event.description }}</p>
191
+ <ng-container *ngFor="let image of event.images">
192
+ <img *ngIf="image.alt" kendoCardMedia [src]="image.src" [alt]="image.alt" />
193
+ <img *ngIf="!image.alt" kendoCardMedia [src]="image.src" />
194
+ </ng-container>
195
+ </div>
196
+ </kendo-card-body>
197
+
198
+ <kendo-card-actions
199
+ *ngIf="event.actions"
200
+ [@toggle]="{value: expanded ? 'expanded' : 'collapsed', params: {animationDuration: this.animationDuration || 0}}"
201
+ >
202
+ <ng-template
203
+ *ngIf="actionsTemplate"
204
+ [ngTemplateOutlet]="actionsTemplate?.templateRef"
205
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
206
+ >
207
+ </ng-template>
208
+
209
+ <ng-container *ngIf="!actionsTemplate">
210
+ <a *ngFor="let action of event.actions"
211
+ [href]="action.url"
212
+ [target]="action.target === 'blank' ? '_blank' : '_self'"
213
+ (click)="onActionClick($event)"
214
+ class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary"
215
+ role="button"
216
+ >
217
+ {{ action.text }}
218
+ </a>
219
+ </ng-container>
220
+ </kendo-card-actions>
221
+ </div>
222
+ </kendo-card>
223
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.CardComponent, selector: "kendo-card", inputs: ["orientation", "width"] }, { kind: "component", type: i4.CardHeaderComponent, selector: "kendo-card-header" }, { kind: "component", type: i5.CardBodyComponent, selector: "kendo-card-body" }, { kind: "component", type: i6.CardActionsComponent, selector: "kendo-card-actions", inputs: ["orientation", "layout", "actions"], outputs: ["action"] }, { kind: "directive", type: i7.CardTitleDirective, selector: "[kendoCardTitle]" }, { kind: "directive", type: i8.CardSubtitleDirective, selector: "[kendoCardSubtitle]" }, { kind: "directive", type: i9.CardMediaDirective, selector: "[kendoCardMedia]" }, { kind: "component", type: i10.ButtonComponent, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], animations: [
224
+ trigger('toggle', [
225
+ state('collapsed', style({
226
+ height: '0',
227
+ 'overflow-y': 'hidden',
228
+ display: 'none'
229
+ })),
230
+ state('expanded', style({
231
+ height: '*',
232
+ 'overflow-y': 'hidden',
233
+ display: 'block'
234
+ })),
235
+ transition('collapsed <=> expanded', [
236
+ animate('{{animationDuration}}ms')
237
+ ], { params: { animationDuration: '400' } }),
238
+ ])
239
+ ] });
240
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: TimelineCardComponent, decorators: [{
241
+ type: Component,
242
+ args: [{
243
+ animations: [
244
+ trigger('toggle', [
245
+ state('collapsed', style({
246
+ height: '0',
247
+ 'overflow-y': 'hidden',
248
+ display: 'none'
249
+ })),
250
+ state('expanded', style({
251
+ height: '*',
252
+ 'overflow-y': 'hidden',
253
+ display: 'block'
254
+ })),
255
+ transition('collapsed <=> expanded', [
256
+ animate('{{animationDuration}}ms')
257
+ ], { params: { animationDuration: '400' } }),
258
+ ])
259
+ ],
260
+ providers: [],
261
+ exportAs: 'kendoTimelineCard',
262
+ selector: 'kendo-timeline-card',
263
+ template: `
264
+ <kendo-card
265
+ [ngStyle]="{ 'height': orientation === 'horizontal' ? eventHeight + 'px' : null }"
266
+ [width]="orientation === 'horizontal' ? 'auto' : eventWidth + 'px'"
267
+ class="k-card-with-callout k-card-vertical"
268
+ (click)="toggle()"
269
+ [attr.role]="role"
270
+ [attr.aria-live]="ariaLive"
271
+ [attr.aria-expanded]="ariaExpanded"
272
+ [attr.tabindex]="tabIndex"
273
+ >
274
+ <span
275
+ #callout
276
+ *ngIf="event"
277
+ class="k-timeline-card-callout k-card-callout"
278
+ [ngClass]="{
279
+ 'k-callout-n': orientation === 'horizontal',
280
+ 'k-callout-w': orientation === 'vertical' && !this.reversed,
281
+ 'k-callout-e': orientation === 'vertical' && this.reversed
282
+ }"
283
+ >
284
+ </span>
285
+ <div *ngIf="event" class="k-card-inner">
286
+ <kendo-card-header>
287
+ <ng-template
288
+ *ngIf="headerTemplate"
289
+ [ngTemplateOutlet]="headerTemplate?.templateRef"
290
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
291
+ >
292
+ </ng-template>
293
+
294
+ <div kendoCardTitle *ngIf="!headerTemplate">
295
+ <span class="k-event-title">{{ event.title }}</span>
296
+ <button
297
+ kendoButton
298
+ *ngIf="collapsible && orientation === 'vertical'"
299
+ [icon]="calloutFontIcon"
300
+ [svgIcon]="calloutSvgIcon"
301
+ class="k-event-collapse"
302
+ fillMode="flat"
303
+ [attr.aria-hidden]="true"
304
+ tabindex="-1"
305
+ type="button"
306
+ ></button>
307
+ </div>
308
+ <div kendoCardSubtitle *ngIf="!headerTemplate">{{ event.subtitle }}</div>
309
+ </kendo-card-header>
310
+
311
+ <kendo-card-body
312
+ *ngIf="event.description || event.images"
313
+ [@toggle]="{value: expanded ? 'expanded' : 'collapsed', params: {animationDuration: this.animationDuration || 0}}"
314
+ (@toggle.start)="animationStart()"
315
+ (@toggle.done)="animationDone($event)"
316
+ >
317
+ <ng-template
318
+ *ngIf="bodyTemplate"
319
+ [ngTemplateOutlet]="bodyTemplate?.templateRef"
320
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
321
+ >
322
+ </ng-template>
323
+
324
+ <div *ngIf="!bodyTemplate" class="k-card-description">
325
+ <p *ngIf="event.description">{{ event.description }}</p>
326
+ <ng-container *ngFor="let image of event.images">
327
+ <img *ngIf="image.alt" kendoCardMedia [src]="image.src" [alt]="image.alt" />
328
+ <img *ngIf="!image.alt" kendoCardMedia [src]="image.src" />
329
+ </ng-container>
330
+ </div>
331
+ </kendo-card-body>
332
+
333
+ <kendo-card-actions
334
+ *ngIf="event.actions"
335
+ [@toggle]="{value: expanded ? 'expanded' : 'collapsed', params: {animationDuration: this.animationDuration || 0}}"
336
+ >
337
+ <ng-template
338
+ *ngIf="actionsTemplate"
339
+ [ngTemplateOutlet]="actionsTemplate?.templateRef"
340
+ [ngTemplateOutletContext]="{ $implicit: event, index: index}">
341
+ >
342
+ </ng-template>
343
+
344
+ <ng-container *ngIf="!actionsTemplate">
345
+ <a *ngFor="let action of event.actions"
346
+ [href]="action.url"
347
+ [target]="action.target === 'blank' ? '_blank' : '_self'"
348
+ (click)="onActionClick($event)"
349
+ class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-primary"
350
+ role="button"
351
+ >
352
+ {{ action.text }}
353
+ </a>
354
+ </ng-container>
355
+ </kendo-card-actions>
356
+ </div>
357
+ </kendo-card>
358
+ `,
359
+ }]
360
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.TimelineService }, { type: i0.Renderer2 }]; }, propDecorators: { event: [{
361
+ type: Input
362
+ }], expanded: [{
363
+ type: Input
364
+ }], collapsible: [{
365
+ type: Input
366
+ }], reversed: [{
367
+ type: Input
368
+ }], orientation: [{
369
+ type: Input
370
+ }], navigable: [{
371
+ type: Input
372
+ }], tabIndex: [{
373
+ type: Input
374
+ }], animationDuration: [{
375
+ type: Input
376
+ }], index: [{
377
+ type: Input
378
+ }], eventWidth: [{
379
+ type: Input
380
+ }], eventHeight: [{
381
+ type: Input
382
+ }], headerTemplate: [{
383
+ type: Input
384
+ }], bodyTemplate: [{
385
+ type: Input
386
+ }], actionsTemplate: [{
387
+ type: Input
388
+ }], calloutStyle: [{
389
+ type: Input
390
+ }], calloutElementRef: [{
391
+ type: ViewChild,
392
+ args: ['callout']
393
+ }], hostClass: [{
394
+ type: HostBinding,
395
+ args: ['class.k-timeline-card']
396
+ }], collapsedClass: [{
397
+ type: HostBinding,
398
+ args: ['class.k-collapsed']
399
+ }], onComponentKeyDown: [{
400
+ type: HostListener,
401
+ args: ['keydown', ['$event']]
402
+ }] } });