@progress/kendo-angular-conversational-ui 4.0.2-dev.202203091004 → 4.1.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/dist/cdn/js/kendo-angular-conversational-ui.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/cards/hero-card.component.js +1 -1
- package/dist/es/chat/attachment.component.js +1 -1
- package/dist/es/chat/chat.component.js +35 -38
- package/dist/es/chat/chat.directives.js +1 -0
- package/dist/es/chat/chat.module.js +6 -2
- package/dist/es/chat/message-attachments.component.js +1 -1
- package/dist/es/chat/message-box.component.js +124 -0
- package/dist/es/chat/message-box.directive.js +24 -0
- package/dist/es/chat/message-list.component.js +1 -1
- package/dist/es/chat/message.component.js +1 -1
- package/dist/es/chat/suggested-actions.component.js +1 -1
- package/dist/es/common/focused-state.directive.js +1 -1
- package/dist/es/common/models/message-box-options.js +4 -0
- package/dist/es/index.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/cards/hero-card.component.js +22 -21
- package/dist/es2015/chat/attachment.component.js +19 -19
- package/dist/es2015/chat/chat.component.d.ts +13 -10
- package/dist/es2015/chat/chat.component.js +67 -83
- package/dist/es2015/chat/chat.directives.d.ts +1 -0
- package/dist/es2015/chat/chat.directives.js +1 -0
- package/dist/es2015/chat/chat.module.js +6 -2
- package/dist/es2015/chat/message-attachments.component.js +31 -31
- package/dist/es2015/chat/message-box.component.d.ts +39 -0
- package/dist/es2015/chat/message-box.component.js +157 -0
- package/dist/es2015/chat/message-box.directive.d.ts +14 -0
- package/dist/es2015/chat/message-box.directive.js +23 -0
- package/dist/es2015/chat/message-list.component.js +66 -66
- package/dist/es2015/chat/message.component.js +33 -33
- package/dist/es2015/chat/suggested-actions.component.js +15 -14
- package/dist/es2015/common/focused-state.directive.js +1 -1
- package/dist/es2015/common/models/message-box-options.d.ts +8 -0
- package/dist/es2015/common/models/message-box-options.js +4 -0
- package/dist/es2015/index.d.ts +1 -0
- package/dist/es2015/index.js +1 -0
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/main.d.ts +1 -0
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +422 -271
- package/dist/fesm5/index.js +178 -48
- package/dist/npm/cards/hero-card.component.js +1 -1
- package/dist/npm/chat/attachment.component.js +1 -1
- package/dist/npm/chat/chat.component.js +35 -38
- package/dist/npm/chat/chat.directives.js +2 -0
- package/dist/npm/chat/chat.module.js +6 -2
- package/dist/npm/chat/message-attachments.component.js +1 -1
- package/dist/npm/chat/message-box.component.js +126 -0
- package/dist/npm/chat/message-box.directive.js +26 -0
- package/dist/npm/chat/message-list.component.js +1 -1
- package/dist/npm/chat/message.component.js +1 -1
- package/dist/npm/chat/suggested-actions.component.js +1 -1
- package/dist/npm/common/focused-state.directive.js +1 -1
- package/dist/npm/common/models/message-box-options.js +6 -0
- package/dist/npm/index.js +2 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-conversational-ui.js +1 -1
- package/package.json +8 -6
package/dist/fesm2015/index.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
6
|
-
import { Directive, Optional, TemplateRef, EventEmitter,
|
|
6
|
+
import { Directive, Optional, TemplateRef, EventEmitter, HostBinding, ViewChild, ElementRef, Input, Output, Component, isDevMode, ContentChild, NgZone, forwardRef, HostListener, ViewChildren, QueryList, Renderer2, NgModule } from '@angular/core';
|
|
7
7
|
import { LocalizationService, L10N_PREFIX, ComponentMessages } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
9
|
+
import { Keys, ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
9
10
|
import { ButtonModule } from '@progress/kendo-angular-buttons';
|
|
10
11
|
import { CommonModule } from '@angular/common';
|
|
11
|
-
import { ResizeSensorModule } from '@progress/kendo-angular-common';
|
|
12
12
|
import { fromEvent } from 'rxjs';
|
|
13
13
|
import { debounceTime } from 'rxjs/operators';
|
|
14
14
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
@@ -105,13 +105,175 @@ const packageMetadata = {
|
|
|
105
105
|
name: '@progress/kendo-angular-conversational-ui',
|
|
106
106
|
productName: 'Kendo UI for Angular',
|
|
107
107
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
108
|
-
publishDate:
|
|
108
|
+
publishDate: 1649323827,
|
|
109
109
|
version: '',
|
|
110
110
|
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'
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Creates a message box area that overrides the default message box of the Conversational UI Component.
|
|
115
|
+
* To define a message-box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag
|
|
116
|
+
* [see example]({% slug message_box %}#toc-message-box-template).
|
|
117
|
+
*/
|
|
118
|
+
let ChatMessageBoxTemplateDirective = class ChatMessageBoxTemplateDirective {
|
|
119
|
+
constructor(templateRef) {
|
|
120
|
+
this.templateRef = templateRef;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
ChatMessageBoxTemplateDirective = __decorate([
|
|
124
|
+
Directive({
|
|
125
|
+
selector: '[kendoChatMessageBoxTemplate]'
|
|
126
|
+
}),
|
|
127
|
+
__metadata("design:paramtypes", [TemplateRef])
|
|
128
|
+
], ChatMessageBoxTemplateDirective);
|
|
129
|
+
|
|
113
130
|
// tslint:disable-next-line:max-line-length
|
|
114
131
|
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>';
|
|
132
|
+
/**
|
|
133
|
+
* @hidden
|
|
134
|
+
*/
|
|
135
|
+
let MessageBoxComponent = class MessageBoxComponent {
|
|
136
|
+
/**
|
|
137
|
+
* @hidden
|
|
138
|
+
*/
|
|
139
|
+
constructor() {
|
|
140
|
+
this.hostClasses = 'k-message-box k-input k-input-md k-rounded-md k-input-solid';
|
|
141
|
+
this.sendMessage = new EventEmitter();
|
|
142
|
+
}
|
|
143
|
+
get messageBoxValue() {
|
|
144
|
+
return this.type === 'textarea';
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* @hidden
|
|
148
|
+
*/
|
|
149
|
+
sendClick() {
|
|
150
|
+
const input = this.messageBoxInput.nativeElement;
|
|
151
|
+
const value = input.value;
|
|
152
|
+
if (!value) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const message = {
|
|
156
|
+
author: this.user,
|
|
157
|
+
text: value,
|
|
158
|
+
timestamp: new Date()
|
|
159
|
+
};
|
|
160
|
+
this.sendMessage.emit(new SendMessageEvent(message));
|
|
161
|
+
input.value = null;
|
|
162
|
+
input.focus();
|
|
163
|
+
this.autoScroll = true;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @hidden
|
|
167
|
+
*/
|
|
168
|
+
inputKeydown(e) {
|
|
169
|
+
if (e.keyCode === Keys.Enter) {
|
|
170
|
+
this.sendClick();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* @hidden
|
|
175
|
+
*/
|
|
176
|
+
textAreaKeydown(e) {
|
|
177
|
+
const isEnter = e.keyCode === Keys.Enter;
|
|
178
|
+
if (!isEnter) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const newLine = (e.metaKey || e.ctrlKey);
|
|
182
|
+
const enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
|
|
183
|
+
if (enterOnly) {
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
this.sendClick();
|
|
186
|
+
}
|
|
187
|
+
if (newLine) {
|
|
188
|
+
this.messageBoxInput.nativeElement.value += `\r\n`;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @hidden
|
|
193
|
+
*/
|
|
194
|
+
textFor(key) {
|
|
195
|
+
return this.localization.get(key);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
__decorate([
|
|
199
|
+
HostBinding('class'),
|
|
200
|
+
__metadata("design:type", String)
|
|
201
|
+
], MessageBoxComponent.prototype, "hostClasses", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
HostBinding('class.\!k-align-items-end'),
|
|
204
|
+
__metadata("design:type", Boolean),
|
|
205
|
+
__metadata("design:paramtypes", [])
|
|
206
|
+
], MessageBoxComponent.prototype, "messageBoxValue", null);
|
|
207
|
+
__decorate([
|
|
208
|
+
ViewChild('messageBoxInput', { static: false }),
|
|
209
|
+
__metadata("design:type", ElementRef)
|
|
210
|
+
], MessageBoxComponent.prototype, "messageBoxInput", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
Input(),
|
|
213
|
+
__metadata("design:type", Object)
|
|
214
|
+
], MessageBoxComponent.prototype, "user", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
Input(),
|
|
217
|
+
__metadata("design:type", Boolean)
|
|
218
|
+
], MessageBoxComponent.prototype, "autoScroll", void 0);
|
|
219
|
+
__decorate([
|
|
220
|
+
Input(),
|
|
221
|
+
__metadata("design:type", String)
|
|
222
|
+
], MessageBoxComponent.prototype, "type", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
Input(),
|
|
225
|
+
__metadata("design:type", LocalizationService)
|
|
226
|
+
], MessageBoxComponent.prototype, "localization", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
Input(),
|
|
229
|
+
__metadata("design:type", ChatMessageBoxTemplateDirective)
|
|
230
|
+
], MessageBoxComponent.prototype, "messageBoxTemplate", void 0);
|
|
231
|
+
__decorate([
|
|
232
|
+
Output(),
|
|
233
|
+
__metadata("design:type", EventEmitter)
|
|
234
|
+
], MessageBoxComponent.prototype, "sendMessage", void 0);
|
|
235
|
+
MessageBoxComponent = __decorate([
|
|
236
|
+
Component({
|
|
237
|
+
selector: 'kendo-message-box',
|
|
238
|
+
template: `
|
|
239
|
+
<ng-container *ngIf="!messageBoxTemplate">
|
|
240
|
+
<input
|
|
241
|
+
*ngIf="type === 'textbox'"
|
|
242
|
+
#messageBoxInput
|
|
243
|
+
kendoChatFocusedState
|
|
244
|
+
type="text"
|
|
245
|
+
class="k-textbox k-input k-input-md k-input-solid"
|
|
246
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
247
|
+
(keydown)="inputKeydown($event)"
|
|
248
|
+
/>
|
|
249
|
+
|
|
250
|
+
<textarea
|
|
251
|
+
*ngIf="type === 'textarea'"
|
|
252
|
+
#messageBoxInput
|
|
253
|
+
kendoChatFocusedState
|
|
254
|
+
[rows]="3"
|
|
255
|
+
class="k-textarea k-input k-input-md k-input-solid !k-overflow-y-auto k-resize-none"
|
|
256
|
+
[placeholder]="textFor('messagePlaceholder')"
|
|
257
|
+
(keydown)="textAreaKeydown($event)"
|
|
258
|
+
></textarea>
|
|
259
|
+
|
|
260
|
+
<button
|
|
261
|
+
kendoButton
|
|
262
|
+
fillMode="flat"
|
|
263
|
+
class="k-button-send"
|
|
264
|
+
[tabindex]="0"
|
|
265
|
+
[attr.title]="textFor('send')"
|
|
266
|
+
(click)="sendClick()"
|
|
267
|
+
>
|
|
268
|
+
${sendIcon}
|
|
269
|
+
</button>
|
|
270
|
+
</ng-container>
|
|
271
|
+
|
|
272
|
+
<ng-template *ngIf="messageBoxTemplate" [ngTemplateOutlet]="messageBoxTemplate?.templateRef"></ng-template>
|
|
273
|
+
`
|
|
274
|
+
})
|
|
275
|
+
], MessageBoxComponent);
|
|
276
|
+
|
|
115
277
|
/**
|
|
116
278
|
* Represents the Kendo UI Chat component for Angular.
|
|
117
279
|
*
|
|
@@ -126,6 +288,12 @@ let ChatComponent = class ChatComponent {
|
|
|
126
288
|
constructor(localization, zone) {
|
|
127
289
|
this.localization = localization;
|
|
128
290
|
this.zone = zone;
|
|
291
|
+
/**
|
|
292
|
+
* Used to switch between a one-liner input or a textarea.
|
|
293
|
+
* ([see example]({% slug message_box %})#toc-message-box-types).
|
|
294
|
+
* @default input
|
|
295
|
+
*/
|
|
296
|
+
this.messageBoxType = 'textbox';
|
|
129
297
|
/**
|
|
130
298
|
* Fires when the user types a message and clicks the **Send** button or presses **Enter**.
|
|
131
299
|
* Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
|
|
@@ -152,11 +320,17 @@ let ChatComponent = class ChatComponent {
|
|
|
152
320
|
});
|
|
153
321
|
}
|
|
154
322
|
get className() {
|
|
155
|
-
return 'k-
|
|
323
|
+
return 'k-chat';
|
|
156
324
|
}
|
|
157
325
|
get dirAttr() {
|
|
158
326
|
return this.direction;
|
|
159
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* @hidden
|
|
330
|
+
*/
|
|
331
|
+
get localizationText() {
|
|
332
|
+
return this.localization;
|
|
333
|
+
}
|
|
160
334
|
ngOnChanges() {
|
|
161
335
|
this.zone.runOutsideAngular(() => setTimeout(() => {
|
|
162
336
|
this.messageList.nativeElement.style.flex = '1 1 auto';
|
|
@@ -175,33 +349,6 @@ let ChatComponent = class ChatComponent {
|
|
|
175
349
|
this.localizationChangeSubscription.unsubscribe();
|
|
176
350
|
}
|
|
177
351
|
}
|
|
178
|
-
/**
|
|
179
|
-
* @hidden
|
|
180
|
-
*/
|
|
181
|
-
sendClick() {
|
|
182
|
-
const input = this.messageInput.nativeElement;
|
|
183
|
-
const value = input.value;
|
|
184
|
-
if (!value) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const message = {
|
|
188
|
-
author: this.user,
|
|
189
|
-
text: value,
|
|
190
|
-
timestamp: new Date()
|
|
191
|
-
};
|
|
192
|
-
this.sendMessage.emit(new SendMessageEvent(message));
|
|
193
|
-
input.value = null;
|
|
194
|
-
input.focus();
|
|
195
|
-
this.autoScroll = true;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* @hidden
|
|
199
|
-
*/
|
|
200
|
-
inputKeydown(e) {
|
|
201
|
-
if (e.keyCode === 13 /* enter */) {
|
|
202
|
-
this.sendClick();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
352
|
/**
|
|
206
353
|
* @hidden
|
|
207
354
|
*/
|
|
@@ -210,7 +357,9 @@ let ChatComponent = class ChatComponent {
|
|
|
210
357
|
if (!e.isDefaultPrevented()) {
|
|
211
358
|
const handler = makeHandler(e.action);
|
|
212
359
|
handler(e.action, this);
|
|
213
|
-
this.
|
|
360
|
+
if (!this.messageBoxTemplate) {
|
|
361
|
+
this.messageBox.messageBoxInput.nativeElement.focus();
|
|
362
|
+
}
|
|
214
363
|
}
|
|
215
364
|
}
|
|
216
365
|
/**
|
|
@@ -228,6 +377,10 @@ __decorate([
|
|
|
228
377
|
Input(),
|
|
229
378
|
__metadata("design:type", Object)
|
|
230
379
|
], ChatComponent.prototype, "user", void 0);
|
|
380
|
+
__decorate([
|
|
381
|
+
Input(),
|
|
382
|
+
__metadata("design:type", String)
|
|
383
|
+
], ChatComponent.prototype, "messageBoxType", void 0);
|
|
231
384
|
__decorate([
|
|
232
385
|
Output(),
|
|
233
386
|
__metadata("design:type", EventEmitter)
|
|
@@ -255,9 +408,13 @@ __decorate([
|
|
|
255
408
|
__metadata("design:type", MessageTemplateDirective)
|
|
256
409
|
], ChatComponent.prototype, "messageTemplate", void 0);
|
|
257
410
|
__decorate([
|
|
258
|
-
|
|
259
|
-
__metadata("design:type",
|
|
260
|
-
], ChatComponent.prototype, "
|
|
411
|
+
ContentChild(ChatMessageBoxTemplateDirective, { static: false }),
|
|
412
|
+
__metadata("design:type", ChatMessageBoxTemplateDirective)
|
|
413
|
+
], ChatComponent.prototype, "messageBoxTemplate", void 0);
|
|
414
|
+
__decorate([
|
|
415
|
+
ViewChild('messageBox', { static: false }),
|
|
416
|
+
__metadata("design:type", MessageBoxComponent)
|
|
417
|
+
], ChatComponent.prototype, "messageBox", void 0);
|
|
261
418
|
__decorate([
|
|
262
419
|
ViewChild('messageList', { static: true }),
|
|
263
420
|
__metadata("design:type", ElementRef)
|
|
@@ -273,58 +430,48 @@ ChatComponent = __decorate([
|
|
|
273
430
|
],
|
|
274
431
|
selector: 'kendo-chat',
|
|
275
432
|
template: `
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
433
|
+
<ng-container
|
|
434
|
+
kendoChatLocalizedMessages
|
|
435
|
+
i18n-messagePlaceholder="kendo.chat.messagePlaceholder|The placholder text of the message text input"
|
|
436
|
+
messagePlaceholder="Type a message..."
|
|
280
437
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
438
|
+
i18n-send="kendo.chat.send|The text for the Send button"
|
|
439
|
+
send="Send..."
|
|
440
|
+
>
|
|
441
|
+
</ng-container>
|
|
285
442
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
443
|
+
<div
|
|
444
|
+
#messageList
|
|
445
|
+
class="k-message-list k-avatars"
|
|
446
|
+
aria-live="polite" role="log"
|
|
447
|
+
kendoChatScrollAnchor
|
|
448
|
+
#anchor="scrollAnchor"
|
|
449
|
+
[(autoScroll)]="autoScroll"
|
|
450
|
+
>
|
|
451
|
+
<kendo-chat-message-list
|
|
452
|
+
[messages]="messages"
|
|
453
|
+
[messageTemplate]="messageTemplate"
|
|
454
|
+
[attachmentTemplate]="attachmentTemplate"
|
|
455
|
+
[user]="user"
|
|
456
|
+
(executeAction)="dispatchAction($event)"
|
|
457
|
+
(resize)="anchor.scrollToBottom()"
|
|
458
|
+
(navigate)="this.autoScroll = false"
|
|
459
|
+
>
|
|
460
|
+
</kendo-chat-message-list>
|
|
461
|
+
</div>
|
|
462
|
+
<kendo-message-box
|
|
463
|
+
#messageBox
|
|
464
|
+
[messageBoxTemplate]="messageBoxTemplate"
|
|
465
|
+
[type]="messageBoxType"
|
|
298
466
|
[user]="user"
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
<div class="k-message-box">
|
|
307
|
-
<input
|
|
308
|
-
#messageInput
|
|
309
|
-
kendoChatFocusedState
|
|
310
|
-
type="text"
|
|
311
|
-
class="k-input"
|
|
312
|
-
[placeholder]="textFor('messagePlaceholder')"
|
|
313
|
-
(keydown)="inputKeydown($event)"
|
|
314
|
-
>
|
|
315
|
-
<button
|
|
316
|
-
kendoButton
|
|
317
|
-
fillMode="flat"
|
|
318
|
-
class="k-button-send"
|
|
319
|
-
tabindex="-1"
|
|
320
|
-
[attr.title]="textFor('send')"
|
|
321
|
-
(click)="sendClick()"
|
|
322
|
-
>${sendIcon}</button>
|
|
323
|
-
</div>
|
|
324
|
-
`
|
|
467
|
+
[autoScroll]="autoScroll"
|
|
468
|
+
[localization]="localizationText"
|
|
469
|
+
(sendMessage)="sendMessage.emit($event)"
|
|
470
|
+
>
|
|
471
|
+
</kendo-message-box>
|
|
472
|
+
`
|
|
325
473
|
}),
|
|
326
|
-
__metadata("design:paramtypes", [LocalizationService,
|
|
327
|
-
NgZone])
|
|
474
|
+
__metadata("design:paramtypes", [LocalizationService, NgZone])
|
|
328
475
|
], ChatComponent);
|
|
329
476
|
|
|
330
477
|
/**
|
|
@@ -363,26 +510,26 @@ AttachmentComponent = __decorate([
|
|
|
363
510
|
Component({
|
|
364
511
|
selector: 'kendo-chat-attachment',
|
|
365
512
|
template: `
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
</ng-container>
|
|
370
|
-
|
|
371
|
-
<div *ngIf="!template" class="k-card">
|
|
372
|
-
<div class="k-card-body">
|
|
373
|
-
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
374
|
-
{{ attachment.title }}
|
|
375
|
-
</h5>
|
|
376
|
-
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
377
|
-
{{ attachment.subtitle }}
|
|
378
|
-
</h6>
|
|
379
|
-
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
380
|
-
<ng-container *ngIf="unknown">
|
|
381
|
-
{{ attachment.content }}
|
|
513
|
+
<ng-container *ngIf="template">
|
|
514
|
+
<ng-container *ngTemplateOutlet="template.templateRef; context: context;">
|
|
515
|
+
</ng-container>
|
|
382
516
|
</ng-container>
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
517
|
+
|
|
518
|
+
<div *ngIf="!template" class="k-card">
|
|
519
|
+
<div class="k-card-body">
|
|
520
|
+
<h5 class="k-card-title" *ngIf="attachment.title">
|
|
521
|
+
{{ attachment.title }}
|
|
522
|
+
</h5>
|
|
523
|
+
<h6 class="k-card-subtitle" *ngIf="attachment.subtitle">
|
|
524
|
+
{{ attachment.subtitle }}
|
|
525
|
+
</h6>
|
|
526
|
+
<img *ngIf="image" [attr.src]="attachment.content" />
|
|
527
|
+
<ng-container *ngIf="unknown">
|
|
528
|
+
{{ attachment.content }}
|
|
529
|
+
</ng-container>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
`
|
|
386
533
|
})
|
|
387
534
|
], AttachmentComponent);
|
|
388
535
|
|
|
@@ -447,7 +594,7 @@ let FocusedStateDirective = class FocusedStateDirective {
|
|
|
447
594
|
}
|
|
448
595
|
};
|
|
449
596
|
__decorate([
|
|
450
|
-
HostBinding('class.k-
|
|
597
|
+
HostBinding('class.k-focus'),
|
|
451
598
|
__metadata("design:type", Boolean)
|
|
452
599
|
], FocusedStateDirective.prototype, "focused", void 0);
|
|
453
600
|
__decorate([
|
|
@@ -516,27 +663,28 @@ HeroCardComponent = __decorate([
|
|
|
516
663
|
Component({
|
|
517
664
|
selector: 'kendo-chat-hero-card',
|
|
518
665
|
template: `
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
666
|
+
<img class="k-card-image" [src]="imageUrl" *ngIf="imageUrl" />
|
|
667
|
+
<div class="k-card-body">
|
|
668
|
+
<h5 class="k-card-title" *ngIf="title">
|
|
669
|
+
{{ title }}
|
|
670
|
+
</h5>
|
|
671
|
+
<h6 class="k-card-subtitle" *ngIf="subtitle">
|
|
672
|
+
{{ subtitle }}
|
|
673
|
+
</h6>
|
|
674
|
+
</div>
|
|
675
|
+
<div class="k-card-actions k-card-actions-vertical">
|
|
676
|
+
<span class="k-card-action"
|
|
677
|
+
*ngFor="let act of actions"
|
|
678
|
+
>
|
|
679
|
+
<button
|
|
680
|
+
kendoButton fillMode="flat"
|
|
681
|
+
(click)="onClick(act)"
|
|
682
|
+
>
|
|
683
|
+
{{ act.title }}
|
|
684
|
+
</button>
|
|
685
|
+
</span>
|
|
686
|
+
</div>
|
|
687
|
+
`
|
|
540
688
|
})
|
|
541
689
|
], HeroCardComponent);
|
|
542
690
|
|
|
@@ -693,37 +841,37 @@ MessageAttachmentsComponent = MessageAttachmentsComponent_1 = __decorate([
|
|
|
693
841
|
}],
|
|
694
842
|
selector: 'kendo-chat-message-attachments',
|
|
695
843
|
template: `
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
844
|
+
<button
|
|
845
|
+
*ngIf="carousel && scrollPosition > 0"
|
|
846
|
+
(click)="scrollTo(-1)"
|
|
847
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
848
|
+
tabindex="-1">
|
|
849
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-left"></span>
|
|
850
|
+
</button>
|
|
851
|
+
<div #deck [class.k-card-deck]="carousel">
|
|
852
|
+
<kendo-chat-attachment #item
|
|
853
|
+
*ngFor="let att of attachments; index as index; first as first; last as last"
|
|
854
|
+
[attachment]="att"
|
|
855
|
+
[template]="template"
|
|
856
|
+
[class.k-state-selected]="isSelected(index)"
|
|
857
|
+
[class.k-state-focused]="isSelected(index)"
|
|
858
|
+
[class.k-card-wrap]="true"
|
|
859
|
+
[class.k-first]="first"
|
|
860
|
+
[class.k-last]="last"
|
|
861
|
+
[attr.tabindex]="tabbable && isSelected(index) ? '0' : '-1'"
|
|
862
|
+
(click)="itemClick(index)"
|
|
863
|
+
(keydown)="itemKeydown($event, att)"
|
|
864
|
+
>
|
|
865
|
+
</kendo-chat-attachment>
|
|
866
|
+
</div>
|
|
867
|
+
<button
|
|
868
|
+
*ngIf="carousel && scrollPosition < 1"
|
|
869
|
+
(click)="scrollTo(1)"
|
|
870
|
+
class="k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base"
|
|
871
|
+
tabindex="-1">
|
|
872
|
+
<span class="k-icon k-button-icon k-i-arrow-chevron-right"></span>
|
|
873
|
+
</button>
|
|
874
|
+
`
|
|
727
875
|
}),
|
|
728
876
|
__metadata("design:paramtypes", [NgZone])
|
|
729
877
|
], MessageAttachmentsComponent);
|
|
@@ -784,44 +932,44 @@ MessageComponent = MessageComponent_1 = __decorate([
|
|
|
784
932
|
useExisting: forwardRef(() => MessageComponent_1)
|
|
785
933
|
}],
|
|
786
934
|
template: `
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
>
|
|
792
|
-
{{ formatTimeStamp(message.timestamp) }}
|
|
793
|
-
</time>
|
|
794
|
-
|
|
795
|
-
<ng-container *ngIf="!message.typing; else typing">
|
|
796
|
-
<div class="k-bubble" *ngIf="template">
|
|
797
|
-
<ng-container
|
|
798
|
-
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
935
|
+
<time
|
|
936
|
+
[attr.aria-hidden]="!selected"
|
|
937
|
+
class="k-message-time"
|
|
938
|
+
*ngIf="message.timestamp"
|
|
799
939
|
>
|
|
800
|
-
|
|
801
|
-
|
|
940
|
+
{{ formatTimeStamp(message.timestamp) }}
|
|
941
|
+
</time>
|
|
802
942
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
943
|
+
<ng-container *ngIf="!message.typing; else typing">
|
|
944
|
+
<div class="k-bubble" *ngIf="template">
|
|
945
|
+
<ng-container
|
|
946
|
+
*ngTemplateOutlet="template.templateRef; context: { $implicit: message };"
|
|
947
|
+
>
|
|
948
|
+
</ng-container>
|
|
949
|
+
</div>
|
|
950
|
+
|
|
951
|
+
<div class="k-bubble" *ngIf="!template && message.text">
|
|
952
|
+
{{message.text}}
|
|
953
|
+
</div>
|
|
954
|
+
</ng-container>
|
|
807
955
|
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
956
|
+
<span
|
|
957
|
+
class="k-message-status"
|
|
958
|
+
*ngIf="message.status"
|
|
959
|
+
>
|
|
960
|
+
{{ message.status }}
|
|
961
|
+
</span>
|
|
814
962
|
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
963
|
+
<ng-template #typing>
|
|
964
|
+
<div class="k-bubble">
|
|
965
|
+
<div class="k-typing-indicator">
|
|
966
|
+
<span></span>
|
|
967
|
+
<span></span>
|
|
968
|
+
<span></span>
|
|
969
|
+
</div>
|
|
821
970
|
</div>
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
`
|
|
971
|
+
</ng-template>
|
|
972
|
+
`
|
|
825
973
|
}),
|
|
826
974
|
__metadata("design:paramtypes", [ElementRef, IntlService])
|
|
827
975
|
], MessageComponent);
|
|
@@ -1094,76 +1242,76 @@ MessageListComponent = __decorate([
|
|
|
1094
1242
|
Component({
|
|
1095
1243
|
selector: 'kendo-chat-message-list',
|
|
1096
1244
|
template: `
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
>
|
|
1120
|
-
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
1121
|
-
<kendo-chat-message #message
|
|
1122
|
-
[message]="msg"
|
|
1123
|
-
[tabbable]="lastGroup && lastMessage"
|
|
1124
|
-
[template]="messageTemplate"
|
|
1125
|
-
(click)="select(message)"
|
|
1126
|
-
(focus)="select(message)"
|
|
1127
|
-
[class.k-only]="group.messages.length === 1"
|
|
1128
|
-
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
1129
|
-
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
1245
|
+
<ng-container *ngFor="let group of view; last as lastGroup; trackBy: trackGroup">
|
|
1246
|
+
<ng-container [ngSwitch]="group.type">
|
|
1247
|
+
<div
|
|
1248
|
+
*ngSwitchCase="'date-marker'"
|
|
1249
|
+
class="k-timestamp"
|
|
1250
|
+
>
|
|
1251
|
+
{{ formatTimeStamp(group.timestamp) }}
|
|
1252
|
+
</div>
|
|
1253
|
+
<div
|
|
1254
|
+
*ngSwitchCase="'message-group'"
|
|
1255
|
+
class="k-message-group"
|
|
1256
|
+
[class.k-alt]="isOwnMessage(group.messages[0])"
|
|
1257
|
+
[class.k-no-avatar]="!group.author.avatarUrl"
|
|
1258
|
+
>
|
|
1259
|
+
<img
|
|
1260
|
+
*ngIf="group.author.avatarUrl"
|
|
1261
|
+
[attr.src]="group.author.avatarUrl"
|
|
1262
|
+
class="k-avatar"
|
|
1263
|
+
/>
|
|
1264
|
+
<p *ngIf="group.author.name" class="k-author">{{ group.author.name }}</p>
|
|
1265
|
+
<ng-container
|
|
1266
|
+
*ngFor="let msg of group.messages; first as firstMessage; last as lastMessage"
|
|
1130
1267
|
>
|
|
1131
|
-
|
|
1268
|
+
<img *ngIf="msg.user?.avatarUrl" [src]="msg.user?.avatarUrl" class="k-avatar">
|
|
1269
|
+
<kendo-chat-message #message
|
|
1270
|
+
[message]="msg"
|
|
1271
|
+
[tabbable]="lastGroup && lastMessage"
|
|
1272
|
+
[template]="messageTemplate"
|
|
1273
|
+
(click)="select(message)"
|
|
1274
|
+
(focus)="select(message)"
|
|
1275
|
+
[class.k-only]="group.messages.length === 1"
|
|
1276
|
+
[class.k-first]="group.messages.length > 1 && firstMessage"
|
|
1277
|
+
[class.k-last]="group.messages.length > 1 && lastMessage"
|
|
1278
|
+
>
|
|
1279
|
+
</kendo-chat-message>
|
|
1132
1280
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1281
|
+
<kendo-chat-attachment
|
|
1282
|
+
*ngIf="msg.attachments && msg.attachments.length === 1"
|
|
1283
|
+
[attachment]="msg.attachments[0]"
|
|
1284
|
+
[template]="attachmentTemplate"
|
|
1285
|
+
>
|
|
1286
|
+
</kendo-chat-attachment>
|
|
1287
|
+
</ng-container>
|
|
1288
|
+
</div>
|
|
1141
1289
|
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1290
|
+
<kendo-chat-message-attachments #attachments
|
|
1291
|
+
*ngSwitchCase="'attachment-group'"
|
|
1292
|
+
[attachments]="group.attachments"
|
|
1293
|
+
[layout]="group.attachmentLayout"
|
|
1294
|
+
[tabbable]="lastGroup"
|
|
1295
|
+
[template]="attachmentTemplate"
|
|
1296
|
+
(click)="select(attachments)"
|
|
1297
|
+
(focus)="select(attachments)"
|
|
1298
|
+
>
|
|
1299
|
+
</kendo-chat-message-attachments>
|
|
1152
1300
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1301
|
+
<kendo-chat-suggested-actions #actions
|
|
1302
|
+
*ngSwitchCase="'action-group'"
|
|
1303
|
+
[actions]="group.actions"
|
|
1304
|
+
[tabbable]="lastGroup"
|
|
1305
|
+
(dispatch)="dispatchAction($event, last(group.messages))"
|
|
1306
|
+
(click)="select(actions)"
|
|
1307
|
+
(focus)="select(actions)"
|
|
1308
|
+
>
|
|
1309
|
+
</kendo-chat-suggested-actions>
|
|
1310
|
+
</ng-container>
|
|
1311
|
+
</ng-container>
|
|
1312
|
+
<kendo-resize-sensor (resize)="onResize()">
|
|
1313
|
+
</kendo-resize-sensor>
|
|
1314
|
+
`
|
|
1167
1315
|
}),
|
|
1168
1316
|
__metadata("design:paramtypes", [ElementRef, IntlService])
|
|
1169
1317
|
], MessageListComponent);
|
|
@@ -1323,20 +1471,21 @@ SuggestedActionsComponent = SuggestedActionsComponent_1 = __decorate([
|
|
|
1323
1471
|
useExisting: forwardRef(() => SuggestedActionsComponent_1)
|
|
1324
1472
|
}],
|
|
1325
1473
|
template: `
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1474
|
+
<span
|
|
1475
|
+
#item
|
|
1476
|
+
*ngFor="let action of actions; index as index; first as first; last as last"
|
|
1477
|
+
class="k-quick-reply"
|
|
1478
|
+
[class.k-state-selected]="isSelected(index)"
|
|
1479
|
+
[class.k-state-focused]="isSelected(index)"
|
|
1480
|
+
[class.k-first]="first"
|
|
1481
|
+
[class.k-last]="last"
|
|
1482
|
+
[attr.tabindex]="tabbable && selectedIndex === index ? '0' : '-1'"
|
|
1483
|
+
(click)="actionClick(action)"
|
|
1484
|
+
(keydown)="actionKeydown($event, action)"
|
|
1485
|
+
>
|
|
1486
|
+
{{ action.title || action.value }}
|
|
1487
|
+
</span>
|
|
1488
|
+
`
|
|
1340
1489
|
})
|
|
1341
1490
|
], SuggestedActionsComponent);
|
|
1342
1491
|
|
|
@@ -1345,7 +1494,8 @@ const PUBLIC_DIRECTIVES = [
|
|
|
1345
1494
|
CustomMessagesComponent,
|
|
1346
1495
|
AttachmentTemplateDirective,
|
|
1347
1496
|
MessageTemplateDirective,
|
|
1348
|
-
HeroCardComponent
|
|
1497
|
+
HeroCardComponent,
|
|
1498
|
+
ChatMessageBoxTemplateDirective
|
|
1349
1499
|
];
|
|
1350
1500
|
const PRIVATE_DIRECTIVES = [
|
|
1351
1501
|
AttachmentComponent,
|
|
@@ -1356,7 +1506,8 @@ const PRIVATE_DIRECTIVES = [
|
|
|
1356
1506
|
MessageListComponent,
|
|
1357
1507
|
MessageTemplateDirective,
|
|
1358
1508
|
ScrollAnchorDirective,
|
|
1359
|
-
SuggestedActionsComponent
|
|
1509
|
+
SuggestedActionsComponent,
|
|
1510
|
+
MessageBoxComponent
|
|
1360
1511
|
];
|
|
1361
1512
|
/**
|
|
1362
1513
|
* The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
|
|
@@ -1400,4 +1551,4 @@ ChatModule = __decorate([
|
|
|
1400
1551
|
* Generated bundle index. Do not edit.
|
|
1401
1552
|
*/
|
|
1402
1553
|
|
|
1403
|
-
export { PreventableEvent, HeroCardComponent, AttachmentComponent, ChatItem, CustomMessagesComponent, LocalizedMessagesDirective, Messages, MessageAttachmentsComponent, MessageListComponent, MessageComponent, SuggestedActionsComponent, FocusedStateDirective, ScrollAnchorDirective, ChatComponent, AttachmentTemplateDirective, MessageTemplateDirective, ChatModule, ExecuteActionEvent, SendMessageEvent };
|
|
1554
|
+
export { PreventableEvent, HeroCardComponent, AttachmentComponent, ChatItem, CustomMessagesComponent, LocalizedMessagesDirective, Messages, MessageAttachmentsComponent, MessageBoxComponent, MessageListComponent, MessageComponent, SuggestedActionsComponent, FocusedStateDirective, ScrollAnchorDirective, ChatComponent, AttachmentTemplateDirective, MessageTemplateDirective, ChatMessageBoxTemplateDirective, ChatModule, ExecuteActionEvent, SendMessageEvent };
|