@volo/abp.ng.chat 4.4.1 → 5.0.0-beta.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.
Files changed (73) hide show
  1. package/bundles/volo-abp.ng.chat-config.umd.js +1 -1
  2. package/bundles/volo-abp.ng.chat-proxy.umd.js +1 -0
  3. package/bundles/volo-abp.ng.chat.umd.js +1 -1
  4. package/config/chat-config.module.d.ts +6 -0
  5. package/config/components/chat-icon.component.d.ts +3 -0
  6. package/config/package.json +0 -1
  7. package/config/providers/nav-item.provider.d.ts +1 -1
  8. package/config/providers/route.provider.d.ts +1 -1
  9. package/config/services/chat-config.service.d.ts +4 -3
  10. package/config/volo-abp.ng.chat-config.d.ts +1 -2
  11. package/esm2015/config/chat-config.module.js +1 -1
  12. package/esm2015/config/components/chat-icon.component.js +1 -1
  13. package/esm2015/config/services/chat-config.service.js +1 -1
  14. package/esm2015/config/volo-abp.ng.chat-config.js +1 -1
  15. package/esm2015/lib/chat-routing.module.js +1 -1
  16. package/esm2015/lib/chat.module.js +1 -1
  17. package/esm2015/lib/components/chat-contacts.component.js +1 -1
  18. package/esm2015/lib/components/chat.component.js +1 -1
  19. package/esm2015/lib/components/conversation-avatar.component.js +1 -1
  20. package/esm2015/lib/components/index.js +1 -0
  21. package/esm2015/lib/services/contact.service.js +1 -1
  22. package/esm2015/lib/services/conversation.service.js +1 -1
  23. package/esm2015/proxy/lib/index.js +1 -0
  24. package/esm2015/proxy/lib/proxy/volo/chat/conversations/conversation.service.js +1 -0
  25. package/esm2015/proxy/lib/proxy/volo/chat/conversations/index.js +1 -0
  26. package/esm2015/proxy/lib/proxy/volo/chat/conversations/models.js +1 -0
  27. package/esm2015/proxy/lib/proxy/volo/chat/messages/chat-message-side.enum.js +1 -0
  28. package/esm2015/proxy/lib/proxy/volo/chat/messages/index.js +1 -0
  29. package/esm2015/proxy/lib/proxy/volo/chat/messages/models.js +1 -0
  30. package/esm2015/proxy/lib/proxy/volo/chat/settings/index.js +1 -0
  31. package/esm2015/proxy/lib/proxy/volo/chat/settings/models.js +1 -0
  32. package/esm2015/proxy/lib/proxy/volo/chat/settings/settings.service.js +1 -0
  33. package/esm2015/proxy/lib/proxy/volo/chat/users/contact.service.js +1 -0
  34. package/esm2015/proxy/lib/proxy/volo/chat/users/index.js +1 -0
  35. package/esm2015/proxy/lib/proxy/volo/chat/users/models.js +1 -0
  36. package/esm2015/proxy/public-api.js +1 -0
  37. package/esm2015/proxy/volo-abp.ng.chat-proxy.js +1 -0
  38. package/esm2015/public-api.js +1 -1
  39. package/esm2015/volo-abp.ng.chat.js +1 -1
  40. package/fesm2015/volo-abp.ng.chat-config.js +48 -47
  41. package/fesm2015/volo-abp.ng.chat-proxy.js +92 -0
  42. package/fesm2015/volo-abp.ng.chat.js +186 -166
  43. package/lib/chat-routing.module.d.ts +5 -0
  44. package/lib/chat.module.d.ts +10 -0
  45. package/lib/components/chat-contacts.component.d.ts +6 -1
  46. package/lib/components/chat.component.d.ts +3 -0
  47. package/lib/components/conversation-avatar.component.d.ts +3 -0
  48. package/lib/components/index.d.ts +3 -0
  49. package/lib/services/contact.service.d.ts +3 -0
  50. package/lib/services/conversation.service.d.ts +3 -0
  51. package/package.json +3 -4
  52. package/proxy/lib/index.d.ts +4 -0
  53. package/proxy/lib/proxy/volo/chat/conversations/conversation.service.d.ts +14 -0
  54. package/proxy/lib/proxy/volo/chat/conversations/index.d.ts +2 -0
  55. package/proxy/lib/proxy/volo/chat/conversations/models.d.ts +13 -0
  56. package/proxy/lib/proxy/volo/chat/messages/chat-message-side.enum.d.ts +5 -0
  57. package/proxy/lib/proxy/volo/chat/messages/index.d.ts +2 -0
  58. package/proxy/lib/proxy/volo/chat/messages/models.d.ts +12 -0
  59. package/proxy/lib/proxy/volo/chat/settings/index.d.ts +2 -0
  60. package/proxy/lib/proxy/volo/chat/settings/models.d.ts +3 -0
  61. package/proxy/lib/proxy/volo/chat/settings/settings.service.d.ts +11 -0
  62. package/proxy/lib/proxy/volo/chat/users/contact.service.d.ts +12 -0
  63. package/proxy/lib/proxy/volo/chat/users/index.d.ts +2 -0
  64. package/proxy/lib/proxy/volo/chat/users/models.d.ts +21 -0
  65. package/proxy/package.json +10 -0
  66. package/proxy/public-api.d.ts +1 -0
  67. package/proxy/volo-abp.ng.chat-proxy.d.ts +5 -0
  68. package/public-api.d.ts +1 -1
  69. package/volo-abp.ng.chat.d.ts +1 -5
  70. package/bundles/volo-abp.ng.chat-config.umd.min.js +0 -1
  71. package/bundles/volo-abp.ng.chat.umd.min.js +0 -1
  72. package/config/volo-abp.ng.chat-config.metadata.json +0 -1
  73. package/volo-abp.ng.chat.metadata.json +0 -1
