@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.
Files changed (59) hide show
  1. package/dist/cdn/js/kendo-angular-conversational-ui.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/cards/hero-card.component.js +1 -1
  4. package/dist/es/chat/attachment.component.js +1 -1
  5. package/dist/es/chat/chat.component.js +35 -38
  6. package/dist/es/chat/chat.directives.js +1 -0
  7. package/dist/es/chat/chat.module.js +6 -2
  8. package/dist/es/chat/message-attachments.component.js +1 -1
  9. package/dist/es/chat/message-box.component.js +124 -0
  10. package/dist/es/chat/message-box.directive.js +24 -0
  11. package/dist/es/chat/message-list.component.js +1 -1
  12. package/dist/es/chat/message.component.js +1 -1
  13. package/dist/es/chat/suggested-actions.component.js +1 -1
  14. package/dist/es/common/focused-state.directive.js +1 -1
  15. package/dist/es/common/models/message-box-options.js +4 -0
  16. package/dist/es/index.js +1 -0
  17. package/dist/es/package-metadata.js +1 -1
  18. package/dist/es2015/cards/hero-card.component.js +22 -21
  19. package/dist/es2015/chat/attachment.component.js +19 -19
  20. package/dist/es2015/chat/chat.component.d.ts +13 -10
  21. package/dist/es2015/chat/chat.component.js +67 -83
  22. package/dist/es2015/chat/chat.directives.d.ts +1 -0
  23. package/dist/es2015/chat/chat.directives.js +1 -0
  24. package/dist/es2015/chat/chat.module.js +6 -2
  25. package/dist/es2015/chat/message-attachments.component.js +31 -31
  26. package/dist/es2015/chat/message-box.component.d.ts +39 -0
  27. package/dist/es2015/chat/message-box.component.js +157 -0
  28. package/dist/es2015/chat/message-box.directive.d.ts +14 -0
  29. package/dist/es2015/chat/message-box.directive.js +23 -0
  30. package/dist/es2015/chat/message-list.component.js +66 -66
  31. package/dist/es2015/chat/message.component.js +33 -33
  32. package/dist/es2015/chat/suggested-actions.component.js +15 -14
  33. package/dist/es2015/common/focused-state.directive.js +1 -1
  34. package/dist/es2015/common/models/message-box-options.d.ts +8 -0
  35. package/dist/es2015/common/models/message-box-options.js +4 -0
  36. package/dist/es2015/index.d.ts +1 -0
  37. package/dist/es2015/index.js +1 -0
  38. package/dist/es2015/index.metadata.json +1 -1
  39. package/dist/es2015/main.d.ts +1 -0
  40. package/dist/es2015/package-metadata.js +1 -1
  41. package/dist/fesm2015/index.js +422 -271
  42. package/dist/fesm5/index.js +178 -48
  43. package/dist/npm/cards/hero-card.component.js +1 -1
  44. package/dist/npm/chat/attachment.component.js +1 -1
  45. package/dist/npm/chat/chat.component.js +35 -38
  46. package/dist/npm/chat/chat.directives.js +2 -0
  47. package/dist/npm/chat/chat.module.js +6 -2
  48. package/dist/npm/chat/message-attachments.component.js +1 -1
  49. package/dist/npm/chat/message-box.component.js +126 -0
  50. package/dist/npm/chat/message-box.directive.js +26 -0
  51. package/dist/npm/chat/message-list.component.js +1 -1
  52. package/dist/npm/chat/message.component.js +1 -1
  53. package/dist/npm/chat/suggested-actions.component.js +1 -1
  54. package/dist/npm/common/focused-state.directive.js +1 -1
  55. package/dist/npm/common/models/message-box-options.js +6 -0
  56. package/dist/npm/index.js +2 -0
  57. package/dist/npm/package-metadata.js +1 -1
  58. package/dist/systemjs/kendo-angular-conversational-ui.js +1 -1
  59. package/package.json +8 -6
