@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
|
@@ -30,51 +30,51 @@ export class AttachmentComponent {
|
|
|
30
30
|
}
|
|
31
31
|
AttachmentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AttachmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
32
32
|
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: `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</ng-container>
|
|
37
|
-
|
|
38
|
-
<div *ngIf="!template" class="k-card">
|
|
39
|
-
<div class="k-card-body">
|
|
40
|
-
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
41
|
-
{{ attachment.title }}
|
|
42
|
-
</h5>
|
|
43
|
-
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
44
|
-
{{ attachment.subtitle }}
|
|
45
|
-
</h6>
|
|
46
|
-
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
47
|
-
<ng-container *ngIf="unknown">
|
|
48
|
-
{{ attachment.content }}
|
|
33
|
+
<ng-container *ngIf="template">
|
|
34
|
+
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
|
|
35
|
+
</ng-container>
|
|
49
36
|
</ng-container>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
|
|
38
|
+
<div *ngIf="!template" class="k-card">
|
|
39
|
+
<div class="k-card-body">
|
|
40
|
+
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
41
|
+
{{ attachment.title }}
|
|
42
|
+
</h5>
|
|
43
|
+
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
44
|
+
{{ attachment.subtitle }}
|
|
45
|
+
</h6>
|
|
46
|
+
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
47
|
+
<ng-container *ngIf="unknown">
|
|
48
|
+
{{ attachment.content }}
|
|
49
|
+
</ng-container>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
53
53
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AttachmentComponent, decorators: [{
|
|
54
54
|
type: Component,
|
|
55
55
|
args: [{
|
|
56
56
|
selector: 'kendo-chat-attachment',
|
|
57
57
|
template: `
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</ng-container>
|
|
62
|
-
|
|
63
|
-
<div *ngIf="!template" class="k-card">
|
|
64
|
-
<div class="k-card-body">
|
|
65
|
-
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
66
|
-
{{ attachment.title }}
|
|
67
|
-
</h5>
|
|
68
|
-
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
69
|
-
{{ attachment.subtitle }}
|
|
70
|
-
</h6>
|
|
71
|
-
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
72
|
-
<ng-container *ngIf="unknown">
|
|
73
|
-
{{ attachment.content }}
|
|
58
|
+
<ng-container *ngIf="template">
|
|
59
|
+
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
|
|
60
|
+
</ng-container>
|
|
74
61
|
</ng-container>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
62
|
+
|
|
63
|
+
<div *ngIf="!template" class="k-card">
|
|
64
|
+
<div class="k-card-body">
|
|
65
|
+
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
66
|
+
{{ attachment.title }}
|
|
67
|
+
</h5>
|
|
68
|
+
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
69
|
+
{{ attachment.subtitle }}
|
|
70
|
+
</h6>
|
|
71
|
+
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
72
|
+
<ng-container *ngIf="unknown">
|
|
73
|
+
{{ attachment.content }}
|
|
74
|
+
</ng-container>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`
|
|
78
78
|
}]
|
|
79
79
|
}], propDecorators: { attachment: [{
|
|
80
80
|
type: Input
|
|
@@ -7,18 +7,15 @@ import { AttachmentTemplateDirective } from './attachment-template.directive';
|
|
|
7
7
|
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { makeHandler } from './builtin-actions';
|
|
9
9
|
import { MessageTemplateDirective } from './message-template.directive';
|
|
10
|
-
import { SendMessageEvent } from '../api';
|
|
11
10
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
12
11
|
import { packageMetadata } from '../package-metadata';
|
|
12
|
+
import { ChatMessageBoxTemplateDirective } from './message-box.directive';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
15
15
|
import * as i2 from "./message-list.component";
|
|
16
|
-
import * as i3 from "./
|
|
17
|
-
import * as i4 from "
|
|
18
|
-
import * as i5 from "../common/
|
|
19
|
-
import * as i6 from "@progress/kendo-angular-buttons";
|
|
20
|
-
// eslint-disable-next-line max-len
|
|
21
|
-
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>';
|
|
16
|
+
import * as i3 from "./message-box.component";
|
|
17
|
+
import * as i4 from "./l10n/localized-messages.directive";
|
|
18
|
+
import * as i5 from "../common/scroll-anchor.directive";
|
|
22
19
|
/**
|
|
23
20
|
* Represents the Kendo UI Chat component for Angular.
|
|
24
21
|
*
|
|
@@ -33,6 +30,12 @@ export class ChatComponent {
|
|
|
33
30
|
constructor(localization, zone) {
|
|
34
31
|
this.localization = localization;
|
|
35
32
|
this.zone = zone;
|
|
33
|
+
/**
|
|
34
|
+
* Used to switch between a one-liner input or a textarea.
|
|
35
|
+
* ([see example]({% slug message_box %})#toc-message-box-types).
|
|
36
|
+
* @default input
|
|
37
|
+
*/
|
|
38
|
+
this.messageBoxType = 'textbox';
|
|
36
39
|
/**
|
|
37
40
|
* Fires when the user types a message and clicks the **Send** button or presses **Enter**.
|
|
38
41
|
* Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
|
|
@@ -59,11 +62,17 @@ export class ChatComponent {
|
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
get className() {
|
|
62
|
-
return 'k-
|
|
65
|
+
return 'k-chat';
|
|
63
66
|
}
|
|
64
67
|
get dirAttr() {
|
|
65
68
|
return this.direction;
|
|
66
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @hidden
|
|
72
|
+
*/
|
|
73
|
+
get localizationText() {
|
|
74
|
+
return this.localization;
|
|
75
|
+
}
|
|
67
76
|
ngOnChanges() {
|
|
68
77
|
this.zone.runOutsideAngular(() => setTimeout(() => {
|
|
69
78
|
this.messageList.nativeElement.style.flex = '1 1 auto';
|
|
@@ -82,33 +91,6 @@ export class ChatComponent {
|
|
|
82
91
|
this.localizationChangeSubscription.unsubscribe();
|
|
83
92
|
}
|
|
84
93
|
}
|
|
85
|
-
/**
|
|
86
|
-
* @hidden
|
|
87
|
-
*/
|
|
88
|
-
sendClick() {
|
|
89
|
-
const input = this.messageInput.nativeElement;
|
|
90
|
-
const value = input.value;
|
|
91
|
-
if (!value) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const message = {
|
|
95
|
-
author: this.user,
|
|
96
|
-
text: value,
|
|
97
|
-
timestamp: new Date()
|
|
98
|
-
};
|
|
99
|
-
this.sendMessage.emit(new SendMessageEvent(message));
|
|
100
|
-
input.value = null;
|
|
101
|
-
input.focus();
|
|
102
|
-
this.autoScroll = true;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* @hidden
|
|
106
|
-
*/
|
|
107
|
-
inputKeydown(e) {
|
|
108
|
-
if (e.keyCode === 13 /* enter */) {
|
|
109
|
-
this.sendClick();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
94
|
/**
|
|
113
95
|
* @hidden
|
|
114
96
|
*/
|
|
@@ -117,7 +99,9 @@ export class ChatComponent {
|
|
|
117
99
|
if (!e.isDefaultPrevented()) {
|
|
118
100
|
const handler = makeHandler(e.action);
|
|
119
101
|
handler(e.action, this);
|
|
120
|
-
this.
|
|
102
|
+
if (!this.messageBoxTemplate) {
|
|
103
|
+
this.messageBox.messageBoxInput.nativeElement.focus();
|
|
104
|
+
}
|
|
121
105
|
}
|
|
122
106
|
}
|
|
123
107
|
/**
|
|
@@ -128,13 +112,53 @@ export class ChatComponent {
|
|
|
128
112
|
}
|
|
129
113
|
}
|
|
130
114
|
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
131
|
-
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: [
|
|
115
|
+
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: [
|
|
132
116
|
LocalizationService,
|
|
133
117
|
{
|
|
134
118
|
provide: L10N_PREFIX,
|
|
135
119
|
useValue: 'kendo.chat'
|
|
136
120
|
}
|
|
137
|
-
], queries: [{ propertyName: "attachmentTemplate", first: true, predicate: AttachmentTemplateDirective, descendants: true }, { propertyName: "messageTemplate", first: true, predicate: MessageTemplateDirective, descendants: true }
|
|
121
|
+
], 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: `
|
|
122
|
+
<ng-container
|
|
123
|
+
kendoChatLocalizedMessages
|
|
124
|
+
i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
|
|
125
|
+
messagePlaceholder="Type a message..."
|
|
126
|
+
|
|
127
|
+
i18n-send="kendo.chat.send|The text for the Send button"
|
|
128
|
+
send="Send..."
|
|
129
|
+
>
|
|
130
|
+
</ng-container>
|
|
131
|
+
|
|
132
|
+
<div
|
|
133
|
+
#messageList
|
|
134
|
+
class="k-message-list k-avatars"
|
|
135
|
+
aria-live="polite" role="log"
|
|
136
|
+
kendoChatScrollAnchor
|
|
137
|
+
#anchor="scrollAnchor"
|
|
138
|
+
[(autoScroll)]="autoScroll"
|
|
139
|
+
>
|
|
140
|
+
<kendo-chat-message-list
|
|
141
|
+
[messages]="messages"
|
|
142
|
+
[messageTemplate]="messageTemplate"
|
|
143
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
144
|
+
[user]="user"
|
|
145
|
+
(executeAction)="dispatchAction($event)"
|
|
146
|
+
(resize)="anchor.scrollToBottom()"
|
|
147
|
+
(navigate)="this.autoScroll = false"
|
|
148
|
+
>
|
|
149
|
+
</kendo-chat-message-list>
|
|
150
|
+
</div>
|
|
151
|
+
<kendo-message-box
|
|
152
|
+
#messageBox
|
|
153
|
+
[messageBoxTemplate]="messageBoxTemplate"
|
|
154
|
+
[type]="messageBoxType"
|
|
155
|
+
[user]="user"
|
|
156
|
+
[autoScroll]="autoScroll"
|
|
157
|
+
[localization]="localizationText"
|
|
158
|
+
(sendMessage)="sendMessage.emit($event)"
|
|
159
|
+
>
|
|
160
|
+
</kendo-message-box>
|
|
161
|
+
`, isInline: true, components: [{ type: i2.MessageListComponent, selector: "kendo-chat-message-list", inputs: ["messages", "attachmentTemplate", "messageTemplate", "user"], outputs: ["executeAction", "navigate", "resize"] }, { type: i3.MessageBoxComponent, selector: "kendo-message-box", inputs: ["user", "autoScroll", "type", "localization", "messageBoxTemplate"], outputs: ["sendMessage"] }], directives: [{ type: i4.LocalizedMessagesDirective, selector: "[kendoChatLocalizedMessages]" }, { type: i5.ScrollAnchorDirective, selector: "[kendoChatScrollAnchor]", inputs: ["autoScroll"], outputs: ["autoScrollChange"], exportAs: ["scrollAnchor"] }] });
|
|
138
162
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatComponent, decorators: [{
|
|
139
163
|
type: Component,
|
|
140
164
|
args: [{
|
|
@@ -147,60 +171,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
147
171
|
],
|
|
148
172
|
selector: 'kendo-chat',
|
|
149
173
|
template: `
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
174
|
+
<ng-container
|
|
175
|
+
kendoChatLocalizedMessages
|
|
176
|
+
i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
|
|
177
|
+
messagePlaceholder="Type a message..."
|
|
154
178
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
179
|
+
i18n-send="kendo.chat.send|The text for the Send button"
|
|
180
|
+
send="Send..."
|
|
181
|
+
>
|
|
182
|
+
</ng-container>
|
|
159
183
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
184
|
+
<div
|
|
185
|
+
#messageList
|
|
186
|
+
class="k-message-list k-avatars"
|
|
187
|
+
aria-live="polite" role="log"
|
|
188
|
+
kendoChatScrollAnchor
|
|
189
|
+
#anchor="scrollAnchor"
|
|
190
|
+
[(autoScroll)]="autoScroll"
|
|
191
|
+
>
|
|
192
|
+
<kendo-chat-message-list
|
|
193
|
+
[messages]="messages"
|
|
194
|
+
[messageTemplate]="messageTemplate"
|
|
195
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
196
|
+
[user]="user"
|
|
197
|
+
(executeAction)="dispatchAction($event)"
|
|
198
|
+
(resize)="anchor.scrollToBottom()"
|
|
199
|
+
(navigate)="this.autoScroll = false"
|
|
200
|
+
>
|
|
201
|
+
</kendo-chat-message-list>
|
|
202
|
+
</div>
|
|
203
|
+
<kendo-message-box
|
|
204
|
+
#messageBox
|
|
205
|
+
[messageBoxTemplate]="messageBoxTemplate"
|
|
206
|
+
[type]="messageBoxType"
|
|
172
207
|
[user]="user"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div class="k-message-box">
|
|
181
|
-
<input
|
|
182
|
-
#messageInput
|
|
183
|
-
kendoChatFocusedState
|
|
184
|
-
type="text"
|
|
185
|
-
class="k-input"
|
|
186
|
-
[placeholder]="textFor('messagePlaceholder')"
|
|
187
|
-
(keydown)="inputKeydown($event)"
|
|
188
|
-
>
|
|
189
|
-
<button
|
|
190
|
-
kendoButton
|
|
191
|
-
fillMode="flat"
|
|
192
|
-
class="k-button-send"
|
|
193
|
-
tabindex="-1"
|
|
194
|
-
[attr.title]="textFor('send')"
|
|
195
|
-
(click)="sendClick()"
|
|
196
|
-
>${sendIcon}</button>
|
|
197
|
-
</div>
|
|
198
|
-
`
|
|
208
|
+
[autoScroll]="autoScroll"
|
|
209
|
+
[localization]="localizationText"
|
|
210
|
+
(sendMessage)="sendMessage.emit($event)"
|
|
211
|
+
>
|
|
212
|
+
</kendo-message-box>
|
|
213
|
+
`
|
|
199
214
|
}]
|
|
200
215
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.NgZone }]; }, propDecorators: { messages: [{
|
|
201
216
|
type: Input
|
|
202
217
|
}], user: [{
|
|
203
218
|
type: Input
|
|
219
|
+
}], messageBoxType: [{
|
|
220
|
+
type: Input
|
|
204
221
|
}], sendMessage: [{
|
|
205
222
|
type: Output
|
|
206
223
|
}], executeAction: [{
|
|
@@ -217,9 +234,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
217
234
|
}], messageTemplate: [{
|
|
218
235
|
type: ContentChild,
|
|
219
236
|
args: [MessageTemplateDirective, { static: false }]
|
|
220
|
-
}],
|
|
237
|
+
}], messageBoxTemplate: [{
|
|
238
|
+
type: ContentChild,
|
|
239
|
+
args: [ChatMessageBoxTemplateDirective, { static: false }]
|
|
240
|
+
}], messageBox: [{
|
|
221
241
|
type: ViewChild,
|
|
222
|
-
args: ['
|
|
242
|
+
args: ['messageBox', { static: false }]
|
|
223
243
|
}], messageList: [{
|
|
224
244
|
type: ViewChild,
|
|
225
245
|
args: ['messageList', { static: true }]
|
|
@@ -5,3 +5,4 @@
|
|
|
5
5
|
export { ChatComponent } from './chat.component';
|
|
6
6
|
export { AttachmentTemplateDirective } from './attachment-template.directive';
|
|
7
7
|
export { MessageTemplateDirective } from './message-template.directive';
|
|
8
|
+
export { ChatMessageBoxTemplateDirective } from './message-box.directive';
|
|
@@ -17,13 +17,16 @@ import { MessageListComponent } from './message-list.component';
|
|
|
17
17
|
import { NgModule } from '@angular/core';
|
|
18
18
|
import { ScrollAnchorDirective } from '../common/scroll-anchor.directive';
|
|
19
19
|
import { SuggestedActionsComponent } from './suggested-actions.component';
|
|
20
|
+
import { MessageBoxComponent } from './message-box.component';
|
|
21
|
+
import { ChatMessageBoxTemplateDirective } from './message-box.directive';
|
|
20
22
|
import * as i0 from "@angular/core";
|
|
21
23
|
const PUBLIC_DIRECTIVES = [
|
|
22
24
|
ChatComponent,
|
|
23
25
|
CustomMessagesComponent,
|
|
24
26
|
AttachmentTemplateDirective,
|
|
25
27
|
MessageTemplateDirective,
|
|
26
|
-
HeroCardComponent
|
|
28
|
+
HeroCardComponent,
|
|
29
|
+
ChatMessageBoxTemplateDirective
|
|
27
30
|
];
|
|
28
31
|
const PRIVATE_DIRECTIVES = [
|
|
29
32
|
AttachmentComponent,
|
|
@@ -34,7 +37,8 @@ const PRIVATE_DIRECTIVES = [
|
|
|
34
37
|
MessageListComponent,
|
|
35
38
|
MessageTemplateDirective,
|
|
36
39
|
ScrollAnchorDirective,
|
|
37
|
-
SuggestedActionsComponent
|
|
40
|
+
SuggestedActionsComponent,
|
|
41
|
+
MessageBoxComponent
|
|
38
42
|
];
|
|
39
43
|
/**
|
|
40
44
|
* The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
|
|
@@ -64,7 +68,8 @@ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12
|
|
|
64
68
|
CustomMessagesComponent,
|
|
65
69
|
AttachmentTemplateDirective,
|
|
66
70
|
MessageTemplateDirective,
|
|
67
|
-
HeroCardComponent,
|
|
71
|
+
HeroCardComponent,
|
|
72
|
+
ChatMessageBoxTemplateDirective, AttachmentComponent,
|
|
68
73
|
FocusedStateDirective,
|
|
69
74
|
LocalizedMessagesDirective,
|
|
70
75
|
MessageAttachmentsComponent,
|
|
@@ -72,13 +77,15 @@ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12
|
|
|
72
77
|
MessageListComponent,
|
|
73
78
|
MessageTemplateDirective,
|
|
74
79
|
ScrollAnchorDirective,
|
|
75
|
-
SuggestedActionsComponent
|
|
80
|
+
SuggestedActionsComponent,
|
|
81
|
+
MessageBoxComponent], imports: [ButtonModule,
|
|
76
82
|
CommonModule,
|
|
77
83
|
ResizeSensorModule], exports: [ChatComponent,
|
|
78
84
|
CustomMessagesComponent,
|
|
79
85
|
AttachmentTemplateDirective,
|
|
80
86
|
MessageTemplateDirective,
|
|
81
|
-
HeroCardComponent
|
|
87
|
+
HeroCardComponent,
|
|
88
|
+
ChatMessageBoxTemplateDirective] });
|
|
82
89
|
ChatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ChatModule, imports: [[
|
|
83
90
|
ButtonModule,
|
|
84
91
|
CommonModule,
|
|
@@ -15,6 +15,7 @@ Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.
|
|
|
15
15
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: Messages, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
18
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
18
19
|
selector: 'kendoConversationalUIMessages'
|
|
19
20
|
}]
|
|
20
21
|
}], propDecorators: { messagePlaceholder: [{
|
|
@@ -99,37 +99,37 @@ MessageAttachmentsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
99
99
|
provide: ChatItem,
|
|
100
100
|
useExisting: forwardRef(() => MessageAttachmentsComponent)
|
|
101
101
|
}], 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: `
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
102
|
+
<button
|
|
103
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
104
|
+
(click)="scrollTo(-1)"
|
|
105
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
106
|
+
tabindex="-1">
|
|
107
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
108
|
+
</button>
|
|
109
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
110
|
+
<kendo-chat-attachment #item
|
|
111
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
112
|
+
[attachment]="att"
|
|
113
|
+
[template]="template"
|
|
114
|
+
[class.k-state-selected]="isSelected(index)"
|
|
115
|
+
[class.k-state-focused]="isSelected(index)"
|
|
116
|
+
[class.k-card-wrap]="true"
|
|
117
|
+
[class.k-first]="first"
|
|
118
|
+
[class.k-last]="last"
|
|
119
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
120
|
+
(click)="itemClick(index)"
|
|
121
|
+
(keydown)="itemKeydown($event, att)"
|
|
122
|
+
>
|
|
123
|
+
</kendo-chat-attachment>
|
|
124
|
+
</div>
|
|
125
|
+
<button
|
|
126
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
127
|
+
(click)="scrollTo(1)"
|
|
128
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
129
|
+
tabindex="-1">
|
|
130
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
131
|
+
</button>
|
|
132
|
+
`, isInline: true, components: [{ type: i1.AttachmentComponent, selector: "kendo-chat-attachment", inputs: ["attachment", "template"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
133
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MessageAttachmentsComponent, decorators: [{
|
|
134
134
|
type: Component,
|
|
135
135
|
args: [{
|
|
@@ -139,37 +139,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
139
139
|
}],
|
|
140
140
|
selector: 'kendo-chat-message-attachments',
|
|
141
141
|
template: `
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
142
|
+
<button
|
|
143
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
144
|
+
(click)="scrollTo(-1)"
|
|
145
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
146
|
+
tabindex="-1">
|
|
147
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
148
|
+
</button>
|
|
149
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
150
|
+
<kendo-chat-attachment #item
|
|
151
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
152
|
+
[attachment]="att"
|
|
153
|
+
[template]="template"
|
|
154
|
+
[class.k-state-selected]="isSelected(index)"
|
|
155
|
+
[class.k-state-focused]="isSelected(index)"
|
|
156
|
+
[class.k-card-wrap]="true"
|
|
157
|
+
[class.k-first]="first"
|
|
158
|
+
[class.k-last]="last"
|
|
159
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
160
|
+
(click)="itemClick(index)"
|
|
161
|
+
(keydown)="itemKeydown($event, att)"
|
|
162
|
+
>
|
|
163
|
+
</kendo-chat-attachment>
|
|
164
|
+
</div>
|
|
165
|
+
<button
|
|
166
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
167
|
+
(click)="scrollTo(1)"
|
|
168
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
169
|
+
tabindex="-1">
|
|
170
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
171
|
+
</button>
|
|
172
|
+
`
|
|
173
173
|
}]
|
|
174
174
|
}], ctorParameters: function () { return [{ type: i0.NgZone }]; }, propDecorators: { attachments: [{
|
|
175
175
|
type: Input
|