@@ -1,12 +1,15 @@
1
- import * as i1 from '@abp/ng.core';
2
- import { RestService, trackBy, takeUntilDestroy, ConfigStateService, HttpWaitService, DynamicLayoutComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
1
+ import * as i3 from '@abp/ng.core';
2
+ import { trackBy, SubscriptionService, DynamicLayoutComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
3
+ import { ThemeSharedModule } from '@abp/ng.theme.shared';
3
4
  import * as i0 from '@angular/core';
4
- import { Injectable, EventEmitter, Component, Output, ViewChild, NgModule, Input } from '@angular/core';
5
- import { ChatConfigService } from '@volo/abp.ng.chat/config';
5
+ import { Injectable, Component, Input, EventEmitter, Output, ViewChild, NgModule } from '@angular/core';
6
+ import * as i1 from '@angular/router';
7
+ import { RouterModule } from '@angular/router';
8
+ import * as i2 from '@volo/abp.ng.chat/config';
6
9
  import { Subject, fromEvent } from 'rxjs';
7
10
  import { finalize, debounceTime, takeUntil } from 'rxjs/operators';
8
- import { ThemeSharedModule } from '@abp/ng.theme.shared';
9
- import { RouterModule } from '@angular/router';
11
+ import * as i6 from '@angular/common';
12
+ import * as i7 from '@angular/forms';
10
13
 
11
14
  var ChatMessageSide;
12
15
  (function (ChatMessageSide) {
@@ -29,13 +32,12 @@ class ConversationService {
29
32
  return this.restService.request({ url: '/api/chat/conversation/mark-conversation-as-read', method: 'POST', body }, { apiName: this.apiName });
30
33
  }
31
34
  }
32
- ConversationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationService_Factory() { return new ConversationService(i0.ɵɵinject(i1.RestService)); }, token: ConversationService, providedIn: "root" });
33
- ConversationService.decorators = [
34
- { type: Injectable, args: [{ providedIn: 'root' },] }
35
- ];
36
- ConversationService.ctorParameters = () => [
37
- { type: RestService }
38
- ];
35
+ ConversationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ConversationService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
36
+ ConversationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ConversationService, providedIn: 'root' });
37
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ConversationService, decorators: [{
38
+ type: Injectable,
39
+ args: [{ providedIn: 'root' }]
40
+ }], ctorParameters: function () { return [{ type: i3.RestService }]; } });
39
41
 
