@progress/kendo-angular-conversational-ui 11.2.0 → 11.3.0-develop.10
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/chat/l10n/messages.d.ts +10 -1
- package/chat/message-list.component.d.ts +9 -3
- package/chat/suggested-actions.component.d.ts +1 -2
- package/esm2020/chat/chat.component.mjs +44 -28
- package/esm2020/chat/l10n/messages.mjs +5 -1
- package/esm2020/chat/message-attachments.component.mjs +5 -4
- package/esm2020/chat/message-box.component.mjs +12 -8
- package/esm2020/chat/message-list.component.mjs +50 -13
- package/esm2020/chat/suggested-actions.component.mjs +14 -22
- package/esm2020/package-metadata.mjs +2 -2
- package/fesm2015/progress-kendo-angular-conversational-ui.mjs +212 -166
- package/fesm2020/progress-kendo-angular-conversational-ui.mjs +209 -163
- package/package.json +7 -7
- package/common/keys.enum.d.ts +0 -14
- package/esm2020/common/keys.enum.mjs +0 -5
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Directive, Optional, isDevMode, forwardRef, Component, Input,
|
|
6
|
+
import { Directive, Optional, isDevMode, EventEmitter, forwardRef, Component, Input, Output, HostBinding, ViewChildren, ElementRef, ViewChild, HostListener, ContentChild, NgModule } from '@angular/core';
|
|
7
7
|
import * as i1$2 from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { ComponentMessages, LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
9
9
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i6 from '@progress/kendo-angular-common';
|
|
11
|
+
import { Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
12
|
+
import { fromEvent, Subscription } from 'rxjs';
|
|
11
13
|
import * as i2 from '@angular/common';
|
|
12
14
|
import { CommonModule } from '@angular/common';
|
|
13
|
-
import
|
|
15
|
+
import * as i1 from '@progress/kendo-angular-intl';
|
|
14
16
|
import { debounceTime } from 'rxjs/operators';
|
|
15
17
|
import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
|
|
16
18
|
import * as i1$1 from '@progress/kendo-angular-buttons';
|
|
17
19
|
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
18
|
-
import * as i6 from '@progress/kendo-angular-common';
|
|
19
|
-
import { Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Defines a template that will be used for displaying message attachments. To define an attachment
|
|
@@ -119,8 +119,8 @@ const packageMetadata = {
|
|
|
119
119
|
name: '@progress/kendo-angular-conversational-ui',
|
|
120
120
|
productName: 'Kendo UI for Angular',
|
|
121
121
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
122
|
-
publishDate:
|
|
123
|
-
version: '11.
|
|
122
|
+
publishDate: 1677586033,
|
|
123
|
+
version: '11.3.0-develop.10',
|
|
124
124
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
125
125
|
};
|
|
126
126
|
|
|
@@ -277,6 +277,102 @@ const groupItems = (total) => (acc, msg, index) => {
|
|
|
277
277
|
*/
|
|
278
278
|
const chatView = (messages) => messages.reduce(groupItems(messages.length), []);
|
|
279
279
|
|
|
280
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
281
|
+
/**
|
|
282
|
+
* @hidden
|
|
283
|
+
*/
|
|
284
|
+
class SuggestedActionsComponent extends ChatItem {
|
|
285
|
+
constructor() {
|
|
286
|
+
super(...arguments);
|
|
287
|
+
this.dispatch = new EventEmitter();
|
|
288
|
+
this.defaultClass = true;
|
|
289
|
+
this.selectedIndex = 0;
|
|
290
|
+
this.keyHandlers = {
|
|
291
|
+
[Keys.Tab]: (e) => this.changeSelectedIndex(e),
|
|
292
|
+
[Keys.Enter]: (_, action) => this.actionClick(action),
|
|
293
|
+
[Keys.Space]: (_, action) => this.actionClick(action),
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
isSelected(index) {
|
|
297
|
+
return this.selected && this.selectedIndex === index;
|
|
298
|
+
}
|
|
299
|
+
actionClick(action) {
|
|
300
|
+
this.dispatch.next(action);
|
|
301
|
+
}
|
|
302
|
+
actionKeydown(e, action) {
|
|
303
|
+
const handler = this.keyHandlers[e.keyCode];
|
|
304
|
+
if (handler) {
|
|
305
|
+
handler(e, action);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
focus() { }
|
|
309
|
+
changeSelectedIndex(e) {
|
|
310
|
+
const offset = e.shiftKey ? -1 : 1;
|
|
311
|
+
const prevIndex = this.selectedIndex;
|
|
312
|
+
this.selectedIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
SuggestedActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuggestedActionsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
316
|
+
SuggestedActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SuggestedActionsComponent, selector: "kendo-chat-suggested-actions", inputs: { actions: "actions", tabbable: "tabbable" }, outputs: { dispatch: "dispatch" }, host: { properties: { "class.k-quick-replies": "this.defaultClass" } }, providers: [{
|
|
317
|
+
provide: ChatItem,
|
|
318
|
+
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
319
|
+
}], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
320
|
+
<span
|
|
321
|
+
#item
|
|
322
|
+
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
323
|
+
class="k-quick-reply"
|
|
324
|
+
role="button"
|
|
325
|
+
[class.k-selected]="isSelected(index)"
|
|
326
|
+
[class.k-focus]="isSelected(index)"
|
|
327
|
+
[class.k-first]="first"
|
|
328
|
+
[class.k-last]="last"
|
|
329
|
+
[attr.tabindex]="0"
|
|
330
|
+
(click)="actionClick(action)"
|
|
331
|
+
(keydown)="actionKeydown($event, action)"
|
|
332
|
+
>
|
|
333
|
+
{{ action.title || action.value }}
|
|
334
|
+
</span>
|
|
335
|
+
`, isInline: true, directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuggestedActionsComponent, decorators: [{
|
|
337
|
+
type: Component,
|
|
338
|
+
args: [{
|
|
339
|
+
selector: 'kendo-chat-suggested-actions',
|
|
340
|
+
providers: [{
|
|
341
|
+
provide: ChatItem,
|
|
342
|
+
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
343
|
+
}],
|
|
344
|
+
template: `
|
|
345
|
+
<span
|
|
346
|
+
#item
|
|
347
|
+
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
348
|
+
class="k-quick-reply"
|
|
349
|
+
role="button"
|
|
350
|
+
[class.k-selected]="isSelected(index)"
|
|
351
|
+
[class.k-focus]="isSelected(index)"
|
|
352
|
+
[class.k-first]="first"
|
|
353
|
+
[class.k-last]="last"
|
|
354
|
+
[attr.tabindex]="0"
|
|
355
|
+
(click)="actionClick(action)"
|
|
356
|
+
(keydown)="actionKeydown($event, action)"
|
|
357
|
+
>
|
|
358
|
+
{{ action.title || action.value }}
|
|
359
|
+
</span>
|
|
360
|
+
`
|
|
361
|
+
}]
|
|
362
|
+
}], propDecorators: { actions: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], tabbable: [{
|
|
365
|
+
type: Input
|
|
366
|
+
}], dispatch: [{
|
|
367
|
+
type: Output
|
|
368
|
+
}], defaultClass: [{
|
|
369
|
+
type: HostBinding,
|
|
370
|
+
args: ['class.k-quick-replies']
|
|
371
|
+
}], items: [{
|
|
372
|
+
type: ViewChildren,
|
|
373
|
+
args: ['item']
|
|
374
|
+
}] } });
|
|
375
|
+
|
|
280
376
|
// eslint-disable no-forward-ref
|
|
281
377
|
/**
|
|
282
378
|
* @hidden
|
|
@@ -505,12 +601,12 @@ class MessageAttachmentsComponent extends ChatItem {
|
|
|
505
601
|
this.scrollPosition = 0;
|
|
506
602
|
this.selectedIndex = 0;
|
|
507
603
|
this.carouselKeyHandlers = {
|
|
508
|
-
[
|
|
509
|
-
[
|
|
604
|
+
[Keys.ArrowLeft]: (e) => this.navigateTo(e, -1),
|
|
605
|
+
[Keys.ArrowRight]: (e) => this.navigateTo(e, 1)
|
|
510
606
|
};
|
|
511
607
|
this.listKeyHandlers = {
|
|
512
|
-
[
|
|
513
|
-
[
|
|
608
|
+
[Keys.ArrowUp]: (e) => this.navigateTo(e, -1),
|
|
609
|
+
[Keys.ArrowDown]: (e) => this.navigateTo(e, 1)
|
|
514
610
|
};
|
|
515
611
|
}
|
|
516
612
|
get carousel() {
|
|
@@ -683,127 +779,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
683
779
|
args: ['item', { read: ElementRef }]
|
|
684
780
|
}] } });
|
|
685
781
|
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* @hidden
|
|
689
|
-
*/
|
|
690
|
-
class SuggestedActionsComponent extends ChatItem {
|
|
691
|
-
constructor() {
|
|
692
|
-
super(...arguments);
|
|
693
|
-
this.dispatch = new EventEmitter();
|
|
694
|
-
this.defaultClass = true;
|
|
695
|
-
this.selectedIndex = 0;
|
|
696
|
-
this.keyHandlers = {
|
|
697
|
-
[37 /* left */]: (e) => this.navigateTo(e, -1),
|
|
698
|
-
[39 /* right */]: (e) => this.navigateTo(e, 1),
|
|
699
|
-
[13 /* enter */]: (_, action) => this.actionClick(action)
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
isSelected(index) {
|
|
703
|
-
return this.selected && this.selectedIndex === index;
|
|
704
|
-
}
|
|
705
|
-
actionClick(action) {
|
|
706
|
-
this.dispatch.next(action);
|
|
707
|
-
}
|
|
708
|
-
actionKeydown(e, action) {
|
|
709
|
-
const handler = this.keyHandlers[e.keyCode];
|
|
710
|
-
if (handler) {
|
|
711
|
-
handler(e, action);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
focus() {
|
|
715
|
-
this.select(this.selectedIndex);
|
|
716
|
-
}
|
|
717
|
-
select(index) {
|
|
718
|
-
this.selectedIndex = index;
|
|
719
|
-
const item = this.items.toArray()[index];
|
|
720
|
-
if (item) {
|
|
721
|
-
item.nativeElement.focus();
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
navigateTo(e, offset) {
|
|
725
|
-
const prevIndex = this.selectedIndex;
|
|
726
|
-
const nextIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
|
|
727
|
-
if (nextIndex !== prevIndex) {
|
|
728
|
-
this.select(nextIndex);
|
|
729
|
-
e.preventDefault();
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
SuggestedActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuggestedActionsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
734
|
-
SuggestedActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SuggestedActionsComponent, selector: "kendo-chat-suggested-actions", inputs: { actions: "actions", tabbable: "tabbable" }, outputs: { dispatch: "dispatch" }, host: { properties: { "class.k-quick-replies": "this.defaultClass" } }, providers: [{
|
|
735
|
-
provide: ChatItem,
|
|
736
|
-
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
737
|
-
}], viewQueries: [{ propertyName: "items", predicate: ["item"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
738
|
-
<span
|
|
739
|
-
#item
|
|
740
|
-
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
741
|
-
class="k-quick-reply"
|
|
742
|
-
[class.k-selected]="isSelected(index)"
|
|
743
|
-
[class.k-focus]="isSelected(index)"
|
|
744
|
-
[class.k-first]="first"
|
|
745
|
-
[class.k-last]="last"
|
|
746
|
-
[attr.tabindex]="tabbable && selectedIndex === index ? '0' : '-1'"
|
|
747
|
-
(click)="actionClick(action)"
|
|
748
|
-
(keydown)="actionKeydown($event, action)"
|
|
749
|
-
>
|
|
750
|
-
{{ action.title || action.value }}
|
|
751
|
-
</span>
|
|
752
|
-
`, isInline: true, directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
753
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SuggestedActionsComponent, decorators: [{
|
|
754
|
-
type: Component,
|
|
755
|
-
args: [{
|
|
756
|
-
selector: 'kendo-chat-suggested-actions',
|
|
757
|
-
providers: [{
|
|
758
|
-
provide: ChatItem,
|
|
759
|
-
useExisting: forwardRef(() => SuggestedActionsComponent)
|
|
760
|
-
}],
|
|
761
|
-
template: `
|
|
762
|
-
<span
|
|
763
|
-
#item
|
|
764
|
-
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
765
|
-
class="k-quick-reply"
|
|
766
|
-
[class.k-selected]="isSelected(index)"
|
|
767
|
-
[class.k-focus]="isSelected(index)"
|
|
768
|
-
[class.k-first]="first"
|
|
769
|
-
[class.k-last]="last"
|
|
770
|
-
[attr.tabindex]="tabbable && selectedIndex === index ? '0' : '-1'"
|
|
771
|
-
(click)="actionClick(action)"
|
|
772
|
-
(keydown)="actionKeydown($event, action)"
|
|
773
|
-
>
|
|
774
|
-
{{ action.title || action.value }}
|
|
775
|
-
</span>
|
|
776
|
-
`
|
|
777
|
-
}]
|
|
778
|
-
}], propDecorators: { actions: [{
|
|
779
|
-
type: Input
|
|
780
|
-
}], tabbable: [{
|
|
781
|
-
type: Input
|
|
782
|
-
}], dispatch: [{
|
|
783
|
-
type: Output
|
|
784
|
-
}], defaultClass: [{
|
|
785
|
-
type: HostBinding,
|
|
786
|
-
args: ['class.k-quick-replies']
|
|
787
|
-
}], items: [{
|
|
788
|
-
type: ViewChildren,
|
|
789
|
-
args: ['item']
|
|
790
|
-
}] } });
|
|
791
|
-
|
|
782
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
792
783
|
/**
|
|
793
784
|
* @hidden
|
|
794
785
|
*/
|
|
795
786
|
class MessageListComponent {
|
|
796
|
-
constructor(element, intl) {
|
|
787
|
+
constructor(element, intl, renderer) {
|
|
797
788
|
this.element = element;
|
|
798
789
|
this.intl = intl;
|
|
790
|
+
this.renderer = renderer;
|
|
799
791
|
this.executeAction = new EventEmitter();
|
|
800
792
|
this.navigate = new EventEmitter();
|
|
801
793
|
this.resize = new EventEmitter();
|
|
802
794
|
this.cssClass = true;
|
|
803
795
|
this.view = [];
|
|
796
|
+
this.subs = new Subscription();
|
|
804
797
|
this.keyActions = {
|
|
805
|
-
[
|
|
806
|
-
[
|
|
798
|
+
[Keys.Home]: (_) => this.onHomeOrEndKeyDown('home'),
|
|
799
|
+
[Keys.End]: (_) => this.onHomeOrEndKeyDown('end'),
|
|
800
|
+
[Keys.ArrowUp]: (e) => this.navigateTo(e, -1),
|
|
801
|
+
[Keys.ArrowDown]: (e) => this.navigateTo(e, 1),
|
|
802
|
+
[Keys.Tab]: (e) => this.onTabKeyDown(e),
|
|
807
803
|
};
|
|
808
804
|
}
|
|
809
805
|
set messages(value) {
|
|
@@ -814,9 +810,17 @@ class MessageListComponent {
|
|
|
814
810
|
get messages() {
|
|
815
811
|
return this._messages;
|
|
816
812
|
}
|
|
813
|
+
ngOnInit() {
|
|
814
|
+
const elRef = this.element.nativeElement;
|
|
815
|
+
this.subs.add(this.renderer.listen(elRef, 'keydown', event => this.onKeydown(event)));
|
|
816
|
+
this.subs.add(this.renderer.listen(elRef, 'focusout', event => this.onBlur(event)));
|
|
817
|
+
}
|
|
817
818
|
ngAfterViewInit() {
|
|
818
819
|
this.selectedItem = this.items.last;
|
|
819
820
|
}
|
|
821
|
+
ngOnDestroy() {
|
|
822
|
+
this.subs.unsubscribe();
|
|
823
|
+
}
|
|
820
824
|
onResize() {
|
|
821
825
|
this.resize.emit();
|
|
822
826
|
}
|
|
@@ -862,13 +866,37 @@ class MessageListComponent {
|
|
|
862
866
|
}
|
|
863
867
|
return items[items.length - 1];
|
|
864
868
|
}
|
|
869
|
+
onHomeOrEndKeyDown(key) {
|
|
870
|
+
const items = this.items.toArray();
|
|
871
|
+
if (key === 'home') {
|
|
872
|
+
items[0].focus();
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
items[items.length - 1].focus();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
onTabKeyDown(event) {
|
|
879
|
+
const item = this.items.toArray()[this.items.length - 1];
|
|
880
|
+
const isLastItemQuickReply = item instanceof SuggestedActionsComponent;
|
|
881
|
+
const isLastItemMessage = item instanceof MessageComponent;
|
|
882
|
+
event.target.blur();
|
|
883
|
+
if (isLastItemQuickReply || isLastItemMessage) {
|
|
884
|
+
this.select(item);
|
|
885
|
+
item.focus();
|
|
886
|
+
this.navigate.emit();
|
|
887
|
+
}
|
|
888
|
+
}
|
|
865
889
|
navigateTo(e, offset) {
|
|
866
890
|
const items = this.items.toArray();
|
|
867
891
|
const prevItem = this.selectedItem;
|
|
868
892
|
const prevIndex = items.indexOf(prevItem);
|
|
869
893
|
const nextIndex = Math.max(0, Math.min(prevIndex + offset, this.items.length - 1));
|
|
870
894
|
const nextItem = items[nextIndex];
|
|
895
|
+
const isNextItemQuickReply = nextItem instanceof SuggestedActionsComponent;
|
|
871
896
|
if (nextItem !== prevItem) {
|
|
897
|
+
if (isNextItemQuickReply) {
|
|
898
|
+
nextItem.items.toArray()[0].nativeElement.focus();
|
|
899
|
+
}
|
|
872
900
|
this.select(nextItem);
|
|
873
901
|
nextItem.focus();
|
|
874
902
|
this.navigate.emit();
|
|
@@ -876,8 +904,8 @@ class MessageListComponent {
|
|
|
876
904
|
}
|
|
877
905
|
}
|
|
878
906
|
}
|
|
879
|
-
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageListComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }], target: i0.ɵɵFactoryTarget.Component });
|
|
880
|
-
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: { messages: "messages", attachmentTemplate: "attachmentTemplate", messageTemplate: "messageTemplate", user: "user" }, outputs: { executeAction: "executeAction", navigate: "navigate", resize: "resize" }, host: {
|
|
907
|
+
MessageListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageListComponent, deps: [{ token: i0.ElementRef }, { token: i1.IntlService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
908
|
+
MessageListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: MessageListComponent, selector: "kendo-chat-message-list", inputs: { messages: "messages", attachmentTemplate: "attachmentTemplate", messageTemplate: "messageTemplate", user: "user" }, outputs: { executeAction: "executeAction", navigate: "navigate", resize: "resize" }, host: { properties: { "class.k-message-list-content": "this.cssClass" } }, viewQueries: [{ propertyName: "items", predicate: ChatItem, descendants: true }], ngImport: i0, template: `
|
|
881
909
|
<ng-container *ngFor="let group of view; last as lastGroup; trackBy: trackGroup">
|
|
882
910
|
<ng-container [ngSwitch]="group.type">
|
|
883
911
|
<div
|
|
@@ -1024,7 +1052,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1024
1052
|
</kendo-resize-sensor>
|
|
1025
1053
|
`
|
|
1026
1054
|
}]
|
|
1027
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }]; }, propDecorators: { messages: [{
|
|
1055
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.IntlService }, { type: i0.Renderer2 }]; }, propDecorators: { messages: [{
|
|
1028
1056
|
type: Input
|
|
1029
1057
|
}], attachmentTemplate: [{
|
|
1030
1058
|
type: Input
|
|
@@ -1044,12 +1072,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1044
1072
|
}], cssClass: [{
|
|
1045
1073
|
type: HostBinding,
|
|
1046
1074
|
args: ['class.k-message-list-content']
|
|
1047
|
-
}], onKeydown: [{
|
|
1048
|
-
type: HostListener,
|
|
1049
|
-
args: ['keydown', ['$event']]
|
|
1050
|
-
}], onBlur: [{
|
|
1051
|
-
type: HostListener,
|
|
1052
|
-
args: ['focusout', ['$event']]
|
|
1053
1075
|
}] } });
|
|
1054
1076
|
|
|
1055
1077
|
/**
|
|
@@ -1150,7 +1172,7 @@ class MessageBoxComponent {
|
|
|
1150
1172
|
}
|
|
1151
1173
|
}
|
|
1152
1174
|
MessageBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1153
|
-
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", 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
|
|
1175
|
+
MessageBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", 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 [attr.role]=\"'textbox'\"\n kendoChatFocusedState\n type=\"text\"\n class=\"k-textbox k-input k-input-md k-input-solid\"\n [attr.aria-label]=\"textFor('messageBoxInputLabel')\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"inputKeydown($event)\"\n />\n\n <textarea\n *ngIf=\"type === 'textarea'\"\n #messageBoxInput\n [attr.role]=\"'textbox'\"\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 [attr.aria-label]=\"textFor('messageBoxInputLabel')\"\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, components: [{ type: i1$1.Button, selector: "button[kendoButton], span[kendoButton], kendo-button", inputs: ["toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "role", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: FocusedStateDirective, selector: "[kendoChatFocusedState]" }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
1154
1176
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: MessageBoxComponent, decorators: [{
|
|
1155
1177
|
type: Component,
|
|
1156
1178
|
args: [{
|
|
@@ -1160,21 +1182,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1160
1182
|
<input
|
|
1161
1183
|
*ngIf="type === 'textbox'"
|
|
1162
1184
|
#messageBoxInput
|
|
1185
|
+
[attr.role]="'textbox'"
|
|
1163
1186
|
kendoChatFocusedState
|
|
1164
1187
|
type="text"
|
|
1165
1188
|
class="k-textbox k-input k-input-md k-input-solid"
|
|
1189
|
+
[attr.aria-label]="textFor('messageBoxInputLabel')"
|
|
1166
1190
|
[placeholder]="textFor('messagePlaceholder')"
|
|
1167
1191
|
(keydown)="inputKeydown($event)"
|
|
1168
1192
|
/>
|
|
1169
1193
|
|
|
1170
1194
|
<textarea
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1195
|
+
*ngIf="type === 'textarea'"
|
|
1196
|
+
#messageBoxInput
|
|
1197
|
+
[attr.role]="'textbox'"
|
|
1198
|
+
kendoChatFocusedState
|
|
1199
|
+
[rows]="3"
|
|
1200
|
+
class="k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none"
|
|
1201
|
+
[attr.aria-label]="textFor('messageBoxInputLabel')"
|
|
1202
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
1203
|
+
(keydown)="textAreaKeydown($event)"
|
|
1178
1204
|
></textarea>
|
|
1179
1205
|
|
|
1180
1206
|
<button
|
|
@@ -1221,7 +1247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1221
1247
|
class Messages extends ComponentMessages {
|
|
1222
1248
|
}
|
|
1223
1249
|
Messages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1224
|
-
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, selector: "kendoConversationalUIMessages", inputs: { messagePlaceholder: "messagePlaceholder", send: "send" }, usesInheritance: true, ngImport: i0 });
|
|
1250
|
+
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.12", type: Messages, selector: "kendoConversationalUIMessages", inputs: { messagePlaceholder: "messagePlaceholder", send: "send", messageListLabel: "messageListLabel", messageBoxInputLabel: "messageBoxInputLabel" }, usesInheritance: true, ngImport: i0 });
|
|
1225
1251
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: Messages, decorators: [{
|
|
1226
1252
|
type: Directive,
|
|
1227
1253
|
args: [{
|
|
@@ -1232,6 +1258,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1232
1258
|
type: Input
|
|
1233
1259
|
}], send: [{
|
|
1234
1260
|
type: Input
|
|
1261
|
+
}], messageListLabel: [{
|
|
1262
|
+
type: Input
|
|
1263
|
+
}], messageBoxInputLabel: [{
|
|
1264
|
+
type: Input
|
|
1235
1265
|
}] } });
|
|
1236
1266
|
|
|
1237
1267
|
// eslint-disable no-forward-ref
|
|
@@ -1444,27 +1474,35 @@ ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version:
|
|
|
1444
1474
|
|
|
1445
1475
|
i18n-send="kendo.chat.send|The text for the Send button"
|
|
1446
1476
|
send="Send..."
|
|
1477
|
+
|
|
1478
|
+
i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
|
|
1479
|
+
messageListLabel="Message list"
|
|
1480
|
+
|
|
1481
|
+
i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
|
|
1482
|
+
messageBoxInputLabel="Message"
|
|
1447
1483
|
>
|
|
1448
1484
|
</ng-container>
|
|
1449
1485
|
|
|
1450
1486
|
<div
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1487
|
+
#messageList
|
|
1488
|
+
class="k-message-list k-avatars"
|
|
1489
|
+
aria-live="polite"
|
|
1490
|
+
role="log"
|
|
1491
|
+
kendoChatScrollAnchor
|
|
1492
|
+
[attr.aria-label]="textFor('messageListLabel')"
|
|
1455
1493
|
#anchor="scrollAnchor"
|
|
1456
1494
|
[(autoScroll)]="autoScroll"
|
|
1457
1495
|
>
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1496
|
+
<kendo-chat-message-list
|
|
1497
|
+
[messages]="messages"
|
|
1498
|
+
[messageTemplate]="messageTemplate"
|
|
1499
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
1500
|
+
[user]="user"
|
|
1501
|
+
(executeAction)="dispatchAction($event)"
|
|
1502
|
+
(resize)="anchor.scrollToBottom()"
|
|
1503
|
+
(navigate)="this.autoScroll = false"
|
|
1504
|
+
>
|
|
1505
|
+
</kendo-chat-message-list>
|
|
1468
1506
|
</div>
|
|
1469
1507
|
<kendo-message-box
|
|
1470
1508
|
#messageBox
|
|
@@ -1496,27 +1534,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
|
|
|
1496
1534
|
|
|
1497
1535
|
i18n-send="kendo.chat.send|The text for the Send button"
|
|
1498
1536
|
send="Send..."
|
|
1537
|
+
|
|
1538
|
+
i18n-messageListLabel="kendo.chat.messageListLabel|The label text for the Message list"
|
|
1539
|
+
messageListLabel="Message list"
|
|
1540
|
+
|
|
1541
|
+
i18n-messageBoxInputLabel="kendo.chat.messageBoxInputLabel|The label text for the Message input box"
|
|
1542
|
+
messageBoxInputLabel="Message"
|
|
1499
1543
|
>
|
|
1500
1544
|
</ng-container>
|
|
1501
1545
|
|
|
1502
1546
|
<div
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1547
|
+
#messageList
|
|
1548
|
+
class="k-message-list k-avatars"
|
|
1549
|
+
aria-live="polite"
|
|
1550
|
+
role="log"
|
|
1551
|
+
kendoChatScrollAnchor
|
|
1552
|
+
[attr.aria-label]="textFor('messageListLabel')"
|
|
1507
1553
|
#anchor="scrollAnchor"
|
|
1508
1554
|
[(autoScroll)]="autoScroll"
|
|
1509
1555
|
>
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1556
|
+
<kendo-chat-message-list
|
|
1557
|
+
[messages]="messages"
|
|
1558
|
+
[messageTemplate]="messageTemplate"
|
|
1559
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
1560
|
+
[user]="user"
|
|
1561
|
+
(executeAction)="dispatchAction($event)"
|
|
1562
|
+
(resize)="anchor.scrollToBottom()"
|
|
1563
|
+
(navigate)="this.autoScroll = false"
|
|
1564
|
+
>
|
|
1565
|
+
</kendo-chat-message-list>
|
|
1520
1566
|
</div>
|
|
1521
1567
|
<kendo-message-box
|
|
1522
1568
|
#messageBox
|