@datarailsshared/datarailsshared 1.4.102 → 1.4.106
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/assets/styles/img/default-chat-avatar.svg +13 -0
- package/bundles/datarailsshared-datarailsshared.umd.js +59 -11
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.106.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-chat/chat.component.js +22 -4
- package/esm2015/lib/dr-chat/dr-chat-form/chat-form.component.js +7 -3
- package/esm2015/lib/dr-chat/dr-chat-message/chat-message.component.js +17 -4
- package/esm2015/lib/dr-popover/dr-popover.service.js +7 -2
- package/esm2015/lib/models/chat.js +4 -3
- package/esm2015/lib/models/popover.js +1 -1
- package/fesm2015/datarailsshared-datarailsshared.js +50 -11
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-chat/chat.component.d.ts +7 -2
- package/lib/dr-chat/dr-chat-form/chat-form.component.d.ts +1 -0
- package/lib/dr-chat/dr-chat-message/chat-message.component.d.ts +8 -0
- package/lib/models/chat.d.ts +4 -1
- package/lib/models/popover.d.ts +1 -0
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.102.tgz +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_60_3314)">
|
|
3
|
+
<circle cx="16" cy="16" r="16" fill="#151B3F"/>
|
|
4
|
+
<path d="M23.9836 6C23.8033 6 23.6271 6.05345 23.4773 6.15358C23.3274 6.25372 23.2106 6.39605 23.1416 6.56257C23.0727 6.72909 23.0546 6.91233 23.0898 7.0891C23.1249 7.26588 23.2117 7.42826 23.3392 7.55571C23.4666 7.68316 23.629 7.76995 23.8058 7.80512C23.9826 7.84028 24.1658 7.82223 24.3323 7.75326C24.4988 7.68428 24.6412 7.56748 24.7413 7.41761C24.8414 7.26775 24.8949 7.09156 24.8949 6.91131C24.8949 6.79164 24.8713 6.67314 24.8255 6.56257C24.7797 6.452 24.7126 6.35154 24.628 6.26692C24.5433 6.18229 24.4429 6.11517 24.3323 6.06937C24.2218 6.02357 24.1032 6 23.9836 6Z" fill="#F93576"/>
|
|
5
|
+
<path d="M14.4784 12.2578C13.4049 12.5041 12.4218 13.0459 11.6402 13.8219C10.8585 14.5979 10.3096 15.5771 10.0556 16.6488L10.0186 16.8072H11.5809L11.6098 16.7177C11.8243 16.0309 12.2036 15.407 12.7146 14.9004C13.2255 14.3937 13.8526 14.0197 14.5412 13.8109L14.6317 13.7832V12.2218L14.4784 12.2578Z" fill="#FFA310"/>
|
|
6
|
+
<path d="M20.26 14.0557L19.8897 13.7091C19.1313 12.9969 18.1992 12.4965 17.1866 12.2578L17.0303 12.2208V13.7832L17.1208 13.8109C17.743 14.0025 18.3152 14.329 18.7966 14.7671C19.2781 15.2053 19.6569 15.7444 19.906 16.3458C20.1551 16.9473 20.2683 17.5963 20.2376 18.2466C20.2069 18.8969 20.0331 19.5323 19.7284 20.1077C19.4238 20.683 18.9959 21.184 18.4754 21.5749C17.9548 21.9658 17.3544 22.2369 16.7169 22.369C16.0794 22.501 15.4207 22.4908 14.7877 22.3389C14.1547 22.187 13.563 21.8972 13.0549 21.4903C12.356 20.9222 11.8443 20.157 11.586 19.2943L11.5593 19.2027H10L10.035 19.358C10.3187 20.5951 10.9875 21.7104 11.945 22.5435C13.0538 23.5056 14.48 24.0223 15.9477 23.9936C17.4155 23.9649 18.8204 23.3929 19.8907 22.3882L20.26 22.0426V23.8282H21.7771V9.13403H20.26V14.0557Z" fill="#FBFCF5"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_60_3314">
|
|
10
|
+
<rect width="32" height="32" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -2612,9 +2612,14 @@
|
|
|
2612
2612
|
DrPopoverService.prototype.getOverlayConfig = function (popoverModel) {
|
|
2613
2613
|
if (!POPUP_POSITIONS[popoverModel.position])
|
|
2614
2614
|
throw new Error("DrPopover does not support the '" + (popoverModel === null || popoverModel === void 0 ? void 0 : popoverModel.position) + "' position!");
|
|
2615
|
+
var position = Object.assign({}, POPUP_POSITIONS[popoverModel.position]);
|
|
2616
|
+
if (popoverModel.overlayConfig.noPadding) {
|
|
2617
|
+
position.offsetY = 0;
|
|
2618
|
+
position.offsetX = 0;
|
|
2619
|
+
}
|
|
2615
2620
|
var config = Object.assign(Object.assign({}, DEFAULT_CONFIG), popoverModel.overlayConfig || {});
|
|
2616
2621
|
var hostElement = this.getHostElement(popoverModel.hostRef);
|
|
2617
|
-
var positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(popoverModel.hostRef).withPositions([
|
|
2622
|
+
var positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(popoverModel.hostRef).withPositions([position]);
|
|
2618
2623
|
var overlayConfig = new i1.OverlayConfig(Object.assign({ scrollStrategy: this.overlay.scrollStrategies.noop(), positionStrategy: positionStrategy }, config));
|
|
2619
2624
|
if (popoverModel.alignment === 'host' && hostElement) {
|
|
2620
2625
|
var alignmentDimension = getAlignmentDimension(popoverModel.position);
|
|
@@ -3938,7 +3943,6 @@
|
|
|
3938
3943
|
CHAT_MESSAGE_TYPE["DOWNLOAD_FILE"] = "download-file";
|
|
3939
3944
|
CHAT_MESSAGE_TYPE["MAILTO"] = "mailto";
|
|
3940
3945
|
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
3941
|
-
CHAT_MESSAGE_TYPE["WIDGET"] = "widget";
|
|
3942
3946
|
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
3943
3947
|
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
3944
3948
|
})(exports.CHAT_MESSAGE_TYPE || (exports.CHAT_MESSAGE_TYPE = {}));
|
|
@@ -3948,7 +3952,7 @@
|
|
|
3948
3952
|
this.kind = obj === null || obj === void 0 ? void 0 : obj.kind;
|
|
3949
3953
|
this.seq = obj === null || obj === void 0 ? void 0 : obj.seq;
|
|
3950
3954
|
this.conversationId = obj === null || obj === void 0 ? void 0 : obj.conversationId;
|
|
3951
|
-
this.reply = (obj === null || obj === void 0 ? void 0 : obj.senderId) !== user.id;
|
|
3955
|
+
this.reply = (obj === null || obj === void 0 ? void 0 : obj.senderId) !== (user === null || user === void 0 ? void 0 : user.id);
|
|
3952
3956
|
this.senderId = obj === null || obj === void 0 ? void 0 : obj.senderId;
|
|
3953
3957
|
this.parentId = obj === null || obj === void 0 ? void 0 : obj.parentId;
|
|
3954
3958
|
this.text = (obj === null || obj === void 0 ? void 0 : obj.text) || obj.body;
|
|
@@ -3959,6 +3963,8 @@
|
|
|
3959
3963
|
this.body = obj === null || obj === void 0 ? void 0 : obj.body;
|
|
3960
3964
|
this.form = obj === null || obj === void 0 ? void 0 : obj.form;
|
|
3961
3965
|
this.parameters = obj === null || obj === void 0 ? void 0 : obj.parameters;
|
|
3966
|
+
this.useDefaultAvatar = obj === null || obj === void 0 ? void 0 : obj.useDefaultAvatar;
|
|
3967
|
+
this.avatarUrl = obj === null || obj === void 0 ? void 0 : obj.avatarUrl;
|
|
3962
3968
|
}
|
|
3963
3969
|
return ChatMessage;
|
|
3964
3970
|
}());
|
|
@@ -5278,14 +5284,18 @@
|
|
|
5278
5284
|
DrChatFormComponent.prototype.onModelChange = function (value) {
|
|
5279
5285
|
this.inputChange.emit(value);
|
|
5280
5286
|
};
|
|
5287
|
+
DrChatFormComponent.prototype.getTextAreaHeight = function (textAreaElement) {
|
|
5288
|
+
return textAreaElement.scrollHeight / 22 > textAreaElement.rows ?
|
|
5289
|
+
'height: ' + textAreaElement.scrollHeight + 'px;' : '';
|
|
5290
|
+
};
|
|
5281
5291
|
return DrChatFormComponent;
|
|
5282
5292
|
}());
|
|
5283
5293
|
DrChatFormComponent.decorators = [
|
|
5284
5294
|
{ type: i0.Component, args: [{
|
|
5285
5295
|
selector: 'dr-chat-form',
|
|
5286
|
-
template: "<div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of droppedFiles\">\n <div class=\"dropped-files__item__preview\" [style.background-image]=\"file.urlStyle || 'none'\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle\"></i>\n </div>\n <div class=\"dropped-files__item__name\">{{ file.name }}</div>\n <i class=\"dropped-files__item__remove dr-icon-exit\" (click)=\"removeFile(file)\"></i>\n </div>\n</div>\n<div class=\"message-row\">\n <
|
|
5296
|
+
template: "<div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of droppedFiles\">\n <div class=\"dropped-files__item__preview\" [style.background-image]=\"file.urlStyle || 'none'\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle\"></i>\n </div>\n <div class=\"dropped-files__item__name\">{{ file.name }}</div>\n <i class=\"dropped-files__item__remove dr-icon-exit\" (click)=\"removeFile(file)\"></i>\n </div>\n</div>\n<div class=\"message-row\">\n <textarea #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keyup.enter)=\"sendMessage()\">\n </textarea>\n <i (click)=\"sendMessage()\" class=\"dr-icon-notify send-button\"></i>\n</div>\n",
|
|
5287
5297
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5288
|
-
styles: [":host{display:flex;flex-direction:column;padding:
|
|
5298
|
+
styles: [":host{display:flex;flex-direction:column;padding:0;border-top:1px solid #E5E6EA}:host .message-row{flex-direction:row;display:flex;align-items:center;flex-grow:1;padding:6px 34px 6px 30px;height:76px;overflow:hidden}:host .message-row textarea{border:none;font-size:14px;line-height:22px;max-height:100%;flex-grow:1;resize:none;padding:0;margin:auto}:host .message-row textarea::placeholder{color:#9ea1aa}:host input{flex:1}:host input.with-button{border-bottom-right-radius:0;border-top-right-radius:0}:host .send-button{margin-left:10px;cursor:pointer;color:#dfe0e3;font-size:28px}:host .send-button:hover{color:#4646ce}:host .dropped-files{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap}:host .dropped-files__item{display:flex;flex-direction:column;justify-content:center;margin:0 10px 10px 0;position:relative}:host .dropped-files__item__preview{background-size:cover;background-position:center;width:64px;height:64px;border-radius:8px;border:1px solid #ccc}:host .dropped-files__item__preview i{font-size:62px}:host .dropped-files__item__name{white-space:nowrap;font-size:12px;color:#8f929e;margin-top:4px;max-width:64px;overflow:hidden;text-overflow:ellipsis}:host .dropped-files__item__remove{position:absolute;right:-4px;top:-4px;cursor:pointer;background:white;border-radius:12px;color:#8f929e;border:1px solid #8f929e;font-size:14px}\n"]
|
|
5289
5299
|
},] }
|
|
5290
5300
|
];
|
|
5291
5301
|
DrChatFormComponent.ctorParameters = function () { return [
|
|
@@ -5334,6 +5344,7 @@
|
|
|
5334
5344
|
this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
|
|
5335
5345
|
this.MESSAGE_TYPE_CUSTOM = exports.CHAT_MESSAGE_TYPE.EMBED;
|
|
5336
5346
|
this._reply = false;
|
|
5347
|
+
this._isEmpty = false;
|
|
5337
5348
|
}
|
|
5338
5349
|
Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
|
|
5339
5350
|
get: function () {
|
|
@@ -5362,6 +5373,21 @@
|
|
|
5362
5373
|
enumerable: false,
|
|
5363
5374
|
configurable: true
|
|
5364
5375
|
});
|
|
5376
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "isEmpty", {
|
|
5377
|
+
/**
|
|
5378
|
+
* The outer flag is whether the message is empty. Needed if it is impossible to calculate it inside.
|
|
5379
|
+
*
|
|
5380
|
+
* @type {boolean}
|
|
5381
|
+
*/
|
|
5382
|
+
get: function () {
|
|
5383
|
+
return this._isEmpty;
|
|
5384
|
+
},
|
|
5385
|
+
set: function (value) {
|
|
5386
|
+
this._isEmpty = !!value;
|
|
5387
|
+
},
|
|
5388
|
+
enumerable: false,
|
|
5389
|
+
configurable: true
|
|
5390
|
+
});
|
|
5365
5391
|
DrChatMessageComponent.prototype.getTemplate = function () {
|
|
5366
5392
|
this.customMessage = true;
|
|
5367
5393
|
var customMessage = this.getCustomMessage(this.type);
|
|
@@ -5383,7 +5409,7 @@
|
|
|
5383
5409
|
DrChatMessageComponent.decorators = [
|
|
5384
5410
|
{ type: i0.Component, args: [{
|
|
5385
5411
|
selector: 'dr-chat-message',
|
|
5386
|
-
template: "<div class=\"message\" [class.message--custom]=\"customMessage\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-rich-text *ngSwitchCase=\"MESSAGE_TYPE.RICH_TEXT\" [message]=\"message\"></dr-chat-message-rich-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [message]=\"message\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
|
|
5412
|
+
template: "<div *ngIf=\"message.useDefaultAvatar || message.avatarUrl\"\n class=\"avatar\"\n [class.avatar--default]=\"message.useDefaultAvatar\"\n [style.background-image]=\"message.useDefaultAvatar ? message.avatarUrl : ''\"></div>\n<div class=\"message\" [class.message--custom]=\"customMessage\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-rich-text *ngSwitchCase=\"MESSAGE_TYPE.RICH_TEXT\" [message]=\"message\"></dr-chat-message-rich-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [message]=\"message\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
|
|
5387
5413
|
animations: [
|
|
5388
5414
|
animations.trigger('flyInOut', [
|
|
5389
5415
|
animations.state('in', animations.style({ transform: 'translateX(0)' })),
|
|
@@ -5392,7 +5418,7 @@
|
|
|
5392
5418
|
]),
|
|
5393
5419
|
],
|
|
5394
5420
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5395
|
-
styles: [":host{display:flex;flex-direction:row}:host:not(:first-child){margin-top:
|
|
5421
|
+
styles: [":host{display:flex;flex-direction:row}:host.empty{display:none}:host:not(:first-child){margin-top:28px}.reply+:host.reply,.not-reply+:host.not-reply{margin-top:11px}:host.not-reply{flex-direction:row-reverse}:host.not-reply .message{align-items:center;background-color:#f9faff}:host .message{display:flex;background-color:#fff;color:#4e566c;padding:13px 16px;max-width:60%;width:auto;border:1px solid #DFE0E3;box-shadow:0 3px 6px #d8d9de80;border-radius:12px;min-height:56px;line-height:22px}:host .avatar{display:flex;width:32px;height:32px;background-color:#151b3f;background-size:cover;border-radius:16px;margin:0 10px}:host .avatar--default{background-image:url(\"data:image/svg+xml,%3Csvg width%3D%2232%22 height%3D%2232%22 viewBox%3D%220 0 32 32%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg clip-path%3D%22url(%23clip0_60_3314)%22%3E%3Ccircle cx%3D%2216%22 cy%3D%2216%22 r%3D%2216%22 fill%3D%22%23151B3F%22%2F%3E%3Cpath d%3D%22M23.9836 6C23.8033 6 23.6271 6.05345 23.4773 6.15358C23.3274 6.25372 23.2106 6.39605 23.1416 6.56257C23.0727 6.72909 23.0546 6.91233 23.0898 7.0891C23.1249 7.26588 23.2117 7.42826 23.3392 7.55571C23.4666 7.68316 23.629 7.76995 23.8058 7.80512C23.9826 7.84028 24.1658 7.82223 24.3323 7.75326C24.4988 7.68428 24.6412 7.56748 24.7413 7.41761C24.8414 7.26775 24.8949 7.09156 24.8949 6.91131C24.8949 6.79164 24.8713 6.67314 24.8255 6.56257C24.7797 6.452 24.7126 6.35154 24.628 6.26692C24.5433 6.18229 24.4429 6.11517 24.3323 6.06937C24.2218 6.02357 24.1032 6 23.9836 6Z%22 fill%3D%22%23F93576%22%2F%3E%3Cpath d%3D%22M14.4784 12.2578C13.4049 12.5041 12.4218 13.0459 11.6402 13.8219C10.8585 14.5979 10.3096 15.5771 10.0556 16.6488L10.0186 16.8072H11.5809L11.6098 16.7177C11.8243 16.0309 12.2036 15.407 12.7146 14.9004C13.2255 14.3937 13.8526 14.0197 14.5412 13.8109L14.6317 13.7832V12.2218L14.4784 12.2578Z%22 fill%3D%22%23FFA310%22%2F%3E%3Cpath d%3D%22M20.26 14.0557L19.8897 13.7091C19.1313 12.9969 18.1992 12.4965 17.1866 12.2578L17.0303 12.2208V13.7832L17.1208 13.8109C17.743 14.0025 18.3152 14.329 18.7966 14.7671C19.2781 15.2053 19.6569 15.7444 19.906 16.3458C20.1551 16.9473 20.2683 17.5963 20.2376 18.2466C20.2069 18.8969 20.0331 19.5323 19.7284 20.1077C19.4238 20.683 18.9959 21.184 18.4754 21.5749C17.9548 21.9658 17.3544 22.2369 16.7169 22.369C16.0794 22.501 15.4207 22.4908 14.7877 22.3389C14.1547 22.187 13.563 21.8972 13.0549 21.4903C12.356 20.9222 11.8443 20.157 11.586 19.2943L11.5593 19.2027H10L10.035 19.358C10.3187 20.5951 10.9875 21.7104 11.945 22.5435C13.0538 23.5056 14.48 24.0223 15.9477 23.9936C17.4155 23.9649 18.8204 23.3929 19.8907 22.3882L20.26 22.0426V23.8282H21.7771V9.13403H20.26V14.0557Z%22 fill%3D%22%23FBFCF5%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath id%3D%22clip0_60_3314%22%3E%3Crect width%3D%2232%22 height%3D%2232%22 fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E\")}\n"]
|
|
5396
5422
|
},] }
|
|
5397
5423
|
];
|
|
5398
5424
|
DrChatMessageComponent.ctorParameters = function () { return [
|
|
@@ -5404,17 +5430,33 @@
|
|
|
5404
5430
|
reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
|
5405
5431
|
type: [{ type: i0.Input }],
|
|
5406
5432
|
message: [{ type: i0.Input }],
|
|
5407
|
-
customMessageData: [{ type: i0.Input }]
|
|
5433
|
+
customMessageData: [{ type: i0.Input }],
|
|
5434
|
+
isEmpty: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.empty',] }]
|
|
5408
5435
|
};
|
|
5409
5436
|
|
|
5410
5437
|
var DrChatComponent = /** @class */ (function () {
|
|
5411
5438
|
function DrChatComponent(cdr) {
|
|
5412
5439
|
this.cdr = cdr;
|
|
5440
|
+
this.destroy$ = new rxjs.Subject();
|
|
5413
5441
|
this.showClearButton = true;
|
|
5414
5442
|
this.noMessagesPlaceholder = 'No messages yet.';
|
|
5415
5443
|
this._scrollBottom = true;
|
|
5416
5444
|
this.clear = new i0.EventEmitter();
|
|
5445
|
+
this.close = new i0.EventEmitter();
|
|
5417
5446
|
}
|
|
5447
|
+
Object.defineProperty(DrChatComponent.prototype, "contentUpdateSubject", {
|
|
5448
|
+
set: function (value) {
|
|
5449
|
+
var _this = this;
|
|
5450
|
+
if (value) {
|
|
5451
|
+
value.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
|
|
5452
|
+
_this.updateView();
|
|
5453
|
+
});
|
|
5454
|
+
}
|
|
5455
|
+
},
|
|
5456
|
+
enumerable: false,
|
|
5457
|
+
configurable: true
|
|
5458
|
+
});
|
|
5459
|
+
;
|
|
5418
5460
|
Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
|
|
5419
5461
|
/**
|
|
5420
5462
|
* Scroll chat to the bottom of the list when a new message arrives
|
|
@@ -5448,14 +5490,18 @@
|
|
|
5448
5490
|
_this.cdr.markForCheck();
|
|
5449
5491
|
});
|
|
5450
5492
|
};
|
|
5493
|
+
DrChatComponent.prototype.ngOnDestroy = function () {
|
|
5494
|
+
this.destroy$.next();
|
|
5495
|
+
this.destroy$.complete();
|
|
5496
|
+
};
|
|
5451
5497
|
return DrChatComponent;
|
|
5452
5498
|
}());
|
|
5453
5499
|
DrChatComponent.decorators = [
|
|
5454
5500
|
{ type: i0.Component, args: [{
|
|
5455
5501
|
selector: 'dr-chat',
|
|
5456
|
-
template: "<div class=\"header\">\n {{ title }}
|
|
5502
|
+
template: "<div class=\"header\">\n <span class=\"header__title\">{{ title }}</span>\n <dr-button *ngIf=\"showClearButton\"\n (click)=\"clear.emit($event)\"\n theme=\"ghost\"\n icon=\"dr-icon-trash\"\n class=\"ml-auto\"\n title=\"Clear the history\">\n <span>Clear chat</span>\n </dr-button>\n\n <dr-button (click)=\"close.emit($event)\"\n theme=\"icon\"\n icon=\"dr-icon-exit\"\n class=\"ml-4\"\n title=\"Close\">\n </dr-button>\n</div>\n\n<div class=\"scrollable\">\n <div class=\"messages\" #messagesContainer>\n <ng-content select=\"dr-chat-message\"></ng-content>\n <p class=\"no-messages\" *ngIf=\"!messages?.length\">{{ noMessagesPlaceholder }}</p>\n </div>\n</div>\n\n<div class=\"form\">\n <ng-content select=\"dr-chat-form\"></ng-content>\n</div>\n",
|
|
5457
5503
|
providers: [DrChatCustomMessageService],
|
|
5458
|
-
styles: [":host{display:flex;flex-grow:1;flex-direction:column;position:relative;height:100%;background-color:#fff;border:1px solid #e5e6ea;border-radius:8px;box-shadow:0 4px 8px 1px #00000040;color:#151b3f;font-family:\"Poppins\",sans-serif;font-size:14px;font-weight:400;line-height:22px}:host .header{display:flex;align-items:center;
|
|
5504
|
+
styles: [":host{display:flex;flex-grow:1;flex-direction:column;position:relative;height:100%;background-color:#fff;border:1px solid #e5e6ea;border-radius:8px;box-shadow:0 4px 8px 1px #00000040;color:#151b3f;font-family:\"Poppins\",sans-serif;font-size:14px;font-weight:400;line-height:22px}:host .header{display:flex;align-items:center;background-color:#4646ce;color:#f9faff;padding:16px 30px;font-weight:bold}:host .header__title{display:flex;align-items:center;font-weight:400;font-size:20px;line-height:28px}:host .header__title:after{content:\"BETA\";display:inline-flex;padding:2px 10px;background:#FFA310;color:#4e566c;font-weight:600;font-size:10px;line-height:14px;border-radius:8px;margin-left:14px}:host .header dr-button::ng-deep button:not(:hover){color:#f9faff}:host .scrollable{display:flex;flex-grow:1;overflow-x:hidden;overflow-y:auto;height:100%;width:100%}:host .scrollable .messages{padding:16px;overflow-y:auto;overflow-x:hidden;display:flex;flex-shrink:0;flex-direction:column;width:100%}:host .scrollable .no-messages{text-align:center}\n"]
|
|
5459
5505
|
},] }
|
|
5460
5506
|
];
|
|
5461
5507
|
DrChatComponent.ctorParameters = function () { return [
|
|
@@ -5465,11 +5511,13 @@
|
|
|
5465
5511
|
title: [{ type: i0.Input }],
|
|
5466
5512
|
showClearButton: [{ type: i0.Input }],
|
|
5467
5513
|
noMessagesPlaceholder: [{ type: i0.Input }],
|
|
5514
|
+
contentUpdateSubject: [{ type: i0.Input }],
|
|
5468
5515
|
scrollBottom: [{ type: i0.Input }],
|
|
5469
5516
|
messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
|
|
5470
5517
|
messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
|
|
5471
5518
|
chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }],
|
|
5472
|
-
clear: [{ type: i0.Output }]
|
|
5519
|
+
clear: [{ type: i0.Output }],
|
|
5520
|
+
close: [{ type: i0.Output }]
|
|
5473
5521
|
};
|
|
5474
5522
|
|
|
5475
5523
|
/**
|