@progress/kendo-angular-conversational-ui 5.0.0-next.202204010856 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/action.interface.d.ts +4 -4
- package/bundles/kendo-angular-conversational-ui.umd.js +1 -1
- package/chat/chat.component.d.ts +14 -11
- package/chat/chat.directives.d.ts +1 -0
- package/chat/chat.module.d.ts +14 -12
- package/chat/message-box.component.d.ts +42 -0
- package/chat/message-box.directive.d.ts +17 -0
- package/chat/message-list.component.d.ts +1 -1
- package/common/models/message-box-options.d.ts +8 -0
- package/esm2015/cards/hero-card.component.js +44 -42
- package/esm2015/chat/attachment.component.js +38 -38
- package/esm2015/chat/chat.component.js +106 -86
- package/esm2015/chat/chat.directives.js +1 -0
- package/esm2015/chat/chat.module.js +12 -5
- package/esm2015/chat/l10n/messages.js +1 -0
- package/esm2015/chat/message-attachments.component.js +62 -62
- package/esm2015/chat/message-box.component.js +141 -0
- package/esm2015/chat/message-box.directive.js +24 -0
- package/esm2015/chat/message-list.component.js +132 -132
- package/esm2015/chat/message.component.js +66 -66
- package/esm2015/chat/suggested-actions.component.js +30 -28
- package/esm2015/common/focused-state.directive.js +2 -2
- package/esm2015/common/models/message-box-options.js +5 -0
- package/esm2015/main.js +1 -0
- package/esm2015/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-conversational-ui.js +682 -501
- package/main.d.ts +2 -0
- package/package.json +12 -14
|
@@ -13,8 +13,8 @@ import { CommonModule } from '@angular/common';
|
|
|
13
13
|
import { fromEvent } from 'rxjs';
|
|
14
14
|
import { debounceTime } from 'rxjs/operators';
|
|
15
15
|
import * as i6 from '@progress/kendo-angular-common';
|
|
16
|
-
import { ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
17
|
-
import * as
|
|
16
|
+
import { Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
17
|
+
import * as i3 from '@progress/kendo-angular-buttons';
|
|
18
18
|
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -107,6 +107,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
107
107
|
type: Optional
|
|
108
108
|
}] }]; } });
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
const packageMetadata = {
|
|
114
|
+
name: '@progress/kendo-angular-conversational-ui',
|
|
115
|
+
productName: 'Kendo UI for Angular',
|
|
116
|
+
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
117
|
+
publishDate: 1650440956,
|
|
118
|
+
version: '',
|
|
119
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Creates a message box area that overrides the default message box of the Conversational UI Component.
|
|
124
|
+
* To define a message-box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag
|
|
125
|
+
* [see example]({% slug message_box %}#toc-message-box-template).
|
|
126
|
+
*/
|
|
127
|
+
class ChatMessageBoxTemplateDirective {
|
|
128
|
+
constructor(templateRef) {
|
|
129
|
+
this.templateRef = templateRef;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
ChatMessageBoxTemplateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatMessageBoxTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
133
|
+
ChatMessageBoxTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: ChatMessageBoxTemplateDirective, selector: "[kendoChatMessageBoxTemplate]", ngImport: i0 });
|
|
134
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatMessageBoxTemplateDirective, decorators: [{
|
|
135
|
+
type: Directive,
|
|
136
|
+
args: [{
|
|
137
|
+
selector: '[kendoChatMessageBoxTemplate]'
|
|
138
|
+
}]
|
|
139
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
|
|
140
|
+
|
|
110
141
|
// eslint-disable max-line-length
|
|
111
142
|
|
|
112
143
|
/**
|
|
@@ -151,18 +182,6 @@ class ExecuteActionEvent extends PreventableEvent {
|
|
|
151
182
|
}
|
|
152
183
|
}
|
|
153
184
|
|
|
154
|
-
/**
|
|
155
|
-
* @hidden
|
|
156
|
-
*/
|
|
157
|
-
const packageMetadata = {
|
|
158
|
-
name: '@progress/kendo-angular-conversational-ui',
|
|
159
|
-
productName: 'Kendo UI for Angular',
|
|
160
|
-
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
161
|
-
publishDate: 1648803312,
|
|
162
|
-
version: '',
|
|
163
|
-
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
164
|
-
};
|
|
165
|
-
|
|
166
185
|
/**
|
|
167
186
|
* @hidden
|
|
168
187
|
*/
|
|
@@ -281,44 +300,44 @@ MessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
281
300
|
provide: ChatItem,
|
|
282
301
|
useExisting: forwardRef(() => MessageComponent)
|
|
283
302
|
}], usesInheritance: true, ngImport: i0, template: `
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
>
|
|
289
|
-
{{ formatTimeStamp(message.timestamp) }}
|
|
290
|
-
</time>
|
|
291
|
-
|
|
292
|
-
<ng-container *ngIf="!message.typing; else typing">
|
|
293
|
-
<div class="k-bubble" *ngIf="template">
|
|
294
|
-
<ng-container
|
|
295
|
-
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
303
|
+
<time
|
|
304
|
+
[attr.aria-hidden]="!selected"
|
|
305
|
+
class="k-message-time"
|
|
306
|
+
*ngIf="message.timestamp"
|
|
296
307
|
>
|
|
297
|
-
|
|
298
|
-
|
|
308
|
+
{{ formatTimeStamp(message.timestamp) }}
|
|
309
|
+
</time>
|
|
299
310
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
311
|
+
<ng-container *ngIf="!message.typing; else typing">
|
|
312
|
+
<div class="k-bubble" *ngIf="template">
|
|
313
|
+
<ng-container
|
|
314
|
+
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
315
|
+
>
|
|
316
|
+
</ng-container>
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
<div class="k-bubble" *ngIf="!template && message.text">
|
|
320
|
+
{{message.text}}
|
|
321
|
+
</div>
|
|
322
|
+
</ng-container>
|
|
304
323
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
324
|
+
<span
|
|
325
|
+
class="k-message-status"
|
|
326
|
+
*ngIf="message.status"
|
|
327
|
+
>
|
|
328
|
+
{{ message.status }}
|
|
329
|
+
</span>
|
|
311
330
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
331
|
+
<ng-template #typing>
|
|
332
|
+
<div class="k-bubble">
|
|
333
|
+
<div class="k-typing-indicator">
|
|
334
|
+
<span></span>
|
|
335
|
+
<span></span>
|
|
336
|
+
<span></span>
|
|
337
|
+
</div>
|
|
318
338
|
</div>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
`, isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
339
|
+
</ng-template>
|
|
340
|
+
`, isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
322
341
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageComponent, decorators: [{
|
|
323
342
|
type: Component,
|
|
324
343
|
args: [{
|
|
@@ -328,44 +347,44 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
328
347
|
useExisting: forwardRef(() => MessageComponent)
|
|
329
348
|
}],
|
|
330
349
|
template: `
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
>
|
|
336
|
-
{{ formatTimeStamp(message.timestamp) }}
|
|
337
|
-
</time>
|
|
338
|
-
|
|
339
|
-
<ng-container *ngIf="!message.typing; else typing">
|
|
340
|
-
<div class="k-bubble" *ngIf="template">
|
|
341
|
-
<ng-container
|
|
342
|
-
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
350
|
+
<time
|
|
351
|
+
[attr.aria-hidden]="!selected"
|
|
352
|
+
class="k-message-time"
|
|
353
|
+
*ngIf="message.timestamp"
|
|
343
354
|
>
|
|
344
|
-
|
|
345
|
-
|
|
355
|
+
{{ formatTimeStamp(message.timestamp) }}
|
|
356
|
+
</time>
|
|
346
357
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
358
|
+
<ng-container *ngIf="!message.typing; else typing">
|
|
359
|
+
<div class="k-bubble" *ngIf="template">
|
|
360
|
+
<ng-container
|
|
361
|
+
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
362
|
+
>
|
|
363
|
+
</ng-container>
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
<div class="k-bubble" *ngIf="!template && message.text">
|
|
367
|
+
{{message.text}}
|
|
368
|
+
</div>
|
|
369
|
+
</ng-container>
|
|
351
370
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
371
|
+
<span
|
|
372
|
+
class="k-message-status"
|
|
373
|
+
*ngIf="message.status"
|
|
374
|
+
>
|
|
375
|
+
{{ message.status }}
|
|
376
|
+
</span>
|
|
358
377
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
378
|
+
<ng-template #typing>
|
|
379
|
+
<div class="k-bubble">
|
|
380
|
+
<div class="k-typing-indicator">
|
|
381
|
+
<span></span>
|
|
382
|
+
<span></span>
|
|
383
|
+
<span></span>
|
|
384
|
+
</div>
|
|
365
385
|
</div>
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
`
|
|
386
|
+
</ng-template>
|
|
387
|
+
`
|
|
369
388
|
}]
|
|
370
389
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }]; }, propDecorators: { message: [{
|
|
371
390
|
type: Input
|
|
@@ -412,51 +431,51 @@ class AttachmentComponent {
|
|
|
412
431
|
}
|
|
413
432
|
AttachmentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
414
433
|
AttachmentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AttachmentComponent, selector: "kendo-chat-attachment", inputs: { attachment: "attachment", template: "template" }, ngImport: i0, template: `
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
</ng-container>
|
|
419
|
-
|
|
420
|
-
<div *ngIf="!template" class="k-card">
|
|
421
|
-
<div class="k-card-body">
|
|
422
|
-
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
423
|
-
{{ attachment.title }}
|
|
424
|
-
</h5>
|
|
425
|
-
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
426
|
-
{{ attachment.subtitle }}
|
|
427
|
-
</h6>
|
|
428
|
-
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
429
|
-
<ng-container *ngIf="unknown">
|
|
430
|
-
{{ attachment.content }}
|
|
434
|
+
<ng-container *ngIf="template">
|
|
435
|
+
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
|
|
436
|
+
</ng-container>
|
|
431
437
|
</ng-container>
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
438
|
+
|
|
439
|
+
<div *ngIf="!template" class="k-card">
|
|
440
|
+
<div class="k-card-body">
|
|
441
|
+
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
442
|
+
{{ attachment.title }}
|
|
443
|
+
</h5>
|
|
444
|
+
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
445
|
+
{{ attachment.subtitle }}
|
|
446
|
+
</h6>
|
|
447
|
+
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
448
|
+
<ng-container *ngIf="unknown">
|
|
449
|
+
{{ attachment.content }}
|
|
450
|
+
</ng-container>
|
|
451
|
+
</div>
|
|
452
|
+
</div>
|
|
453
|
+
`, isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
435
454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AttachmentComponent, decorators: [{
|
|
436
455
|
type: Component,
|
|
437
456
|
args: [{
|
|
438
457
|
selector: 'kendo-chat-attachment',
|
|
439
458
|
template: `
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
</ng-container>
|
|
444
|
-
|
|
445
|
-
<div *ngIf="!template" class="k-card">
|
|
446
|
-
<div class="k-card-body">
|
|
447
|
-
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
448
|
-
{{ attachment.title }}
|
|
449
|
-
</h5>
|
|
450
|
-
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
451
|
-
{{ attachment.subtitle }}
|
|
452
|
-
</h6>
|
|
453
|
-
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
454
|
-
<ng-container *ngIf="unknown">
|
|
455
|
-
{{ attachment.content }}
|
|
459
|
+
<ng-container *ngIf="template">
|
|
460
|
+
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
|
|
461
|
+
</ng-container>
|
|
456
462
|
</ng-container>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
463
|
+
|
|
464
|
+
<div *ngIf="!template" class="k-card">
|
|
465
|
+
<div class="k-card-body">
|
|
466
|
+
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
467
|
+
{{ attachment.title }}
|
|
468
|
+
</h5>
|
|
469
|
+
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
470
|
+
{{ attachment.subtitle }}
|
|
471
|
+
</h6>
|
|
472
|
+
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
473
|
+
<ng-container *ngIf="unknown">
|
|
474
|
+
{{ attachment.content }}
|
|
475
|
+
</ng-container>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
`
|
|
460
479
|
}]
|
|
461
480
|
}], propDecorators: { attachment: [{
|
|
462
481
|
type: Input
|
|
@@ -554,37 +573,37 @@ MessageAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
554
573
|
provide: ChatItem,
|
|
555
574
|
useExisting: forwardRef(() => MessageAttachmentsComponent)
|
|
556
575
|
}], viewQueries: [{ propertyName: "deck", first: true, predicate: ["deck"], descendants: true, read: ElementRef, static: true }, { propertyName: "items", predicate: ["item"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: `
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
576
|
+
<button
|
|
577
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
578
|
+
(click)="scrollTo(-1)"
|
|
579
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
580
|
+
tabindex="-1">
|
|
581
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
582
|
+
</button>
|
|
583
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
584
|
+
<kendo-chat-attachment #item
|
|
585
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
586
|
+
[attachment]="att"
|
|
587
|
+
[template]="template"
|
|
588
|
+
[class.k-state-selected]="isSelected(index)"
|
|
589
|
+
[class.k-state-focused]="isSelected(index)"
|
|
590
|
+
[class.k-card-wrap]="true"
|
|
591
|
+
[class.k-first]="first"
|
|
592
|
+
[class.k-last]="last"
|
|
593
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
594
|
+
(click)="itemClick(index)"
|
|
595
|
+
(keydown)="itemKeydown($event, att)"
|
|
596
|
+
>
|
|
597
|
+
</kendo-chat-attachment>
|
|
598
|
+
</div>
|
|
599
|
+
<button
|
|
600
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
601
|
+
(click)="scrollTo(1)"
|
|
602
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
603
|
+
tabindex="-1">
|
|
604
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
605
|
+
</button>
|
|
606
|
+
`, isInline: true, components: [{ type: AttachmentComponent, selector: "kendo-chat-attachment", inputs: ["attachment", "template"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
588
607
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageAttachmentsComponent, decorators: [{
|
|
589
608
|
type: Component,
|
|
590
609
|
args: [{
|
|
@@ -594,37 +613,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
594
613
|
}],
|
|
595
614
|
selector: 'kendo-chat-message-attachments',
|
|
596
615
|
template: `
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
616
|
+
<button
|
|
617
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
618
|
+
(click)="scrollTo(-1)"
|
|
619
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
620
|
+
tabindex="-1">
|
|
621
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
622
|
+
</button>
|
|
623
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
624
|
+
<kendo-chat-attachment #item
|
|
625
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
626
|
+
[attachment]="att"
|
|
627
|
+
[template]="template"
|
|
628
|
+
[class.k-state-selected]="isSelected(index)"
|
|
629
|
+
[class.k-state-focused]="isSelected(index)"
|
|
630
|
+
[class.k-card-wrap]="true"
|
|
631
|
+
[class.k-first]="first"
|
|
632
|
+
[class.k-last]="last"
|
|
633
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
634
|
+
(click)="itemClick(index)"
|
|
635
|
+
(keydown)="itemKeydown($event, att)"
|
|
636
|
+
>
|
|
637
|
+
</kendo-chat-attachment>
|
|
638
|
+
</div>
|
|
639
|
+
<button
|
|
640
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
641
|
+
(click)="scrollTo(1)"
|
|
642
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
643
|
+
tabindex="-1">
|
|
644
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
645
|
+
</button>
|
|
646
|
+
`
|
|
628
647
|
}]
|
|
629
648
|
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { attachments: [{
|
|
630
649
|
type: Input
|
|
@@ -697,20 +716,21 @@ SuggestedActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.
|
|
|
697
716
|
provide: ChatItem,
|
|
698
717
|
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
699
718
|
}], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
719
|
+
<span
|
|
720
|
+
#item
|
|
721
|
+
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
722
|
+
class="k-quick-reply"
|
|
723
|
+
[class.k-state-selected]="isSelected(index)"
|
|
724
|
+
[class.k-state-focused]="isSelected(index)"
|
|
725
|
+
[class.k-first]="first"
|
|
726
|
+
[class.k-last]="last"
|
|
727
|
+
[attr.tabindex]="tabbable && selectedIndex === index ? '0' : '-1'"
|
|
728
|
+
(click)="actionClick(action)"
|
|
729
|
+
(keydown)="actionKeydown($event, action)"
|
|
730
|
+
>
|
|
731
|
+
{{ action.title || action.value }}
|
|
732
|
+
</span>
|
|
733
|
+
`, isInline: true, directives: [{ type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
714
734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SuggestedActionsComponent, decorators: [{
|
|
715
735
|
type: Component,
|
|
716
736
|
args: [{
|
|
@@ -720,20 +740,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
720
740
|
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
721
741
|
}],
|
|
722
742
|
template: `
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
743
|
+
<span
|
|
744
|
+
#item
|
|
745
|
+
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
746
|
+
class="k-quick-reply"
|
|
747
|
+
[class.k-state-selected]="isSelected(index)"
|
|
748
|
+
[class.k-state-focused]="isSelected(index)"
|
|
749
|
+
[class.k-first]="first"
|
|
750
|
+
[class.k-last]="last"
|
|
751
|
+
[attr.tabindex]="tabbable && selectedIndex === index ? '0' : '-1'"
|
|
752
|
+
(click)="actionClick(action)"
|
|
753
|
+
(keydown)="actionKeydown($event, action)"
|
|
754
|
+
>
|
|
755
|
+
{{ action.title || action.value }}
|
|
756
|
+
</span>
|
|
757
|
+
`
|
|
737
758
|
}]
|
|
738
759
|
}], propDecorators: { actions: [{
|
|
739
760
|
type: Input
|
|
@@ -838,151 +859,151 @@ class MessageListComponent {
|
|
|
838
859
|
}
|
|
839
860
|
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageListComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Component });
|
|
840
861
|
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: { messages: "messages", attachmentTemplate: "attachmentTemplate", messageTemplate: "messageTemplate", user: "user" }, outputs: { executeAction: "executeAction", navigate: "navigate", resize: "resize" }, host: { listeners: { "keydown": "onKeydown($event)", "focusout": "onBlur($event)" }, properties: { "class.k-message-list-content": "this.cssClass" } }, viewQueries: [{ propertyName: "items", predicate: ChatItem, descendants: true }], ngImport: i0, template: `
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
>
|
|
864
|
-
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
865
|
-
<kendo-chat-message #message
|
|
866
|
-
[message]="msg"
|
|
867
|
-
[tabbable]="lastGroup && lastMessage"
|
|
868
|
-
[template]="messageTemplate"
|
|
869
|
-
(click)="select(message)"
|
|
870
|
-
(focus)="select(message)"
|
|
871
|
-
[class.k-only]="group.messages.length === 1"
|
|
872
|
-
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
873
|
-
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
862
|
+
<ng-container *ngFor="let group of view; last as lastGroup; trackBy: trackGroup">
|
|
863
|
+
<ng-container [ngSwitch]="group.type">
|
|
864
|
+
<div
|
|
865
|
+
*ngSwitchCase="'date-marker'"
|
|
866
|
+
class="k-timestamp"
|
|
867
|
+
>
|
|
868
|
+
{{ formatTimeStamp(group.timestamp) }}
|
|
869
|
+
</div>
|
|
870
|
+
<div
|
|
871
|
+
*ngSwitchCase="'message-group'"
|
|
872
|
+
class="k-message-group"
|
|
873
|
+
[class.k-alt]="isOwnMessage(group.messages[0])"
|
|
874
|
+
[class.k-no-avatar]="!group.author.avatarUrl"
|
|
875
|
+
>
|
|
876
|
+
<img
|
|
877
|
+
*ngIf="group.author.avatarUrl"
|
|
878
|
+
[attr.src]="group.author.avatarUrl"
|
|
879
|
+
class="k-avatar"
|
|
880
|
+
/>
|
|
881
|
+
<p *ngIf="group.author.name" class="k-author">{{ group.author.name }}</p>
|
|
882
|
+
<ng-container
|
|
883
|
+
*ngFor="let msg of group.messages; first as firstMessage; last as lastMessage"
|
|
874
884
|
>
|
|
875
|
-
|
|
885
|
+
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
886
|
+
<kendo-chat-message #message
|
|
887
|
+
[message]="msg"
|
|
888
|
+
[tabbable]="lastGroup && lastMessage"
|
|
889
|
+
[template]="messageTemplate"
|
|
890
|
+
(click)="select(message)"
|
|
891
|
+
(focus)="select(message)"
|
|
892
|
+
[class.k-only]="group.messages.length === 1"
|
|
893
|
+
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
894
|
+
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
895
|
+
>
|
|
896
|
+
</kendo-chat-message>
|
|
876
897
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
898
|
+
<kendo-chat-attachment
|
|
899
|
+
*ngIf="msg.attachments && msg.attachments.length === 1"
|
|
900
|
+
[attachment]="msg.attachments[0]"
|
|
901
|
+
[template]="attachmentTemplate"
|
|
902
|
+
>
|
|
903
|
+
</kendo-chat-attachment>
|
|
904
|
+
</ng-container>
|
|
905
|
+
</div>
|
|
885
906
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
907
|
+
<kendo-chat-message-attachments #attachments
|
|
908
|
+
*ngSwitchCase="'attachment-group'"
|
|
909
|
+
[attachments]="group.attachments"
|
|
910
|
+
[layout]="group.attachmentLayout"
|
|
911
|
+
[tabbable]="lastGroup"
|
|
912
|
+
[template]="attachmentTemplate"
|
|
913
|
+
(click)="select(attachments)"
|
|
914
|
+
(focus)="select(attachments)"
|
|
915
|
+
>
|
|
916
|
+
</kendo-chat-message-attachments>
|
|
896
917
|
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
918
|
+
<kendo-chat-suggested-actions #actions
|
|
919
|
+
*ngSwitchCase="'action-group'"
|
|
920
|
+
[actions]="group.actions"
|
|
921
|
+
[tabbable]="lastGroup"
|
|
922
|
+
(dispatch)="dispatchAction($event, last(group.messages))"
|
|
923
|
+
(click)="select(actions)"
|
|
924
|
+
(focus)="select(actions)"
|
|
925
|
+
>
|
|
926
|
+
</kendo-chat-suggested-actions>
|
|
927
|
+
</ng-container>
|
|
928
|
+
</ng-container>
|
|
929
|
+
<kendo-resize-sensor (resize)="onResize()">
|
|
930
|
+
</kendo-resize-sensor>
|
|
931
|
+
`, isInline: true, components: [{ type: MessageComponent, selector: "kendo-chat-message", inputs: ["message", "tabbable", "template"] }, { type: AttachmentComponent, selector: "kendo-chat-attachment", inputs: ["attachment", "template"] }, { type: MessageAttachmentsComponent, selector: "kendo-chat-message-attachments", inputs: ["attachments", "layout", "tabbable", "template"] }, { type: SuggestedActionsComponent, selector: "kendo-chat-suggested-actions", inputs: ["actions", "tabbable"], outputs: ["dispatch"] }, { type: i6.ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }], directives: [{ type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
911
932
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageListComponent, decorators: [{
|
|
912
933
|
type: Component,
|
|
913
934
|
args: [{
|
|
914
935
|
selector: 'kendo-chat-message-list',
|
|
915
936
|
template: `
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
>
|
|
939
|
-
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
940
|
-
<kendo-chat-message #message
|
|
941
|
-
[message]="msg"
|
|
942
|
-
[tabbable]="lastGroup && lastMessage"
|
|
943
|
-
[template]="messageTemplate"
|
|
944
|
-
(click)="select(message)"
|
|
945
|
-
(focus)="select(message)"
|
|
946
|
-
[class.k-only]="group.messages.length === 1"
|
|
947
|
-
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
948
|
-
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
937
|
+
<ng-container *ngFor="let group of view; last as lastGroup; trackBy: trackGroup">
|
|
938
|
+
<ng-container [ngSwitch]="group.type">
|
|
939
|
+
<div
|
|
940
|
+
*ngSwitchCase="'date-marker'"
|
|
941
|
+
class="k-timestamp"
|
|
942
|
+
>
|
|
943
|
+
{{ formatTimeStamp(group.timestamp) }}
|
|
944
|
+
</div>
|
|
945
|
+
<div
|
|
946
|
+
*ngSwitchCase="'message-group'"
|
|
947
|
+
class="k-message-group"
|
|
948
|
+
[class.k-alt]="isOwnMessage(group.messages[0])"
|
|
949
|
+
[class.k-no-avatar]="!group.author.avatarUrl"
|
|
950
|
+
>
|
|
951
|
+
<img
|
|
952
|
+
*ngIf="group.author.avatarUrl"
|
|
953
|
+
[attr.src]="group.author.avatarUrl"
|
|
954
|
+
class="k-avatar"
|
|
955
|
+
/>
|
|
956
|
+
<p *ngIf="group.author.name" class="k-author">{{ group.author.name }}</p>
|
|
957
|
+
<ng-container
|
|
958
|
+
*ngFor="let msg of group.messages; first as firstMessage; last as lastMessage"
|
|
949
959
|
>
|
|
950
|
-
|
|
960
|
+
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
961
|
+
<kendo-chat-message #message
|
|
962
|
+
[message]="msg"
|
|
963
|
+
[tabbable]="lastGroup && lastMessage"
|
|
964
|
+
[template]="messageTemplate"
|
|
965
|
+
(click)="select(message)"
|
|
966
|
+
(focus)="select(message)"
|
|
967
|
+
[class.k-only]="group.messages.length === 1"
|
|
968
|
+
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
969
|
+
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
970
|
+
>
|
|
971
|
+
</kendo-chat-message>
|
|
951
972
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
973
|
+
<kendo-chat-attachment
|
|
974
|
+
*ngIf="msg.attachments && msg.attachments.length === 1"
|
|
975
|
+
[attachment]="msg.attachments[0]"
|
|
976
|
+
[template]="attachmentTemplate"
|
|
977
|
+
>
|
|
978
|
+
</kendo-chat-attachment>
|
|
979
|
+
</ng-container>
|
|
980
|
+
</div>
|
|
960
981
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
982
|
+
<kendo-chat-message-attachments #attachments
|
|
983
|
+
*ngSwitchCase="'attachment-group'"
|
|
984
|
+
[attachments]="group.attachments"
|
|
985
|
+
[layout]="group.attachmentLayout"
|
|
986
|
+
[tabbable]="lastGroup"
|
|
987
|
+
[template]="attachmentTemplate"
|
|
988
|
+
(click)="select(attachments)"
|
|
989
|
+
(focus)="select(attachments)"
|
|
990
|
+
>
|
|
991
|
+
</kendo-chat-message-attachments>
|
|
971
992
|
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
993
|
+
<kendo-chat-suggested-actions #actions
|
|
994
|
+
*ngSwitchCase="'action-group'"
|
|
995
|
+
[actions]="group.actions"
|
|
996
|
+
[tabbable]="lastGroup"
|
|
997
|
+
(dispatch)="dispatchAction($event, last(group.messages))"
|
|
998
|
+
(click)="select(actions)"
|
|
999
|
+
(focus)="select(actions)"
|
|
1000
|
+
>
|
|
1001
|
+
</kendo-chat-suggested-actions>
|
|
1002
|
+
</ng-container>
|
|
1003
|
+
</ng-container>
|
|
1004
|
+
<kendo-resize-sensor (resize)="onResize()">
|
|
1005
|
+
</kendo-resize-sensor>
|
|
1006
|
+
`
|
|
986
1007
|
}]
|
|
987
1008
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }]; }, propDecorators: { messages: [{
|
|
988
1009
|
type: Input
|
|
@@ -1012,6 +1033,169 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1012
1033
|
args: ['focusout', ['$event']]
|
|
1013
1034
|
}] } });
|
|
1014
1035
|
|
|
1036
|
+
/**
|
|
1037
|
+
* @hidden
|
|
1038
|
+
*/
|
|
1039
|
+
class FocusedStateDirective {
|
|
1040
|
+
constructor() {
|
|
1041
|
+
this.focused = false;
|
|
1042
|
+
}
|
|
1043
|
+
onFocus() {
|
|
1044
|
+
this.focused = true;
|
|
1045
|
+
}
|
|
1046
|
+
onBlur() {
|
|
1047
|
+
this.focused = false;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
FocusedStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusedStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1051
|
+
FocusedStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FocusedStateDirective, selector: "[kendoChatFocusedState]", host: { listeners: { "focusin": "onFocus()", "focusout": "onBlur()" }, properties: { "class.k-focus": "this.focused" } }, ngImport: i0 });
|
|
1052
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusedStateDirective, decorators: [{
|
|
1053
|
+
type: Directive,
|
|
1054
|
+
args: [{
|
|
1055
|
+
selector: '[kendoChatFocusedState]'
|
|
1056
|
+
}]
|
|
1057
|
+
}], propDecorators: { focused: [{
|
|
1058
|
+
type: HostBinding,
|
|
1059
|
+
args: ['class.k-focus']
|
|
1060
|
+
}], onFocus: [{
|
|
1061
|
+
type: HostListener,
|
|
1062
|
+
args: ['focusin']
|
|
1063
|
+
}], onBlur: [{
|
|
1064
|
+
type: HostListener,
|
|
1065
|
+
args: ['focusout']
|
|
1066
|
+
}] } });
|
|
1067
|
+
|
|
1068
|
+
// tslint:disable-next-line:max-line-length
|
|
1069
|
+
const sendIcon = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path d="M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z"/></svg>';
|
|
1070
|
+
/**
|
|
1071
|
+
* @hidden
|
|
1072
|
+
*/
|
|
1073
|
+
class MessageBoxComponent {
|
|
1074
|
+
constructor() {
|
|
1075
|
+
this.hostClasses = 'k-message-box k-input k-input-md k-rounded-md k-input-solid';
|
|
1076
|
+
this.sendMessage = new EventEmitter();
|
|
1077
|
+
}
|
|
1078
|
+
get messageBoxValue() {
|
|
1079
|
+
return this.type === 'textarea';
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* @hidden
|
|
1083
|
+
*/
|
|
1084
|
+
sendClick() {
|
|
1085
|
+
const input = this.messageBoxInput.nativeElement;
|
|
1086
|
+
const value = input.value;
|
|
1087
|
+
if (!value) {
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
const message = {
|
|
1091
|
+
author: this.user,
|
|
1092
|
+
text: value,
|
|
1093
|
+
timestamp: new Date()
|
|
1094
|
+
};
|
|
1095
|
+
this.sendMessage.emit(new SendMessageEvent(message));
|
|
1096
|
+
input.value = null;
|
|
1097
|
+
input.focus();
|
|
1098
|
+
this.autoScroll = true;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* @hidden
|
|
1102
|
+
*/
|
|
1103
|
+
inputKeydown(e) {
|
|
1104
|
+
if (e.keyCode === Keys.Enter) {
|
|
1105
|
+
this.sendClick();
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* @hidden
|
|
1110
|
+
*/
|
|
1111
|
+
textAreaKeydown(e) {
|
|
1112
|
+
const isEnter = e.keyCode === Keys.Enter;
|
|
1113
|
+
if (!isEnter) {
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const newLine = (e.metaKey || e.ctrlKey);
|
|
1117
|
+
const enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
|
|
1118
|
+
if (enterOnly) {
|
|
1119
|
+
e.preventDefault();
|
|
1120
|
+
this.sendClick();
|
|
1121
|
+
}
|
|
1122
|
+
if (newLine) {
|
|
1123
|
+
this.messageBoxInput.nativeElement.value += `\r\n`;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* @hidden
|
|
1128
|
+
*/
|
|
1129
|
+
textFor(key) {
|
|
1130
|
+
return this.localization.get(key);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1134
|
+
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: MessageBoxComponent, selector: "kendo-message-box", inputs: { user: "user", autoScroll: "autoScroll", type: "type", localization: "localization", messageBoxTemplate: "messageBoxTemplate" }, outputs: { sendMessage: "sendMessage" }, host: { properties: { "class": "this.hostClasses", "class.!k-align-items-end": "this.messageBoxValue" } }, viewQueries: [{ propertyName: "messageBoxInput", first: true, predicate: ["messageBoxInput"], descendants: true }], ngImport: i0, template: "\n <ng-container *ngIf=\"!messageBoxTemplate\">\n <input\n *ngIf=\"type === 'textbox'\"\n #messageBoxInput\n kendoChatFocusedState\n type=\"text\"\n class=\"k-textbox k-input k-input-md k-input-solid\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"inputKeydown($event)\"\n />\n\n <textarea\n *ngIf=\"type === 'textarea'\"\n #messageBoxInput\n kendoChatFocusedState\n [rows]=\"3\"\n class=\"k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"textAreaKeydown($event)\"\n ></textarea>\n\n <button\n kendoButton\n fillMode=\"flat\"\n class=\"k-button-send\"\n [tabindex]=\"0\"\n [attr.title]=\"textFor('send')\"\n (click)=\"sendClick()\"\n >\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" viewBox=\"0 0 16 16\"><path d=\"M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z\"/></svg>\n </button>\n </ng-container>\n\n <ng-template *ngIf=\"messageBoxTemplate\" [ngTemplateOutlet]=\"messageBoxTemplate?.templateRef\"></ng-template>\n", isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FocusedStateDirective, selector: "[kendoChatFocusedState]" }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
1135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
1136
|
+
type: Component,
|
|
1137
|
+
args: [{
|
|
1138
|
+
selector: 'kendo-message-box',
|
|
1139
|
+
template: `
|
|
1140
|
+
<ng-container *ngIf="!messageBoxTemplate">
|
|
1141
|
+
<input
|
|
1142
|
+
*ngIf="type === 'textbox'"
|
|
1143
|
+
#messageBoxInput
|
|
1144
|
+
kendoChatFocusedState
|
|
1145
|
+
type="text"
|
|
1146
|
+
class="k-textbox k-input k-input-md k-input-solid"
|
|
1147
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
1148
|
+
(keydown)="inputKeydown($event)"
|
|
1149
|
+
/>
|
|
1150
|
+
|
|
1151
|
+
<textarea
|
|
1152
|
+
*ngIf="type === 'textarea'"
|
|
1153
|
+
#messageBoxInput
|
|
1154
|
+
kendoChatFocusedState
|
|
1155
|
+
[rows]="3"
|
|
1156
|
+
class="k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none"
|
|
1157
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
1158
|
+
(keydown)="textAreaKeydown($event)"
|
|
1159
|
+
></textarea>
|
|
1160
|
+
|
|
1161
|
+
<button
|
|
1162
|
+
kendoButton
|
|
1163
|
+
fillMode="flat"
|
|
1164
|
+
class="k-button-send"
|
|
1165
|
+
[tabindex]="0"
|
|
1166
|
+
[attr.title]="textFor('send')"
|
|
1167
|
+
(click)="sendClick()"
|
|
1168
|
+
>
|
|
1169
|
+
${sendIcon}
|
|
1170
|
+
</button>
|
|
1171
|
+
</ng-container>
|
|
1172
|
+
|
|
1173
|
+
<ng-template *ngIf="messageBoxTemplate" [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
|
1174
|
+
`
|
|
1175
|
+
}]
|
|
1176
|
+
}], propDecorators: { hostClasses: [{
|
|
1177
|
+
type: HostBinding,
|
|
1178
|
+
args: ['class']
|
|
1179
|
+
}], messageBoxValue: [{
|
|
1180
|
+
type: HostBinding,
|
|
1181
|
+
args: ['class.\!k-align-items-end']
|
|
1182
|
+
}], messageBoxInput: [{
|
|
1183
|
+
type: ViewChild,
|
|
1184
|
+
args: ['messageBoxInput', { static: false }]
|
|
1185
|
+
}], user: [{
|
|
1186
|
+
type: Input
|
|
1187
|
+
}], autoScroll: [{
|
|
1188
|
+
type: Input
|
|
1189
|
+
}], type: [{
|
|
1190
|
+
type: Input
|
|
1191
|
+
}], localization: [{
|
|
1192
|
+
type: Input
|
|
1193
|
+
}], messageBoxTemplate: [{
|
|
1194
|
+
type: Input
|
|
1195
|
+
}], sendMessage: [{
|
|
1196
|
+
type: Output
|
|
1197
|
+
}] } });
|
|
1198
|
+
|
|
1015
1199
|
/**
|
|
1016
1200
|
* @hidden
|
|
1017
1201
|
*/
|
|
@@ -1022,6 +1206,7 @@ Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.
|
|
|
1022
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
|
|
1023
1207
|
type: Directive,
|
|
1024
1208
|
args: [{
|
|
1209
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
1025
1210
|
selector: 'kendoConversationalUIMessages'
|
|
1026
1211
|
}]
|
|
1027
1212
|
}], propDecorators: { messagePlaceholder: [{
|
|
@@ -1130,40 +1315,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1130
1315
|
args: ['style.overflow-anchor']
|
|
1131
1316
|
}] } });
|
|
1132
1317
|
|
|
1133
|
-
/**
|
|
1134
|
-
* @hidden
|
|
1135
|
-
*/
|
|
1136
|
-
class FocusedStateDirective {
|
|
1137
|
-
constructor() {
|
|
1138
|
-
this.focused = false;
|
|
1139
|
-
}
|
|
1140
|
-
onFocus() {
|
|
1141
|
-
this.focused = true;
|
|
1142
|
-
}
|
|
1143
|
-
onBlur() {
|
|
1144
|
-
this.focused = false;
|
|
1145
|
-
}
|
|
1146
|
-
}
|
|
1147
|
-
FocusedStateDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusedStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1148
|
-
FocusedStateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: FocusedStateDirective, selector: "[kendoChatFocusedState]", host: { listeners: { "focusin": "onFocus()", "focusout": "onBlur()" }, properties: { "class.k-state-focused": "this.focused" } }, ngImport: i0 });
|
|
1149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FocusedStateDirective, decorators: [{
|
|
1150
|
-
type: Directive,
|
|
1151
|
-
args: [{
|
|
1152
|
-
selector: '[kendoChatFocusedState]'
|
|
1153
|
-
}]
|
|
1154
|
-
}], propDecorators: { focused: [{
|
|
1155
|
-
type: HostBinding,
|
|
1156
|
-
args: ['class.k-state-focused']
|
|
1157
|
-
}], onFocus: [{
|
|
1158
|
-
type: HostListener,
|
|
1159
|
-
args: ['focusin']
|
|
1160
|
-
}], onBlur: [{
|
|
1161
|
-
type: HostListener,
|
|
1162
|
-
args: ['focusout']
|
|
1163
|
-
}] } });
|
|
1164
|
-
|
|
1165
|
-
// eslint-disable-next-line max-len
|
|
1166
|
-
const sendIcon = '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path d="M0,14.3c-0.1,0.6,0.3,0.8,0.8,0.6l14.8-6.5c0.5-0.2,0.5-0.6,0-0.8L0.8,1.1C0.3,0.9-0.1,1.1,0,1.7l0.7,4.2C0.8,6.5,1.4,7,1.9,7.1l8.8,0.8c0.6,0.1,0.6,0.1,0,0.2L1.9,8.9C1.4,9,0.8,9.5,0.7,10.1L0,14.3z"/></svg>';
|
|
1167
1318
|
/**
|
|
1168
1319
|
* Represents the Kendo UI Chat component for Angular.
|
|
1169
1320
|
*
|
|
@@ -1178,6 +1329,12 @@ class ChatComponent {
|
|
|
1178
1329
|
constructor(localization, zone) {
|
|
1179
1330
|
this.localization = localization;
|
|
1180
1331
|
this.zone = zone;
|
|
1332
|
+
/**
|
|
1333
|
+
* Used to switch between a one-liner input or a textarea.
|
|
1334
|
+
* ([see example]({% slug message_box %})#toc-message-box-types).
|
|
1335
|
+
* @default input
|
|
1336
|
+
*/
|
|
1337
|
+
this.messageBoxType = 'textbox';
|
|
1181
1338
|
/**
|
|
1182
1339
|
* Fires when the user types a message and clicks the **Send** button or presses **Enter**.
|
|
1183
1340
|
* Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
|
|
@@ -1204,11 +1361,17 @@ class ChatComponent {
|
|
|
1204
1361
|
});
|
|
1205
1362
|
}
|
|
1206
1363
|
get className() {
|
|
1207
|
-
return 'k-
|
|
1364
|
+
return 'k-chat';
|
|
1208
1365
|
}
|
|
1209
1366
|
get dirAttr() {
|
|
1210
1367
|
return this.direction;
|
|
1211
1368
|
}
|
|
1369
|
+
/**
|
|
1370
|
+
* @hidden
|
|
1371
|
+
*/
|
|
1372
|
+
get localizationText() {
|
|
1373
|
+
return this.localization;
|
|
1374
|
+
}
|
|
1212
1375
|
ngOnChanges() {
|
|
1213
1376
|
this.zone.runOutsideAngular(() => setTimeout(() => {
|
|
1214
1377
|
this.messageList.nativeElement.style.flex = '1 1 auto';
|
|
@@ -1227,33 +1390,6 @@ class ChatComponent {
|
|
|
1227
1390
|
this.localizationChangeSubscription.unsubscribe();
|
|
1228
1391
|
}
|
|
1229
1392
|
}
|
|
1230
|
-
/**
|
|
1231
|
-
* @hidden
|
|
1232
|
-
*/
|
|
1233
|
-
sendClick() {
|
|
1234
|
-
const input = this.messageInput.nativeElement;
|
|
1235
|
-
const value = input.value;
|
|
1236
|
-
if (!value) {
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
const message = {
|
|
1240
|
-
author: this.user,
|
|
1241
|
-
text: value,
|
|
1242
|
-
timestamp: new Date()
|
|
1243
|
-
};
|
|
1244
|
-
this.sendMessage.emit(new SendMessageEvent(message));
|
|
1245
|
-
input.value = null;
|
|
1246
|
-
input.focus();
|
|
1247
|
-
this.autoScroll = true;
|
|
1248
|
-
}
|
|
1249
|
-
/**
|
|
1250
|
-
* @hidden
|
|
1251
|
-
*/
|
|
1252
|
-
inputKeydown(e) {
|
|
1253
|
-
if (e.keyCode === 13 /* enter */) {
|
|
1254
|
-
this.sendClick();
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
1393
|
/**
|
|
1258
1394
|
* @hidden
|
|
1259
1395
|
*/
|
|
@@ -1262,7 +1398,9 @@ class ChatComponent {
|
|
|
1262
1398
|
if (!e.isDefaultPrevented()) {
|
|
1263
1399
|
const handler = makeHandler(e.action);
|
|
1264
1400
|
handler(e.action, this);
|
|
1265
|
-
this.
|
|
1401
|
+
if (!this.messageBoxTemplate) {
|
|
1402
|
+
this.messageBox.messageBoxInput.nativeElement.focus();
|
|
1403
|
+
}
|
|
1266
1404
|
}
|
|
1267
1405
|
}
|
|
1268
1406
|
/**
|
|
@@ -1273,13 +1411,53 @@ class ChatComponent {
|
|
|
1273
1411
|
}
|
|
1274
1412
|
}
|
|
1275
1413
|
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatComponent, deps: [{ token: i1$2.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
1276
|
-
ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChatComponent, selector: "kendo-chat", inputs: { messages: "messages", user: "user" }, outputs: { sendMessage: "sendMessage", executeAction: "executeAction" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
|
|
1414
|
+
ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ChatComponent, selector: "kendo-chat", inputs: { messages: "messages", user: "user", messageBoxType: "messageBoxType" }, outputs: { sendMessage: "sendMessage", executeAction: "executeAction" }, host: { properties: { "class": "this.className", "attr.dir": "this.dirAttr" } }, providers: [
|
|
1277
1415
|
LocalizationService,
|
|
1278
1416
|
{
|
|
1279
1417
|
provide: L10N_PREFIX,
|
|
1280
1418
|
useValue: 'kendo.chat'
|
|
1281
1419
|
}
|
|
1282
|
-
], queries: [{ propertyName: "attachmentTemplate", first: true, predicate: AttachmentTemplateDirective, descendants: true }, { propertyName: "messageTemplate", first: true, predicate: MessageTemplateDirective, descendants: true }
|
|
1420
|
+
], queries: [{ propertyName: "attachmentTemplate", first: true, predicate: AttachmentTemplateDirective, descendants: true }, { propertyName: "messageTemplate", first: true, predicate: MessageTemplateDirective, descendants: true }, { propertyName: "messageBoxTemplate", first: true, predicate: ChatMessageBoxTemplateDirective, descendants: true }], viewQueries: [{ propertyName: "messageBox", first: true, predicate: ["messageBox"], descendants: true }, { propertyName: "messageList", first: true, predicate: ["messageList"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
1421
|
+
<ng-container
|
|
1422
|
+
kendoChatLocalizedMessages
|
|
1423
|
+
i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
|
|
1424
|
+
messagePlaceholder="Type a message..."
|
|
1425
|
+
|
|
1426
|
+
i18n-send="kendo.chat.send|The text for the Send button"
|
|
1427
|
+
send="Send..."
|
|
1428
|
+
>
|
|
1429
|
+
</ng-container>
|
|
1430
|
+
|
|
1431
|
+
<div
|
|
1432
|
+
#messageList
|
|
1433
|
+
class="k-message-list k-avatars"
|
|
1434
|
+
aria-live="polite" role="log"
|
|
1435
|
+
kendoChatScrollAnchor
|
|
1436
|
+
#anchor="scrollAnchor"
|
|
1437
|
+
[(autoScroll)]="autoScroll"
|
|
1438
|
+
>
|
|
1439
|
+
<kendo-chat-message-list
|
|
1440
|
+
[messages]="messages"
|
|
1441
|
+
[messageTemplate]="messageTemplate"
|
|
1442
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
1443
|
+
[user]="user"
|
|
1444
|
+
(executeAction)="dispatchAction($event)"
|
|
1445
|
+
(resize)="anchor.scrollToBottom()"
|
|
1446
|
+
(navigate)="this.autoScroll = false"
|
|
1447
|
+
>
|
|
1448
|
+
</kendo-chat-message-list>
|
|
1449
|
+
</div>
|
|
1450
|
+
<kendo-message-box
|
|
1451
|
+
#messageBox
|
|
1452
|
+
[messageBoxTemplate]="messageBoxTemplate"
|
|
1453
|
+
[type]="messageBoxType"
|
|
1454
|
+
[user]="user"
|
|
1455
|
+
[autoScroll]="autoScroll"
|
|
1456
|
+
[localization]="localizationText"
|
|
1457
|
+
(sendMessage)="sendMessage.emit($event)"
|
|
1458
|
+
>
|
|
1459
|
+
</kendo-message-box>
|
|
1460
|
+
`, isInline: true, components: [{ type: MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "messageTemplate", "user"], outputs: ["executeAction", "navigate", "resize"] }, { type: MessageBoxComponent, selector: "kendo-message-box", inputs: ["user", "autoScroll", "type", "localization", "messageBoxTemplate"], outputs: ["sendMessage"] }], directives: [{ type: LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { type: ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }] });
|
|
1283
1461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatComponent, decorators: [{
|
|
1284
1462
|
type: Component,
|
|
1285
1463
|
args: [{
|
|
@@ -1292,60 +1470,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1292
1470
|
],
|
|
1293
1471
|
selector: 'kendo-chat',
|
|
1294
1472
|
template: `
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1473
|
+
<ng-container
|
|
1474
|
+
kendoChatLocalizedMessages
|
|
1475
|
+
i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
|
|
1476
|
+
messagePlaceholder="Type a message..."
|
|
1299
1477
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1478
|
+
i18n-send="kendo.chat.send|The text for the Send button"
|
|
1479
|
+
send="Send..."
|
|
1480
|
+
>
|
|
1481
|
+
</ng-container>
|
|
1304
1482
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1483
|
+
<div
|
|
1484
|
+
#messageList
|
|
1485
|
+
class="k-message-list k-avatars"
|
|
1486
|
+
aria-live="polite" role="log"
|
|
1487
|
+
kendoChatScrollAnchor
|
|
1488
|
+
#anchor="scrollAnchor"
|
|
1489
|
+
[(autoScroll)]="autoScroll"
|
|
1490
|
+
>
|
|
1491
|
+
<kendo-chat-message-list
|
|
1492
|
+
[messages]="messages"
|
|
1493
|
+
[messageTemplate]="messageTemplate"
|
|
1494
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
1495
|
+
[user]="user"
|
|
1496
|
+
(executeAction)="dispatchAction($event)"
|
|
1497
|
+
(resize)="anchor.scrollToBottom()"
|
|
1498
|
+
(navigate)="this.autoScroll = false"
|
|
1499
|
+
>
|
|
1500
|
+
</kendo-chat-message-list>
|
|
1501
|
+
</div>
|
|
1502
|
+
<kendo-message-box
|
|
1503
|
+
#messageBox
|
|
1504
|
+
[messageBoxTemplate]="messageBoxTemplate"
|
|
1505
|
+
[type]="messageBoxType"
|
|
1317
1506
|
[user]="user"
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
(
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
<div class="k-message-box">
|
|
1326
|
-
<input
|
|
1327
|
-
#messageInput
|
|
1328
|
-
kendoChatFocusedState
|
|
1329
|
-
type="text"
|
|
1330
|
-
class="k-input"
|
|
1331
|
-
[placeholder]="textFor('messagePlaceholder')"
|
|
1332
|
-
(keydown)="inputKeydown($event)"
|
|
1333
|
-
>
|
|
1334
|
-
<button
|
|
1335
|
-
kendoButton
|
|
1336
|
-
fillMode="flat"
|
|
1337
|
-
class="k-button-send"
|
|
1338
|
-
tabindex="-1"
|
|
1339
|
-
[attr.title]="textFor('send')"
|
|
1340
|
-
(click)="sendClick()"
|
|
1341
|
-
>${sendIcon}</button>
|
|
1342
|
-
</div>
|
|
1343
|
-
`
|
|
1507
|
+
[autoScroll]="autoScroll"
|
|
1508
|
+
[localization]="localizationText"
|
|
1509
|
+
(sendMessage)="sendMessage.emit($event)"
|
|
1510
|
+
>
|
|
1511
|
+
</kendo-message-box>
|
|
1512
|
+
`
|
|
1344
1513
|
}]
|
|
1345
1514
|
}], ctorParameters: function () { return [{ type: i1$2.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { messages: [{
|
|
1346
1515
|
type: Input
|
|
1347
1516
|
}], user: [{
|
|
1348
1517
|
type: Input
|
|
1518
|
+
}], messageBoxType: [{
|
|
1519
|
+
type: Input
|
|
1349
1520
|
}], sendMessage: [{
|
|
1350
1521
|
type: Output
|
|
1351
1522
|
}], executeAction: [{
|
|
@@ -1362,9 +1533,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1362
1533
|
}], messageTemplate: [{
|
|
1363
1534
|
type: ContentChild,
|
|
1364
1535
|
args: [MessageTemplateDirective, { static: false }]
|
|
1365
|
-
}],
|
|
1536
|
+
}], messageBoxTemplate: [{
|
|
1537
|
+
type: ContentChild,
|
|
1538
|
+
args: [ChatMessageBoxTemplateDirective, { static: false }]
|
|
1539
|
+
}], messageBox: [{
|
|
1366
1540
|
type: ViewChild,
|
|
1367
|
-
args: ['
|
|
1541
|
+
args: ['messageBox', { static: false }]
|
|
1368
1542
|
}], messageList: [{
|
|
1369
1543
|
type: ViewChild,
|
|
1370
1544
|
args: ['messageList', { static: true }]
|
|
@@ -1423,53 +1597,55 @@ class HeroCardComponent {
|
|
|
1423
1597
|
}
|
|
1424
1598
|
HeroCardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeroCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1425
1599
|
HeroCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: HeroCardComponent, selector: "kendo-chat-hero-card", inputs: { imageUrl: "imageUrl", title: "title", subtitle: "subtitle", actions: "actions" }, outputs: { executeAction: "executeAction" }, host: { properties: { "class.k-card": "this.cssClass" } }, ngImport: i0, template: `
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1600
|
+
<img class="k-card-image" [src]="imageUrl" *ngIf="imageUrl" />
|
|
1601
|
+
<div class="k-card-body">
|
|
1602
|
+
<h5 class="k-card-title" *ngIf="title">
|
|
1603
|
+
{{ title }}
|
|
1604
|
+
</h5>
|
|
1605
|
+
<h6 class="k-card-subtitle" *ngIf="subtitle">
|
|
1606
|
+
{{ subtitle }}
|
|
1607
|
+
</h6>
|
|
1608
|
+
</div>
|
|
1609
|
+
<div class="k-card-actions k-card-actions-vertical">
|
|
1610
|
+
<span class="k-card-action"
|
|
1611
|
+
*ngFor="let act of actions"
|
|
1612
|
+
>
|
|
1613
|
+
<button
|
|
1614
|
+
kendoButton fillMode="flat"
|
|
1615
|
+
(click)="onClick(act)"
|
|
1616
|
+
>
|
|
1617
|
+
{{ act.title }}
|
|
1618
|
+
</button>
|
|
1619
|
+
</span>
|
|
1620
|
+
</div>
|
|
1621
|
+
`, isInline: true, directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.ButtonDirective, selector: "button[kendoButton], span[kendoButton]", inputs: ["toggleable", "togglable", "selected", "tabIndex", "icon", "iconClass", "imageUrl", "disabled", "size", "rounded", "fillMode", "themeColor", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
1447
1622
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: HeroCardComponent, decorators: [{
|
|
1448
1623
|
type: Component,
|
|
1449
1624
|
args: [{
|
|
1450
1625
|
selector: 'kendo-chat-hero-card',
|
|
1451
1626
|
template: `
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1627
|
+
<img class="k-card-image" [src]="imageUrl" *ngIf="imageUrl" />
|
|
1628
|
+
<div class="k-card-body">
|
|
1629
|
+
<h5 class="k-card-title" *ngIf="title">
|
|
1630
|
+
{{ title }}
|
|
1631
|
+
</h5>
|
|
1632
|
+
<h6 class="k-card-subtitle" *ngIf="subtitle">
|
|
1633
|
+
{{ subtitle }}
|
|
1634
|
+
</h6>
|
|
1635
|
+
</div>
|
|
1636
|
+
<div class="k-card-actions k-card-actions-vertical">
|
|
1637
|
+
<span class="k-card-action"
|
|
1638
|
+
*ngFor="let act of actions"
|
|
1639
|
+
>
|
|
1640
|
+
<button
|
|
1641
|
+
kendoButton fillMode="flat"
|
|
1642
|
+
(click)="onClick(act)"
|
|
1643
|
+
>
|
|
1644
|
+
{{ act.title }}
|
|
1645
|
+
</button>
|
|
1646
|
+
</span>
|
|
1647
|
+
</div>
|
|
1648
|
+
`
|
|
1473
1649
|
}]
|
|
1474
1650
|
}], propDecorators: { imageUrl: [{
|
|
1475
1651
|
type: Input
|
|
@@ -1491,7 +1667,8 @@ const PUBLIC_DIRECTIVES = [
|
|
|
1491
1667
|
CustomMessagesComponent,
|
|
1492
1668
|
AttachmentTemplateDirective,
|
|
1493
1669
|
MessageTemplateDirective,
|
|
1494
|
-
HeroCardComponent
|
|
1670
|
+
HeroCardComponent,
|
|
1671
|
+
ChatMessageBoxTemplateDirective
|
|
1495
1672
|
];
|
|
1496
1673
|
const PRIVATE_DIRECTIVES = [
|
|
1497
1674
|
AttachmentComponent,
|
|
@@ -1502,7 +1679,8 @@ const PRIVATE_DIRECTIVES = [
|
|
|
1502
1679
|
MessageListComponent,
|
|
1503
1680
|
MessageTemplateDirective,
|
|
1504
1681
|
ScrollAnchorDirective,
|
|
1505
|
-
SuggestedActionsComponent
|
|
1682
|
+
SuggestedActionsComponent,
|
|
1683
|
+
MessageBoxComponent
|
|
1506
1684
|
];
|
|
1507
1685
|
/**
|
|
1508
1686
|
* The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
|
|
@@ -1532,7 +1710,8 @@ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12
|
|
|
1532
1710
|
CustomMessagesComponent,
|
|
1533
1711
|
AttachmentTemplateDirective,
|
|
1534
1712
|
MessageTemplateDirective,
|
|
1535
|
-
HeroCardComponent,
|
|
1713
|
+
HeroCardComponent,
|
|
1714
|
+
ChatMessageBoxTemplateDirective, AttachmentComponent,
|
|
1536
1715
|
FocusedStateDirective,
|
|
1537
1716
|
LocalizedMessagesDirective,
|
|
1538
1717
|
MessageAttachmentsComponent,
|
|
@@ -1540,13 +1719,15 @@ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12
|
|
|
1540
1719
|
MessageListComponent,
|
|
1541
1720
|
MessageTemplateDirective,
|
|
1542
1721
|
ScrollAnchorDirective,
|
|
1543
|
-
SuggestedActionsComponent
|
|
1722
|
+
SuggestedActionsComponent,
|
|
1723
|
+
MessageBoxComponent], imports: [ButtonModule,
|
|
1544
1724
|
CommonModule,
|
|
1545
1725
|
ResizeSensorModule], exports: [ChatComponent,
|
|
1546
1726
|
CustomMessagesComponent,
|
|
1547
1727
|
AttachmentTemplateDirective,
|
|
1548
1728
|
MessageTemplateDirective,
|
|
1549
|
-
HeroCardComponent
|
|
1729
|
+
HeroCardComponent,
|
|
1730
|
+
ChatMessageBoxTemplateDirective] });
|
|
1550
1731
|
ChatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatModule, imports: [[
|
|
1551
1732
|
ButtonModule,
|
|
1552
1733
|
CommonModule,
|
|
@@ -1572,5 +1753,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
1572
1753
|
* Generated bundle index. Do not edit.
|
|
1573
1754
|
*/
|
|
1574
1755
|
|
|
1575
|
-
export { AttachmentTemplateDirective, ChatComponent, ChatModule, CustomMessagesComponent, ExecuteActionEvent, HeroCardComponent, MessageTemplateDirective, SendMessageEvent };
|
|
1756
|
+
export { AttachmentTemplateDirective, ChatComponent, ChatMessageBoxTemplateDirective, ChatModule, CustomMessagesComponent, ExecuteActionEvent, HeroCardComponent, MessageTemplateDirective, SendMessageEvent };
|
|
1576
1757
|
|