@@ -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, __extends } from 'tslib';
6
- import { Directive, Optional, TemplateRef, isDevMode, Input, Output, EventEmitter, HostBinding, ContentChild, ViewChild, ElementRef, Component, NgZone, forwardRef, HostListener, ViewChildren, QueryList, Renderer2, NgModule } from '@angular/core';
6
+ import { Directive, Optional, TemplateRef, HostBinding, ViewChild, ElementRef, Input, Output, EventEmitter, 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';
@@ -108,13 +108,143 @@ var packageMetadata = {
108
108
  name: '@progress/kendo-angular-conversational-ui',
109
109
  productName: 'Kendo UI for Angular',
110
110
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
111
- publishDate: 1646820248,
111
+ publishDate: 1649323827,
112
112
  version: '',
113
113
  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'
114
114
  };
115
115
 
116
+ /**
117
+ * Creates a message box area that overrides the default message box of the Conversational UI Component.
118
+ * To define a message-box template, nest an `<ng-template>` tag with the `kendoChatMessageBoxTemplate` directive inside the `<kendo-chat>` tag
119
+ * [see example]({% slug message_box %}#toc-message-box-template).
120
+ */
121
+ var ChatMessageBoxTemplateDirective = /** @class */ (function () {
122
+ function ChatMessageBoxTemplateDirective(templateRef) {
123
+ this.templateRef = templateRef;
124
+ }
125
+ ChatMessageBoxTemplateDirective = __decorate([
126
+ Directive({
127
+ selector: '[kendoChatMessageBoxTemplate]'
128
+ }),
129
+ __metadata("design:paramtypes", [TemplateRef])
130
+ ], ChatMessageBoxTemplateDirective);
131
+ return ChatMessageBoxTemplateDirective;
132
+ }());
133
+
116
134
  // tslint:disable-next-line:max-line-length
117
135
  var 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>';
136
+ /**
137
+ * @hidden
138
+ */
139
+ var MessageBoxComponent = /** @class */ (function () {
140
+ function MessageBoxComponent() {
141
+ this.hostClasses = 'k-message-box k-input k-input-md k-rounded-md k-input-solid';
142
+ this.sendMessage = new EventEmitter();
143
+ }
144
+ Object.defineProperty(MessageBoxComponent.prototype, "messageBoxValue", {
145
+ get: function () {
146
+ return this.type === 'textarea';
147
+ },
148
+ enumerable: true,
149
+ configurable: true
150
+ });
151
+ /**
152
+ * @hidden
153
+ */
154
+ MessageBoxComponent.prototype.sendClick = function () {
155
+ var input = this.messageBoxInput.nativeElement;
156
+ var value = input.value;
157
+ if (!value) {
158
+ return;
159
+ }
160
+ var message = {
161
+ author: this.user,
162
+ text: value,
163
+ timestamp: new Date()
164
+ };
165
+ this.sendMessage.emit(new SendMessageEvent(message));
166
+ input.value = null;
167
+ input.focus();
168
+ this.autoScroll = true;
169
+ };
170
+ /**
171
+ * @hidden
172
+ */
173
+ MessageBoxComponent.prototype.inputKeydown = function (e) {
174
+ if (e.keyCode === Keys.Enter) {
175
+ this.sendClick();
176
+ }
177
+ };
178
+ /**
179
+ * @hidden
180
+ */
181
+ MessageBoxComponent.prototype.textAreaKeydown = function (e) {
182
+ var isEnter = e.keyCode === Keys.Enter;
183
+ if (!isEnter) {
184
+ return;
185
+ }
186
+ var newLine = (e.metaKey || e.ctrlKey);
187
+ var enterOnly = !(e.shiftKey || e.metaKey || e.ctrlKey);
188
+ if (enterOnly) {
189
+ e.preventDefault();
190
+ this.sendClick();
191
+ }
192
+ if (newLine) {
193
+ this.messageBoxInput.nativeElement.value += "\r\n";
194
+ }
195
+ };
196
+ /**
197
+ * @hidden
198
+ */
199
+ MessageBoxComponent.prototype.textFor = function (key) {
200
+ return this.localization.get(key);
201
+ };
202
+ __decorate([
203
+ HostBinding('class'),
204
+ __metadata("design:type", String)
205
+ ], MessageBoxComponent.prototype, "hostClasses", void 0);
206
+ __decorate([
207
+ HostBinding('class.\!k-align-items-end'),
208
+ __metadata("design:type", Boolean),
209
+ __metadata("design:paramtypes", [])
210
+ ], MessageBoxComponent.prototype, "messageBoxValue", null);
211
+ __decorate([
212
+ ViewChild('messageBoxInput', { static: false }),
213
+ __metadata("design:type", ElementRef)
214
+ ], MessageBoxComponent.prototype, "messageBoxInput", void 0);
215
+ __decorate([
216
+ Input(),
217
+ __metadata("design:type", Object)
218
+ ], MessageBoxComponent.prototype, "user", void 0);
219
+ __decorate([
220
+ Input(),
221
+ __metadata("design:type", Boolean)
222
+ ], MessageBoxComponent.prototype, "autoScroll", void 0);
223
+ __decorate([
224
+ Input(),
225
+ __metadata("design:type", String)
226
+ ], MessageBoxComponent.prototype, "type", void 0);
227
+ __decorate([
228
+ Input(),
229
+ __metadata("design:type", LocalizationService)
230
+ ], MessageBoxComponent.prototype, "localization", void 0);
231
+ __decorate([
232
+ Input(),
233
+ __metadata("design:type", ChatMessageBoxTemplateDirective)
234
+ ], MessageBoxComponent.prototype, "messageBoxTemplate", void 0);
235
+ __decorate([
236
+ Output(),
237
+ __metadata("design:type", EventEmitter)
238
+ ], MessageBoxComponent.prototype, "sendMessage", void 0);
239
+ MessageBoxComponent = __decorate([
240
+ Component({
241
+ selector: 'kendo-message-box',
242
+ 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 " + sendIcon + "\n </button>\n </ng-container>\n\n <ng-template *ngIf=\"messageBoxTemplate\" [ngTemplateOutlet]=\"messageBoxTemplate?.templateRef\"></ng-template>\n"
243
+ })
244
+ ], MessageBoxComponent);
245
+ return MessageBoxComponent;
246
+ }());
247
+
118
248
  /**
119
249
  * Represents the Kendo UI Chat component for Angular.
120
250
  *
@@ -130,6 +260,12 @@ var ChatComponent = /** @class */ (function () {
130
260
  var _this = this;
131
261
  this.localization = localization;
132
262
  this.zone = zone;
263
+ /**
264
+ * Used to switch between a one-liner input or a textarea.
265
+ * ([see example]({% slug message_box %})#toc-message-box-types).
266
+ * @default input
267
+ */
268
+ this.messageBoxType = 'textbox';
133
269
  /**
134
270
  * Fires when the user types a message and clicks the **Send** button or presses **Enter**.
135
271
  * Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
@@ -158,7 +294,7 @@ var ChatComponent = /** @class */ (function () {
158
294
  }
159
295
  Object.defineProperty(ChatComponent.prototype, "className", {
160
296
  get: function () {
161
- return 'k-widget k-chat';
297
+ return 'k-chat';
162
298
  },
163
299
  enumerable: true,
164
300
  configurable: true
@@ -170,6 +306,16 @@ var ChatComponent = /** @class */ (function () {
170
306
  enumerable: true,
171
307
  configurable: true
172
308
  });
309
+ Object.defineProperty(ChatComponent.prototype, "localizationText", {
310
+ /**
311
+ * @hidden
312
+ */
313
+ get: function () {
314
+ return this.localization;
315
+ },
316
+ enumerable: true,
317
+ configurable: true
318
+ });
173
319
  ChatComponent.prototype.ngOnChanges = function () {
174
320
  var _this = this;
175
321
  this.zone.runOutsideAngular(function () { return setTimeout(function () {
@@ -189,33 +335,6 @@ var ChatComponent = /** @class */ (function () {
189
335
  this.localizationChangeSubscription.unsubscribe();
190
336
  }
191
337
  };
192
- /**
193
- * @hidden
194
- */
195
- ChatComponent.prototype.sendClick = function () {
196
- var input = this.messageInput.nativeElement;
197
- var value = input.value;
198
- if (!value) {
199
- return;
200
- }
201
- var message = {
202
- author: this.user,
203
- text: value,
204
- timestamp: new Date()
205
- };
206
- this.sendMessage.emit(new SendMessageEvent(message));
207
- input.value = null;
208
- input.focus();
209
- this.autoScroll = true;
210
- };
211
- /**
212
- * @hidden
213
- */
214
- ChatComponent.prototype.inputKeydown = function (e) {
215
- if (e.keyCode === 13 /* enter */) {
216
- this.sendClick();
217
- }
218
- };
219
338
  /**
220
339
  * @hidden
221
340
  */
@@ -224,7 +343,9 @@ var ChatComponent = /** @class */ (function () {
224
343
  if (!e.isDefaultPrevented()) {
225
344
  var handler = makeHandler(e.action);
226
345
  handler(e.action, this);
227
- this.messageInput.nativeElement.focus();
346
+ if (!this.messageBoxTemplate) {
347
+ this.messageBox.messageBoxInput.nativeElement.focus();
348
+ }
228
349
  }
229
350
  };
230
351
  /**
@@ -241,6 +362,10 @@ var ChatComponent = /** @class */ (function () {
241
362
  Input(),
242
363
  __metadata("design:type", Object)
243
364
  ], ChatComponent.prototype, "user", void 0);
365
+ __decorate([
366
+ Input(),
367
+ __metadata("design:type", String)
368
+ ], ChatComponent.prototype, "messageBoxType", void 0);
244
369
  __decorate([
245
370
  Output(),
246
371
  __metadata("design:type", EventEmitter)
@@ -268,9 +393,13 @@ var ChatComponent = /** @class */ (function () {
268
393
  __metadata("design:type", MessageTemplateDirective)
269
394
  ], ChatComponent.prototype, "messageTemplate", void 0);
270
395
  __decorate([
271
- ViewChild('messageInput', { static: true }),
272
- __metadata("design:type", ElementRef)
273
- ], ChatComponent.prototype, "messageInput", void 0);
396
+ ContentChild(ChatMessageBoxTemplateDirective, { static: false }),
397
+ __metadata("design:type", ChatMessageBoxTemplateDirective)
398
+ ], ChatComponent.prototype, "messageBoxTemplate", void 0);
399
+ __decorate([
400
+ ViewChild('messageBox', { static: false }),
401
+ __metadata("design:type", MessageBoxComponent)
402
+ ], ChatComponent.prototype, "messageBox", void 0);
274
403
  __decorate([
275
404
  ViewChild('messageList', { static: true }),
276
405
  __metadata("design:type", ElementRef)
@@ -285,10 +414,9 @@ var ChatComponent = /** @class */ (function () {
285
414
  }
286
415
  ],
287
416
  selector: 'kendo-chat',
288
- template: "\n <ng-container\n kendoChatLocalizedMessages\n i18n-messagePlaceholder=\"kendo.chat.messagePlaceholder|The placholder text of the message text input\"\n messagePlaceholder=\"Type a message...\"\n\n i18n-send=\"kendo.chat.send|The text for the Send button\"\n send=\"Send...\"\n >\n </ng-container>\n\n <div\n #messageList\n class=\"k-message-list k-avatars\"\n aria-live=\"polite\" role=\"log\"\n kendoChatScrollAnchor\n #anchor=\"scrollAnchor\"\n [(autoScroll)]=\"autoScroll\"\n >\n <kendo-chat-message-list\n [messages]=\"messages\"\n [messageTemplate]=\"messageTemplate\"\n [attachmentTemplate]=\"attachmentTemplate\"\n [user]=\"user\"\n (executeAction)=\"dispatchAction($event)\"\n (resize)=\"anchor.scrollToBottom()\"\n (navigate)=\"this.autoScroll = false\"\n >\n </kendo-chat-message-list>\n </div>\n\n <div class=\"k-message-box\">\n <input\n #messageInput\n kendoChatFocusedState\n type=\"text\"\n class=\"k-input\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"inputKeydown($event)\"\n >\n <button\n kendoButton\n fillMode=\"flat\"\n class=\"k-button-send\"\n tabindex=\"-1\"\n [attr.title]=\"textFor('send')\"\n (click)=\"sendClick()\"\n >" + sendIcon + "</button>\n </div>\n "
417
+ template: "\n <ng-container\n kendoChatLocalizedMessages\n i18n-messagePlaceholder=\"kendo.chat.messagePlaceholder|The placholder text of the message text input\"\n messagePlaceholder=\"Type a message...\"\n\n i18n-send=\"kendo.chat.send|The text for the Send button\"\n send=\"Send...\"\n >\n </ng-container>\n\n <div\n #messageList\n class=\"k-message-list k-avatars\"\n aria-live=\"polite\" role=\"log\"\n kendoChatScrollAnchor\n #anchor=\"scrollAnchor\"\n [(autoScroll)]=\"autoScroll\"\n >\n <kendo-chat-message-list\n [messages]=\"messages\"\n [messageTemplate]=\"messageTemplate\"\n [attachmentTemplate]=\"attachmentTemplate\"\n [user]=\"user\"\n (executeAction)=\"dispatchAction($event)\"\n (resize)=\"anchor.scrollToBottom()\"\n (navigate)=\"this.autoScroll = false\"\n >\n </kendo-chat-message-list>\n </div>\n <kendo-message-box\n #messageBox\n [messageBoxTemplate]=\"messageBoxTemplate\"\n [type]=\"messageBoxType\"\n [user]=\"user\"\n [autoScroll]=\"autoScroll\"\n [localization]=\"localizationText\"\n (sendMessage)=\"sendMessage.emit($event)\"\n >\n </kendo-message-box>\n "
289
418
  }),
290
- __metadata("design:paramtypes", [LocalizationService,
291
- NgZone])
419
+ __metadata("design:paramtypes", [LocalizationService, NgZone])
292
420
  ], ChatComponent);
293
421
  return ChatComponent;
294
422
  }());
@@ -345,7 +473,7 @@ var AttachmentComponent = /** @class */ (function () {
345
473
  AttachmentComponent = __decorate([
346
474
  Component({
347
475
  selector: 'kendo-chat-attachment',
348
- template: "\n <ng-container *ngIf=\"template\">\n <ng-container *ngTemplateOutlet=\"template.templateRef; context: context;\">\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"!template\" class=\"k-card\">\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"attachment.title\">\n {{ attachment.title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"attachment.subtitle\">\n {{ attachment.subtitle }}\n </h6>\n <img *ngIf=\"image\" [attr.src]=\"attachment.content\" />\n <ng-container *ngIf=\"unknown\">\n {{ attachment.content }}\n </ng-container>\n </div>\n </div>\n "
476
+ template: "\n <ng-container *ngIf=\"template\">\n <ng-container *ngTemplateOutlet=\"template.templateRef; context: context;\">\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"!template\" class=\"k-card\">\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"attachment.title\">\n {{ attachment.title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"attachment.subtitle\">\n {{ attachment.subtitle }}\n </h6>\n <img *ngIf=\"image\" [attr.src]=\"attachment.content\" />\n <ng-container *ngIf=\"unknown\">\n {{ attachment.content }}\n </ng-container>\n </div>\n </div>\n "
349
477
  })
350
478
  ], AttachmentComponent);
351
479
  return AttachmentComponent;
@@ -421,7 +549,7 @@ var FocusedStateDirective = /** @class */ (function () {
421
549
  this.focused = false;
422
550
  };
423
551
  __decorate([
424
- HostBinding('class.k-state-focused'),
552
+ HostBinding('class.k-focus'),
425
553
  __metadata("design:type", Boolean)
426
554
  ], FocusedStateDirective.prototype, "focused", void 0);
427
555
  __decorate([
@@ -486,7 +614,7 @@ var HeroCardComponent = /** @class */ (function () {
486
614
  HeroCardComponent = __decorate([
487
615
  Component({
488
616
  selector: 'kendo-chat-hero-card',
489
- template: "\n <img class=\"k-card-image\" [src]=\"imageUrl\" *ngIf=\"imageUrl\" />\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"title\">\n {{ title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"subtitle\">\n {{ subtitle }}\n </h6>\n </div>\n <div class=\"k-card-actions k-card-actions-vertical\">\n <span class=\"k-card-action\"\n *ngFor=\"let act of actions\"\n >\n <button\n kendoButton fillMode=\"flat\"\n (click)=\"onClick(act)\">\n {{ act.title }}\n </button>\n </span>\n </div>\n "
617
+ template: "\n <img class=\"k-card-image\" [src]=\"imageUrl\" *ngIf=\"imageUrl\" />\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"title\">\n {{ title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"subtitle\">\n {{ subtitle }}\n </h6>\n </div>\n <div class=\"k-card-actions k-card-actions-vertical\">\n <span class=\"k-card-action\"\n *ngFor=\"let act of actions\"\n >\n <button\n kendoButton fillMode=\"flat\"\n (click)=\"onClick(act)\"\n >\n {{ act.title }}\n </button>\n </span>\n </div>\n "
490
618
  })
491
619
  ], HeroCardComponent);
492
620
  return HeroCardComponent;
@@ -660,7 +788,7 @@ var MessageAttachmentsComponent = /** @class */ (function (_super) {
660
788
  useExisting: forwardRef(function () { return MessageAttachmentsComponent_1; })
661
789
  }],
662
790
  selector: 'kendo-chat-message-attachments',
663
- template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
791
+ template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
664
792
  }),
665
793
  __metadata("design:paramtypes", [NgZone])
666
794
  ], MessageAttachmentsComponent);
@@ -728,7 +856,7 @@ var MessageComponent = /** @class */ (function (_super) {
728
856
  provide: ChatItem,
729
857
  useExisting: forwardRef(function () { return MessageComponent_1; })
730
858
  }],
731
- template: "\n <time\n [attr.aria-hidden]=\"!selected\"\n class=\"k-message-time\"\n *ngIf=\"message.timestamp\"\n >\n {{ formatTimeStamp(message.timestamp) }}\n </time>\n\n <ng-container *ngIf=\"!message.typing; else typing\">\n <div class=\"k-bubble\" *ngIf=\"template\">\n <ng-container\n *ngTemplateOutlet=\"template.templateRef; context: { $implicit: message };\"\n >\n </ng-container>\n </div>\n\n <div class=\"k-bubble\" *ngIf=\"!template && message.text\">\n {{message.text}}\n </div>\n </ng-container>\n\n <span\n class=\"k-message-status\"\n *ngIf=\"message.status\"\n >\n {{ message.status }}\n </span>\n\n <ng-template #typing>\n <div class=\"k-bubble\">\n <div class=\"k-typing-indicator\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n </ng-template>\n "
859
+ template: "\n <time\n [attr.aria-hidden]=\"!selected\"\n class=\"k-message-time\"\n *ngIf=\"message.timestamp\"\n >\n {{ formatTimeStamp(message.timestamp) }}\n </time>\n\n <ng-container *ngIf=\"!message.typing; else typing\">\n <div class=\"k-bubble\" *ngIf=\"template\">\n <ng-container\n *ngTemplateOutlet=\"template.templateRef; context: { $implicit: message };\"\n >\n </ng-container>\n </div>\n\n <div class=\"k-bubble\" *ngIf=\"!template && message.text\">\n {{message.text}}\n </div>\n </ng-container>\n\n <span\n class=\"k-message-status\"\n *ngIf=\"message.status\"\n >\n {{ message.status }}\n </span>\n\n <ng-template #typing>\n <div class=\"k-bubble\">\n <div class=\"k-typing-indicator\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n </ng-template>\n "
732
860
  }),
733
861
  __metadata("design:paramtypes", [ElementRef, IntlService])
734
862
  ], MessageComponent);
@@ -1018,7 +1146,7 @@ var MessageListComponent = /** @class */ (function () {
1018
1146
  MessageListComponent = __decorate([
1019
1147
  Component({
1020
1148
  selector: 'kendo-chat-message-list',
1021
- template: "\n <ng-container *ngFor=\"let group of view; last as lastGroup; trackBy: trackGroup\">\n <ng-container [ngSwitch]=\"group.type\">\n <div\n *ngSwitchCase=\"'date-marker'\"\n class=\"k-timestamp\"\n >\n {{ formatTimeStamp(group.timestamp) }}\n </div>\n <div\n *ngSwitchCase=\"'message-group'\"\n class=\"k-message-group\"\n [class.k-alt]=\"isOwnMessage(group.messages[0])\"\n [class.k-no-avatar]=\"!group.author.avatarUrl\"\n >\n <img\n *ngIf=\"group.author.avatarUrl\"\n [attr.src]=\"group.author.avatarUrl\"\n class=\"k-avatar\"\n />\n <p *ngIf=\"group.author.name\" class=\"k-author\">{{ group.author.name }}</p>\n <ng-container\n *ngFor=\"let msg of group.messages; first as firstMessage; last as lastMessage\"\n >\n <img *ngIf=\"msg.user?.avatarUrl\" [src]=\"msg.user?.avatarUrl\" class=\"k-avatar\">\n <kendo-chat-message #message\n [message]=\"msg\"\n [tabbable]=\"lastGroup && lastMessage\"\n [template]=\"messageTemplate\"\n (click)=\"select(message)\"\n (focus)=\"select(message)\"\n [class.k-only]=\"group.messages.length === 1\"\n [class.k-first]=\"group.messages.length > 1 && firstMessage\"\n [class.k-last]=\"group.messages.length > 1 && lastMessage\"\n >\n </kendo-chat-message>\n\n <kendo-chat-attachment\n *ngIf=\"msg.attachments && msg.attachments.length === 1\"\n [attachment]=\"msg.attachments[0]\"\n [template]=\"attachmentTemplate\"\n >\n </kendo-chat-attachment>\n </ng-container>\n </div>\n\n <kendo-chat-message-attachments #attachments\n *ngSwitchCase=\"'attachment-group'\"\n [attachments]=\"group.attachments\"\n [layout]=\"group.attachmentLayout\"\n [tabbable]=\"lastGroup\"\n [template]=\"attachmentTemplate\"\n (click)=\"select(attachments)\"\n (focus)=\"select(attachments)\"\n >\n </kendo-chat-message-attachments>\n\n <kendo-chat-suggested-actions #actions\n *ngSwitchCase=\"'action-group'\"\n [actions]=\"group.actions\"\n [tabbable]=\"lastGroup\"\n (dispatch)=\"dispatchAction($event, last(group.messages))\"\n (click)=\"select(actions)\"\n (focus)=\"select(actions)\"\n >\n </kendo-chat-suggested-actions>\n </ng-container>\n </ng-container>\n <kendo-resize-sensor (resize)=\"onResize()\">\n </kendo-resize-sensor>\n "
1149
+ template: "\n <ng-container *ngFor=\"let group of view; last as lastGroup; trackBy: trackGroup\">\n <ng-container [ngSwitch]=\"group.type\">\n <div\n *ngSwitchCase=\"'date-marker'\"\n class=\"k-timestamp\"\n >\n {{ formatTimeStamp(group.timestamp) }}\n </div>\n <div\n *ngSwitchCase=\"'message-group'\"\n class=\"k-message-group\"\n [class.k-alt]=\"isOwnMessage(group.messages[0])\"\n [class.k-no-avatar]=\"!group.author.avatarUrl\"\n >\n <img\n *ngIf=\"group.author.avatarUrl\"\n [attr.src]=\"group.author.avatarUrl\"\n class=\"k-avatar\"\n />\n <p *ngIf=\"group.author.name\" class=\"k-author\">{{ group.author.name }}</p>\n <ng-container\n *ngFor=\"let msg of group.messages; first as firstMessage; last as lastMessage\"\n >\n <img *ngIf=\"msg.user?.avatarUrl\" [src]=\"msg.user?.avatarUrl\" class=\"k-avatar\">\n <kendo-chat-message #message\n [message]=\"msg\"\n [tabbable]=\"lastGroup && lastMessage\"\n [template]=\"messageTemplate\"\n (click)=\"select(message)\"\n (focus)=\"select(message)\"\n [class.k-only]=\"group.messages.length === 1\"\n [class.k-first]=\"group.messages.length > 1 && firstMessage\"\n [class.k-last]=\"group.messages.length > 1 && lastMessage\"\n >\n </kendo-chat-message>\n\n <kendo-chat-attachment\n *ngIf=\"msg.attachments && msg.attachments.length === 1\"\n [attachment]=\"msg.attachments[0]\"\n [template]=\"attachmentTemplate\"\n >\n </kendo-chat-attachment>\n </ng-container>\n </div>\n\n <kendo-chat-message-attachments #attachments\n *ngSwitchCase=\"'attachment-group'\"\n [attachments]=\"group.attachments\"\n [layout]=\"group.attachmentLayout\"\n [tabbable]=\"lastGroup\"\n [template]=\"attachmentTemplate\"\n (click)=\"select(attachments)\"\n (focus)=\"select(attachments)\"\n >\n </kendo-chat-message-attachments>\n\n <kendo-chat-suggested-actions #actions\n *ngSwitchCase=\"'action-group'\"\n [actions]=\"group.actions\"\n [tabbable]=\"lastGroup\"\n (dispatch)=\"dispatchAction($event, last(group.messages))\"\n (click)=\"select(actions)\"\n (focus)=\"select(actions)\"\n >\n </kendo-chat-suggested-actions>\n </ng-container>\n </ng-container>\n <kendo-resize-sensor (resize)=\"onResize()\">\n </kendo-resize-sensor>\n "
1022
1150
  }),
1023
1151
  __metadata("design:paramtypes", [ElementRef, IntlService])
1024
1152
  ], MessageListComponent);
@@ -1184,7 +1312,7 @@ var SuggestedActionsComponent = /** @class */ (function (_super) {
1184
1312
  provide: ChatItem,
1185
1313
  useExisting: forwardRef(function () { return SuggestedActionsComponent_1; })
1186
1314
  }],
1187
- template: "\n <span #item\n *ngFor=\"let action of actions; index as index; first as first; last as last\"\n class=\"k-quick-reply\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && selectedIndex === index ? '0' : '-1'\"\n (click)=\"actionClick(action)\"\n (keydown)=\"actionKeydown($event, action)\"\n >\n {{ action.title || action.value }}\n </span>\n "
1315
+ template: "\n <span\n #item\n *ngFor=\"let action of actions; index as index; first as first; last as last\"\n class=\"k-quick-reply\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && selectedIndex === index ? '0' : '-1'\"\n (click)=\"actionClick(action)\"\n (keydown)=\"actionKeydown($event, action)\"\n >\n {{ action.title || action.value }}\n </span>\n "
1188
1316
  })
1189
1317
  ], SuggestedActionsComponent);
1190
1318
  return SuggestedActionsComponent;
@@ -1195,7 +1323,8 @@ var PUBLIC_DIRECTIVES = [
1195
1323
  CustomMessagesComponent,
1196
1324
  AttachmentTemplateDirective,
1197
1325
  MessageTemplateDirective,
1198
- HeroCardComponent
1326
+ HeroCardComponent,
1327
+ ChatMessageBoxTemplateDirective
1199
1328
  ];
1200
1329
  var PRIVATE_DIRECTIVES = [
1201
1330
  AttachmentComponent,
@@ -1206,7 +1335,8 @@ var PRIVATE_DIRECTIVES = [
1206
1335
  MessageListComponent,
1207
1336
  MessageTemplateDirective,
1208
1337
  ScrollAnchorDirective,
1209
- SuggestedActionsComponent
1338
+ SuggestedActionsComponent,
1339
+ MessageBoxComponent
1210
1340
  ];
1211
1341
  /**
1212
1342
  * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
@@ -1250,4 +1380,4 @@ var ChatModule = /** @class */ (function () {
1250
1380
  * Generated bundle index. Do not edit.
1251
1381
  */
1252
1382
 
1253
- export { PreventableEvent, HeroCardComponent, AttachmentComponent, ChatItem, CustomMessagesComponent, LocalizedMessagesDirective, Messages, MessageAttachmentsComponent, MessageListComponent, MessageComponent, SuggestedActionsComponent, FocusedStateDirective, ScrollAnchorDirective, ChatComponent, AttachmentTemplateDirective, MessageTemplateDirective, ChatModule, ExecuteActionEvent, SendMessageEvent };
1383
+ export { PreventableEvent, HeroCardComponent, AttachmentComponent, ChatItem, CustomMessagesComponent, LocalizedMessagesDirective, Messages, MessageAttachmentsComponent, MessageBoxComponent, MessageListComponent, MessageComponent, SuggestedActionsComponent, FocusedStateDirective, ScrollAnchorDirective, ChatComponent, AttachmentTemplateDirective, MessageTemplateDirective, ChatMessageBoxTemplateDirective, ChatModule, ExecuteActionEvent, SendMessageEvent };
@@ -48,7 +48,7 @@ var HeroCardComponent = /** @class */ (function () {
48
48
  HeroCardComponent = tslib_1.__decorate([
49
49
  core_1.Component({
50
50
  selector: 'kendo-chat-hero-card',
51
- template: "\n <img class=\"k-card-image\" [src]=\"imageUrl\" *ngIf=\"imageUrl\" />\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"title\">\n {{ title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"subtitle\">\n {{ subtitle }}\n </h6>\n </div>\n <div class=\"k-card-actions k-card-actions-vertical\">\n <span class=\"k-card-action\"\n *ngFor=\"let act of actions\"\n >\n <button\n kendoButton fillMode=\"flat\"\n (click)=\"onClick(act)\">\n {{ act.title }}\n </button>\n </span>\n </div>\n "
51
+ template: "\n <img class=\"k-card-image\" [src]=\"imageUrl\" *ngIf=\"imageUrl\" />\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"title\">\n {{ title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"subtitle\">\n {{ subtitle }}\n </h6>\n </div>\n <div class=\"k-card-actions k-card-actions-vertical\">\n <span class=\"k-card-action\"\n *ngFor=\"let act of actions\"\n >\n <button\n kendoButton fillMode=\"flat\"\n (click)=\"onClick(act)\"\n >\n {{ act.title }}\n </button>\n </span>\n </div>\n "
52
52
  })
53
53
  ], HeroCardComponent);
54
54
  return HeroCardComponent;
@@ -59,7 +59,7 @@ var AttachmentComponent = /** @class */ (function () {
59
59
  AttachmentComponent = tslib_1.__decorate([
60
60
  core_1.Component({
61
61
  selector: 'kendo-chat-attachment',
62
- template: "\n <ng-container *ngIf=\"template\">\n <ng-container *ngTemplateOutlet=\"template.templateRef; context: context;\">\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"!template\" class=\"k-card\">\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"attachment.title\">\n {{ attachment.title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"attachment.subtitle\">\n {{ attachment.subtitle }}\n </h6>\n <img *ngIf=\"image\" [attr.src]=\"attachment.content\" />\n <ng-container *ngIf=\"unknown\">\n {{ attachment.content }}\n </ng-container>\n </div>\n </div>\n "
62
+ template: "\n <ng-container *ngIf=\"template\">\n <ng-container *ngTemplateOutlet=\"template.templateRef; context: context;\">\n </ng-container>\n </ng-container>\n\n <div *ngIf=\"!template\" class=\"k-card\">\n <div class=\"k-card-body\">\n <h5 class=\"k-card-title\" *ngIf=\"attachment.title\">\n {{ attachment.title }}\n </h5>\n <h6 class=\"k-card-subtitle\" *ngIf=\"attachment.subtitle\">\n {{ attachment.subtitle }}\n </h6>\n <img *ngIf=\"image\" [attr.src]=\"attachment.content\" />\n <ng-container *ngIf=\"unknown\">\n {{ attachment.content }}\n </ng-container>\n </div>\n </div>\n "
63
63
  })
64
64
  ], AttachmentComponent);
65
65
  return AttachmentComponent;
@@ -10,11 +10,10 @@ var attachment_template_directive_1 = require("./attachment-template.directive")
10
10
  var kendo_angular_l10n_1 = require("@progress/kendo-angular-l10n");
11
11
  var builtin_actions_1 = require("./builtin-actions");
12
12
  var message_template_directive_1 = require("./message-template.directive");
13
- var post_message_event_1 = require("../api/post-message-event");
14
13
  var kendo_licensing_1 = require("@progress/kendo-licensing");
15
14
  var package_metadata_1 = require("../package-metadata");
16
- // tslint:disable-next-line:max-line-length
17
- var 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>';
15
+ var message_box_directive_1 = require("./message-box.directive");
16
+ var message_box_component_1 = require("./message-box.component");
18
17
  /**
19
18
  * Represents the Kendo UI Chat component for Angular.
20
19
  *
@@ -30,6 +29,12 @@ var ChatComponent = /** @class */ (function () {
30
29
  var _this = this;
31
30
  this.localization = localization;
32
31
  this.zone = zone;
32
+ /**
33
+ * Used to switch between a one-liner input or a textarea.
34
+ * ([see example]({% slug message_box %})#toc-message-box-types).
35
+ * @default input
36
+ */
37
+ this.messageBoxType = 'textbox';
33
38
  /**
34
39
  * Fires when the user types a message and clicks the **Send** button or presses **Enter**.
35
40
  * Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
@@ -58,7 +63,7 @@ var ChatComponent = /** @class */ (function () {
58
63
  }
59
64
  Object.defineProperty(ChatComponent.prototype, "className", {
60
65
  get: function () {
61
- return 'k-widget k-chat';
66
+ return 'k-chat';
62
67
  },
63
68
  enumerable: true,
64
69
  configurable: true
@@ -70,6 +75,16 @@ var ChatComponent = /** @class */ (function () {
70
75
  enumerable: true,
71
76
  configurable: true
72
77
  });
78
+ Object.defineProperty(ChatComponent.prototype, "localizationText", {
79
+ /**
80
+ * @hidden
81
+ */
82
+ get: function () {
83
+ return this.localization;
84
+ },
85
+ enumerable: true,
86
+ configurable: true
87
+ });
73
88
  ChatComponent.prototype.ngOnChanges = function () {
74
89
  var _this = this;
75
90
  this.zone.runOutsideAngular(function () { return setTimeout(function () {
@@ -89,33 +104,6 @@ var ChatComponent = /** @class */ (function () {
89
104
  this.localizationChangeSubscription.unsubscribe();
90
105
  }
91
106
  };
92
- /**
93
- * @hidden
94
- */
95
- ChatComponent.prototype.sendClick = function () {
96
- var input = this.messageInput.nativeElement;
97
- var value = input.value;
98
- if (!value) {
99
- return;
100
- }
101
- var message = {
102
- author: this.user,
103
- text: value,
104
- timestamp: new Date()
105
- };
106
- this.sendMessage.emit(new post_message_event_1.SendMessageEvent(message));
107
- input.value = null;
108
- input.focus();
109
- this.autoScroll = true;
110
- };
111
- /**
112
- * @hidden
113
- */
114
- ChatComponent.prototype.inputKeydown = function (e) {
115
- if (e.keyCode === 13 /* enter */) {
116
- this.sendClick();
117
- }
118
- };
119
107
  /**
120
108
  * @hidden
121
109
  */
@@ -124,7 +112,9 @@ var ChatComponent = /** @class */ (function () {
124
112
  if (!e.isDefaultPrevented()) {
125
113
  var handler = builtin_actions_1.makeHandler(e.action);
126
114
  handler(e.action, this);
127
- this.messageInput.nativeElement.focus();
115
+ if (!this.messageBoxTemplate) {
116
+ this.messageBox.messageBoxInput.nativeElement.focus();
117
+ }
128
118
  }
129
119
  };
130
120
  /**
@@ -141,6 +131,10 @@ var ChatComponent = /** @class */ (function () {
141
131
  core_1.Input(),
142
132
  tslib_1.__metadata("design:type", Object)
143
133
  ], ChatComponent.prototype, "user", void 0);
134
+ tslib_1.__decorate([
135
+ core_1.Input(),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], ChatComponent.prototype, "messageBoxType", void 0);
144
138
  tslib_1.__decorate([
145
139
  core_1.Output(),
146
140
  tslib_1.__metadata("design:type", core_1.EventEmitter)
@@ -168,9 +162,13 @@ var ChatComponent = /** @class */ (function () {
168
162
  tslib_1.__metadata("design:type", message_template_directive_1.MessageTemplateDirective)
169
163
  ], ChatComponent.prototype, "messageTemplate", void 0);
170
164
  tslib_1.__decorate([
171
- core_1.ViewChild('messageInput', { static: true }),
172
- tslib_1.__metadata("design:type", core_1.ElementRef)
173
- ], ChatComponent.prototype, "messageInput", void 0);
165
+ core_1.ContentChild(message_box_directive_1.ChatMessageBoxTemplateDirective, { static: false }),
166
+ tslib_1.__metadata("design:type", message_box_directive_1.ChatMessageBoxTemplateDirective)
167
+ ], ChatComponent.prototype, "messageBoxTemplate", void 0);
168
+ tslib_1.__decorate([
169
+ core_1.ViewChild('messageBox', { static: false }),
170
+ tslib_1.__metadata("design:type", message_box_component_1.MessageBoxComponent)
171
+ ], ChatComponent.prototype, "messageBox", void 0);
174
172
  tslib_1.__decorate([
175
173
  core_1.ViewChild('messageList', { static: true }),
176
174
  tslib_1.__metadata("design:type", core_1.ElementRef)
@@ -185,10 +183,9 @@ var ChatComponent = /** @class */ (function () {
185
183
  }
186
184
  ],
187
185
  selector: 'kendo-chat',
188
- template: "\n <ng-container\n kendoChatLocalizedMessages\n i18n-messagePlaceholder=\"kendo.chat.messagePlaceholder|The placholder text of the message text input\"\n messagePlaceholder=\"Type a message...\"\n\n i18n-send=\"kendo.chat.send|The text for the Send button\"\n send=\"Send...\"\n >\n </ng-container>\n\n <div\n #messageList\n class=\"k-message-list k-avatars\"\n aria-live=\"polite\" role=\"log\"\n kendoChatScrollAnchor\n #anchor=\"scrollAnchor\"\n [(autoScroll)]=\"autoScroll\"\n >\n <kendo-chat-message-list\n [messages]=\"messages\"\n [messageTemplate]=\"messageTemplate\"\n [attachmentTemplate]=\"attachmentTemplate\"\n [user]=\"user\"\n (executeAction)=\"dispatchAction($event)\"\n (resize)=\"anchor.scrollToBottom()\"\n (navigate)=\"this.autoScroll = false\"\n >\n </kendo-chat-message-list>\n </div>\n\n <div class=\"k-message-box\">\n <input\n #messageInput\n kendoChatFocusedState\n type=\"text\"\n class=\"k-input\"\n [placeholder]=\"textFor('messagePlaceholder')\"\n (keydown)=\"inputKeydown($event)\"\n >\n <button\n kendoButton\n fillMode=\"flat\"\n class=\"k-button-send\"\n tabindex=\"-1\"\n [attr.title]=\"textFor('send')\"\n (click)=\"sendClick()\"\n >" + sendIcon + "</button>\n </div>\n "
186
+ template: "\n <ng-container\n kendoChatLocalizedMessages\n i18n-messagePlaceholder=\"kendo.chat.messagePlaceholder|The placholder text of the message text input\"\n messagePlaceholder=\"Type a message...\"\n\n i18n-send=\"kendo.chat.send|The text for the Send button\"\n send=\"Send...\"\n >\n </ng-container>\n\n <div\n #messageList\n class=\"k-message-list k-avatars\"\n aria-live=\"polite\" role=\"log\"\n kendoChatScrollAnchor\n #anchor=\"scrollAnchor\"\n [(autoScroll)]=\"autoScroll\"\n >\n <kendo-chat-message-list\n [messages]=\"messages\"\n [messageTemplate]=\"messageTemplate\"\n [attachmentTemplate]=\"attachmentTemplate\"\n [user]=\"user\"\n (executeAction)=\"dispatchAction($event)\"\n (resize)=\"anchor.scrollToBottom()\"\n (navigate)=\"this.autoScroll = false\"\n >\n </kendo-chat-message-list>\n </div>\n <kendo-message-box\n #messageBox\n [messageBoxTemplate]=\"messageBoxTemplate\"\n [type]=\"messageBoxType\"\n [user]=\"user\"\n [autoScroll]=\"autoScroll\"\n [localization]=\"localizationText\"\n (sendMessage)=\"sendMessage.emit($event)\"\n >\n </kendo-message-box>\n "
189
187
  }),
190
- tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService,
191
- core_1.NgZone])
188
+ tslib_1.__metadata("design:paramtypes", [kendo_angular_l10n_1.LocalizationService, core_1.NgZone])
192
189
  ], ChatComponent);
193
190
  return ChatComponent;
194
191
  }());
@@ -10,3 +10,5 @@ var attachment_template_directive_1 = require("./attachment-template.directive")
10
10
  exports.AttachmentTemplateDirective = attachment_template_directive_1.AttachmentTemplateDirective;
11
11
  var message_template_directive_1 = require("./message-template.directive");
12
12
  exports.MessageTemplateDirective = message_template_directive_1.MessageTemplateDirective;
13
+ var message_box_directive_1 = require("./message-box.directive");
14
+ exports.ChatMessageBoxTemplateDirective = message_box_directive_1.ChatMessageBoxTemplateDirective;
@@ -20,12 +20,15 @@ var message_list_component_1 = require("./message-list.component");
20
20
  var core_1 = require("@angular/core");
21
21
  var scroll_anchor_directive_1 = require("../common/scroll-anchor.directive");
22
22
  var suggested_actions_component_1 = require("./suggested-actions.component");
23
+ var message_box_component_1 = require("./message-box.component");
24
+ var message_box_directive_1 = require("./message-box.directive");
23
25
  var PUBLIC_DIRECTIVES = [
24
26
  chat_directives_1.ChatComponent,
25
27
  custom_messages_component_1.CustomMessagesComponent,
26
28
  chat_directives_1.AttachmentTemplateDirective,
27
29
  chat_directives_1.MessageTemplateDirective,
28
- hero_card_component_1.HeroCardComponent
30
+ hero_card_component_1.HeroCardComponent,
31
+ message_box_directive_1.ChatMessageBoxTemplateDirective
29
32
  ];
30
33
  var PRIVATE_DIRECTIVES = [
31
34
  attachment_component_1.AttachmentComponent,
@@ -36,7 +39,8 @@ var PRIVATE_DIRECTIVES = [
36
39
  message_list_component_1.MessageListComponent,
37
40
  chat_directives_1.MessageTemplateDirective,
38
41
  scroll_anchor_directive_1.ScrollAnchorDirective,
39
- suggested_actions_component_1.SuggestedActionsComponent
42
+ suggested_actions_component_1.SuggestedActionsComponent,
43
+ message_box_component_1.MessageBoxComponent
40
44
  ];
41
45
  /**
42
46
  * The [NgModule]({{ site.data.urls.angular['ngmodules'] }}) for the Chat component.
@@ -141,7 +141,7 @@ var MessageAttachmentsComponent = /** @class */ (function (_super) {
141
141
  useExisting: core_1.forwardRef(function () { return MessageAttachmentsComponent_1; })
142
142
  }],
143
143
  selector: 'kendo-chat-message-attachments',
144
- template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
144
+ template: "\n <button\n *ngIf=\"carousel && scrollPosition > 0\"\n (click)=\"scrollTo(-1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-left\"></span>\n </button>\n <div #deck [class.k-card-deck]=\"carousel\">\n <kendo-chat-attachment #item\n *ngFor=\"let att of attachments; index as index; first as first; last as last\"\n [attachment]=\"att\"\n [template]=\"template\"\n [class.k-state-selected]=\"isSelected(index)\"\n [class.k-state-focused]=\"isSelected(index)\"\n [class.k-card-wrap]=\"true\"\n [class.k-first]=\"first\"\n [class.k-last]=\"last\"\n [attr.tabindex]=\"tabbable && isSelected(index) ? '0' : '-1'\"\n (click)=\"itemClick(index)\"\n (keydown)=\"itemKeydown($event, att)\"\n >\n </kendo-chat-attachment>\n </div>\n <button\n *ngIf=\"carousel && scrollPosition < 1\"\n (click)=\"scrollTo(1)\"\n class=\"k-button k-icon-button k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n tabindex=\"-1\">\n <span class=\"k-icon k-button-icon k-i-arrow-chevron-right\"></span>\n </button>\n "
145
145
  }),
146
146
  tslib_1.__metadata("design:paramtypes", [core_1.NgZone])
147
147
  ], MessageAttachmentsComponent);