UNPKG

angular-chat-widget-rasa

Version:

A chatbot widget that is able to connect to a rasa chatbot using SocketIO

49 lines 4.41 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, EventEmitter, Input, Output } from '@angular/core'; var ChatConfigComponent = /** @class */ (function () { function ChatConfigComponent() { this.text = 'Select theme'; this.themeChange = new EventEmitter(); this.themes = ['blue', 'grey', 'red']; } /** * @param {?} theme * @return {?} */ ChatConfigComponent.prototype.setTheme = /** * @param {?} theme * @return {?} */ function (theme) { this.theme = theme; this.themeChange.emit(this.theme); }; ChatConfigComponent.decorators = [ { type: Component, args: [{ selector: 'chat-config', template: "\n <div class=\"chat-config\">\n {{text}}\n <button *ngFor=\"let item of themes\"\n class=\"btn\" [class.btn-active]=\"item === theme\"\n (click)=\"setTheme(item)\">\n {{item}}\n </button>\n </div>\n ", styles: ["\n .chat-config {\n padding: 20px;\n }\n .btn {\n padding: 5px;\n margin: 0px 2px;\n border: 1px solid #dedede;\n outline: none;\n }\n .btn-active {\n border: 1px solid #a0a0a0;\n }\n .btn:focus {\n border: 1px solid #333;\n }\n "] }] } ]; ChatConfigComponent.propDecorators = { theme: [{ type: Input }], text: [{ type: Input }], themeChange: [{ type: Output }] }; return ChatConfigComponent; }()); export { ChatConfigComponent }; if (false) { /** @type {?} */ ChatConfigComponent.prototype.theme; /** @type {?} */ ChatConfigComponent.prototype.text; /** @type {?} */ ChatConfigComponent.prototype.themeChange; /** @type {?} */ ChatConfigComponent.prototype.themes; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC1jb25maWcuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vYW5ndWxhci1jaGF0LXdpZGdldC1yYXNhLyIsInNvdXJjZXMiOlsibGliL2NoYXQtY29uZmlnL2NoYXQtY29uZmlnLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm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