@progress/kendo-angular-conversational-ui 4.0.0 → 5.0.0-next.202202241517
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/es2015/api → api}/action.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/attachment.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/execute-action-event.d.ts +1 -1
- package/{dist/es/api/user.interface.js → api/index.d.ts} +6 -0
- package/{dist/es2015/api → api}/message.interface.d.ts +0 -0
- package/{dist/es2015/api → api}/post-message-event.d.ts +0 -0
- package/{dist/es2015/api → api}/preventable-event.d.ts +0 -0
- package/{dist/es2015/api → api}/user.interface.d.ts +0 -0
- package/bundles/kendo-angular-conversational-ui.umd.js +5 -0
- package/{dist/es2015/cards → cards}/hero-card.component.d.ts +3 -0
- package/{dist/es2015/chat → chat}/attachment-template.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/attachment.component.d.ts +9 -5
- package/{dist/es2015/chat → chat}/builtin-actions.d.ts +0 -0
- package/{dist/es2015/chat → chat}/chat-item.d.ts +0 -0
- package/{dist/es2015/chat → chat}/chat-view.d.ts +1 -1
- package/{dist/es2015/chat → chat}/chat.component.d.ts +6 -6
- package/{dist/es2015/chat → chat}/chat.directives.d.ts +0 -0
- package/chat/chat.module.d.ts +47 -0
- package/{dist/es2015/chat → chat}/l10n/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/chat → chat}/l10n/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/l10n/messages.d.ts +3 -0
- package/{dist/es2015/chat → chat}/message-attachments.component.d.ts +5 -2
- package/{dist/es2015/chat → chat}/message-list.component.d.ts +8 -7
- package/{dist/es2015/chat → chat}/message-template.directive.d.ts +3 -0
- package/{dist/es2015/chat → chat}/message.component.d.ts +4 -1
- package/{dist/es2015/chat → chat}/suggested-actions.component.d.ts +4 -1
- package/common/focused-state.directive.d.ts +15 -0
- package/{dist/es2015/common → common}/keys.enum.d.ts +0 -0
- package/{dist/es2015/common → common}/scroll-anchor.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/utils.d.ts +0 -0
- package/{dist/es2015 → esm2015}/api/action.interface.js +2 -1
- package/{dist/es2015 → esm2015}/api/attachment.interface.js +1 -0
- package/{dist/es2015 → esm2015}/api/execute-action-event.js +0 -0
- package/{dist/es/api/attachment.interface.js → esm2015/api/index.js} +6 -0
- package/{dist/es → esm2015}/api/message.interface.js +1 -0
- package/{dist/es2015 → esm2015}/api/post-message-event.js +0 -0
- package/{dist/es2015 → esm2015}/api/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/api/user.interface.js +1 -0
- package/esm2015/cards/hero-card.component.js +88 -0
- package/{dist/es2015 → esm2015}/chat/attachment-template.directive.js +14 -12
- package/esm2015/chat/attachment.component.js +83 -0
- package/{dist/es2015 → esm2015}/chat/builtin-actions.js +13 -16
- package/{dist/es2015 → esm2015}/chat/chat-item.js +0 -0
- package/{dist/es2015 → esm2015}/chat/chat-view.js +0 -6
- package/esm2015/chat/chat.component.js +226 -0
- package/{dist/es → esm2015}/chat/chat.directives.js +0 -0
- package/{dist/es2015 → esm2015}/chat/chat.module.js +40 -15
- package/esm2015/chat/l10n/custom-messages.component.js +42 -0
- package/esm2015/chat/l10n/localized-messages.directive.js +37 -0
- package/esm2015/chat/l10n/messages.js +24 -0
- package/{dist/es2015 → esm2015}/chat/message-attachments.component.js +71 -48
- package/esm2015/chat/message-list.component.js +279 -0
- package/{dist/es2015 → esm2015}/chat/message-template.directive.js +14 -12
- package/esm2015/chat/message.component.js +140 -0
- package/esm2015/chat/suggested-actions.component.js +111 -0
- package/esm2015/common/focused-state.directive.js +37 -0
- package/{dist/es2015 → esm2015}/common/keys.enum.js +1 -0
- package/{dist/es2015 → esm2015}/common/scroll-anchor.directive.js +20 -26
- package/{dist/es2015 → esm2015}/common/utils.js +0 -0
- package/{dist/es/api/action.interface.js → esm2015/kendo-angular-conversational-ui.js} +4 -1
- package/{dist/npm/chat/chat-item.js → esm2015/main.js} +5 -11
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/fesm2015/kendo-angular-conversational-ui.js +1576 -0
- package/{dist/es2015/common/focused-state.directive.d.ts → kendo-angular-conversational-ui.d.ts} +3 -6
- package/main.d.ts +9 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -101
- package/schematics/ngAdd/index.js +5 -2
- package/schematics/ngAdd/index.js.map +1 -1
- package/dist/cdn/js/kendo-angular-conversational-ui.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/api/execute-action-event.js +0 -24
- package/dist/es/api/post-message-event.js +0 -18
- package/dist/es/api/preventable-event.js +0 -32
- package/dist/es/cards/hero-card.component.js +0 -54
- package/dist/es/chat/attachment-template.directive.js +0 -32
- package/dist/es/chat/attachment.component.js +0 -65
- package/dist/es/chat/builtin-actions.js +0 -28
- package/dist/es/chat/chat-item.js +0 -13
- package/dist/es/chat/chat-view.js +0 -92
- package/dist/es/chat/chat.component.js +0 -193
- package/dist/es/chat/chat.module.js +0 -76
- package/dist/es/chat/l10n/custom-messages.component.js +0 -45
- package/dist/es/chat/l10n/localized-messages.directive.js +0 -36
- package/dist/es/chat/l10n/messages.js +0 -26
- package/dist/es/chat/message-attachments.component.js +0 -148
- package/dist/es/chat/message-list.component.js +0 -165
- package/dist/es/chat/message-template.directive.js +0 -32
- package/dist/es/chat/message.component.js +0 -77
- package/dist/es/chat/suggested-actions.component.js +0 -91
- package/dist/es/common/focused-state.directive.js +0 -43
- package/dist/es/common/keys.enum.js +0 -4
- package/dist/es/common/scroll-anchor.directive.js +0 -87
- package/dist/es/common/utils.js +0 -13
- package/dist/es/index.js +0 -21
- package/dist/es/main.js +0 -8
- package/dist/es/package-metadata.js +0 -15
- package/dist/es2015/api/message.interface.js +0 -4
- package/dist/es2015/cards/hero-card.component.js +0 -78
- package/dist/es2015/chat/attachment.component.js +0 -66
- package/dist/es2015/chat/chat.component.js +0 -230
- package/dist/es2015/chat/chat.directives.js +0 -7
- package/dist/es2015/chat/chat.module.d.ts +0 -27
- package/dist/es2015/chat/l10n/custom-messages.component.js +0 -37
- package/dist/es2015/chat/l10n/localized-messages.directive.js +0 -32
- package/dist/es2015/chat/l10n/messages.js +0 -20
- package/dist/es2015/chat/message-list.component.js +0 -227
- package/dist/es2015/chat/message.component.js +0 -107
- package/dist/es2015/chat/suggested-actions.component.js +0 -104
- package/dist/es2015/common/focused-state.directive.js +0 -45
- package/dist/es2015/index.d.ts +0 -21
- package/dist/es2015/index.js +0 -21
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/main.d.ts +0 -12
- package/dist/es2015/main.js +0 -8
- package/dist/fesm2015/index.js +0 -1403
- package/dist/fesm5/index.js +0 -1253
- package/dist/npm/api/action.interface.js +0 -7
- package/dist/npm/api/attachment.interface.js +0 -6
- package/dist/npm/api/execute-action-event.js +0 -26
- package/dist/npm/api/message.interface.js +0 -6
- package/dist/npm/api/post-message-event.js +0 -20
- package/dist/npm/api/preventable-event.js +0 -34
- package/dist/npm/api/user.interface.js +0 -6
- package/dist/npm/cards/hero-card.component.js +0 -56
- package/dist/npm/chat/attachment-template.directive.js +0 -34
- package/dist/npm/chat/attachment.component.js +0 -67
- package/dist/npm/chat/builtin-actions.js +0 -33
- package/dist/npm/chat/chat-view.js +0 -98
- package/dist/npm/chat/chat.component.js +0 -195
- package/dist/npm/chat/chat.directives.js +0 -12
- package/dist/npm/chat/chat.module.js +0 -78
- package/dist/npm/chat/l10n/custom-messages.component.js +0 -47
- package/dist/npm/chat/l10n/localized-messages.directive.js +0 -38
- package/dist/npm/chat/l10n/messages.js +0 -28
- package/dist/npm/chat/message-attachments.component.js +0 -150
- package/dist/npm/chat/message-list.component.js +0 -167
- package/dist/npm/chat/message-template.directive.js +0 -34
- package/dist/npm/chat/message.component.js +0 -79
- package/dist/npm/chat/suggested-actions.component.js +0 -93
- package/dist/npm/common/focused-state.directive.js +0 -45
- package/dist/npm/common/keys.enum.js +0 -6
- package/dist/npm/common/scroll-anchor.directive.js +0 -89
- package/dist/npm/common/utils.js +0 -15
- package/dist/npm/index.js +0 -37
- package/dist/npm/main.js +0 -11
- package/dist/npm/package-metadata.js +0 -17
- package/dist/systemjs/kendo-angular-conversational-ui.js +0 -5
package/dist/cdn/main.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("tslib"),require("@angular/core"),require("@progress/kendo-angular-l10n"),require("@progress/kendo-angular-intl"),require("@progress/kendo-licensing"),require("@progress/kendo-angular-buttons"),require("@angular/common"),require("@progress/kendo-angular-common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["tslib","@angular/core","@progress/kendo-angular-l10n","@progress/kendo-angular-intl","@progress/kendo-licensing","@progress/kendo-angular-buttons","@angular/common","@progress/kendo-angular-common","rxjs","rxjs/operators"],t):"object"==typeof exports?exports.KendoAngularConversationalUi=t(require("tslib"),require("@angular/core"),require("@progress/kendo-angular-l10n"),require("@progress/kendo-angular-intl"),require("@progress/kendo-licensing"),require("@progress/kendo-angular-buttons"),require("@angular/common"),require("@progress/kendo-angular-common"),require("rxjs"),require("rxjs/operators")):e.KendoAngularConversationalUi=t(e.tslib,e["@angular/core"],e["@progress/kendo-angular-l10n"],e["@progress/kendo-angular-intl"],e["@progress/kendo-licensing"],e["@progress/kendo-angular-buttons"],e["@angular/common"],e["@progress/kendo-angular-common"],e.rxjs,e["rxjs/operators"])}(window,(function(e,t,n,a,o,s,r,i,c,l){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(12);t.ChatComponent=a.ChatComponent;var o=n(7);t.AttachmentTemplateDirective=o.AttachmentTemplateDirective;var s=n(4);t.MessageTemplateDirective=s.MessageTemplateDirective},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(){function e(e){this.templateRef=e}return e=a.__decorate([o.Directive({selector:"[kendoChatMessageTemplate]"}),a.__param(0,o.Optional()),a.__metadata("design:paramtypes",[o.TemplateRef])],e)}();t.MessageTemplateDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){};t.ChatItem=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){this.message=e};t.SendMessageEvent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(){function e(e){this.templateRef=e}return e=a.__decorate([o.Directive({selector:"[kendoChatAttachmentTemplate]"}),a.__param(0,o.Optional()),a.__metadata("design:paramtypes",[o.TemplateRef])],e)}();t.AttachmentTemplateDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),a.__decorate([o.Input(),a.__metadata("design:type",String)],t.prototype,"messagePlaceholder",void 0),a.__decorate([o.Input(),a.__metadata("design:type",String)],t.prototype,"send",void 0),t}(n(3).ComponentMessages);t.Messages=s},function(e,t){e.exports=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(t,n){var a=e.call(this)||this;return a.action=t,a.message=n,a}return a.__extends(t,e),t}(n(30).PreventableEvent);t.ExecuteActionEvent=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0);a.__exportStar(n(2),t),a.__exportStar(n(16),t),a.__exportStar(n(10),t),a.__exportStar(n(6),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(7),r=n(3),i=n(13),c=n(4),l=n(6),u=n(14),d=n(15),p=function(){function e(e,t){var n=this;this.localization=e,this.zone=t,this.sendMessage=new o.EventEmitter,this.executeAction=new o.EventEmitter,this.autoScroll=!0,u.validatePackage(d.packageMetadata),this.direction=e.rtl?"rtl":"ltr",this.localizationChangeSubscription=e.changes.subscribe((function(e){var t=e.rtl;n.direction=t?"rtl":"ltr"}))}return Object.defineProperty(e.prototype,"className",{get:function(){return"k-widget k-chat"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dirAttr",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){var e=this;this.zone.runOutsideAngular((function(){return setTimeout((function(){e.messageList.nativeElement.style.flex="1 1 auto"}))}))},e.prototype.ngAfterViewInit=function(){if(o.isDevMode()&&!this.user)throw new Error("User must be set and have a valid id.")},e.prototype.ngOnDestroy=function(){this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe()},e.prototype.sendClick=function(){var e=this.messageInput.nativeElement,t=e.value;if(t){var n={author:this.user,text:t,timestamp:new Date};this.sendMessage.emit(new l.SendMessageEvent(n)),e.value=null,e.focus(),this.autoScroll=!0}},e.prototype.inputKeydown=function(e){13===e.keyCode&&this.sendClick()},e.prototype.dispatchAction=function(e){(this.executeAction.emit(e),e.isDefaultPrevented())||(i.makeHandler(e.action)(e.action,this),this.messageInput.nativeElement.focus())},e.prototype.textFor=function(e){return this.localization.get(e)},a.__decorate([o.Input(),a.__metadata("design:type",Array)],e.prototype,"messages",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Object)],e.prototype,"user",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"sendMessage",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"executeAction",void 0),a.__decorate([o.HostBinding("class"),a.__metadata("design:type",String),a.__metadata("design:paramtypes",[])],e.prototype,"className",null),a.__decorate([o.HostBinding("attr.dir"),a.__metadata("design:type",String),a.__metadata("design:paramtypes",[])],e.prototype,"dirAttr",null),a.__decorate([o.ContentChild(s.AttachmentTemplateDirective,{static:!1}),a.__metadata("design:type",s.AttachmentTemplateDirective)],e.prototype,"attachmentTemplate",void 0),a.__decorate([o.ContentChild(c.MessageTemplateDirective,{static:!1}),a.__metadata("design:type",c.MessageTemplateDirective)],e.prototype,"messageTemplate",void 0),a.__decorate([o.ViewChild("messageInput",{static:!0}),a.__metadata("design:type",o.ElementRef)],e.prototype,"messageInput",void 0),a.__decorate([o.ViewChild("messageList",{static:!0}),a.__metadata("design:type",o.ElementRef)],e.prototype,"messageList",void 0),e=a.__decorate([o.Component({providers:[r.LocalizationService,{provide:r.L10N_PREFIX,useValue:"kendo.chat"}],selector:"kendo-chat",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 ><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></button>\n </div>\n '}),a.__metadata("design:paramtypes",[r.LocalizationService,o.NgZone])],e)}();t.ChatComponent=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),o=function(){},s={reply:function(e,t){t.sendMessage.emit(new a.SendMessageEvent({author:t.user,text:e.value,timestamp:new Date}))},call:function(e){window.open("tel:"+e.value)},openUrl:function(e){window.open(e.value)}};t.makeHandler=function(e){return s[e.type]||o}},function(e,t){e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-angular-conversational-ui",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1642589598,version:"",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"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(17),s=n(2),r=n(18),i=n(19),c=n(20),l=n(21),u=n(22),d=n(23),p=n(24),m=n(25),g=n(28),f=n(29),_=n(1),h=n(33),v=n(34),y=[s.ChatComponent,l.CustomMessagesComponent,s.AttachmentTemplateDirective,s.MessageTemplateDirective,d.HeroCardComponent],k=[o.AttachmentComponent,u.FocusedStateDirective,p.LocalizedMessagesDirective,m.MessageAttachmentsComponent,g.MessageComponent,f.MessageListComponent,s.MessageTemplateDirective,h.ScrollAnchorDirective,v.SuggestedActionsComponent],b=function(){function e(){}return e=a.__decorate([_.NgModule({declarations:y.concat(k),exports:[y],imports:[r.ButtonModule,i.CommonModule,c.ResizeSensorModule]})],e)}();t.ChatModule=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(2),r=function(){function e(){}return Object.defineProperty(e.prototype,"attachment",{get:function(){return this._attachment},set:function(e){this._attachment=e,this.context={$implicit:this.attachment}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"image",{get:function(){return 0===this.contentType.indexOf("image/")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"unknown",{get:function(){return!this.image},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentType",{get:function(){return this.attachment.contentType||""},enumerable:!0,configurable:!0}),a.__decorate([o.Input(),a.__metadata("design:type",Object),a.__metadata("design:paramtypes",[Object])],e.prototype,"attachment",null),a.__decorate([o.Input(),a.__metadata("design:type",s.AttachmentTemplateDirective)],e.prototype,"template",void 0),e=a.__decorate([o.Component({selector:"kendo-chat-attachment",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 '})],e)}();t.AttachmentComponent=r},function(e,t){e.exports=s},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(3),r=n(8),i=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return a.__extends(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=a.__decorate([o.Component({providers:[{provide:r.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-chat-messages",template:""}),a.__metadata("design:paramtypes",[s.LocalizationService])],t)}(r.Messages);t.CustomMessagesComponent=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(){function e(){this.focused=!1}return e.prototype.onFocus=function(){this.focused=!0},e.prototype.onBlur=function(){this.focused=!1},a.__decorate([o.HostBinding("class.k-state-focused"),a.__metadata("design:type",Boolean)],e.prototype,"focused",void 0),a.__decorate([o.HostListener("focusin"),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],e.prototype,"onFocus",null),a.__decorate([o.HostListener("focusout"),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[]),a.__metadata("design:returntype",void 0)],e.prototype,"onBlur",null),e=a.__decorate([o.Directive({selector:"[kendoChatFocusedState]"})],e)}();t.FocusedStateDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(){function e(){this.cssClass=!0,this.executeAction=new o.EventEmitter}return e.prototype.onClick=function(e){this.executeAction.next(e)},a.__decorate([o.Input(),a.__metadata("design:type",String)],e.prototype,"imageUrl",void 0),a.__decorate([o.Input(),a.__metadata("design:type",String)],e.prototype,"title",void 0),a.__decorate([o.Input(),a.__metadata("design:type",String)],e.prototype,"subtitle",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Array)],e.prototype,"actions",void 0),a.__decorate([o.HostBinding("class.k-card"),a.__metadata("design:type",Boolean)],e.prototype,"cssClass",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"executeAction",void 0),e=a.__decorate([o.Component({selector:"kendo-chat-hero-card",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 '})],e)}();t.HeroCardComponent=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(3),r=n(8),i=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return a.__extends(t,e),n=t,t=n=a.__decorate([o.Directive({providers:[{provide:r.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"[kendoChatLocalizedMessages]"}),a.__metadata("design:paramtypes",[s.LocalizationService])],t)}(r.Messages);t.LocalizedMessagesDirective=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(26),r=n(27),i=n(5),c=n(2),l=function(e){function t(t){var n,a,o=e.call(this)||this;return o.zone=t,o.scrollPosition=0,o.selectedIndex=0,o.carouselKeyHandlers=((n={})[37]=function(e){return o.navigateTo(e,-1)},n[39]=function(e){return o.navigateTo(e,1)},n),o.listKeyHandlers=((a={})[38]=function(e){return o.navigateTo(e,-1)},a[40]=function(e){return o.navigateTo(e,1)},a),o}var n;return a.__extends(t,e),n=t,Object.defineProperty(t.prototype,"carousel",{get:function(){return"list"!==this.layout},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var e=this;this.zone.runOutsideAngular((function(){e.scrollSubscription=s.fromEvent(e.deck.nativeElement,"scroll").pipe(r.debounceTime(100)).subscribe((function(){return e.onScroll()}))}))},t.prototype.ngOnDestroy=function(){this.scrollSubscription.unsubscribe()},t.prototype.isSelected=function(e){return this.selectedIndex===e},t.prototype.itemKeydown=function(e,t){var n=("list"===this.layout?this.listKeyHandlers:this.carouselKeyHandlers)[e.keyCode];n&&n(e,t)},t.prototype.itemClick=function(e){this.select(e)},t.prototype.focus=function(){this.select(this.selectedIndex)},t.prototype.scrollTo=function(e){var t=this.deck.nativeElement,n=t.scrollWidth/this.items.length,a=t.scrollWidth-t.offsetWidth,o=t.scrollLeft+n*e;t.scrollLeft=Math.max(0,Math.min(a,o))},t.prototype.select=function(e){this.selectedIndex=e;var t=this.items.toArray()[e];t&&t.nativeElement.focus()},t.prototype.navigateTo=function(e,t){var n=this.selectedIndex,a=Math.max(0,Math.min(n+t,this.items.length-1));a!==n&&(this.select(a),e.preventDefault())},t.prototype.onScroll=function(){var e=this,t=this.deck.nativeElement;if(0!==t.scrollWidth){var n=t.scrollLeft/(t.scrollWidth-t.offsetWidth);n!==this.scrollPosition&&this.zone.run((function(){e.scrollPosition=n}))}},a.__decorate([o.Input(),a.__metadata("design:type",Array)],t.prototype,"attachments",void 0),a.__decorate([o.Input(),a.__metadata("design:type",String)],t.prototype,"layout",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Boolean)],t.prototype,"tabbable",void 0),a.__decorate([o.Input(),a.__metadata("design:type",c.AttachmentTemplateDirective)],t.prototype,"template",void 0),a.__decorate([o.HostBinding("class.k-card-deck-scrollwrap"),a.__metadata("design:type",Boolean),a.__metadata("design:paramtypes",[])],t.prototype,"carousel",null),a.__decorate([o.ViewChild("deck",{read:o.ElementRef,static:!0}),a.__metadata("design:type",o.ElementRef)],t.prototype,"deck",void 0),a.__decorate([o.ViewChildren("item",{read:o.ElementRef}),a.__metadata("design:type",o.QueryList)],t.prototype,"items",void 0),t=n=a.__decorate([o.Component({providers:[{provide:i.ChatItem,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-chat-message-attachments",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 '}),a.__metadata("design:paramtypes",[o.NgZone])],t)}(i.ChatItem);t.MessageAttachmentsComponent=l},function(e,t){e.exports=c},function(e,t){e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(5),r=n(4),i=n(9),c=function(e){function t(t,n){var a=e.call(this)||this;return a.element=t,a.intl=n,a.cssClass=!0,a}var n;return a.__extends(t,e),n=t,Object.defineProperty(t.prototype,"tabIndex",{get:function(){return this.tabbable?"0":"-1"},enumerable:!0,configurable:!0}),t.prototype.formatTimeStamp=function(e){return this.intl.formatDate(e,{datetime:"short"})},t.prototype.focus=function(){this.element.nativeElement.focus()},a.__decorate([o.Input(),a.__metadata("design:type",Object)],t.prototype,"message",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Boolean)],t.prototype,"tabbable",void 0),a.__decorate([o.Input(),a.__metadata("design:type",r.MessageTemplateDirective)],t.prototype,"template",void 0),a.__decorate([o.HostBinding("class.k-message"),a.__metadata("design:type",Boolean)],t.prototype,"cssClass",void 0),a.__decorate([o.HostBinding("class.k-state-selected"),o.HostBinding("class.k-state-focused"),a.__metadata("design:type",Boolean)],t.prototype,"selected",void 0),a.__decorate([o.HostBinding("attr.tabIndex"),a.__metadata("design:type",String),a.__metadata("design:paramtypes",[])],t.prototype,"tabIndex",null),t=n=a.__decorate([o.Component({selector:"kendo-chat-message",providers:[{provide:s.ChatItem,useExisting:o.forwardRef((function(){return n}))}],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 '}),a.__metadata("design:paramtypes",[o.ElementRef,i.IntlService])],t)}(s.ChatItem);t.MessageComponent=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(10),r=n(31),i=n(5),c=n(32),l=n(2),u=n(4),d=n(9),p=function(){function e(e,t){var n,a=this;this.element=e,this.intl=t,this.executeAction=new o.EventEmitter,this.navigate=new o.EventEmitter,this.resize=new o.EventEmitter,this.cssClass=!0,this.view=[],this.keyActions=((n={})[38]=function(e){return a.navigateTo(e,-1)},n[40]=function(e){return a.navigateTo(e,1)},n)}return Object.defineProperty(e.prototype,"messages",{get:function(){return this._messages},set:function(e){var t=e||[];this.view=c.chatView(t),this._messages=t},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.selectedItem=this.items.last},e.prototype.onResize=function(){this.resize.emit()},e.prototype.formatTimeStamp=function(e){return this.intl.formatDate(e,{date:"full"})},e.prototype.onKeydown=function(e){var t=this.keyActions[e.keyCode];t&&t(e)},e.prototype.onBlur=function(e){var t=this,n=e.relatedTarget||document.activeElement;!r.closest(n,(function(e){return e===t.element.nativeElement}))&&this.select(null)},e.prototype.isOwnMessage=function(e){return c.isAuthor(this.user,e)},e.prototype.dispatchAction=function(e,t){var n=new s.ExecuteActionEvent(e,t);this.executeAction.emit(n)},e.prototype.trackGroup=function(e,t){return t.trackBy},e.prototype.select=function(e){var t=this.selectedItem;t&&(t.selected=!1),e&&(e.selected=!0,this.selectedItem=e)},e.prototype.last=function(e){if(e&&0!==e.length)return e[e.length-1]},e.prototype.navigateTo=function(e,t){var n=this.items.toArray(),a=this.selectedItem,o=n.indexOf(a),s=n[Math.max(0,Math.min(o+t,this.items.length-1))];s!==a&&(this.select(s),s.focus(),this.navigate.emit(),e.preventDefault())},a.__decorate([o.Input(),a.__metadata("design:type",Array),a.__metadata("design:paramtypes",[Array])],e.prototype,"messages",null),a.__decorate([o.Input(),a.__metadata("design:type",l.AttachmentTemplateDirective)],e.prototype,"attachmentTemplate",void 0),a.__decorate([o.Input(),a.__metadata("design:type",u.MessageTemplateDirective)],e.prototype,"messageTemplate",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Object)],e.prototype,"user",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"executeAction",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"navigate",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"resize",void 0),a.__decorate([o.ViewChildren(i.ChatItem),a.__metadata("design:type",o.QueryList)],e.prototype,"items",void 0),a.__decorate([o.HostBinding("class.k-message-list-content"),a.__metadata("design:type",Boolean)],e.prototype,"cssClass",void 0),a.__decorate([o.HostListener("keydown",["$event"]),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[Object]),a.__metadata("design:returntype",void 0)],e.prototype,"onKeydown",null),a.__decorate([o.HostListener("focusout",["$event"]),a.__metadata("design:type",Function),a.__metadata("design:paramtypes",[FocusEvent]),a.__metadata("design:returntype",void 0)],e.prototype,"onBlur",null),e=a.__decorate([o.Component({selector:"kendo-chat-message-list",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 '}),a.__metadata("design:paramtypes",[o.ElementRef,d.IntlService])],e)}();t.MessageListComponent=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}();t.PreventableEvent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closest=function(e,t){for(;e&&!t(e);)e=e.parentNode;return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1);t.isAuthor=function(e,t){return e&&t.author&&e.id===t.author.id};var o=function(e){return e[e.length-1]},s=function(e){return function(n,s,r){var i=r===e-1;return function(e,t){var n,a,s=t.timestamp,r=o(e);if(s&&(!r||(n=s,a=r.timestamp,n&&a&&(a.getDate()!==n.getDate()||a.getMonth()!==n.getMonth()||a.getFullYear()!==n.getFullYear())))){var i={type:"date-marker",timestamp:s,trackBy:s.getTime()};e.push(i)}}(n,s),function(e,n,s){var r,i=o(e);if(a.isDevMode()&&!n.author)throw new Error("Author must be set for message: "+JSON.stringify(n));n.typing&&!s||(i&&"message-group"===i.type&&(r=i.messages),r&&t.isAuthor(n.author,o(r))?r.push(n):e.push({type:"message-group",messages:[n],author:n.author,timestamp:n.timestamp,trackBy:n}))}(n,s,i),s.attachments&&s.attachments.length>1&&n.push({type:"attachment-group",attachments:s.attachments,attachmentLayout:s.attachmentLayout,timestamp:s.timestamp,trackBy:s}),s.suggestedActions&&i&&n.push({type:"action-group",actions:s.suggestedActions,timestamp:s.timestamp,trackBy:s}),n}};t.chatView=function(e){return e.reduce(s(e.length),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=function(){function e(e,t,n){this.element=e,this.zone=t,this.renderer=n,this.autoScroll=!0,this.autoScrollChange=new o.EventEmitter,this.overflowAnchor="none",this.scrolling=!1}return e.prototype.ngOnInit=function(){var e=this;this.zone.runOutsideAngular((function(){e.unsubscribe=e.renderer.listen(e.element.nativeElement,"scroll",(function(){return e.onScroll()}))}))},e.prototype.ngAfterViewInit=function(){this.scrollToBottom()},e.prototype.ngOnDestroy=function(){this.unsubscribe&&this.unsubscribe()},e.prototype.onScroll=function(){var e=this;if(!this.scrolling){var t=this.element.nativeElement,n=t.scrollTop+t.offsetHeight,a=t.scrollHeight-n<2;this.autoScroll!==a&&this.zone.run((function(){e.autoScroll=a,e.autoScrollChange.emit(e.autoScroll)}))}},e.prototype.scrollToBottom=function(){var e=this;if(this.autoScroll){var t=this.element.nativeElement;t.scrollTop=t.scrollHeight-t.clientHeight,this.scrolling=!0,this.zone.runOutsideAngular((function(){return setTimeout((function(){return e.scrolling=!1}),1e3)}))}},a.__decorate([o.Input(),a.__metadata("design:type",Boolean)],e.prototype,"autoScroll",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],e.prototype,"autoScrollChange",void 0),a.__decorate([o.HostBinding("style.overflow-anchor"),a.__metadata("design:type",String)],e.prototype,"overflowAnchor",void 0),e=a.__decorate([o.Directive({selector:"[kendoChatScrollAnchor]",exportAs:"scrollAnchor"}),a.__metadata("design:paramtypes",[o.ElementRef,o.NgZone,o.Renderer2])],e)}();t.ScrollAnchorDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=n(1),s=n(5),r=function(e){function t(){var t,n=null!==e&&e.apply(this,arguments)||this;return n.dispatch=new o.EventEmitter,n.defaultClass=!0,n.selectedIndex=0,n.keyHandlers=((t={})[37]=function(e){return n.navigateTo(e,-1)},t[39]=function(e){return n.navigateTo(e,1)},t[13]=function(e,t){return n.actionClick(t)},t),n}var n;return a.__extends(t,e),n=t,t.prototype.isSelected=function(e){return this.selected&&this.selectedIndex===e},t.prototype.actionClick=function(e){this.dispatch.next(e)},t.prototype.actionKeydown=function(e,t){var n=this.keyHandlers[e.keyCode];n&&n(e,t)},t.prototype.focus=function(){this.select(this.selectedIndex)},t.prototype.select=function(e){this.selectedIndex=e;var t=this.items.toArray()[e];t&&t.nativeElement.focus()},t.prototype.navigateTo=function(e,t){var n=this.selectedIndex,a=Math.max(0,Math.min(n+t,this.items.length-1));a!==n&&(this.select(a),e.preventDefault())},a.__decorate([o.Input(),a.__metadata("design:type",Array)],t.prototype,"actions",void 0),a.__decorate([o.Input(),a.__metadata("design:type",Boolean)],t.prototype,"tabbable",void 0),a.__decorate([o.Output(),a.__metadata("design:type",o.EventEmitter)],t.prototype,"dispatch",void 0),a.__decorate([o.HostBinding("class.k-quick-replies"),a.__metadata("design:type",Boolean)],t.prototype,"defaultClass",void 0),a.__decorate([o.ViewChildren("item"),a.__metadata("design:type",o.QueryList)],t.prototype,"items",void 0),t=n=a.__decorate([o.Component({selector:"kendo-chat-suggested-actions",providers:[{provide:s.ChatItem,useExisting:o.forwardRef((function(){return n}))}],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 '})],t)}(s.ChatItem);t.SuggestedActionsComponent=r}])}));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { PreventableEvent } from "./preventable-event";
|
|
7
|
-
/**
|
|
8
|
-
* Arguments for the `executeAction` event. The `executeAction` event fires when the user clicks
|
|
9
|
-
* a quick action button. Calling `preventDefault()` suppresses the built-in action handler.
|
|
10
|
-
*/
|
|
11
|
-
var ExecuteActionEvent = /** @class */ (function (_super) {
|
|
12
|
-
tslib_1.__extends(ExecuteActionEvent, _super);
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
function ExecuteActionEvent(action, message) {
|
|
17
|
-
var _this = _super.call(this) || this;
|
|
18
|
-
_this.action = action;
|
|
19
|
-
_this.message = message;
|
|
20
|
-
return _this;
|
|
21
|
-
}
|
|
22
|
-
return ExecuteActionEvent;
|
|
23
|
-
}(PreventableEvent));
|
|
24
|
-
export { ExecuteActionEvent };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* Arguments for the `SendMessage` event.
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
var SendMessageEvent = /** @class */ (function () {
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
function SendMessageEvent(message) {
|
|
14
|
-
this.message = message;
|
|
15
|
-
}
|
|
16
|
-
return SendMessageEvent;
|
|
17
|
-
}());
|
|
18
|
-
export { SendMessageEvent };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
var PreventableEvent = /** @class */ (function () {
|
|
9
|
-
function PreventableEvent() {
|
|
10
|
-
this.prevented = false;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Prevents the default action for a specified event.
|
|
14
|
-
* In this way, the source component suppresses
|
|
15
|
-
* the built-in behavior that follows the event.
|
|
16
|
-
*/
|
|
17
|
-
PreventableEvent.prototype.preventDefault = function () {
|
|
18
|
-
this.prevented = true;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Returns `true` if the event was prevented
|
|
22
|
-
* by any of its subscribers.
|
|
23
|
-
*
|
|
24
|
-
* @returns `true` if the default action was prevented.
|
|
25
|
-
* Otherwise, returns `false`.
|
|
26
|
-
*/
|
|
27
|
-
PreventableEvent.prototype.isDefaultPrevented = function () {
|
|
28
|
-
return this.prevented;
|
|
29
|
-
};
|
|
30
|
-
return PreventableEvent;
|
|
31
|
-
}());
|
|
32
|
-
export { PreventableEvent };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
|
|
7
|
-
/**
|
|
8
|
-
* Represents a Hero Card component ([see example]({% slug dialogflow_chat %})).
|
|
9
|
-
* Hero cards host a single large image and action buttons with text content.
|
|
10
|
-
*/
|
|
11
|
-
var HeroCardComponent = /** @class */ (function () {
|
|
12
|
-
function HeroCardComponent() {
|
|
13
|
-
this.cssClass = true;
|
|
14
|
-
/**
|
|
15
|
-
* Fires when the user clicks a button.
|
|
16
|
-
*/
|
|
17
|
-
this.executeAction = new EventEmitter();
|
|
18
|
-
}
|
|
19
|
-
HeroCardComponent.prototype.onClick = function (action) {
|
|
20
|
-
this.executeAction.next(action);
|
|
21
|
-
};
|
|
22
|
-
tslib_1.__decorate([
|
|
23
|
-
Input(),
|
|
24
|
-
tslib_1.__metadata("design:type", String)
|
|
25
|
-
], HeroCardComponent.prototype, "imageUrl", void 0);
|
|
26
|
-
tslib_1.__decorate([
|
|
27
|
-
Input(),
|
|
28
|
-
tslib_1.__metadata("design:type", String)
|
|
29
|
-
], HeroCardComponent.prototype, "title", void 0);
|
|
30
|
-
tslib_1.__decorate([
|
|
31
|
-
Input(),
|
|
32
|
-
tslib_1.__metadata("design:type", String)
|
|
33
|
-
], HeroCardComponent.prototype, "subtitle", void 0);
|
|
34
|
-
tslib_1.__decorate([
|
|
35
|
-
Input(),
|
|
36
|
-
tslib_1.__metadata("design:type", Array)
|
|
37
|
-
], HeroCardComponent.prototype, "actions", void 0);
|
|
38
|
-
tslib_1.__decorate([
|
|
39
|
-
HostBinding('class.k-card'),
|
|
40
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
41
|
-
], HeroCardComponent.prototype, "cssClass", void 0);
|
|
42
|
-
tslib_1.__decorate([
|
|
43
|
-
Output(),
|
|
44
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
45
|
-
], HeroCardComponent.prototype, "executeAction", void 0);
|
|
46
|
-
HeroCardComponent = tslib_1.__decorate([
|
|
47
|
-
Component({
|
|
48
|
-
selector: 'kendo-chat-hero-card',
|
|
49
|
-
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 "
|
|
50
|
-
})
|
|
51
|
-
], HeroCardComponent);
|
|
52
|
-
return HeroCardComponent;
|
|
53
|
-
}());
|
|
54
|
-
export { HeroCardComponent };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Directive, Optional, TemplateRef } from "@angular/core";
|
|
7
|
-
/**
|
|
8
|
-
* Defines a template that will be used for displaying message attachments. To define an attachment
|
|
9
|
-
* template, nest an `<ng-template>` tag with the `kendoChatAttachmentTemplate` attribute inside the
|
|
10
|
-
* `<kendo-chat>` component. The template context is set to the attachment instance. For more information,
|
|
11
|
-
* refer to the article on [message attachments]({% slug attachments_chat %}).
|
|
12
|
-
*
|
|
13
|
-
* {% meta height:700 %}
|
|
14
|
-
* {% embed_file attachments/templates/app.component.ts preview %}
|
|
15
|
-
* {% embed_file shared/app.module.ts preview %}
|
|
16
|
-
* {% embed_file shared/main.ts hidden %}
|
|
17
|
-
* {% endmeta %}
|
|
18
|
-
*/
|
|
19
|
-
var AttachmentTemplateDirective = /** @class */ (function () {
|
|
20
|
-
function AttachmentTemplateDirective(templateRef) {
|
|
21
|
-
this.templateRef = templateRef;
|
|
22
|
-
}
|
|
23
|
-
AttachmentTemplateDirective = tslib_1.__decorate([
|
|
24
|
-
Directive({
|
|
25
|
-
selector: '[kendoChatAttachmentTemplate]'
|
|
26
|
-
}),
|
|
27
|
-
tslib_1.__param(0, Optional()),
|
|
28
|
-
tslib_1.__metadata("design:paramtypes", [TemplateRef])
|
|
29
|
-
], AttachmentTemplateDirective);
|
|
30
|
-
return AttachmentTemplateDirective;
|
|
31
|
-
}());
|
|
32
|
-
export { AttachmentTemplateDirective };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, Input } from '@angular/core';
|
|
7
|
-
import { AttachmentTemplateDirective } from './chat.directives';
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
var AttachmentComponent = /** @class */ (function () {
|
|
12
|
-
function AttachmentComponent() {
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(AttachmentComponent.prototype, "attachment", {
|
|
15
|
-
get: function () {
|
|
16
|
-
return this._attachment;
|
|
17
|
-
},
|
|
18
|
-
set: function (value) {
|
|
19
|
-
this._attachment = value;
|
|
20
|
-
this.context = {
|
|
21
|
-
$implicit: this.attachment
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(AttachmentComponent.prototype, "image", {
|
|
28
|
-
get: function () {
|
|
29
|
-
return this.contentType.indexOf('image/') === 0;
|
|
30
|
-
},
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true
|
|
33
|
-
});
|
|
34
|
-
Object.defineProperty(AttachmentComponent.prototype, "unknown", {
|
|
35
|
-
get: function () {
|
|
36
|
-
return !this.image;
|
|
37
|
-
},
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(AttachmentComponent.prototype, "contentType", {
|
|
42
|
-
get: function () {
|
|
43
|
-
return this.attachment.contentType || '';
|
|
44
|
-
},
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true
|
|
47
|
-
});
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
Input(),
|
|
50
|
-
tslib_1.__metadata("design:type", Object),
|
|
51
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
52
|
-
], AttachmentComponent.prototype, "attachment", null);
|
|
53
|
-
tslib_1.__decorate([
|
|
54
|
-
Input(),
|
|
55
|
-
tslib_1.__metadata("design:type", AttachmentTemplateDirective)
|
|
56
|
-
], AttachmentComponent.prototype, "template", void 0);
|
|
57
|
-
AttachmentComponent = tslib_1.__decorate([
|
|
58
|
-
Component({
|
|
59
|
-
selector: 'kendo-chat-attachment',
|
|
60
|
-
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 "
|
|
61
|
-
})
|
|
62
|
-
], AttachmentComponent);
|
|
63
|
-
return AttachmentComponent;
|
|
64
|
-
}());
|
|
65
|
-
export { AttachmentComponent };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { SendMessageEvent } from '../api/post-message-event';
|
|
6
|
-
var noop = function () { };
|
|
7
|
-
var ɵ0 = noop;
|
|
8
|
-
var ɵ1 = function (action, sender) {
|
|
9
|
-
sender.sendMessage.emit(new SendMessageEvent({
|
|
10
|
-
author: sender.user,
|
|
11
|
-
text: action.value,
|
|
12
|
-
timestamp: new Date()
|
|
13
|
-
}));
|
|
14
|
-
}, ɵ2 = function (action) {
|
|
15
|
-
window.open('tel:' + action.value);
|
|
16
|
-
}, ɵ3 = function (action) {
|
|
17
|
-
window.open(action.value);
|
|
18
|
-
};
|
|
19
|
-
var handlers = {
|
|
20
|
-
'reply': ɵ1,
|
|
21
|
-
'call': ɵ2,
|
|
22
|
-
'openUrl': ɵ3
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* @hidden
|
|
26
|
-
*/
|
|
27
|
-
export var makeHandler = function (action) { return handlers[action.type] || noop; };
|
|
28
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3 };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
var ChatItem = /** @class */ (function () {
|
|
9
|
-
function ChatItem() {
|
|
10
|
-
}
|
|
11
|
-
return ChatItem;
|
|
12
|
-
}());
|
|
13
|
-
export { ChatItem };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { isDevMode } from '@angular/core';
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
export var isAuthor = function (user, msg) {
|
|
10
|
-
return user && msg.author && user.id === msg.author.id;
|
|
11
|
-
};
|
|
12
|
-
var last = function (arr) { return arr[arr.length - 1]; };
|
|
13
|
-
var ɵ0 = last;
|
|
14
|
-
var dateChanged = function (curr, prev) {
|
|
15
|
-
return (curr && prev) && (prev.getDate() !== curr.getDate() ||
|
|
16
|
-
prev.getMonth() !== curr.getMonth() ||
|
|
17
|
-
prev.getFullYear() !== curr.getFullYear());
|
|
18
|
-
};
|
|
19
|
-
var ɵ1 = dateChanged;
|
|
20
|
-
var addDateMarker = function (acc, msg) {
|
|
21
|
-
var timestamp = msg.timestamp;
|
|
22
|
-
var lastItem = last(acc);
|
|
23
|
-
if (!timestamp) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (!lastItem || dateChanged(timestamp, lastItem.timestamp)) {
|
|
27
|
-
var dateMarker = {
|
|
28
|
-
type: 'date-marker',
|
|
29
|
-
timestamp: timestamp,
|
|
30
|
-
trackBy: timestamp.getTime()
|
|
31
|
-
};
|
|
32
|
-
acc.push(dateMarker);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var ɵ2 = addDateMarker;
|
|
36
|
-
var groupMessages = function (acc, msg, isLastMessage) {
|
|
37
|
-
var lastItem = last(acc);
|
|
38
|
-
var messages;
|
|
39
|
-
if (isDevMode() && !msg.author) {
|
|
40
|
-
throw new Error('Author must be set for message: ' + JSON.stringify(msg));
|
|
41
|
-
}
|
|
42
|
-
if (msg.typing && !isLastMessage) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (lastItem && lastItem.type === 'message-group') {
|
|
46
|
-
messages = lastItem.messages;
|
|
47
|
-
}
|
|
48
|
-
if (messages && isAuthor(msg.author, last(messages))) {
|
|
49
|
-
messages.push(msg);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
acc.push({
|
|
53
|
-
type: 'message-group',
|
|
54
|
-
messages: [msg],
|
|
55
|
-
author: msg.author,
|
|
56
|
-
timestamp: msg.timestamp,
|
|
57
|
-
trackBy: msg
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var ɵ3 = groupMessages;
|
|
62
|
-
var groupItems = function (total) { return function (acc, msg, index) {
|
|
63
|
-
var isLastMessage = index === total - 1;
|
|
64
|
-
addDateMarker(acc, msg);
|
|
65
|
-
groupMessages(acc, msg, isLastMessage);
|
|
66
|
-
if (msg.attachments && msg.attachments.length > 1) {
|
|
67
|
-
acc.push({
|
|
68
|
-
type: 'attachment-group',
|
|
69
|
-
attachments: msg.attachments,
|
|
70
|
-
attachmentLayout: msg.attachmentLayout,
|
|
71
|
-
timestamp: msg.timestamp,
|
|
72
|
-
trackBy: msg
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (msg.suggestedActions && isLastMessage) {
|
|
76
|
-
acc.push({
|
|
77
|
-
type: 'action-group',
|
|
78
|
-
actions: msg.suggestedActions,
|
|
79
|
-
timestamp: msg.timestamp,
|
|
80
|
-
trackBy: msg
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
return acc;
|
|
84
|
-
}; };
|
|
85
|
-
var ɵ4 = groupItems;
|
|
86
|
-
/**
|
|
87
|
-
* @hidden
|
|
88
|
-
*/
|
|
89
|
-
export var chatView = function (messages) {
|
|
90
|
-
return messages.reduce(groupItems(messages.length), []);
|
|
91
|
-
};
|
|
92
|
-
export { ɵ0, ɵ1, ɵ2, ɵ3, ɵ4 };
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Component, ContentChild, ElementRef, EventEmitter, HostBinding, Input, isDevMode, Output, ViewChild, NgZone } from '@angular/core';
|
|
7
|
-
import { AttachmentTemplateDirective } from './attachment-template.directive';
|
|
8
|
-
import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
|
|
9
|
-
import { makeHandler } from './builtin-actions';
|
|
10
|
-
import { MessageTemplateDirective } from './message-template.directive';
|
|
11
|
-
import { SendMessageEvent } from '../api/post-message-event';
|
|
12
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
13
|
-
import { packageMetadata } from '../package-metadata';
|
|
14
|
-
// tslint:disable-next-line:max-line-length
|
|
15
|
-
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>';
|
|
16
|
-
/**
|
|
17
|
-
* Represents the Kendo UI Chat component for Angular.
|
|
18
|
-
*
|
|
19
|
-
* {% meta height:700 %}
|
|
20
|
-
* {% embed_file echo/app.component.ts preview %}
|
|
21
|
-
* {% embed_file shared/app.module.ts %}
|
|
22
|
-
* {% embed_file shared/main.ts hidden %}
|
|
23
|
-
* {% endmeta %}
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
var ChatComponent = /** @class */ (function () {
|
|
27
|
-
function ChatComponent(localization, zone) {
|
|
28
|
-
var _this = this;
|
|
29
|
-
this.localization = localization;
|
|
30
|
-
this.zone = zone;
|
|
31
|
-
/**
|
|
32
|
-
* Fires when the user types a message and clicks the **Send** button or presses **Enter**.
|
|
33
|
-
* Emits the [`SendMessageEvent`]({% slug api_conversational-ui_sendmessageevent %}).
|
|
34
|
-
*
|
|
35
|
-
* > The message is not automatically appended to the `messages` array.
|
|
36
|
-
*/
|
|
37
|
-
this.sendMessage = new EventEmitter();
|
|
38
|
-
/**
|
|
39
|
-
* Fires when the user clicks a quick action button.
|
|
40
|
-
* The Chat internally handles the `reply`, `openUrl`, and `call` [known actions]({% slug api_conversational-ui_actiontype %}).
|
|
41
|
-
*
|
|
42
|
-
* Emits the [`ExecuteActionEvent`]({% slug api_conversational-ui_executeactionevent %}).
|
|
43
|
-
* The event is preventable. If `preventDefault` is called, the built-in action will be suppressed.
|
|
44
|
-
*/
|
|
45
|
-
this.executeAction = new EventEmitter();
|
|
46
|
-
/**
|
|
47
|
-
* @hidden
|
|
48
|
-
*/
|
|
49
|
-
this.autoScroll = true;
|
|
50
|
-
validatePackage(packageMetadata);
|
|
51
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
52
|
-
this.localizationChangeSubscription = localization.changes.subscribe(function (_a) {
|
|
53
|
-
var rtl = _a.rtl;
|
|
54
|
-
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
Object.defineProperty(ChatComponent.prototype, "className", {
|
|
58
|
-
get: function () {
|
|
59
|
-
return 'k-widget k-chat';
|
|
60
|
-
},
|
|
61
|
-
enumerable: true,
|
|
62
|
-
configurable: true
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(ChatComponent.prototype, "dirAttr", {
|
|
65
|
-
get: function () {
|
|
66
|
-
return this.direction;
|
|
67
|
-
},
|
|
68
|
-
enumerable: true,
|
|
69
|
-
configurable: true
|
|
70
|
-
});
|
|
71
|
-
ChatComponent.prototype.ngOnChanges = function () {
|
|
72
|
-
var _this = this;
|
|
73
|
-
this.zone.runOutsideAngular(function () { return setTimeout(function () {
|
|
74
|
-
_this.messageList.nativeElement.style.flex = '1 1 auto';
|
|
75
|
-
}); });
|
|
76
|
-
};
|
|
77
|
-
ChatComponent.prototype.ngAfterViewInit = function () {
|
|
78
|
-
if (!isDevMode()) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (!this.user) {
|
|
82
|
-
throw new Error('User must be set and have a valid id.');
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
ChatComponent.prototype.ngOnDestroy = function () {
|
|
86
|
-
if (this.localizationChangeSubscription) {
|
|
87
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* @hidden
|
|
92
|
-
*/
|
|
93
|
-
ChatComponent.prototype.sendClick = function () {
|
|
94
|
-
var input = this.messageInput.nativeElement;
|
|
95
|
-
var value = input.value;
|
|
96
|
-
if (!value) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
var message = {
|
|
100
|
-
author: this.user,
|
|
101
|
-
text: value,
|
|
102
|
-
timestamp: new Date()
|
|
103
|
-
};
|
|
104
|
-
this.sendMessage.emit(new SendMessageEvent(message));
|
|
105
|
-
input.value = null;
|
|
106
|
-
input.focus();
|
|
107
|
-
this.autoScroll = true;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* @hidden
|
|
111
|
-
*/
|
|
112
|
-
ChatComponent.prototype.inputKeydown = function (e) {
|
|
113
|
-
if (e.keyCode === 13 /* enter */) {
|
|
114
|
-
this.sendClick();
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* @hidden
|
|
119
|
-
*/
|
|
120
|
-
ChatComponent.prototype.dispatchAction = function (e) {
|
|
121
|
-
this.executeAction.emit(e);
|
|
122
|
-
if (!e.isDefaultPrevented()) {
|
|
123
|
-
var handler = makeHandler(e.action);
|
|
124
|
-
handler(e.action, this);
|
|
125
|
-
this.messageInput.nativeElement.focus();
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* @hidden
|
|
130
|
-
*/
|
|
131
|
-
ChatComponent.prototype.textFor = function (key) {
|
|
132
|
-
return this.localization.get(key);
|
|
133
|
-
};
|
|
134
|
-
tslib_1.__decorate([
|
|
135
|
-
Input(),
|
|
136
|
-
tslib_1.__metadata("design:type", Array)
|
|
137
|
-
], ChatComponent.prototype, "messages", void 0);
|
|
138
|
-
tslib_1.__decorate([
|
|
139
|
-
Input(),
|
|
140
|
-
tslib_1.__metadata("design:type", Object)
|
|
141
|
-
], ChatComponent.prototype, "user", void 0);
|
|
142
|
-
tslib_1.__decorate([
|
|
143
|
-
Output(),
|
|
144
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
145
|
-
], ChatComponent.prototype, "sendMessage", void 0);
|
|
146
|
-
tslib_1.__decorate([
|
|
147
|
-
Output(),
|
|
148
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
149
|
-
], ChatComponent.prototype, "executeAction", void 0);
|
|
150
|
-
tslib_1.__decorate([
|
|
151
|
-
HostBinding('class'),
|
|
152
|
-
tslib_1.__metadata("design:type", String),
|
|
153
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
154
|
-
], ChatComponent.prototype, "className", null);
|
|
155
|
-
tslib_1.__decorate([
|
|
156
|
-
HostBinding('attr.dir'),
|
|
157
|
-
tslib_1.__metadata("design:type", String),
|
|
158
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
159
|
-
], ChatComponent.prototype, "dirAttr", null);
|
|
160
|
-
tslib_1.__decorate([
|
|
161
|
-
ContentChild(AttachmentTemplateDirective, { static: false }),
|
|
162
|
-
tslib_1.__metadata("design:type", AttachmentTemplateDirective)
|
|
163
|
-
], ChatComponent.prototype, "attachmentTemplate", void 0);
|
|
164
|
-
tslib_1.__decorate([
|
|
165
|
-
ContentChild(MessageTemplateDirective, { static: false }),
|
|
166
|
-
tslib_1.__metadata("design:type", MessageTemplateDirective)
|
|
167
|
-
], ChatComponent.prototype, "messageTemplate", void 0);
|
|
168
|
-
tslib_1.__decorate([
|
|
169
|
-
ViewChild('messageInput', { static: true }),
|
|
170
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
171
|
-
], ChatComponent.prototype, "messageInput", void 0);
|
|
172
|
-
tslib_1.__decorate([
|
|
173
|
-
ViewChild('messageList', { static: true }),
|
|
174
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
175
|
-
], ChatComponent.prototype, "messageList", void 0);
|
|
176
|
-
ChatComponent = tslib_1.__decorate([
|
|
177
|
-
Component({
|
|
178
|
-
providers: [
|
|
179
|
-
LocalizationService,
|
|
180
|
-
{
|
|
181
|
-
provide: L10N_PREFIX,
|
|
182
|
-
useValue: 'kendo.chat'
|
|
183
|
-
}
|
|
184
|
-
],
|
|
185
|
-
selector: 'kendo-chat',
|
|
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\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 "
|
|
187
|
-
}),
|
|
188
|
-
tslib_1.__metadata("design:paramtypes", [LocalizationService,
|
|
189
|
-
NgZone])
|
|
190
|
-
], ChatComponent);
|
|
191
|
-
return ChatComponent;
|
|
192
|
-
}());
|
|
193
|
-
export { ChatComponent };
|