@volo/abp.ng.chat 6.0.0-rc.4 → 6.0.0-rc.5
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/config/components/chat-icon.component.d.ts +1 -1
- package/config/{volo-abp.ng.chat-config.d.ts → index.d.ts} +0 -0
- package/esm2020/config/chat-config.module.mjs +5 -5
- package/esm2020/config/components/chat-icon.component.mjs +7 -23
- package/esm2020/config/providers/nav-item.provider.mjs +2 -2
- package/esm2020/config/providers/route.provider.mjs +4 -4
- package/esm2020/config/services/chat-config.service.mjs +3 -3
- package/esm2020/lib/chat-routing.module.mjs +5 -5
- package/esm2020/lib/chat.module.mjs +18 -6
- package/esm2020/lib/components/chat-contacts.component.mjs +7 -14
- package/esm2020/lib/components/chat-message-title.component.mjs +43 -0
- package/esm2020/lib/components/chat.component.mjs +13 -39
- package/esm2020/lib/components/conversation-avatar.component.mjs +9 -32
- package/esm2020/lib/components/index.mjs +2 -1
- package/esm2020/lib/models/index.mjs +10 -0
- package/esm2020/lib/models/send-on-enter-setting-dto.mjs +12 -0
- package/esm2020/lib/services/contact.service.mjs +3 -3
- package/esm2020/lib/services/conversation.service.mjs +3 -3
- package/esm2020/proxy/lib/proxy/volo/chat/conversations/conversation.service.mjs +3 -3
- package/esm2020/proxy/lib/proxy/volo/chat/settings/settings.service.mjs +3 -3
- package/esm2020/proxy/lib/proxy/volo/chat/users/contact.service.mjs +3 -3
- package/fesm2015/volo-abp.ng.chat-config.mjs +17 -33
- package/fesm2015/volo-abp.ng.chat-config.mjs.map +1 -1
- package/fesm2015/volo-abp.ng.chat-proxy.mjs +9 -9
- package/fesm2015/volo-abp.ng.chat.mjs +86 -93
- package/fesm2015/volo-abp.ng.chat.mjs.map +1 -1
- package/fesm2020/volo-abp.ng.chat-config.mjs +17 -33
- package/fesm2020/volo-abp.ng.chat-config.mjs.map +1 -1
- package/fesm2020/volo-abp.ng.chat-proxy.mjs +9 -9
- package/fesm2020/volo-abp.ng.chat.mjs +165 -94
- package/fesm2020/volo-abp.ng.chat.mjs.map +1 -1
- package/{volo-abp.ng.chat.d.ts → index.d.ts} +0 -0
- package/lib/chat.module.d.ts +5 -4
- package/lib/components/chat-contacts.component.d.ts +1 -1
- package/lib/components/chat-message-title.component.d.ts +8 -0
- package/lib/components/chat.component.d.ts +1 -2
- package/lib/components/conversation-avatar.component.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/models/index.d.ts +9 -0
- package/lib/models/send-on-enter-setting-dto.d.ts +4 -0
- package/package.json +5 -5
- package/proxy/{volo-abp.ng.chat-proxy.d.ts → index.d.ts} +0 -0
- package/config/package.json +0 -10
- package/proxy/package.json +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i3 from '@abp/ng.core';
|
|
2
|
-
import { trackBy, SubscriptionService, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
|
|
2
|
+
import { trackBy, SubscriptionService, PagedResultRequestDto, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
|
|
3
3
|
import { ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { Injectable, Component, Input, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
|
|
@@ -8,8 +8,8 @@ import { RouterModule } from '@angular/router';
|
|
|
8
8
|
import * as i2 from '@volo/abp.ng.chat/config';
|
|
9
9
|
import { Subject, fromEvent } from 'rxjs';
|
|
10
10
|
import { finalize, debounceTime, takeUntil } from 'rxjs/operators';
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
11
|
+
import * as i4 from '@angular/common';
|
|
12
|
+
import * as i5 from '@angular/forms';
|
|
13
13
|
|
|
14
14
|
var ChatMessageSide;
|
|
15
15
|
(function (ChatMessageSide) {
|
|
@@ -32,9 +32,9 @@ class ConversationService {
|
|
|
32
32
|
return this.restService.request({ url: '/api/chat/conversation/mark-conversation-as-read', method: 'POST', body }, { apiName: this.apiName });
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
ConversationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
36
|
-
ConversationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
35
|
+
ConversationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConversationService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
+
ConversationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConversationService, providedIn: 'root' });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConversationService, decorators: [{
|
|
38
38
|
type: Injectable,
|
|
39
39
|
args: [{ providedIn: 'root' }]
|
|
40
40
|
}], ctorParameters: function () { return [{ type: i3.RestService }]; } });
|
|
@@ -48,9 +48,9 @@ class ContactService {
|
|
|
48
48
|
return this.restService.request({ url: '/api/chat/contact/contacts', method: 'GET', params }, { apiName: this.apiName });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
ContactService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
52
|
-
ContactService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
51
|
+
ContactService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContactService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
52
|
+
ContactService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContactService, providedIn: 'root' });
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ContactService, decorators: [{
|
|
54
54
|
type: Injectable,
|
|
55
55
|
args: [{ providedIn: 'root' }]
|
|
56
56
|
}], ctorParameters: function () { return [{ type: i3.RestService }]; } });
|
|
@@ -102,46 +102,23 @@ class ConversationAvatarComponent {
|
|
|
102
102
|
return typeof this.small === 'string' || this.small;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
ConversationAvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
106
|
-
ConversationAvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
107
|
-
class="avatar
|
|
105
|
+
ConversationAvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConversationAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
106
|
+
ConversationAvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: { contact: "contact", small: "small" }, ngImport: i0, template: `<div
|
|
107
|
+
class="avatar me-2 float-start rounded-circle"
|
|
108
108
|
[class.small]="isSmall"
|
|
109
109
|
[ngStyle]="avatarBgStyle"
|
|
110
110
|
>
|
|
111
111
|
{{ avatarText }}
|
|
112
|
-
</div>`, isInline: true, styles: [".avatar{height:
|
|
113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
112
|
+
</div>`, isInline: true, styles: [".avatar{height:48px;width:48px;line-height:48px;font-size:16px;font-weight:700;text-align:center;text-transform:uppercase}.avatar.small{height:36px;width:36px;line-height:37px;font-size:14px}\n"], dependencies: [{ kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ConversationAvatarComponent, decorators: [{
|
|
114
114
|
type: Component,
|
|
115
|
-
args: [{
|
|
116
|
-
|
|
117
|
-
template: `<div
|
|
118
|
-
class="avatar mx-auto rounded-circle"
|
|
115
|
+
args: [{ selector: 'abp-conversation-avatar', template: `<div
|
|
116
|
+
class="avatar me-2 float-start rounded-circle"
|
|
119
117
|
[class.small]="isSmall"
|
|
120
118
|
[ngStyle]="avatarBgStyle"
|
|
121
119
|
>
|
|
122
120
|
{{ avatarText }}
|
|
123
|
-
</div>`,
|
|
124
|
-
styles: [
|
|
125
|
-
`
|
|
126
|
-
.avatar {
|
|
127
|
-
height: 40px;
|
|
128
|
-
width: 40px;
|
|
129
|
-
line-height: 40px;
|
|
130
|
-
font-size: 16px;
|
|
131
|
-
font-weight: 700;
|
|
132
|
-
text-align: center;
|
|
133
|
-
text-transform: uppercase;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.avatar.small {
|
|
137
|
-
height: 27px;
|
|
138
|
-
width: 27px;
|
|
139
|
-
line-height: 27px;
|
|
140
|
-
font-size: 14px;
|
|
141
|
-
}
|
|
142
|
-
`,
|
|
143
|
-
],
|
|
144
|
-
}]
|
|
121
|
+
</div>`, styles: [".avatar{height:48px;width:48px;line-height:48px;font-size:16px;font-weight:700;text-align:center;text-transform:uppercase}.avatar.small{height:36px;width:36px;line-height:37px;font-size:14px}\n"] }]
|
|
145
122
|
}], propDecorators: { contact: [{
|
|
146
123
|
type: Input
|
|
147
124
|
}], small: [{
|
|
@@ -226,18 +203,11 @@ class ChatContactsComponent {
|
|
|
226
203
|
this.selectedContact.unreadMessageCount = 0;
|
|
227
204
|
}
|
|
228
205
|
}
|
|
229
|
-
ChatContactsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
230
|
-
ChatContactsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
206
|
+
ChatContactsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatContactsComponent, deps: [{ token: ContactService }, { token: i2.ChatConfigService }, { token: i3.SubscriptionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
207
|
+
ChatContactsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ChatContactsComponent, selector: "abp-chat-contacts", outputs: { selected: "selected" }, providers: [SubscriptionService], ngImport: i0, template: "\r\n<div class=\"card w-100 mb-3 mb-md-0\">\r\n\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <div class=\" mb-2 rounded-2\">\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <input\r\n id=\"contacts-filter\"\r\n type=\"search\"\r\n class=\"form-control form-control\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n [(ngModel)]=\"filter\"\r\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n (input.debounce)=\"get()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"messages-box m-0 p-0\">\r\n <div class=\"list-group rounded-3\" id=\"contact-list\">\r\n <ng-container\r\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n <div\r\n *ngIf=\"otherContacts.length\"\r\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0\"\r\n >\r\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #contactTemplate let-contact let-i=\"index\">\r\n <a\r\n (click)=\"selectContact(contact)\"\r\n class=\"chat-contact list-group-item list-group-item-action cursor-pointer px-2 border-2 rounded-2 mb-1 mt-0 {{\r\n selectedContact.userId === contact.userId ? 'active' : ''\r\n }}\"\r\n ><div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\r\n <div class=\"media-body ms-2\">\r\n <div class=\"d-flex align-items-center justify-content-between mb-0\">\r\n <h5 class=\"mb-0 mt-1\">\r\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success me-1\">{{\r\n contact.unreadMessageCount\r\n }}</small\r\n >{{ getContactName(contact) }}\r\n </h5>\r\n <small class=\"last-message-date\">{{\r\n contact.lastMessageDate | date\r\n }}</small>\r\n </div>\r\n <p class=\"mb-0 small last-message\">\r\n {{\r\n contact.lastMessage?.length > 24\r\n ? (contact.lastMessage | slice: 0:23) + '...'\r\n : contact.lastMessage\r\n }}\r\n </p>\r\n </div>\r\n </div>\r\n </a>\r\n</ng-template>\r\n", styles: [".messages-box{overflow-y:scroll;max-height:calc(100vh - 254.34px)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.InputEventDebounceDirective, selector: "[input.debounce]", inputs: ["debounce"], outputs: ["input.debounce"] }, { kind: "component", type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: ["contact", "small"] }, { kind: "pipe", type: i4.SlicePipe, name: "slice" }, { kind: "pipe", type: i4.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatContactsComponent, decorators: [{
|
|
232
209
|
type: Component,
|
|
233
|
-
args: [{ selector: 'abp-chat-contacts', styles: [
|
|
234
|
-
`
|
|
235
|
-
.messages-box {
|
|
236
|
-
overflow-y: scroll;
|
|
237
|
-
max-height: calc(100vh - 254.34px);
|
|
238
|
-
}
|
|
239
|
-
`,
|
|
240
|
-
], providers: [SubscriptionService], template: "<div class=\"border-end\">\r\n <div class=\"p-3 bg-light border-bottom\">\r\n <div class=\"form-row\">\r\n <div class=\"col\">\r\n <input\r\n id=\"contacts-filter\"\r\n type=\"search\"\r\n class=\"form-control form-control-sm\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n [(ngModel)]=\"filter\"\r\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n (input.debounce)=\"get()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"messages-box m-0 p-0\">\r\n <div class=\"list-group rounded-0\" id=\"contact-list\">\r\n <ng-container\r\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n <div\r\n *ngIf=\"otherContacts.length\"\r\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0\"\r\n >\r\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #contactTemplate let-contact let-i=\"index\">\r\n <a\r\n (click)=\"selectContact(contact)\"\r\n class=\"chat-contact list-group-item list-group-item-action px-4 rounded-0 border-start-0 pointer {{\r\n selectedContact.userId === contact.userId ? 'active text-white' : ''\r\n }}\"\r\n ><div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\r\n <div class=\"media-body ms-2 d-none d-md-block\">\r\n <div class=\"d-flex align-items-center justify-content-between mb-1\">\r\n <h6 class=\"mb-0\">\r\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success me-1\">{{\r\n contact.unreadMessageCount\r\n }}</small\r\n >{{ getContactName(contact) }}\r\n </h6>\r\n <small class=\"small font-weight-bold last-message-date\">{{\r\n contact.lastMessageDate | date\r\n }}</small>\r\n </div>\r\n <p class=\"mb-0 text-small last-message\">\r\n {{\r\n contact.lastMessage?.length > 24\r\n ? (contact.lastMessage | slice: 0:23) + '...'\r\n : contact.lastMessage\r\n }}\r\n </p>\r\n </div>\r\n </div>\r\n </a>\r\n</ng-template>\r\n" }]
|
|
210
|
+
args: [{ selector: 'abp-chat-contacts', providers: [SubscriptionService], template: "\r\n<div class=\"card w-100 mb-3 mb-md-0\">\r\n\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <div class=\" mb-2 rounded-2\">\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <input\r\n id=\"contacts-filter\"\r\n type=\"search\"\r\n class=\"form-control form-control\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n [(ngModel)]=\"filter\"\r\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\r\n (input.debounce)=\"get()\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"messages-box m-0 p-0\">\r\n <div class=\"list-group rounded-3\" id=\"contact-list\">\r\n <ng-container\r\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n <div\r\n *ngIf=\"otherContacts.length\"\r\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-start-0 border-end-0\"\r\n >\r\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\r\n </div>\r\n <ng-container\r\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #contactTemplate let-contact let-i=\"index\">\r\n <a\r\n (click)=\"selectContact(contact)\"\r\n class=\"chat-contact list-group-item list-group-item-action cursor-pointer px-2 border-2 rounded-2 mb-1 mt-0 {{\r\n selectedContact.userId === contact.userId ? 'active' : ''\r\n }}\"\r\n ><div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\r\n <div class=\"media-body ms-2\">\r\n <div class=\"d-flex align-items-center justify-content-between mb-0\">\r\n <h5 class=\"mb-0 mt-1\">\r\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success me-1\">{{\r\n contact.unreadMessageCount\r\n }}</small\r\n >{{ getContactName(contact) }}\r\n </h5>\r\n <small class=\"last-message-date\">{{\r\n contact.lastMessageDate | date\r\n }}</small>\r\n </div>\r\n <p class=\"mb-0 small last-message\">\r\n {{\r\n contact.lastMessage?.length > 24\r\n ? (contact.lastMessage | slice: 0:23) + '...'\r\n : contact.lastMessage\r\n }}\r\n </p>\r\n </div>\r\n </div>\r\n </a>\r\n</ng-template>\r\n", styles: [".messages-box{overflow-y:scroll;max-height:calc(100vh - 254.34px)}\n"] }]
|
|
241
211
|
}], ctorParameters: function () { return [{ type: ContactService }, { type: i2.ChatConfigService }, { type: i3.SubscriptionService }]; }, propDecorators: { selected: [{
|
|
242
212
|
type: Output
|
|
243
213
|
}] } });
|
|
@@ -247,6 +217,122 @@ function getContactName({ name, surname, username }) {
|
|
|
247
217
|
return `${name || ''} ${surname || ''}`;
|
|
248
218
|
}
|
|
249
219
|
|
|
220
|
+
class ChatConversationDto {
|
|
221
|
+
constructor(initialValues = {}) {
|
|
222
|
+
if (initialValues) {
|
|
223
|
+
for (const key in initialValues) {
|
|
224
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
225
|
+
this[key] = initialValues[key];
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
class ChatMessageDto {
|
|
233
|
+
constructor(initialValues = {}) {
|
|
234
|
+
if (initialValues) {
|
|
235
|
+
for (const key in initialValues) {
|
|
236
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
237
|
+
this[key] = initialValues[key];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
class ChatTargetUserInfo {
|
|
245
|
+
constructor(initialValues = {}) {
|
|
246
|
+
if (initialValues) {
|
|
247
|
+
for (const key in initialValues) {
|
|
248
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
249
|
+
this[key] = initialValues[key];
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
class GetConversationInput extends PagedResultRequestDto {
|
|
257
|
+
constructor(initialValues = {}) {
|
|
258
|
+
super(initialValues);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
class MarkConversationAsReadInput {
|
|
263
|
+
constructor(initialValues = {}) {
|
|
264
|
+
if (initialValues) {
|
|
265
|
+
for (const key in initialValues) {
|
|
266
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
267
|
+
this[key] = initialValues[key];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
class SendMessageInput {
|
|
275
|
+
constructor(initialValues = {}) {
|
|
276
|
+
if (initialValues) {
|
|
277
|
+
for (const key in initialValues) {
|
|
278
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
279
|
+
this[key] = initialValues[key];
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
class SendOnEnterSettingDto {
|
|
287
|
+
constructor(initialValues = {}) {
|
|
288
|
+
if (initialValues) {
|
|
289
|
+
for (const key in initialValues) {
|
|
290
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
291
|
+
this[key] = initialValues[key];
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
class ChatMessageTitleComponent {
|
|
299
|
+
get contactName() {
|
|
300
|
+
return getContactName(this.selectedContact || {});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
ChatMessageTitleComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatMessageTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
304
|
+
ChatMessageTitleComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ChatMessageTitleComponent, selector: "abp-chat-message-title", inputs: { selectedContact: "selectedContact" }, ngImport: i0, template: `
|
|
305
|
+
<div class="px-2 py-1 border mb-2 rounded-2">
|
|
306
|
+
<div class="row">
|
|
307
|
+
<div class="col-auto py-1 pe-0">
|
|
308
|
+
<abp-conversation-avatar small [contact]="selectedContact"></abp-conversation-avatar>
|
|
309
|
+
</div>
|
|
310
|
+
<div class="col d-flex flex-column justify-content-center">
|
|
311
|
+
<h5 id="conversation-title" class="m-0">{{ contactName }}</h5>
|
|
312
|
+
<small id="conversation-info"></small>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</div>
|
|
316
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: ["contact", "small"] }] });
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatMessageTitleComponent, decorators: [{
|
|
318
|
+
type: Component,
|
|
319
|
+
args: [{ selector: 'abp-chat-message-title', template: `
|
|
320
|
+
<div class="px-2 py-1 border mb-2 rounded-2">
|
|
321
|
+
<div class="row">
|
|
322
|
+
<div class="col-auto py-1 pe-0">
|
|
323
|
+
<abp-conversation-avatar small [contact]="selectedContact"></abp-conversation-avatar>
|
|
324
|
+
</div>
|
|
325
|
+
<div class="col d-flex flex-column justify-content-center">
|
|
326
|
+
<h5 id="conversation-title" class="m-0">{{ contactName }}</h5>
|
|
327
|
+
<small id="conversation-info"></small>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
` }]
|
|
332
|
+
}], propDecorators: { selectedContact: [{
|
|
333
|
+
type: Input
|
|
334
|
+
}] } });
|
|
335
|
+
|
|
250
336
|
const now = new Date();
|
|
251
337
|
const today = new Date(now.getFullYear(), now.getMonth(), now.getDate()).valueOf();
|
|
252
338
|
class ChatComponent {
|
|
@@ -278,7 +364,7 @@ class ChatComponent {
|
|
|
278
364
|
targetUserId: this.selectedContact.userId,
|
|
279
365
|
})
|
|
280
366
|
.pipe(finalize(() => (this.pagingLoading = false)))
|
|
281
|
-
.subscribe(
|
|
367
|
+
.subscribe(res => {
|
|
282
368
|
if (!res.messages.length) {
|
|
283
369
|
this.allMessagesLoaded = true;
|
|
284
370
|
return;
|
|
@@ -297,9 +383,6 @@ class ChatComponent {
|
|
|
297
383
|
},
|
|
298
384
|
]);
|
|
299
385
|
}
|
|
300
|
-
get contactName() {
|
|
301
|
-
return getContactName(this.selectedContact || {});
|
|
302
|
-
}
|
|
303
386
|
get selectedContactMessages() {
|
|
304
387
|
return this.userMessages.get(this.selectedContact.userId) || [];
|
|
305
388
|
}
|
|
@@ -332,7 +415,7 @@ class ChatComponent {
|
|
|
332
415
|
this.listenToNewMessages();
|
|
333
416
|
}
|
|
334
417
|
ngOnDestroy() {
|
|
335
|
-
this.destroy$.next();
|
|
418
|
+
this.destroy$.next(null);
|
|
336
419
|
this.destroy$.complete();
|
|
337
420
|
}
|
|
338
421
|
getConversation(scrollToEnd) {
|
|
@@ -343,7 +426,7 @@ class ChatComponent {
|
|
|
343
426
|
maxResultCount: 50,
|
|
344
427
|
targetUserId: this.selectedContact.userId,
|
|
345
428
|
})
|
|
346
|
-
.subscribe(
|
|
429
|
+
.subscribe(res => {
|
|
347
430
|
this.userMessages.set(this.selectedContact.userId, res.messages.reverse());
|
|
348
431
|
if (scrollToEnd)
|
|
349
432
|
this.scrollToEnd();
|
|
@@ -418,34 +501,11 @@ class ChatComponent {
|
|
|
418
501
|
}, 0);
|
|
419
502
|
}
|
|
420
503
|
}
|
|
421
|
-
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
422
|
-
ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
504
|
+
ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatComponent, deps: [{ token: ConversationService }, { token: i2.ChatConfigService }, { token: i3.ConfigStateService }, { token: i3.HttpWaitService }], target: i0.ɵɵFactoryTarget.Component });
|
|
505
|
+
ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.2", type: ChatComponent, selector: "abp-chat", viewQueries: [{ propertyName: "chatBoxRef", first: true, predicate: ["chatBox"], descendants: true }, { propertyName: "chatContactsComponent", first: true, predicate: ChatContactsComponent, descendants: true }], ngImport: i0, template: "<div class=\"row entry-row\">\r\n <div class=\"col-auto\"></div>\r\n <div class=\"col-lg-auto ps-lg-0\"></div>\r\n <div class=\"col\">\r\n <div class=\"text-lg-end pt-2\" id=\"AbpContentToolbar\"></div>\r\n </div>\r\n</div>\r\n\r\n<div id=\"chat_wrapper\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <!-- Users box-->\r\n <div class=\"col-12 col-md-5 col-lg-4 d-flex align-items-stretch\">\r\n <abp-chat-contacts class=\"d-flex w-100\" (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\r\n </div>\r\n <!-- /Users box-->\r\n\r\n <!-- Chat Box-->\r\n\r\n <div class=\"col-12 col-md-7 col-lg-8 d-flex align-items-stretch\">\r\n <div class=\"card w-100 mb-0\">\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <abp-chat-message-title [selectedContact]=\"selectedContact\"></abp-chat-message-title>\r\n\r\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box mb-2\">\r\n <div class=\"chat-box-container\" id=\"chat-conversation\">\r\n <ng-container\r\n *ngFor=\"\r\n let message of selectedContactMessages;\r\n let i = index;\r\n trackBy: trackByMessageDate\r\n \"\r\n >\r\n <div\r\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\r\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\r\n >\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n </ng-container>\r\n\r\n <ng-template #moreThanOne>\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages'\r\n | abpLocalization: '' + unreadMessageCount\r\n }}\r\n </ng-template>\r\n </span>\r\n </h3>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\r\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\r\n [class.ms-auto]=\"data.isSender\"\r\n >\r\n <div class=\"media-body position-relative\">\r\n <div\r\n class=\"card shadow-sm rounded py-1 px-2 py-lg-2 px-lg-3 mb-1 {{\r\n data.isSender ? 'bg-primary' : 'bg-light'\r\n }}\"\r\n >\r\n <p\r\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\r\n [innerHTML]=\"message.message\"\r\n ></p>\r\n </div>\r\n <p\r\n class=\"message-date small text-muted m-0 {{\r\n data.isSender ? 'left' : 'right'\r\n }}\"\r\n >\r\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\r\n </p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <!-- Typing area -->\r\n <div\r\n *ngIf=\"selectedContact?.userId\"\r\n id=\"send-message-form\"\r\n class=\"bg-light rounded-3 m-0\"\r\n >\r\n <div class=\"p-2 p-lg-3\">\r\n <textarea\r\n id=\"chat-message-box\"\r\n name=\"message\"\r\n type=\"text\"\r\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\r\n class=\"form-control rounded py-2 bg-white\"\r\n [(ngModel)]=\"message\"\r\n (keydown.enter)=\"sendWithEnter($event)\"\r\n ></textarea>\r\n <div class=\"form-check float-start mt-2\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input border shadow-sm\"\r\n id=\"send-on-enter\"\r\n [(ngModel)]=\"sendOnEnter\"\r\n />\r\n <label class=\"form-check-label\" for=\"send-on-enter\">{{\r\n 'Chat::SendOnEnter' | abpLocalization\r\n }}</label>\r\n </div>\r\n <div class=\"mt-2 text-end\">\r\n <button\r\n [disabled]=\"!message\"\r\n (click)=\"send()\"\r\n id=\"send-message-button\"\r\n type=\"button\"\r\n class=\"btn btn-primary px-3\"\r\n >\r\n {{ 'Chat::Send' | abpLocalization }}\r\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ms-2\"></i>\r\n\r\n <ng-template #loadingIcon>\r\n <i class=\"fas fa-spinner fa-spin ms-2\"></i>\r\n </ng-template>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- /Chat Box-->\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".chat-box{height:calc(100vh - 390px);overflow-y:scroll}.message-date{position:absolute;opacity:.35;width:100px;top:1px}.message-date.left{left:-110px;text-align:right}.message-date.right{right:-110px}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ChatContactsComponent, selector: "abp-chat-contacts", outputs: ["selected"] }, { kind: "component", type: ChatMessageTitleComponent, selector: "abp-chat-message-title", inputs: ["selectedContact"] }, { kind: "pipe", type: i4.DatePipe, name: "date" }, { kind: "pipe", type: i3.LocalizationPipe, name: "abpLocalization" }] });
|
|
506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatComponent, decorators: [{
|
|
424
507
|
type: Component,
|
|
425
|
-
args: [{ selector: 'abp-chat', styles: [
|
|
426
|
-
`
|
|
427
|
-
.chat-box {
|
|
428
|
-
height: calc(100vh - 390px);
|
|
429
|
-
overflow-y: scroll;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.message-date {
|
|
433
|
-
position: absolute;
|
|
434
|
-
opacity: 0.35;
|
|
435
|
-
width: 100px;
|
|
436
|
-
top: 1px;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.message-date.left {
|
|
440
|
-
left: -110px;
|
|
441
|
-
text-align: right;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.message-date.right {
|
|
445
|
-
right: -110px;
|
|
446
|
-
}
|
|
447
|
-
`,
|
|
448
|
-
], template: "<div class=\"row entry-row\">\r\n <div class=\"col-auto\"></div>\r\n <div class=\"col-lg-auto ps-lg-0\"></div>\r\n <div class=\"col\">\r\n <div class=\"text-lg-end pt-2\" id=\"AbpContentToolbar\"></div>\r\n </div>\r\n</div>\r\n\r\n<div id=\"chat_wrapper\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row rounded-lg overflow-hidden shadow bor der\">\r\n <div class=\"col-3 col-md-5 col-lg-4 px-0\">\r\n <abp-chat-contacts (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\r\n </div>\r\n\r\n <!-- Chat Box-->\r\n <div class=\"col-9 col-md-7 col-lg-8 px-0\">\r\n <div class=\"p-3 bg-light border-bottom\">\r\n <div class=\"form-row\">\r\n <div class=\"col\">\r\n <div class=\"form-row\">\r\n <div class=\"col-auto\">\r\n <abp-conversation-avatar\r\n small\r\n [contact]=\"selectedContact\"\r\n ></abp-conversation-avatar>\r\n </div>\r\n <div class=\"col pt-1\" style=\"line-height: 1.2\">\r\n <strong id=\"conversation-title\" class=\"font-weight-bold\">{{ contactName }}</strong\r\n ><br />\r\n <small id=\"conversation-info\"></small>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box m-0 p-0\">\r\n <div class=\"chat-box-container p-4\" [id]=\"'chat-conversation'\">\r\n <ng-container\r\n *ngFor=\"\r\n let message of selectedContactMessages;\r\n let i = index;\r\n trackBy: trackByMessageDate\r\n \"\r\n >\r\n <div\r\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\r\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\r\n >\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n </ng-container>\r\n\r\n <ng-template #moreThanOne>\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages' | abpLocalization: '' + unreadMessageCount\r\n }}\r\n </ng-template>\r\n </span>\r\n </h3>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\r\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\r\n [class.ms-auto]=\"data.isSender\"\r\n >\r\n <div class=\"media-body position-relative\">\r\n <div\r\n class=\"shadow rounded py-3 px-4 mb-1 {{\r\n data.isSender ? 'bg-primary' : 'bg-light'\r\n }}\"\r\n >\r\n <p\r\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\r\n [innerHTML]=\"message.message\"\r\n ></p>\r\n </div>\r\n <p\r\n class=\"message-date small text-muted m-0 {{ data.isSender ? 'left' : 'right' }}\"\r\n >\r\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\r\n </p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <!-- Typing area -->\r\n <div *ngIf=\"selectedContact?.userId\" id=\"send-message-form\" class=\"bg-light border-top m-0\">\r\n <div class=\"p-3\">\r\n <textarea\r\n id=\"chat-message-box\"\r\n name=\"message\"\r\n type=\"text\"\r\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\r\n class=\"form-control rounded py-2 bg-white\"\r\n [(ngModel)]=\"message\"\r\n (keydown.enter)=\"sendWithEnter($event)\"\r\n ></textarea>\r\n <div class=\"form-checkbox float-start mt-3\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input me-1\"\r\n id=\"send-on-enter\"\r\n [(ngModel)]=\"sendOnEnter\"\r\n />\r\n <label class=\"form-check-label\" for=\"send-on-enter\">{{\r\n 'Chat::SendOnEnter' | abpLocalization\r\n }}</label>\r\n </div>\r\n <div class=\"mt-2 text-end\">\r\n <button\r\n [disabled]=\"!message\"\r\n (click)=\"send()\"\r\n id=\"send-message-button\"\r\n type=\"button\"\r\n class=\"btn btn-primary px-3\"\r\n >\r\n {{ 'Chat::Send' | abpLocalization }}\r\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ms-2\"></i>\r\n\r\n <ng-template #loadingIcon>\r\n <i class=\"fas fa-spinner fa-spin ms-2\"></i>\r\n </ng-template>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
|
|
508
|
+
args: [{ selector: 'abp-chat', template: "<div class=\"row entry-row\">\r\n <div class=\"col-auto\"></div>\r\n <div class=\"col-lg-auto ps-lg-0\"></div>\r\n <div class=\"col\">\r\n <div class=\"text-lg-end pt-2\" id=\"AbpContentToolbar\"></div>\r\n </div>\r\n</div>\r\n\r\n<div id=\"chat_wrapper\">\r\n <div class=\"container-fluid\">\r\n <div class=\"row\">\r\n <!-- Users box-->\r\n <div class=\"col-12 col-md-5 col-lg-4 d-flex align-items-stretch\">\r\n <abp-chat-contacts class=\"d-flex w-100\" (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\r\n </div>\r\n <!-- /Users box-->\r\n\r\n <!-- Chat Box-->\r\n\r\n <div class=\"col-12 col-md-7 col-lg-8 d-flex align-items-stretch\">\r\n <div class=\"card w-100 mb-0\">\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <abp-chat-message-title [selectedContact]=\"selectedContact\"></abp-chat-message-title>\r\n\r\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box mb-2\">\r\n <div class=\"chat-box-container\" id=\"chat-conversation\">\r\n <ng-container\r\n *ngFor=\"\r\n let message of selectedContactMessages;\r\n let i = index;\r\n trackBy: trackByMessageDate\r\n \"\r\n >\r\n <div\r\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\r\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\r\n >\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n </ng-container>\r\n\r\n <ng-template #moreThanOne>\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages'\r\n | abpLocalization: '' + unreadMessageCount\r\n }}\r\n </ng-template>\r\n </span>\r\n </h3>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\r\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\r\n [class.ms-auto]=\"data.isSender\"\r\n >\r\n <div class=\"media-body position-relative\">\r\n <div\r\n class=\"card shadow-sm rounded py-1 px-2 py-lg-2 px-lg-3 mb-1 {{\r\n data.isSender ? 'bg-primary' : 'bg-light'\r\n }}\"\r\n >\r\n <p\r\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\r\n [innerHTML]=\"message.message\"\r\n ></p>\r\n </div>\r\n <p\r\n class=\"message-date small text-muted m-0 {{\r\n data.isSender ? 'left' : 'right'\r\n }}\"\r\n >\r\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\r\n </p>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>\r\n\r\n <!-- Typing area -->\r\n <div\r\n *ngIf=\"selectedContact?.userId\"\r\n id=\"send-message-form\"\r\n class=\"bg-light rounded-3 m-0\"\r\n >\r\n <div class=\"p-2 p-lg-3\">\r\n <textarea\r\n id=\"chat-message-box\"\r\n name=\"message\"\r\n type=\"text\"\r\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\r\n class=\"form-control rounded py-2 bg-white\"\r\n [(ngModel)]=\"message\"\r\n (keydown.enter)=\"sendWithEnter($event)\"\r\n ></textarea>\r\n <div class=\"form-check float-start mt-2\">\r\n <input\r\n type=\"checkbox\"\r\n class=\"form-check-input border shadow-sm\"\r\n id=\"send-on-enter\"\r\n [(ngModel)]=\"sendOnEnter\"\r\n />\r\n <label class=\"form-check-label\" for=\"send-on-enter\">{{\r\n 'Chat::SendOnEnter' | abpLocalization\r\n }}</label>\r\n </div>\r\n <div class=\"mt-2 text-end\">\r\n <button\r\n [disabled]=\"!message\"\r\n (click)=\"send()\"\r\n id=\"send-message-button\"\r\n type=\"button\"\r\n class=\"btn btn-primary px-3\"\r\n >\r\n {{ 'Chat::Send' | abpLocalization }}\r\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ms-2\"></i>\r\n\r\n <ng-template #loadingIcon>\r\n <i class=\"fas fa-spinner fa-spin ms-2\"></i>\r\n </ng-template>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <!-- /Chat Box-->\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".chat-box{height:calc(100vh - 390px);overflow-y:scroll}.message-date{position:absolute;opacity:.35;width:100px;top:1px}.message-date.left{left:-110px;text-align:right}.message-date.right{right:-110px}\n"] }]
|
|
449
509
|
}], ctorParameters: function () { return [{ type: ConversationService }, { type: i2.ChatConfigService }, { type: i3.ConfigStateService }, { type: i3.HttpWaitService }]; }, propDecorators: { chatBoxRef: [{
|
|
450
510
|
type: ViewChild,
|
|
451
511
|
args: ['chatBox', { static: false }]
|
|
@@ -476,10 +536,10 @@ const routes = [
|
|
|
476
536
|
];
|
|
477
537
|
class ChatRoutingModule {
|
|
478
538
|
}
|
|
479
|
-
ChatRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
480
|
-
ChatRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
481
|
-
ChatRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
539
|
+
ChatRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
540
|
+
ChatRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ChatRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
|
|
541
|
+
ChatRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatRoutingModule, decorators: [{
|
|
483
543
|
type: NgModule,
|
|
484
544
|
args: [{
|
|
485
545
|
imports: [RouterModule.forChild(routes)],
|
|
@@ -487,7 +547,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
487
547
|
}]
|
|
488
548
|
}] });
|
|
489
549
|
|
|
490
|
-
const declarations = [
|
|
550
|
+
const declarations = [
|
|
551
|
+
ChatComponent,
|
|
552
|
+
ChatContactsComponent,
|
|
553
|
+
ConversationAvatarComponent,
|
|
554
|
+
ChatMessageTitleComponent,
|
|
555
|
+
];
|
|
491
556
|
class ChatModule {
|
|
492
557
|
static forChild() {
|
|
493
558
|
return {
|
|
@@ -499,10 +564,16 @@ class ChatModule {
|
|
|
499
564
|
return new LazyModuleFactory(ChatModule.forChild());
|
|
500
565
|
}
|
|
501
566
|
}
|
|
502
|
-
ChatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
503
|
-
ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
504
|
-
|
|
505
|
-
|
|
567
|
+
ChatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
568
|
+
ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.2", ngImport: i0, type: ChatModule, declarations: [ChatComponent,
|
|
569
|
+
ChatContactsComponent,
|
|
570
|
+
ConversationAvatarComponent,
|
|
571
|
+
ChatMessageTitleComponent], imports: [CoreModule, ThemeSharedModule, ChatRoutingModule], exports: [ChatComponent,
|
|
572
|
+
ChatContactsComponent,
|
|
573
|
+
ConversationAvatarComponent,
|
|
574
|
+
ChatMessageTitleComponent] });
|
|
575
|
+
ChatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatModule, imports: [CoreModule, ThemeSharedModule, ChatRoutingModule] });
|
|
576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ChatModule, decorators: [{
|
|
506
577
|
type: NgModule,
|
|
507
578
|
args: [{
|
|
508
579
|
declarations,
|
|
@@ -515,5 +586,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImpor
|
|
|
515
586
|
* Generated bundle index. Do not edit.
|
|
516
587
|
*/
|
|
517
588
|
|
|
518
|
-
export { ChatComponent, ChatContactsComponent, ChatModule, ConversationAvatarComponent, getContactName };
|
|
589
|
+
export { ChatComponent, ChatContactsComponent, ChatMessageTitleComponent, ChatModule, ConversationAvatarComponent, getContactName };
|
|
519
590
|
//# sourceMappingURL=volo-abp.ng.chat.mjs.map
|