40
42
  class ContactService {
41
43
  constructor(restService) {
@@ -46,18 +48,111 @@ class ContactService {
46
48
  return this.restService.request({ url: '/api/chat/contact/contacts', method: 'GET', params }, { apiName: this.apiName });
47
49
  }
48
50
  }
49
- ContactService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ContactService_Factory() { return new ContactService(i0.ɵɵinject(i1.RestService)); }, token: ContactService, providedIn: "root" });
50
- ContactService.decorators = [
51
- { type: Injectable, args: [{ providedIn: 'root' },] }
51
+ ContactService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ContactService, deps: [{ token: i3.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
52
+ ContactService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ContactService, providedIn: 'root' });
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ContactService, decorators: [{
54
+ type: Injectable,
55
+ args: [{ providedIn: 'root' }]
56
+ }], ctorParameters: function () { return [{ type: i3.RestService }]; } });
57
+
58
+ class ChatContactDto {
59
+ constructor(initialValues = {}) {
60
+ if (initialValues) {
61
+ for (const key in initialValues) {
62
+ if (initialValues.hasOwnProperty(key)) {
63
+ this[key] = initialValues[key];
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+
70
+ const avatarStyles = [
71
+ { color: '#ffffff', backgroundColor: '#3cb160' },
72
+ { color: '#ffffff', backgroundColor: '#c373cc' },
73
+ { color: '#ffffff', backgroundColor: '#2b78b3' },
74
+ { color: '#ffffff', backgroundColor: '#6ac79a' },
75
+ { color: '#ffffff', backgroundColor: '#aeb140' },
76
+ { color: '#ffffff', backgroundColor: '#b773c0' },
77
+ { color: '#ffffff', backgroundColor: '#e16d7a' },
78
+ { color: '#ffffff', backgroundColor: '#ffac2a' },
79
+ { color: '#ffffff', backgroundColor: '#21bbc7' },
80
+ { color: '#ffffff', backgroundColor: '#59ab95' },
52
81
  ];
53
- ContactService.ctorParameters = () => [
54
- { type: RestService }
55
- ];
82
+ class ConversationAvatarComponent {
83
+ get avatarText() {
84
+ if (!this.contact || !this.contact.username)
85
+ return;
86
+ if (this.contact.name && this.contact.surname)
87
+ return this.contact.name[0] + this.contact.surname[0];
88
+ if (this.contact.name)
89
+ return this.contact.name.slice(0, 2);
90
+ return this.contact.username.slice(0, 2);
91
+ }
92
+ get avatarBgStyle() {
93
+ if (!this.contact || !this.contact.username)
94
+ return;
95
+ let hash = 0;
96
+ for (let i = 0; i < this.contact.username.length; i++) {
97
+ hash = this.contact.username.charCodeAt(i) + ((hash << 5) - hash);
98
+ }
99
+ return avatarStyles[Math.abs(hash % 10)];
100
+ }
101
+ get isSmall() {
102
+ return typeof this.small === 'string' || this.small;
103
+ }
104
+ }
105
+ ConversationAvatarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ConversationAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
106
+ ConversationAvatarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: { contact: "contact", small: "small" }, ngImport: i0, template: `<div
107
+ class="avatar mx-auto rounded-circle"
108
+ [class.small]="isSmall"
109
+ [ngStyle]="avatarBgStyle"
110
+ >
111
+ {{ avatarText }}
112
+ </div>`, isInline: true, styles: ["\n .avatar {\n height: 40px;\n width: 40px;\n line-height: 40px;\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n text-transform: uppercase;\n }\n\n .avatar.small {\n height: 27px;\n width: 27px;\n line-height: 27px;\n font-size: 14px;\n }\n "], directives: [{ type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ConversationAvatarComponent, decorators: [{
114
+ type: Component,
115
+ args: [{
116
+ selector: 'abp-conversation-avatar',
117
+ template: `<div
118
+ class="avatar mx-auto rounded-circle"
119
+ [class.small]="isSmall"
120
+ [ngStyle]="avatarBgStyle"
121
+ >
122
+ {{ 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
+ }]
145
+ }], propDecorators: { contact: [{
146
+ type: Input
147
+ }], small: [{
148
+ type: Input
149
+ }] } });
56
150
 
57
151
  class ChatContactsComponent {
58
- constructor(contactService, chatConfigService) {
152
+ constructor(contactService, chatConfigService, subscription) {
59
153
  this.contactService = contactService;
60
154
  this.chatConfigService = chatConfigService;
155
+ this.subscription = subscription;
61
156
  this.selected = new EventEmitter();
62
157
  this.allContacts = [];
63
158
  this.selectedContact = {};
@@ -74,16 +169,14 @@ class ChatContactsComponent {
74
169
  return this.allContacts.filter((contact) => !contact.lastMessage);
75
170
  }
76
171
  listenToNewMessages() {
77
- this.chatConfigService.message$
78
- .pipe(takeUntilDestroy(this))
79
- .subscribe(({ senderName, senderSurname, senderUserId, senderUsername, text } = {}) => {
80
- const index = this.allContacts.findIndex((cont) => cont.userId === senderUserId);
172
+ this.subscription.addOne(this.chatConfigService.message$, (message = {}) => {
173
+ const index = this.allContacts.findIndex((cont) => cont.userId === message.senderUserId);
81
174
  const contact = {
82
- userId: senderUserId,
83
- username: senderUsername,
84
- name: senderName,
85
- surname: senderSurname,
86
- lastMessage: text,
175
+ userId: message.senderUserId,
176
+ username: message.senderUsername,
177
+ name: message.senderName,
178
+ surname: message.senderSurname,
179
+ lastMessage: message.text,
87
180
  unreadMessageCount: 1,
88
181
  lastMessageDate: new Date(),
89
182
  lastMessageSide: ChatMessageSide.Receiver,
@@ -130,25 +223,26 @@ class ChatContactsComponent {
130
223
  this.selectedContact.unreadMessageCount = 0;
131
224
  }
132
225
  }
133
- ChatContactsComponent.decorators = [
134
- { type: Component, args: [{
135
- selector: 'abp-chat-contacts',
136
- template: "<div class=\"border-right\">\n <div class=\"p-3 bg-light border-bottom\">\n <div class=\"form-row\">\n <div class=\"col\">\n <input\n id=\"contacts-filter\"\n type=\"search\"\n class=\"form-control form-control-sm\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [(ngModel)]=\"filter\"\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\n (input.debounce)=\"get()\"\n />\n </div>\n </div>\n </div>\n\n <div class=\"messages-box m-0 p-0\">\n <div class=\"list-group rounded-0\" id=\"contact-list\">\n <ng-container\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\n [ngTemplateOutlet]=\"contactTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\n >\n </ng-container>\n <div\n *ngIf=\"otherContacts.length\"\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-left-0 border-right-0\"\n >\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\n </div>\n <ng-container\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\n [ngTemplateOutlet]=\"contactTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\n >\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #contactTemplate let-contact let-i=\"index\">\n <a\n (click)=\"selectContact(contact)\"\n class=\"chat-contact list-group-item list-group-item-action px-4 rounded-0 border-left-0 pointer {{\n selectedContact.userId === contact.userId ? 'active text-white' : ''\n }}\"\n ><div class=\"media\">\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\n <div class=\"media-body ml-2 d-none d-md-block\">\n <div class=\"d-flex align-items-center justify-content-between mb-1\">\n <h6 class=\"mb-0\">\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success mr-1\">{{\n contact.unreadMessageCount\n }}</small\n >{{ getContactName(contact) }}\n </h6>\n <small class=\"small font-weight-bold last-message-date\">{{\n contact.lastMessageDate | date\n }}</small>\n </div>\n <p class=\"mb-0 text-small last-message\">\n {{\n contact.lastMessage?.length > 24\n ? (contact.lastMessage | slice: 0:23) + '...'\n : contact.lastMessage\n }}\n </p>\n </div>\n </div>\n </a>\n</ng-template>\n",
137
- styles: [`
226
+ ChatContactsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatContactsComponent, deps: [{ token: ContactService }, { token: i2.ChatConfigService }, { token: i3.SubscriptionService }], target: i0.ɵɵFactoryTarget.Component });
227
+ ChatContactsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", type: ChatContactsComponent, selector: "abp-chat-contacts", outputs: { selected: "selected" }, providers: [SubscriptionService], ngImport: i0, template: "<div class=\"border-right\">\n <div class=\"p-3 bg-light border-bottom\">\n <div class=\"form-row\">\n <div class=\"col\">\n <input\n id=\"contacts-filter\"\n type=\"search\"\n class=\"form-control form-control-sm\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [(ngModel)]=\"filter\"\n [placeholder]=\"'Chat::SearchInContacts' | abpLocalization\"\n [attr.aria-label]=\"'Chat::SearchInContacts' | abpLocalization\"\n (input.debounce)=\"get()\"\n />\n </div>\n </div>\n </div>\n\n <div class=\"messages-box m-0 p-0\">\n <div class=\"list-group rounded-0\" id=\"contact-list\">\n <ng-container\n *ngFor=\"let contact of contacts; let i = index; trackBy: trackByUserId\"\n [ngTemplateOutlet]=\"contactTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\n >\n </ng-container>\n <div\n *ngIf=\"otherContacts.length\"\n class=\"list-group-item px-2 py-1 bg-light text-muted text-center font-size-sm text-uppercase border-left-0 border-right-0\"\n >\n <small>{{ 'Chat::OtherContacts' | abpLocalization }}</small>\n </div>\n <ng-container\n *ngFor=\"let contact of otherContacts; let i = index; trackBy: trackByUserId\"\n [ngTemplateOutlet]=\"contactTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: contact, index: i }\"\n >\n </ng-container>\n </div>\n </div>\n</div>\n\n<ng-template #contactTemplate let-contact let-i=\"index\">\n <a\n (click)=\"selectContact(contact)\"\n class=\"chat-contact list-group-item list-group-item-action px-4 rounded-0 border-left-0 pointer {{\n selectedContact.userId === contact.userId ? 'active text-white' : ''\n }}\"\n ><div class=\"media\">\n <abp-conversation-avatar [contact]=\"contact\"></abp-conversation-avatar>\n <div class=\"media-body ml-2 d-none d-md-block\">\n <div class=\"d-flex align-items-center justify-content-between mb-1\">\n <h6 class=\"mb-0\">\n <small *ngIf=\"contact.unreadMessageCount\" class=\"badge badge-success mr-1\">{{\n contact.unreadMessageCount\n }}</small\n >{{ getContactName(contact) }}\n </h6>\n <small class=\"small font-weight-bold last-message-date\">{{\n contact.lastMessageDate | date\n }}</small>\n </div>\n <p class=\"mb-0 text-small last-message\">\n {{\n contact.lastMessage?.length > 24\n ? (contact.lastMessage | slice: 0:23) + '...'\n : contact.lastMessage\n }}\n </p>\n </div>\n </div>\n </a>\n</ng-template>\n", styles: ["\n .messages-box {\n overflow-y: scroll;\n max-height: calc(100vh - 254.34px);\n }\n "], components: [{ type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: ["contact", "small"] }], directives: [{ type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.InputEventDebounceDirective, selector: "[input.debounce]", inputs: ["debounce"], outputs: ["input.debounce"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "abpLocalization": i3.LocalizationPipe, "date": i6.DatePipe, "slice": i6.SlicePipe } });
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatContactsComponent, decorators: [{
229
+ type: Component,
230
+ args: [{
231
+ selector: 'abp-chat-contacts',
232
+ templateUrl: 'chat-contacts.component.html',
233
+ styles: [
234
+ `
138
235
  .messages-box {
139
236
  overflow-y: scroll;
140
237
  max-height: calc(100vh - 254.34px);
141
238
  }
142
- `]
143
- },] }
144
- ];
145
- ChatContactsComponent.ctorParameters = () => [
146
- { type: ContactService },
147
- { type: ChatConfigService }
148
- ];
149
- ChatContactsComponent.propDecorators = {
150
- selected: [{ type: Output }]
151
- };
239
+ `,
240
+ ],
241
+ providers: [SubscriptionService],
242
+ }]
243
+ }], ctorParameters: function () { return [{ type: ContactService }, { type: i2.ChatConfigService }, { type: i3.SubscriptionService }]; }, propDecorators: { selected: [{
244
+ type: Output
245
+ }] } });
152
246
  function getContactName({ name, surname, username }) {
153
247
  if (!name && !surname)
154
248
  return username;
@@ -326,11 +420,15 @@ class ChatComponent {
326
420
  }, 0);
327
421
  }
328
422
  }
329
- ChatComponent.decorators = [
330
- { type: Component, args: [{
331
- selector: 'abp-chat',
332
- template: "<div class=\"row entry-row\">\n <div class=\"col-auto\"></div>\n <div class=\"col-lg-auto pl-lg-0\"></div>\n <div class=\"col\">\n <div class=\"text-lg-right pt-2\" id=\"AbpContentToolbar\"></div>\n </div>\n</div>\n\n<div id=\"chat_wrapper\">\n <div class=\"container-fluid\">\n <div class=\"row rounded-lg overflow-hidden shadow bor der\">\n <div class=\"col-3 col-md-5 col-lg-4 px-0\">\n <abp-chat-contacts (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\n </div>\n\n <!-- Chat Box-->\n <div class=\"col-9 col-md-7 col-lg-8 px-0\">\n <div class=\"p-3 bg-light border-bottom\">\n <div class=\"form-row\">\n <div class=\"col\">\n <div class=\"form-row\">\n <div class=\"col-auto\">\n <abp-conversation-avatar\n small\n [contact]=\"selectedContact\"\n ></abp-conversation-avatar>\n </div>\n <div class=\"col pt-1\" style=\"line-height: 1.2;\">\n <strong id=\"conversation-title\" class=\"font-weight-bold\">{{ contactName }}</strong\n ><br />\n <small id=\"conversation-info\"></small>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box m-0 p-0\">\n <div class=\"chat-box-container p-4\" [id]=\"'chat-conversation'\">\n <ng-container\n *ngFor=\"\n let message of selectedContactMessages;\n let i = index;\n trackBy: trackByMessageDate\n \"\n >\n <div\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\n >\n <h3>\n <span class=\"badge badge-info\">\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\n </ng-container>\n\n <ng-template #moreThanOne>\n {{\n 'Chat::YouHave{0}UnreadMessages' | abpLocalization: '' + unreadMessageCount\n }}\n </ng-template>\n </span>\n </h3>\n </div>\n\n <div\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\n [class.ml-auto]=\"data.isSender\"\n >\n <div class=\"media-body position-relative\">\n <div\n class=\"shadow rounded py-3 px-4 mb-1 {{\n data.isSender ? 'bg-primary' : 'bg-light'\n }}\"\n >\n <p\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\n [innerHTML]=\"message.message\"\n ></p>\n </div>\n <p\n class=\"message-date small text-muted m-0 {{ data.isSender ? 'left' : 'right' }}\"\n >\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\n </p>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n\n <!-- Typing area -->\n <div *ngIf=\"selectedContact?.userId\" id=\"send-message-form\" class=\"bg-light border-top m-0\">\n <div class=\"p-3\">\n <textarea\n id=\"chat-message-box\"\n name=\"message\"\n type=\"text\"\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\n class=\"form-control rounded py-2 bg-white\"\n [(ngModel)]=\"message\"\n (keydown.enter)=\"sendWithEnter($event)\"\n ></textarea>\n <div class=\"custom-control custom-checkbox float-left mt-3\">\n <input\n type=\"checkbox\"\n class=\"custom-control-input\"\n id=\"send-on-enter\"\n [(ngModel)]=\"sendOnEnter\"\n />\n <label class=\"custom-control-label\" for=\"send-on-enter\">{{\n 'Chat::SendOnEnter' | abpLocalization\n }}</label>\n </div>\n <div class=\"mt-2 text-right\">\n <button\n [disabled]=\"!message\"\n (click)=\"send()\"\n id=\"send-message-button\"\n type=\"button\"\n class=\"btn btn-primary px-3\"\n >\n {{ 'Chat::Send' | abpLocalization }}\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ml-2\"></i>\n\n <ng-template #loadingIcon>\n <i class=\"fas fa-spinner fa-spin ml-2\"></i>\n </ng-template>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n",
333
- styles: [`
423
+ ChatComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatComponent, deps: [{ token: ConversationService }, { token: i2.ChatConfigService }, { token: i3.ConfigStateService }, { token: i3.HttpWaitService }], target: i0.ɵɵFactoryTarget.Component });
424
+ ChatComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.9", 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\">\n <div class=\"col-auto\"></div>\n <div class=\"col-lg-auto pl-lg-0\"></div>\n <div class=\"col\">\n <div class=\"text-lg-right pt-2\" id=\"AbpContentToolbar\"></div>\n </div>\n</div>\n\n<div id=\"chat_wrapper\">\n <div class=\"container-fluid\">\n <div class=\"row rounded-lg overflow-hidden shadow bor der\">\n <div class=\"col-3 col-md-5 col-lg-4 px-0\">\n <abp-chat-contacts (selected)=\"onSelectContact($event)\"></abp-chat-contacts>\n </div>\n\n <!-- Chat Box-->\n <div class=\"col-9 col-md-7 col-lg-8 px-0\">\n <div class=\"p-3 bg-light border-bottom\">\n <div class=\"form-row\">\n <div class=\"col\">\n <div class=\"form-row\">\n <div class=\"col-auto\">\n <abp-conversation-avatar\n small\n [contact]=\"selectedContact\"\n ></abp-conversation-avatar>\n </div>\n <div class=\"col pt-1\" style=\"line-height: 1.2;\">\n <strong id=\"conversation-title\" class=\"font-weight-bold\">{{ contactName }}</strong\n ><br />\n <small id=\"conversation-info\"></small>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div #chatBox id=\"chat-conversation-wrapper\" class=\"chat-box m-0 p-0\">\n <div class=\"chat-box-container p-4\" [id]=\"'chat-conversation'\">\n <ng-container\n *ngFor=\"\n let message of selectedContactMessages;\n let i = index;\n trackBy: trackByMessageDate\n \"\n >\n <div\n *ngIf=\"selectedContactMessages.length - unreadMessageCount === i\"\n class=\"row justify-content-center unread-message-count-badge-wrapper\"\n >\n <h3>\n <span class=\"badge badge-info\">\n <ng-container *ngIf=\"unreadMessageCount === 1; else moreThanOne\">\n {{ 'Chat::YouHaveAnUnreadMessage' | abpLocalization }}\n </ng-container>\n\n <ng-template #moreThanOne>\n {{\n 'Chat::YouHave{0}UnreadMessages' | abpLocalization: '' + unreadMessageCount\n }}\n </ng-template>\n </span>\n </h3>\n </div>\n\n <div\n *ngIf=\"{ isSender: message.side === chatMessageSide.Sender } as data\"\n class=\"media w-75 mw-65 w-lp-auto mb-2\"\n [class.ml-auto]=\"data.isSender\"\n >\n <div class=\"media-body position-relative\">\n <div\n class=\"shadow rounded py-3 px-4 mb-1 {{\n data.isSender ? 'bg-primary' : 'bg-light'\n }}\"\n >\n <p\n class=\"text-small mb-0 {{ data.isSender ? 'text-white' : 'text-muted' }}\"\n [innerHTML]=\"message.message\"\n ></p>\n </div>\n <p\n class=\"message-date small text-muted m-0 {{ data.isSender ? 'left' : 'right' }}\"\n >\n {{ message.messageDate | date: getDateFormat(message.messageDate) }}\n </p>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n\n <!-- Typing area -->\n <div *ngIf=\"selectedContact?.userId\" id=\"send-message-form\" class=\"bg-light border-top m-0\">\n <div class=\"p-3\">\n <textarea\n id=\"chat-message-box\"\n name=\"message\"\n type=\"text\"\n [placeholder]=\"'Chat::TypeMessage' | abpLocalization\"\n class=\"form-control rounded py-2 bg-white\"\n [(ngModel)]=\"message\"\n (keydown.enter)=\"sendWithEnter($event)\"\n ></textarea>\n <div class=\"custom-control custom-checkbox float-left mt-3\">\n <input\n type=\"checkbox\"\n class=\"custom-control-input\"\n id=\"send-on-enter\"\n [(ngModel)]=\"sendOnEnter\"\n />\n <label class=\"custom-control-label\" for=\"send-on-enter\">{{\n 'Chat::SendOnEnter' | abpLocalization\n }}</label>\n </div>\n <div class=\"mt-2 text-right\">\n <button\n [disabled]=\"!message\"\n (click)=\"send()\"\n id=\"send-message-button\"\n type=\"button\"\n class=\"btn btn-primary px-3\"\n >\n {{ 'Chat::Send' | abpLocalization }}\n <i *ngIf=\"!loading; else loadingIcon\" class=\"fa fa-paper-plane ml-2\"></i>\n\n <ng-template #loadingIcon>\n <i class=\"fas fa-spinner fa-spin ml-2\"></i>\n </ng-template>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["\n .chat-box {\n height: calc(100vh - 390px);\n overflow-y: scroll;\n }\n\n .message-date {\n position: absolute;\n opacity: 0.35;\n width: 100px;\n top: 1px;\n }\n\n .message-date.left {\n left: -110px;\n text-align: right;\n }\n\n .message-date.right {\n right: -110px;\n }\n "], components: [{ type: ChatContactsComponent, selector: "abp-chat-contacts", outputs: ["selected"] }, { type: ConversationAvatarComponent, selector: "abp-conversation-avatar", inputs: ["contact", "small"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i7.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }], pipes: { "abpLocalization": i3.LocalizationPipe, "date": i6.DatePipe } });
425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatComponent, decorators: [{
426
+ type: Component,
427
+ args: [{
428
+ selector: 'abp-chat',
429
+ templateUrl: 'chat.component.html',
430
+ styles: [
431
+ `
334
432
  .chat-box {
335
433
  height: calc(100vh - 390px);
336
434
  overflow-y: scroll;
@@ -351,27 +449,17 @@ ChatComponent.decorators = [
351
449
  .message-date.right {
352
450
  right: -110px;
353
451
  }
354
- `]
355
- },] }
356
- ];
357
- ChatComponent.ctorParameters = () => [
358
- { type: ConversationService },
359
- { type: ChatConfigService },
360
- { type: ConfigStateService },
361
- { type: HttpWaitService }
362
- ];
363
- ChatComponent.propDecorators = {
364
- chatBoxRef: [{ type: ViewChild, args: ['chatBox', { static: false },] }],
365
- chatContactsComponent: [{ type: ViewChild, args: [ChatContactsComponent, { static: false },] }]
366
- };
452
+ `,
453
+ ],
454
+ }]
455
+ }], ctorParameters: function () { return [{ type: ConversationService }, { type: i2.ChatConfigService }, { type: i3.ConfigStateService }, { type: i3.HttpWaitService }]; }, propDecorators: { chatBoxRef: [{
456
+ type: ViewChild,
457
+ args: ['chatBox', { static: false }]
458
+ }], chatContactsComponent: [{
459
+ type: ViewChild,
460
+ args: [ChatContactsComponent, { static: false }]
461
+ }] } });
367
462
 
368
- const ɵ0 = {
369
- requiredPolicy: 'Chat.Messaging',
370
- replaceableComponent: {
371
- defaultComponent: ChatComponent,
372
- key: 'Chat.ChatComponent',
373
- },
374
- };
375
463
  const routes = [
376
464
  {
377
465
  path: '',
@@ -381,101 +469,29 @@ const routes = [
381
469
  {
382
470
  path: '',
383
471
  component: ReplaceableRouteContainerComponent,
384
- data: ɵ0,
472
+ data: {
473
+ requiredPolicy: 'Chat.Messaging',
474
+ replaceableComponent: {
475
+ defaultComponent: ChatComponent,
476
+ key: 'Chat.ChatComponent',
477
+ },
478
+ },
385
479
  },
386
480
  ],
387
481
  },
388
482
  ];
389
483
  class ChatRoutingModule {
390
484
  }
391
- ChatRoutingModule.decorators = [
392
- { type: NgModule, args: [{
393
- imports: [RouterModule.forChild(routes)],
394
- exports: [RouterModule],
395
- },] }
396
- ];
397
-
398
- class ChatContactDto {
399
- constructor(initialValues = {}) {
400
- if (initialValues) {
401
- for (const key in initialValues) {
402
- if (initialValues.hasOwnProperty(key)) {
403
- this[key] = initialValues[key];
404
- }
405
- }
406
- }
407
- }
408
- }
409
-
410
- const avatarStyles = [
411
- { color: '#ffffff', backgroundColor: '#3cb160' },
412
- { color: '#ffffff', backgroundColor: '#c373cc' },
413
- { color: '#ffffff', backgroundColor: '#2b78b3' },
414
- { color: '#ffffff', backgroundColor: '#6ac79a' },
415
- { color: '#ffffff', backgroundColor: '#aeb140' },
416
- { color: '#ffffff', backgroundColor: '#b773c0' },
417
- { color: '#ffffff', backgroundColor: '#e16d7a' },
418
- { color: '#ffffff', backgroundColor: '#ffac2a' },
419
- { color: '#ffffff', backgroundColor: '#21bbc7' },
420
- { color: '#ffffff', backgroundColor: '#59ab95' },
421
- ];
422
- class ConversationAvatarComponent {
423
- get avatarText() {
424
- if (!this.contact || !this.contact.username)
425
- return;
426
- if (this.contact.name && this.contact.surname)
427
- return this.contact.name[0] + this.contact.surname[0];
428
- if (this.contact.name)
429
- return this.contact.name.slice(0, 2);
430
- return this.contact.username.slice(0, 2);
431
- }
432
- get avatarBgStyle() {
433
- if (!this.contact || !this.contact.username)
434
- return;
435
- let hash = 0;
436
- for (let i = 0; i < this.contact.username.length; i++) {
437
- hash = this.contact.username.charCodeAt(i) + ((hash << 5) - hash);
438
- }
439
- return avatarStyles[Math.abs(hash % 10)];
440
- }
441
- get isSmall() {
442
- return typeof this.small === 'string' || this.small;
443
- }
444
- }
445
- ConversationAvatarComponent.decorators = [
446
- { type: Component, args: [{
447
- selector: 'abp-conversation-avatar',
448
- template: `<div
449
- class="avatar mx-auto rounded-circle"
450
- [class.small]="isSmall"
451
- [ngStyle]="avatarBgStyle"
452
- >
453
- {{ avatarText }}
454
- </div>`,
455
- styles: [`
456
- .avatar {
457
- height: 40px;
458
- width: 40px;
459
- line-height: 40px;
460
- font-size: 16px;
461
- font-weight: 700;
462
- text-align: center;
463
- text-transform: uppercase;
464
- }
465
-
466
- .avatar.small {
467
- height: 27px;
468
- width: 27px;
469
- line-height: 27px;
470
- font-size: 14px;
471
- }
472
- `]
473
- },] }
474
- ];
475
- ConversationAvatarComponent.propDecorators = {
476
- contact: [{ type: Input }],
477
- small: [{ type: Input }]
478
- };
485
+ ChatRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
486
+ ChatRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatRoutingModule, imports: [i1.RouterModule], exports: [RouterModule] });
487
+ ChatRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatRoutingModule, decorators: [{
489
+ type: NgModule,
490
+ args: [{
491
+ imports: [RouterModule.forChild(routes)],
492
+ exports: [RouterModule],
493
+ }]
494
+ }] });
479
495
 
480
496
  const declarations = [ChatComponent, ChatContactsComponent, ConversationAvatarComponent];
481
497
  class ChatModule {
@@ -489,17 +505,21 @@ class ChatModule {
489
505
  return new LazyModuleFactory(ChatModule.forChild());
490
506
  }
491
507
  }
492
- ChatModule.decorators = [
493
- { type: NgModule, args: [{
494
- declarations,
495
- imports: [CoreModule, ThemeSharedModule, ChatRoutingModule],
496
- exports: [...declarations],
497
- },] }
498
- ];
508
+ ChatModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
509
+ ChatModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatModule, declarations: [ChatComponent, ChatContactsComponent, ConversationAvatarComponent], imports: [CoreModule, ThemeSharedModule, ChatRoutingModule], exports: [ChatComponent, ChatContactsComponent, ConversationAvatarComponent] });
510
+ ChatModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatModule, imports: [[CoreModule, ThemeSharedModule, ChatRoutingModule]] });
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.9", ngImport: i0, type: ChatModule, decorators: [{
512
+ type: NgModule,
513
+ args: [{
514
+ declarations,
515
+ imports: [CoreModule, ThemeSharedModule, ChatRoutingModule],
516
+ exports: [...declarations],
517
+ }]
518
+ }] });
499
519
 
500
520
  /**
501
521
  * Generated bundle index. Do not edit.
502
522
  */
503
523
 
504
- export { ChatComponent, ChatModule, ChatContactsComponent as ɵa, ContactService as ɵb, ConversationService as ɵc, ConversationAvatarComponent as ɵd, ChatRoutingModule as ɵe };
524
+ export { ChatComponent, ChatContactsComponent, ChatModule, ConversationAvatarComponent, getContactName };
505
525
  //# sourceMappingURL=volo-abp.ng.chat.js.map
@@ -1,2 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/router";
1
3
  export declare class ChatRoutingModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatRoutingModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChatRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<ChatRoutingModule>;
2
7
  }
@@ -1,5 +1,15 @@
1
1
  import { ModuleWithProviders, NgModuleFactory } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./components/chat.component";
4
+ import * as i2 from "./components/chat-contacts.component";
5
+ import * as i3 from "./components/conversation-avatar.component";
6
+ import * as i4 from "@abp/ng.core";
7
+ import * as i5 from "@abp/ng.theme.shared";
8
+ import * as i6 from "./chat-routing.module";
2
9
  export declare class ChatModule {
3
10
  static forChild(): ModuleWithProviders<ChatModule>;
4
11
  static forLazy(): NgModuleFactory<ChatModule>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ChatModule, [typeof i1.ChatComponent, typeof i2.ChatContactsComponent, typeof i3.ConversationAvatarComponent], [typeof i4.CoreModule, typeof i5.ThemeSharedModule, typeof i6.ChatRoutingModule], [typeof i1.ChatComponent, typeof i2.ChatContactsComponent, typeof i3.ConversationAvatarComponent]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<ChatModule>;
5
15
  }
@@ -1,10 +1,13 @@
1
+ import { SubscriptionService } from '@abp/ng.core';
1
2
  import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
3
  import { ChatConfigService } from '@volo/abp.ng.chat/config';
3
4
  import { ChatContactDto } from '../models/chat-contact-dto';
4
5
  import { ContactService } from '../services/contact.service';
6
+ import * as i0 from "@angular/core";
5
7
  export declare class ChatContactsComponent implements OnInit, OnDestroy {
6
8
  private contactService;
7
9
  private chatConfigService;
10
+ private subscription;
8
11
  selected: EventEmitter<ChatContactDto>;
9
12
  allContacts: ChatContactDto[];
10
13
  selectedContact: ChatContactDto;
@@ -13,7 +16,7 @@ export declare class ChatContactsComponent implements OnInit, OnDestroy {
13
16
  trackByUserId: import("@angular/core").TrackByFunction<ChatContactDto>;
14
17
  get contacts(): ChatContactDto[];
15
18
  get otherContacts(): ChatContactDto[];
16
- constructor(contactService: ContactService, chatConfigService: ChatConfigService);
19
+ constructor(contactService: ContactService, chatConfigService: ChatConfigService, subscription: SubscriptionService);
17
20
  private listenToNewMessages;
18
21
  ngOnInit(): void;
19
22
  ngOnDestroy(): void;
@@ -21,5 +24,7 @@ export declare class ChatContactsComponent implements OnInit, OnDestroy {
21
24
  selectContact(contact: ChatContactDto): void;
22
25
  changeLastMessageOfSelectedContact(message: string): void;
23
26
  markSelectedContactAsRead(): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatContactsComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatContactsComponent, "abp-chat-contacts", never, {}, { "selected": "selected"; }, never, never>;
24
29
  }
25
30
  export declare function getContactName({ name, surname, username }: ChatContactDto): string;
@@ -7,6 +7,7 @@ import { ChatContactDto } from '../models/chat-contact-dto';
7
7
  import { ChatMessageDto } from '../models/chat-message-dto';
8
8
  import { ConversationService } from '../services/conversation.service';
9
9
  import { ChatContactsComponent } from './chat-contacts.component';
10
+ import * as i0 from "@angular/core";
10
11
  export declare class ChatComponent implements AfterViewInit, OnDestroy {
11
12
  private conversationService;
12
13
  private chatConfigService;
@@ -40,4 +41,6 @@ export declare class ChatComponent implements AfterViewInit, OnDestroy {
40
41
  getDateFormat(date: string | Date): string;
41
42
  scrollToEnd(): void;
42
43
  onScroll: (event: Event) => void;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "abp-chat", never, {}, {}, never, never>;
43
46
  }
@@ -1,4 +1,5 @@
1
1
  import { ChatContactDto } from '../models/chat-contact-dto';
2
+ import * as i0 from "@angular/core";
2
3
  export declare class ConversationAvatarComponent {
3
4
  contact: ChatContactDto;
4
5
  small: boolean | string;
@@ -8,4 +9,6 @@ export declare class ConversationAvatarComponent {
8
9
  backgroundColor: string;
9
10
  };
10
11
  get isSmall(): boolean;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConversationAvatarComponent, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConversationAvatarComponent, "abp-conversation-avatar", never, { "contact": "contact"; "small": "small"; }, {}, never, never>;
11
14
  }
@@ -0,0 +1,3 @@
1
+ export * from './chat.component';
2
+ export * from './chat-contacts.component';
3
+ export * from './conversation-avatar.component';
@@ -2,9 +2,12 @@ import { RestService } from '@abp/ng.core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { GetContactsInput } from '../models/get-contacts-input';
4
4
  import { ChatContactDto } from '../models/chat-contact-dto';
5
+ import * as i0 from "@angular/core";
5
6
  export declare class ContactService {
6
7
  private restService;
7
8
  apiName: string;
8
9
  constructor(restService: RestService);
9
10
  getContactsByInput(params?: GetContactsInput): Observable<ChatContactDto[]>;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContactService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<ContactService>;
10
13
  }
@@ -4,6 +4,7 @@ import { SendMessageInput } from '../models/send-message-input';
4
4
  import { GetConversationInput } from '../models/get-conversation-input';
5
5
  import { MarkConversationAsReadInput } from '../models/mark-conversation-as-read-input';
6
6
  import { ChatConversationDto } from '../models/chat-conversation-dto';
7
+ import * as i0 from "@angular/core";
7
8
  export declare class ConversationService {
8
9
  private restService;
9
10
  apiName: string;
@@ -11,4 +12,6 @@ export declare class ConversationService {
11
12
  sendMessageByInput(body: SendMessageInput): Observable<void>;
12
13
  getConversationByInput(params?: GetConversationInput): Observable<ChatConversationDto>;
13
14
  markConversationAsReadByInput(body: MarkConversationAsReadInput): Observable<void>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConversationService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<ConversationService>;
14
17
  }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@volo/abp.ng.chat",
3
- "version": "4.4.1",
3
+ "version": "5.0.0-beta.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "dependencies": {
8
8
  "@microsoft/signalr": "^3.1.4",
9
- "tslib": "^2.0.0"
9
+ "tslib": "^2.2.0"
10
10
  },
11
11
  "peerDependencies": {
12
- "@abp/ng.theme.shared": ">=4.4.1",
12
+ "@abp/ng.theme.shared": ">=5.0.0-beta.1-1",
13
13
  "angular-oauth2-oidc": ">=9.0.0"
14
14
  },
15
15
  "main": "bundles/volo-abp.ng.chat.umd.js",
@@ -18,6 +18,5 @@
18
18
  "esm2015": "esm2015/volo-abp.ng.chat.js",
19
19
  "fesm2015": "fesm2015/volo-abp.ng.chat.js",
20
20
  "typings": "volo-abp.ng.chat.d.ts",
21
- "metadata": "volo-abp.ng.chat.metadata.json",
22
21
  "sideEffects": false
23
22
  }
@@ -0,0 +1,4 @@
1
+ export * from './proxy/volo/chat/conversations';
2
+ export * from './proxy/volo/chat/messages';
3
+ export * from './proxy/volo/chat/settings';
4
+ export * from './proxy/volo/chat/users';