@volo/abp.ng.chat 8.3.1 → 8.3.2
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/services/chat-config.service.d.ts +10 -10
- package/esm2022/config/services/chat-config.service.mjs +29 -31
- package/esm2022/lib/components/chat-contacts.component.mjs +34 -21
- package/esm2022/lib/components/chat-message-title.component.mjs +6 -4
- package/esm2022/lib/components/chat.component.mjs +1 -1
- package/esm2022/lib/components/conversation-avatar.component.mjs +1 -2
- package/esm2022/lib/models/index.mjs +1 -2
- package/esm2022/lib/services/index.mjs +1 -2
- package/fesm2022/volo-abp.ng.chat-config.mjs +38 -39
- package/fesm2022/volo-abp.ng.chat-config.mjs.map +1 -1
- package/fesm2022/volo-abp.ng.chat.mjs +127 -138
- package/fesm2022/volo-abp.ng.chat.mjs.map +1 -1
- package/lib/components/chat-contacts.component.d.ts +2 -6
- package/lib/components/chat-message-title.component.d.ts +1 -1
- package/lib/components/conversation-avatar.component.d.ts +1 -1
- package/lib/models/index.d.ts +0 -1
- package/lib/services/index.d.ts +0 -1
- package/package.json +1 -1
- package/esm2022/lib/models/chat-contact-dto.mjs +0 -12
- package/esm2022/lib/models/get-contacts-input.mjs +0 -12
- package/esm2022/lib/services/contact.service.mjs +0 -20
- package/lib/models/chat-contact-dto.d.ts +0 -11
- package/lib/models/get-contacts-input.d.ts +0 -5
- package/lib/services/contact.service.d.ts +0 -13
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as i1 from '@abp/ng.core';
|
|
2
|
-
import {
|
|
1
|
+
import * as i1$2 from '@abp/ng.core';
|
|
2
|
+
import { ConfigStateService, HttpWaitService, RouterOutletComponent, authGuard, permissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule, PagedResultRequestDto } from '@abp/ng.core';
|
|
3
3
|
import { ConfirmationService, ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import {
|
|
5
|
+
import { Component, Input, inject, model, EventEmitter, output, effect, Output, DestroyRef, ViewChild, NgModule, Injectable } from '@angular/core';
|
|
6
6
|
import * as i1$3 from '@angular/router';
|
|
7
7
|
import { RouterModule } from '@angular/router';
|
|
8
8
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
|
-
import { take, fromEvent } from 'rxjs';
|
|
9
|
+
import { filter, take, fromEvent } from 'rxjs';
|
|
10
10
|
import { debounceTime, finalize, catchError } from 'rxjs/operators';
|
|
11
|
-
import { ConversationService as ConversationService$1, ChatMessageSide as ChatMessageSide$1, chatDeletingMessagesOptions, chatDeletingConversationsOptions, ChatDeletingMessages, ChatDeletingConversations } from '@volo/abp.ng.chat/proxy';
|
|
11
|
+
import { ContactService, ConversationService as ConversationService$1, ChatMessageSide as ChatMessageSide$1, chatDeletingMessagesOptions, chatDeletingConversationsOptions, ChatDeletingMessages, ChatDeletingConversations } from '@volo/abp.ng.chat/proxy';
|
|
12
12
|
import { ChatConfigService } from '@volo/abp.ng.chat/config';
|
|
13
|
-
import * as i1
|
|
14
|
-
import * as i1$
|
|
13
|
+
import * as i1 from '@angular/common';
|
|
14
|
+
import * as i1$1 from '@angular/forms';
|
|
15
15
|
import * as i4 from '@ng-bootstrap/ng-bootstrap';
|
|
16
16
|
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
17
17
|
|
|
@@ -21,34 +21,6 @@ var ChatMessageSide;
|
|
|
21
21
|
ChatMessageSide[ChatMessageSide["Receiver"] = 2] = "Receiver";
|
|
22
22
|
})(ChatMessageSide || (ChatMessageSide = {}));
|
|
23
23
|
|
|
24
|
-
class ContactService {
|
|
25
|
-
constructor(restService) {
|
|
26
|
-
this.restService = restService;
|
|
27
|
-
this.apiName = 'Chat';
|
|
28
|
-
}
|
|
29
|
-
getContactsByInput(params = {}) {
|
|
30
|
-
return this.restService.request({ url: '/api/chat/contact/contacts', method: 'GET', params }, { apiName: this.apiName });
|
|
31
|
-
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ContactService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
33
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ContactService, providedIn: 'root' }); }
|
|
34
|
-
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ContactService, decorators: [{
|
|
36
|
-
type: Injectable,
|
|
37
|
-
args: [{ providedIn: 'root' }]
|
|
38
|
-
}], ctorParameters: () => [{ type: i1.RestService }] });
|
|
39
|
-
|
|
40
|
-
class ChatContactDto {
|
|
41
|
-
constructor(initialValues = {}) {
|
|
42
|
-
if (initialValues) {
|
|
43
|
-
for (const key in initialValues) {
|
|
44
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
45
|
-
this[key] = initialValues[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
24
|
const avatarStyles = [
|
|
53
25
|
{ color: '#ffffff', backgroundColor: '#3cb160' },
|
|
54
26
|
{ color: '#ffffff', backgroundColor: '#c373cc' },
|
|
@@ -92,7 +64,7 @@ class ConversationAvatarComponent {
|
|
|
92
64
|
>
|
|
93
65
|
{{ avatarText }}
|
|
94
66
|
</div>
|
|
95
|
-
`, 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: i1
|
|
67
|
+
`, 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: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
|
96
68
|
}
|
|
97
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ConversationAvatarComponent, decorators: [{
|
|
98
70
|
type: Component,
|
|
@@ -122,7 +94,9 @@ class ChatContactsComponent {
|
|
|
122
94
|
return this.allContacts.filter(contact => !contact.lastMessage);
|
|
123
95
|
}
|
|
124
96
|
listenToNewMessages() {
|
|
125
|
-
this.
|
|
97
|
+
this.chatConfigService.message$
|
|
98
|
+
.pipe(takeUntilDestroyed())
|
|
99
|
+
.subscribe((message = {}) => {
|
|
126
100
|
const index = this.allContacts.findIndex(cont => cont.userId === message.senderUserId);
|
|
127
101
|
const contact = {
|
|
128
102
|
userId: message.senderUserId,
|
|
@@ -131,18 +105,18 @@ class ChatContactsComponent {
|
|
|
131
105
|
surname: message.senderSurname,
|
|
132
106
|
lastMessage: message.text,
|
|
133
107
|
unreadMessageCount: 1,
|
|
134
|
-
lastMessageDate: new Date(),
|
|
108
|
+
lastMessageDate: new Date().toString(),
|
|
135
109
|
lastMessageSide: ChatMessageSide.Receiver,
|
|
136
110
|
};
|
|
137
111
|
if (index > -1) {
|
|
138
|
-
this.allContacts[index]
|
|
139
|
-
|
|
140
|
-
unreadMessageCount
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
112
|
+
let unreadMessageCount = this.allContacts[index].unreadMessageCount + 1;
|
|
113
|
+
if (this.selectedContact.userId === this.allContacts[index].userId) {
|
|
114
|
+
unreadMessageCount = 0;
|
|
115
|
+
}
|
|
116
|
+
this.allContacts[index] = { ...contact, unreadMessageCount };
|
|
117
|
+
return;
|
|
144
118
|
}
|
|
145
|
-
|
|
119
|
+
if (!this.filter) {
|
|
146
120
|
this.allContacts.push(contact);
|
|
147
121
|
}
|
|
148
122
|
});
|
|
@@ -150,7 +124,6 @@ class ChatContactsComponent {
|
|
|
150
124
|
constructor() {
|
|
151
125
|
this.contactService = inject(ContactService);
|
|
152
126
|
this.chatConfigService = inject(ChatConfigService);
|
|
153
|
-
this.subscription = inject(SubscriptionService);
|
|
154
127
|
this.chatConversationService = inject(ConversationService$1);
|
|
155
128
|
this.startConversation = model();
|
|
156
129
|
this.selected = new EventEmitter();
|
|
@@ -159,6 +132,15 @@ class ChatContactsComponent {
|
|
|
159
132
|
this.selectedContact = {};
|
|
160
133
|
this.filter = '';
|
|
161
134
|
this.getContactName = getContactName;
|
|
135
|
+
this.listenToNewMessages();
|
|
136
|
+
this.contactService
|
|
137
|
+
.getTotalUnreadMessageCount()
|
|
138
|
+
.pipe(filter(Boolean))
|
|
139
|
+
.subscribe(count => {
|
|
140
|
+
if (count > 0) {
|
|
141
|
+
this.get(null, false);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
162
144
|
effect(() => {
|
|
163
145
|
if (this.startConversation()) {
|
|
164
146
|
this.#startConversation = this.startConversation();
|
|
@@ -168,8 +150,9 @@ class ChatContactsComponent {
|
|
|
168
150
|
});
|
|
169
151
|
}
|
|
170
152
|
ngOnInit() {
|
|
171
|
-
|
|
172
|
-
|
|
153
|
+
if (this.allContacts.length) {
|
|
154
|
+
this.selectContact(this.allContacts[0]);
|
|
155
|
+
}
|
|
173
156
|
}
|
|
174
157
|
typing() {
|
|
175
158
|
if (!this.filter && this.#startConversation) {
|
|
@@ -191,7 +174,10 @@ class ChatContactsComponent {
|
|
|
191
174
|
const includeOtherContactsParam = isBoolean ? includeOtherContacts : !!this.filter;
|
|
192
175
|
this.filter = this.filter?.trim();
|
|
193
176
|
this.contactService
|
|
194
|
-
.
|
|
177
|
+
.getContacts({
|
|
178
|
+
includeOtherContacts: includeOtherContactsParam,
|
|
179
|
+
filter: this.filter,
|
|
180
|
+
})
|
|
195
181
|
.subscribe(res => {
|
|
196
182
|
this.allContacts = res;
|
|
197
183
|
if (onSuccess) {
|
|
@@ -205,7 +191,7 @@ class ChatContactsComponent {
|
|
|
205
191
|
}
|
|
206
192
|
changeLastMessageOfSelectedContact(message) {
|
|
207
193
|
this.selectedContact.lastMessage = message;
|
|
208
|
-
this.selectedContact.lastMessageDate = new Date();
|
|
194
|
+
this.selectedContact.lastMessageDate = new Date().toString();
|
|
209
195
|
const index = this.allContacts.findIndex(contact => contact.userId === this.selectedContact.userId);
|
|
210
196
|
this.allContacts[index] = this.selectedContact;
|
|
211
197
|
}
|
|
@@ -223,11 +209,11 @@ class ChatContactsComponent {
|
|
|
223
209
|
});
|
|
224
210
|
}
|
|
225
211
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ChatContactsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
226
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: ChatContactsComponent, selector: "abp-chat-contacts", inputs: { conversationDeletable: { classPropertyName: "conversationDeletable", publicName: "conversationDeletable", isSignal: false, isRequired: false, transformFunction: null }, startConversation: { classPropertyName: "startConversation", publicName: "startConversation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startConversation: "startConversationChange", selected: "selected", conversationDeleted: "conversationDeleted" },
|
|
212
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", type: ChatContactsComponent, selector: "abp-chat-contacts", inputs: { conversationDeletable: { classPropertyName: "conversationDeletable", publicName: "conversationDeletable", isSignal: false, isRequired: false, transformFunction: null }, startConversation: { classPropertyName: "startConversation", publicName: "startConversation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { startConversation: "startConversationChange", selected: "selected", conversationDeleted: "conversationDeleted" }, ngImport: i0, template: "<div class=\"card w-100 mb-3 mb-md-0\">\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 *abpPermission=\"'Chat.Searching'\"\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)=\"typing()\"\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\r\n id=\"contact-list\"\r\n class=\"list-group rounded-3\"\r\n [ngStyle]=\"{ 'min-height': allContacts.length && 'calc(100vh - 254.34px)' }\"\r\n >\r\n @for (contact of contacts; track contact.userId; let i = $index) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n }\r\n\r\n @if (otherContacts.length) {\r\n <div\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 }\r\n\r\n @for (contact of otherContacts; track contact.userId; let i = $index) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n }\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 position-relative px-2 border-2 rounded-2 mb-1 mt-0\"\r\n [class.active]=\"selectedContact?.userId === contact.userId\"\r\n >\r\n <div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\" />\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 cursor-pointer\">\r\n {{ getContactName(contact) }}\r\n @if (contact.unreadMessageCount) {\r\n <span class=\"badge bg-secondary text-white ms-1\">{{ contact.unreadMessageCount }}</span>\r\n }\r\n </h5>\r\n <small class=\"last-message-date\">{{ contact.lastMessageDate | date: 'HH:mm' }}</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\r\n @if (conversationDeletable) {\r\n <div ngbDropdown class=\"dropdown position-absolute bottom-0 end-0\">\r\n <button class=\"btn p-1 down-arrow\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteConversation(contact)\">Delete</button>\r\n </div>\r\n </div>\r\n }\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)}.dropdown-toggle:after{display:none}.dropdown{border-color:transparent}.down-arrow{border:none;opacity:0}.media:hover .down-arrow{opacity:100%}.list-group{padding-right:7px}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:var(--lpx-border-color)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.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: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.InputEventDebounceDirective, selector: "[input.debounce]", inputs: ["debounce"], outputs: ["input.debounce"] }, { kind: "directive", type: i1$2.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "directive", type: i4.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i4.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i4.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i4.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i4.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: ["contact", "small"] }, { kind: "pipe", type: i1.SlicePipe, name: "slice" }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i1$2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
227
213
|
}
|
|
228
214
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ChatContactsComponent, decorators: [{
|
|
229
215
|
type: Component,
|
|
230
|
-
args: [{ selector: 'abp-chat-contacts',
|
|
216
|
+
args: [{ selector: 'abp-chat-contacts', template: "<div class=\"card w-100 mb-3 mb-md-0\">\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 *abpPermission=\"'Chat.Searching'\"\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)=\"typing()\"\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\r\n id=\"contact-list\"\r\n class=\"list-group rounded-3\"\r\n [ngStyle]=\"{ 'min-height': allContacts.length && 'calc(100vh - 254.34px)' }\"\r\n >\r\n @for (contact of contacts; track contact.userId; let i = $index) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n }\r\n\r\n @if (otherContacts.length) {\r\n <div\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 }\r\n\r\n @for (contact of otherContacts; track contact.userId; let i = $index) {\r\n <ng-container\r\n [ngTemplateOutlet]=\"contactTemplate\"\r\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\r\n >\r\n </ng-container>\r\n }\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 position-relative px-2 border-2 rounded-2 mb-1 mt-0\"\r\n [class.active]=\"selectedContact?.userId === contact.userId\"\r\n >\r\n <div class=\"media\">\r\n <abp-conversation-avatar [contact]=\"contact\" />\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 cursor-pointer\">\r\n {{ getContactName(contact) }}\r\n @if (contact.unreadMessageCount) {\r\n <span class=\"badge bg-secondary text-white ms-1\">{{ contact.unreadMessageCount }}</span>\r\n }\r\n </h5>\r\n <small class=\"last-message-date\">{{ contact.lastMessageDate | date: 'HH:mm' }}</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\r\n @if (conversationDeletable) {\r\n <div ngbDropdown class=\"dropdown position-absolute bottom-0 end-0\">\r\n <button class=\"btn p-1 down-arrow\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteConversation(contact)\">Delete</button>\r\n </div>\r\n </div>\r\n }\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)}.dropdown-toggle:after{display:none}.dropdown{border-color:transparent}.down-arrow{border:none;opacity:0}.media:hover .down-arrow{opacity:100%}.list-group{padding-right:7px}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:var(--lpx-border-color)}\n"] }]
|
|
231
217
|
}], ctorParameters: () => [], propDecorators: { conversationDeletable: [{
|
|
232
218
|
type: Input
|
|
233
219
|
}], selected: [{
|
|
@@ -239,84 +225,6 @@ function getContactName({ name, surname, username }) {
|
|
|
239
225
|
return `${name || ''} ${surname || ''}`;
|
|
240
226
|
}
|
|
241
227
|
|
|
242
|
-
class ChatConversationDto {
|
|
243
|
-
constructor(initialValues = {}) {
|
|
244
|
-
if (initialValues) {
|
|
245
|
-
for (const key in initialValues) {
|
|
246
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
247
|
-
this[key] = initialValues[key];
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
class ChatMessageDto {
|
|
255
|
-
constructor(initialValues = {}) {
|
|
256
|
-
if (initialValues) {
|
|
257
|
-
for (const key in initialValues) {
|
|
258
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
259
|
-
this[key] = initialValues[key];
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
class ChatTargetUserInfo {
|
|
267
|
-
constructor(initialValues = {}) {
|
|
268
|
-
if (initialValues) {
|
|
269
|
-
for (const key in initialValues) {
|
|
270
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
271
|
-
this[key] = initialValues[key];
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
class GetConversationInput extends PagedResultRequestDto {
|
|
279
|
-
constructor(initialValues = {}) {
|
|
280
|
-
super(initialValues);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
class MarkConversationAsReadInput {
|
|
285
|
-
constructor(initialValues = {}) {
|
|
286
|
-
if (initialValues) {
|
|
287
|
-
for (const key in initialValues) {
|
|
288
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
289
|
-
this[key] = initialValues[key];
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
class SendMessageInput {
|
|
297
|
-
constructor(initialValues = {}) {
|
|
298
|
-
if (initialValues) {
|
|
299
|
-
for (const key in initialValues) {
|
|
300
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
301
|
-
this[key] = initialValues[key];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
class SendOnEnterSettingDto {
|
|
309
|
-
constructor(initialValues = {}) {
|
|
310
|
-
if (initialValues) {
|
|
311
|
-
for (const key in initialValues) {
|
|
312
|
-
if (initialValues.hasOwnProperty(key)) {
|
|
313
|
-
this[key] = initialValues[key];
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
228
|
class ChatMessageTitleComponent {
|
|
321
229
|
get contactName() {
|
|
322
230
|
return getContactName(this.selectedContact || {});
|
|
@@ -338,7 +246,9 @@ class ChatMessageTitleComponent {
|
|
|
338
246
|
}
|
|
339
247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ChatMessageTitleComponent, decorators: [{
|
|
340
248
|
type: Component,
|
|
341
|
-
args: [{
|
|
249
|
+
args: [{
|
|
250
|
+
selector: 'abp-chat-message-title',
|
|
251
|
+
template: `
|
|
342
252
|
<div class="px-2 py-1 border mb-2 rounded-2">
|
|
343
253
|
<div class="row">
|
|
344
254
|
<div class="col-auto py-1 pe-0">
|
|
@@ -350,7 +260,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImpor
|
|
|
350
260
|
</div>
|
|
351
261
|
</div>
|
|
352
262
|
</div>
|
|
353
|
-
|
|
263
|
+
`,
|
|
264
|
+
}]
|
|
354
265
|
}], propDecorators: { selectedContact: [{
|
|
355
266
|
type: Input
|
|
356
267
|
}] } });
|
|
@@ -587,7 +498,7 @@ class ChatComponent {
|
|
|
587
498
|
}
|
|
588
499
|
}
|
|
589
500
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
590
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", 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\r\n class=\"d-flex w-100\"\r\n (selected)=\"onSelectContact($event)\"\r\n [(startConversation)]=\"clickedStartMessage\"\r\n [conversationDeletable]=\"conversationDeletable\"\r\n (conversationDeleted)=\"conversationDeleted($event)\"\r\n />\r\n </div>\r\n <!-- /Users box-->\r\n\r\n <!-- Chat Box-->\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 @if (selectedContact.userId) {\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <abp-chat-message-title [selectedContact]=\"selectedContact\" />\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 @for (\r\n message of selectedContactMessages;\r\n track message.messageDate;\r\n let i = $index\r\n ) {\r\n @if (selectedContactMessages.length - unreadMessageCount === i) {\r\n <div class=\"row justify-content-center unread-message-count-badge-wrapper\">\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n @if (unreadMessageCount === 1) {\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n } @else {\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages'\r\n | abpLocalization: '' + unreadMessageCount\r\n }}\r\n }\r\n </span>\r\n </h3>\r\n </div>\r\n }\r\n\r\n @if ({ isSender: message.side === chatMessageSide.Sender }; as data) {\r\n <div class=\"media w-75 mw-65 w-lp-auto mb-2\" [class.ms-auto]=\"data.isSender\">\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 [class.bg-primary]=\"data.isSender\"\r\n [class.bg-light]=\"!data.isSender\"\r\n >\r\n <p\r\n class=\"message-text text-small mb-0 {{\r\n data.isSender ? 'text-white' : 'text-muted'\r\n }}\"\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\r\n @if (messageDeletable && message.side === chatMessageSide.Sender) {\r\n <div ngbDropdown class=\"dropdown position-absolute top-0 end-0\">\r\n <button class=\"btn p-1 text-white down-arrow\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteMessage(message)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (\r\n messageDeletableWithPeriod &&\r\n showDeleteDropdown(message) &&\r\n message.side === chatMessageSide.Sender\r\n ) {\r\n <div ngbDropdown class=\"dropdown position-absolute top-0 end-0\">\r\n <button class=\"btn p-1 text-light down-arrow\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteMessage(message)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (selectedContact?.userId) {\r\n <div id=\"send-message-form\" class=\"bg-light rounded-3 m-0\">\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\"\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 @if (!loading) {\r\n <i class=\"fa fa-paper-plane ms-2\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <i class=\"fas fa-spinner fa-spin ms-2\" aria-hidden=\"true\"></i>\r\n }\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!selectedContact.userId) {\r\n <div class=\"card-body pt-5 pb-5 text-center\">\r\n <i class=\"fa fa-commenting-o fs-2\" aria-hidden=\"true\"></i>\r\n <p>{{ 'Chat::NoMessageYetMessage' | abpLocalization }}</p>\r\n <button (click)=\"startConversation()\" type=\"button\" class=\"btn btn-primary\">\r\n {{ 'Chat::StartConversation' | abpLocalization }}\r\n </button>\r\n </div>\r\n }\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-text{white-space:pre-line}.message-date{position:absolute;opacity:.35;width:100px;top:1px}.message-date.left{left:-110px;text-align:right}.message-date.right{right:-110px}.dropdown-toggle:after{display:none}.dropdown{border-color:transparent}.down-arrow{border:none;opacity:0}.media-body:hover .down-arrow{opacity:100%}.chat-box-container{padding-right:7px}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:var(--lpx-border-color)}\n"], dependencies: [{ kind: "directive", type: i1$2.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: i1$2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i4.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i4.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i4.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i4.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: ChatContactsComponent, selector: "abp-chat-contacts", inputs: ["conversationDeletable", "startConversation"], outputs: ["startConversationChange", "selected", "conversationDeleted"] }, { kind: "component", type: ChatMessageTitleComponent, selector: "abp-chat-message-title", inputs: ["selectedContact"] }, { kind: "pipe", type: i1$1.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
501
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.1.5", 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\r\n class=\"d-flex w-100\"\r\n (selected)=\"onSelectContact($event)\"\r\n [(startConversation)]=\"clickedStartMessage\"\r\n [conversationDeletable]=\"conversationDeletable\"\r\n (conversationDeleted)=\"conversationDeleted($event)\"\r\n />\r\n </div>\r\n <!-- /Users box-->\r\n\r\n <!-- Chat Box-->\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 @if (selectedContact.userId) {\r\n <div class=\"card-body p-1 p-md-2 p-lg-3\">\r\n <abp-chat-message-title [selectedContact]=\"selectedContact\" />\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 @for (\r\n message of selectedContactMessages;\r\n track message.messageDate;\r\n let i = $index\r\n ) {\r\n @if (selectedContactMessages.length - unreadMessageCount === i) {\r\n <div class=\"row justify-content-center unread-message-count-badge-wrapper\">\r\n <h3>\r\n <span class=\"badge badge-info\">\r\n @if (unreadMessageCount === 1) {\r\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\r\n } @else {\r\n {{\r\n 'Chat::YouHave{0}UnreadMessages'\r\n | abpLocalization: '' + unreadMessageCount\r\n }}\r\n }\r\n </span>\r\n </h3>\r\n </div>\r\n }\r\n\r\n @if ({ isSender: message.side === chatMessageSide.Sender }; as data) {\r\n <div class=\"media w-75 mw-65 w-lp-auto mb-2\" [class.ms-auto]=\"data.isSender\">\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 [class.bg-primary]=\"data.isSender\"\r\n [class.bg-light]=\"!data.isSender\"\r\n >\r\n <p\r\n class=\"message-text text-small mb-0 {{\r\n data.isSender ? 'text-white' : 'text-muted'\r\n }}\"\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\r\n @if (messageDeletable && message.side === chatMessageSide.Sender) {\r\n <div ngbDropdown class=\"dropdown position-absolute top-0 end-0\">\r\n <button class=\"btn p-1 text-white down-arrow\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteMessage(message)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (\r\n messageDeletableWithPeriod &&\r\n showDeleteDropdown(message) &&\r\n message.side === chatMessageSide.Sender\r\n ) {\r\n <div ngbDropdown class=\"dropdown position-absolute top-0 end-0\">\r\n <button class=\"btn p-1 text-light down-arrow\" ngbDropdownToggle>\r\n <i class=\"bi bi-chevron-down\"></i>\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem (click)=\"deleteMessage(message)\">\r\n {{ 'AbpUi::Delete' | abpLocalization }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (selectedContact?.userId) {\r\n <div id=\"send-message-form\" class=\"bg-light rounded-3 m-0\">\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\"\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 @if (!loading) {\r\n <i class=\"fa fa-paper-plane ms-2\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <i class=\"fas fa-spinner fa-spin ms-2\" aria-hidden=\"true\"></i>\r\n }\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!selectedContact.userId) {\r\n <div class=\"card-body pt-5 pb-5 text-center\">\r\n <i class=\"fa fa-commenting-o fs-2\" aria-hidden=\"true\"></i>\r\n <p>{{ 'Chat::NoMessageYetMessage' | abpLocalization }}</p>\r\n <button (click)=\"startConversation()\" type=\"button\" class=\"btn btn-primary\">\r\n {{ 'Chat::StartConversation' | abpLocalization }}\r\n </button>\r\n </div>\r\n }\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-text{white-space:pre-line}.message-date{position:absolute;opacity:.35;width:100px;top:1px}.message-date.left{left:-110px;text-align:right}.message-date.right{right:-110px}.dropdown-toggle:after{display:none}.dropdown{border-color:transparent}.down-arrow{border:none;opacity:0}.media-body:hover .down-arrow{opacity:100%}.chat-box-container{padding-right:7px}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:var(--lpx-border-color)}\n"], dependencies: [{ kind: "directive", type: i1$1.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: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i4.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i4.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i4.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i4.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: ChatContactsComponent, selector: "abp-chat-contacts", inputs: ["conversationDeletable", "startConversation"], outputs: ["startConversationChange", "selected", "conversationDeleted"] }, { kind: "component", type: ChatMessageTitleComponent, selector: "abp-chat-message-title", inputs: ["selectedContact"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i1$2.LocalizationPipe, name: "abpLocalization" }] }); }
|
|
591
502
|
}
|
|
592
503
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ChatComponent, decorators: [{
|
|
593
504
|
type: Component,
|
|
@@ -683,13 +594,13 @@ class ConversationService {
|
|
|
683
594
|
markConversationAsReadByInput(body) {
|
|
684
595
|
return this.restService.request({ url: '/api/chat/conversation/mark-conversation-as-read', method: 'POST', body }, { apiName: this.apiName });
|
|
685
596
|
}
|
|
686
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ConversationService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
597
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ConversationService, deps: [{ token: i1$2.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
687
598
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ConversationService, providedIn: 'root' }); }
|
|
688
599
|
}
|
|
689
600
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ConversationService, decorators: [{
|
|
690
601
|
type: Injectable,
|
|
691
602
|
args: [{ providedIn: 'root' }]
|
|
692
|
-
}], ctorParameters: () => [{ type: i1.RestService }] });
|
|
603
|
+
}], ctorParameters: () => [{ type: i1$2.RestService }] });
|
|
693
604
|
|
|
694
605
|
class SettingsService {
|
|
695
606
|
constructor(restService) {
|
|
@@ -699,17 +610,95 @@ class SettingsService {
|
|
|
699
610
|
setSendOnEnterSettingByInput(body) {
|
|
700
611
|
return this.restService.request({ url: '/api/chat/settings/send-on-enter', method: 'POST', body }, { apiName: this.apiName });
|
|
701
612
|
}
|
|
702
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SettingsService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
613
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SettingsService, deps: [{ token: i1$2.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
703
614
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SettingsService, providedIn: 'root' }); }
|
|
704
615
|
}
|
|
705
616
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SettingsService, decorators: [{
|
|
706
617
|
type: Injectable,
|
|
707
618
|
args: [{ providedIn: 'root' }]
|
|
708
|
-
}], ctorParameters: () => [{ type: i1.RestService }] });
|
|
619
|
+
}], ctorParameters: () => [{ type: i1$2.RestService }] });
|
|
620
|
+
|
|
621
|
+
class ChatConversationDto {
|
|
622
|
+
constructor(initialValues = {}) {
|
|
623
|
+
if (initialValues) {
|
|
624
|
+
for (const key in initialValues) {
|
|
625
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
626
|
+
this[key] = initialValues[key];
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
class ChatMessageDto {
|
|
634
|
+
constructor(initialValues = {}) {
|
|
635
|
+
if (initialValues) {
|
|
636
|
+
for (const key in initialValues) {
|
|
637
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
638
|
+
this[key] = initialValues[key];
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
class ChatTargetUserInfo {
|
|
646
|
+
constructor(initialValues = {}) {
|
|
647
|
+
if (initialValues) {
|
|
648
|
+
for (const key in initialValues) {
|
|
649
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
650
|
+
this[key] = initialValues[key];
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
class GetConversationInput extends PagedResultRequestDto {
|
|
658
|
+
constructor(initialValues = {}) {
|
|
659
|
+
super(initialValues);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
class MarkConversationAsReadInput {
|
|
664
|
+
constructor(initialValues = {}) {
|
|
665
|
+
if (initialValues) {
|
|
666
|
+
for (const key in initialValues) {
|
|
667
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
668
|
+
this[key] = initialValues[key];
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
class SendMessageInput {
|
|
676
|
+
constructor(initialValues = {}) {
|
|
677
|
+
if (initialValues) {
|
|
678
|
+
for (const key in initialValues) {
|
|
679
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
680
|
+
this[key] = initialValues[key];
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
class SendOnEnterSettingDto {
|
|
688
|
+
constructor(initialValues = {}) {
|
|
689
|
+
if (initialValues) {
|
|
690
|
+
for (const key in initialValues) {
|
|
691
|
+
if (initialValues.hasOwnProperty(key)) {
|
|
692
|
+
this[key] = initialValues[key];
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
709
698
|
|
|
710
699
|
/**
|
|
711
700
|
* Generated bundle index. Do not edit.
|
|
712
701
|
*/
|
|
713
702
|
|
|
714
|
-
export { ChatComponent,
|
|
703
|
+
export { ChatComponent, ChatContactsComponent, ChatConversationDto, ChatMessageDto, ChatMessageSide, ChatMessageTitleComponent, ChatModule, ChatTargetUserInfo, ConversationAvatarComponent, ConversationService, GetConversationInput, MarkConversationAsReadInput, SendMessageInput, SendOnEnterSettingDto, SettingsService, getContactName };
|
|
715
704
|
//# sourceMappingURL=volo-abp.ng.chat.mjs.map
|