@bizdoc/core 3.8.8 → 3.8.9
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/fesm2022/bizdoc-core.mjs +141 -85
- package/fesm2022/bizdoc-core.mjs.map +1 -1
- package/index.d.ts +63 -21
- package/package.json +1 -1
package/fesm2022/bizdoc-core.mjs
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
2
|
import { InjectionToken, Inject, Injectable, Pipe, Directive, Component, Injector, ElementRef, HostListener, TemplateRef, ViewContainerRef, ViewChild, Input, Optional, HostBinding, Output, Self, EventEmitter, NgModule, ViewChildren, inject, Host, SkipSelf, ContentChild, ContentChildren, provideAppInitializer } from '@angular/core';
|
3
|
-
import { Subject, firstValueFrom, of, forkJoin, filter, map as map$1,
|
3
|
+
import { BehaviorSubject, Subject, firstValueFrom, of, forkJoin, filter, map as map$1, merge, takeUntil as takeUntil$1, shareReplay as shareReplay$1, Observable, from, interval, switchMap as switchMap$1, isObservable, catchError as catchError$1, startWith as startWith$1, EMPTY, debounceTime as debounceTime$1 } from 'rxjs';
|
4
4
|
import { map, tap, catchError, filter as filter$1, first, shareReplay, startWith, takeUntil, debounceTime, switchMap, take, finalize, delay } from 'rxjs/operators';
|
5
5
|
import * as i4 from '@angular/material/chips';
|
6
6
|
import { MatChipInput, MatChipsModule, MatChipListbox } from '@angular/material/chips';
|
7
7
|
import { ENTER, COMMA, SEMICOLON } from '@angular/cdk/keycodes';
|
8
8
|
import * as i4$1 from '@angular/material/input';
|
9
9
|
import { MatInput, MatInputModule } from '@angular/material/input';
|
10
|
-
import {
|
10
|
+
import { HubConnectionState, HubConnectionBuilder } from '@microsoft/signalr';
|
11
11
|
import { trigger, transition, style, animate, state, query, stagger, animateChild, keyframes } from '@angular/animations';
|
12
12
|
import dayjs from 'dayjs';
|
13
13
|
import { Loader } from '@googlemaps/js-api-loader';
|
@@ -980,15 +980,14 @@ class AuthenticationImpl {
|
|
980
980
|
class HubService {
|
981
981
|
constructor(config, _auth) {
|
982
982
|
this._auth = _auth;
|
983
|
-
this.
|
984
|
-
this.state$ = this._state.asObservable();
|
983
|
+
this._connectionState = new BehaviorSubject(HubConnectionState.Disconnected);
|
985
984
|
this._configurationChange = new Subject();
|
986
985
|
this._newMail = new Subject();
|
987
986
|
this._newChat = new Subject();
|
988
987
|
this._newComment = new Subject();
|
989
988
|
this._commentUpdate = new Subject();
|
990
989
|
this._commentDelete = new Subject();
|
991
|
-
this.
|
990
|
+
this._mailUpdate = new Subject();
|
992
991
|
this._mailDelete = new Subject();
|
993
992
|
this._mailHeaderUpdate = new Subject();
|
994
993
|
this._newNotify = new Subject();
|
@@ -1002,6 +1001,7 @@ class HubService {
|
|
1002
1001
|
this._jobProgress = new Subject();
|
1003
1002
|
this._reportProgress = new Subject();
|
1004
1003
|
this._callback = new Subject();
|
1004
|
+
this.state$ = this._connectionState.asObservable();
|
1005
1005
|
this.configurationChange$ = this._configurationChange.asObservable();
|
1006
1006
|
this.jobProgress$ = this._jobProgress.asObservable();
|
1007
1007
|
this.reportProgress$ = this._reportProgress.asObservable();
|
@@ -1014,13 +1014,13 @@ class HubService {
|
|
1014
1014
|
this.commentUpdate$ = this._commentUpdate.asObservable();
|
1015
1015
|
this.commentDelete$ = this._commentDelete.asObservable();
|
1016
1016
|
/** new notification */
|
1017
|
-
this.
|
1017
|
+
this.newNotification$ = this._newNotify.asObservable();
|
1018
1018
|
this.chat$ = this._newChat.asObservable();
|
1019
1019
|
this.updateNotify$ = this._updateNotify.asObservable();
|
1020
1020
|
/** new mail */
|
1021
1021
|
this.new$ = this._newMail.asObservable();
|
1022
1022
|
/** mail update */
|
1023
|
-
this.update$ = this.
|
1023
|
+
this.update$ = this._mailUpdate.asObservable();
|
1024
1024
|
this.updateMailHeader$ = this._mailHeaderUpdate.asObservable();
|
1025
1025
|
this.delete$ = this._mailDelete.asObservable();
|
1026
1026
|
this.comment$ = this._newComment.asObservable();
|
@@ -1040,7 +1040,7 @@ class HubService {
|
|
1040
1040
|
//skipNegotiation: true,
|
1041
1041
|
}).withAutomaticReconnect().build();
|
1042
1042
|
this._connection.on('newMail', (data) => this._newMail.next(data));
|
1043
|
-
this._connection.on('mailUpdate', (data) => this.
|
1043
|
+
this._connection.on('mailUpdate', (data) => this._mailUpdate.next(data));
|
1044
1044
|
this._connection.on('mailDelete', (data) => this._mailDelete.next(data));
|
1045
1045
|
this._connection.on('mailHeaderUpdate', (data) => this._mailHeaderUpdate.next(data));
|
1046
1046
|
this._connection.on('newComment', (data) => {
|
@@ -1061,8 +1061,8 @@ class HubService {
|
|
1061
1061
|
this._connection.on('jobProgress', (data) => this._jobProgress.next(data));
|
1062
1062
|
this._connection.on('reportProgress', (data) => this._reportProgress.next(data));
|
1063
1063
|
this._connection.on('configurationChange', () => this._configurationChange.next());
|
1064
|
-
this._connection.onclose(() => this.
|
1065
|
-
this._connection.onreconnected(() => this.
|
1064
|
+
this._connection.onclose(() => this._connectionState.next(HubConnectionState.Disconnected));
|
1065
|
+
this._connection.onreconnected(() => this._connectionState.next(HubConnectionState.Connected));
|
1066
1066
|
}
|
1067
1067
|
get state() {
|
1068
1068
|
return this._connection.state;
|
@@ -1074,11 +1074,11 @@ class HubService {
|
|
1074
1074
|
}
|
1075
1075
|
async start() {
|
1076
1076
|
await this._connection.start();
|
1077
|
-
this.
|
1077
|
+
this._connectionState.next(HubConnectionState.Connected);
|
1078
1078
|
}
|
1079
1079
|
async stop() {
|
1080
1080
|
await this._connection.stop();
|
1081
|
-
this.
|
1081
|
+
this._connectionState.next(HubConnectionState.Disconnected);
|
1082
1082
|
}
|
1083
1083
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: HubService, deps: [{ token: BIZDOC_CONFIG }, { token: AuthenticationImpl }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
1084
1084
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: HubService, providedIn: "root" }); }
|
@@ -1118,7 +1118,7 @@ class SessionService {
|
|
1118
1118
|
*/
|
1119
1119
|
prepare() {
|
1120
1120
|
const promises = [];
|
1121
|
-
('serviceWorker' in navigator) &&
|
1121
|
+
('serviceWorker' in navigator) && loadServiceWorker();
|
1122
1122
|
this._config.maps && promises.push(this._loadGoogleMaps());
|
1123
1123
|
promises.push(this._changeTheme(this.theme));
|
1124
1124
|
return Promise.all(promises);
|
@@ -1128,46 +1128,77 @@ class SessionService {
|
|
1128
1128
|
this._http = _http;
|
1129
1129
|
this._cookies = _cookies;
|
1130
1130
|
this._hub = _hub;
|
1131
|
-
this.
|
1132
|
-
this.
|
1133
|
-
this.
|
1134
|
-
this.
|
1135
|
-
this.themeChange = this._themeChange.asObservable();
|
1131
|
+
this._messagesCount$ = new BehaviorSubject(0);
|
1132
|
+
this._inboxCount$ = new BehaviorSubject(0);
|
1133
|
+
this._loaded$ = new Subject();
|
1134
|
+
this._themeChange$ = new Subject();
|
1136
1135
|
this._firebase = new FirebaseService(this._config ? this._config.firebase : undefined, this);
|
1136
|
+
this.loaded = this._loaded$.asObservable();
|
1137
|
+
this.themeChange = this._themeChange$.asObservable();
|
1138
|
+
this.notificationsCountChange$ = this._messagesCount$.asObservable();
|
1139
|
+
this.inboxCountChange$ = this._inboxCount$.asObservable();
|
1140
|
+
this.Themes = this._config.themes || THEMES;
|
1137
1141
|
iconRegistry.addSvgIconLiteral('excel', sanitizer.bypassSecurityTrustHtml(EXCEL_ICON));
|
1138
1142
|
iconRegistry.addSvgIconLiteral('word', sanitizer.bypassSecurityTrustHtml(WORD_ICON));
|
1139
1143
|
iconRegistry.addSvgIconLiteral('powerpoint', sanitizer.bypassSecurityTrustHtml(POWERPOINT_ICON));
|
1140
1144
|
iconRegistry.addSvgIconLiteral('pdf', sanitizer.bypassSecurityTrustHtml(PDF_ICON));
|
1141
|
-
_hub.
|
1142
|
-
const { messages
|
1145
|
+
_hub.newNotification$.subscribe(n => {
|
1146
|
+
const { messages } = this._profile;
|
1143
1147
|
messages.push(n.model);
|
1144
|
-
this.
|
1145
|
-
messagesCount + 1;
|
1148
|
+
this._stepNotificationsCount(1);
|
1146
1149
|
});
|
1147
1150
|
//
|
1148
1151
|
_hub.updateNotify$.subscribe(e => {
|
1149
|
-
const { originalRead, model: { id, sent, read } } = e, { messages
|
1152
|
+
const { originalRead, model: { id, sent, read } } = e, { messages } = this._profile;
|
1150
1153
|
const item = messages.find(n => n.id === id);
|
1151
1154
|
if (item)
|
1152
1155
|
Object.assign(item, e.model);
|
1153
1156
|
else
|
1154
1157
|
messages.push(e.model);
|
1155
|
-
|
1156
|
-
this._isAboveWatermark(sent)
|
1157
|
-
this.
|
1158
|
+
originalRead !== undefined && read !== originalRead &&
|
1159
|
+
this._isAboveWatermark(sent) &&
|
1160
|
+
this._stepNotificationsCount(read ? -1 : 1);
|
1158
1161
|
});
|
1159
1162
|
//
|
1160
1163
|
_hub.new$.subscribe(m => {
|
1161
|
-
const { userId, model: { folderId } } = m, {
|
1164
|
+
const { userId, model: { folderId } } = m, { folders, userId: me } = this._profile;
|
1162
1165
|
if (userId !== me)
|
1163
1166
|
return;
|
1164
|
-
this.
|
1165
|
-
inboxCount + 1;
|
1167
|
+
this._stepInboxCount(1);
|
1166
1168
|
const folder = folders.find(f => f.name === folderId);
|
1167
1169
|
folder.count = !folder.count ? 1 :
|
1168
1170
|
folder.count + 1;
|
1169
1171
|
});
|
1170
1172
|
}
|
1173
|
+
reportInboxRead(date, move) {
|
1174
|
+
const { inboxView } = this._profile.options;
|
1175
|
+
inboxView !== undefined &&
|
1176
|
+
inboxView < date &&
|
1177
|
+
this._stepInboxCount(move);
|
1178
|
+
}
|
1179
|
+
reportNotificationsRead(date, move) {
|
1180
|
+
const { notificationsView } = this._profile.options;
|
1181
|
+
notificationsView !== undefined &&
|
1182
|
+
notificationsView < date &&
|
1183
|
+
!this.isImpersonating &&
|
1184
|
+
this._stepNotificationsCount(move);
|
1185
|
+
}
|
1186
|
+
_stepNotificationsCount(move) {
|
1187
|
+
let { messagesCount } = this._profile;
|
1188
|
+
if (messagesCount === undefined)
|
1189
|
+
messagesCount = 0;
|
1190
|
+
messagesCount += move;
|
1191
|
+
this._profile.messagesCount = messagesCount;
|
1192
|
+
this._messagesCount$.next(messagesCount);
|
1193
|
+
}
|
1194
|
+
_stepInboxCount(move) {
|
1195
|
+
let { inboxCount } = this._profile;
|
1196
|
+
if (inboxCount === undefined)
|
1197
|
+
inboxCount = 0;
|
1198
|
+
inboxCount += move;
|
1199
|
+
this._profile.inboxCount = inboxCount;
|
1200
|
+
this._inboxCount$.next(inboxCount);
|
1201
|
+
}
|
1171
1202
|
/** */
|
1172
1203
|
get tags() {
|
1173
1204
|
return this._tags || (this._tags =
|
@@ -1207,7 +1238,7 @@ class SessionService {
|
|
1207
1238
|
}
|
1208
1239
|
set theme(value) {
|
1209
1240
|
this._theme = value;
|
1210
|
-
this._changeTheme(value).then(() => this._themeChange
|
1241
|
+
this._changeTheme(value).then(() => this._themeChange$.next(value));
|
1211
1242
|
localStorage.setItem('theme', value.name);
|
1212
1243
|
}
|
1213
1244
|
get ok() { return this.profile !== undefined; }
|
@@ -1285,7 +1316,7 @@ class SessionService {
|
|
1285
1316
|
this._hub.state !== HubConnectionState.Connected && this._hub.start();
|
1286
1317
|
this._firebase.state !== FirebaseState.Activated &&
|
1287
1318
|
this._firebase.activate();
|
1288
|
-
this._loaded
|
1319
|
+
this._loaded$.next();
|
1289
1320
|
}));
|
1290
1321
|
}
|
1291
1322
|
getProfileExtra(name) {
|
@@ -1320,14 +1351,14 @@ class SessionService {
|
|
1320
1351
|
}
|
1321
1352
|
markInboxAsTouched() {
|
1322
1353
|
return firstValueFrom(this._http.put('/api/account/inboxview', {}, { headers: { 'no-progress': 'true' } }).pipe(tap(e => {
|
1323
|
-
this.
|
1324
|
-
this.
|
1354
|
+
this._stepInboxCount(0);
|
1355
|
+
this._profile.options.inboxView = e.time;
|
1325
1356
|
})));
|
1326
1357
|
}
|
1327
1358
|
markNotificationsAsTouched() {
|
1328
1359
|
return firstValueFrom(this._http.put('/api/account/notificationsView', {}, { headers: { 'no-progress': 'true' } }).pipe(tap(e => {
|
1329
|
-
this.
|
1330
|
-
this.
|
1360
|
+
this._stepNotificationsCount(0);
|
1361
|
+
this._profile.options.notificationsView = e.time;
|
1331
1362
|
})));
|
1332
1363
|
}
|
1333
1364
|
_constructPalette(color) {
|
@@ -1380,12 +1411,6 @@ class SessionService {
|
|
1380
1411
|
}
|
1381
1412
|
});
|
1382
1413
|
}
|
1383
|
-
_loadServiceWorker() {
|
1384
|
-
window.addEventListener('load', function () {
|
1385
|
-
navigator.serviceWorker.register('/js/app-sw.js').then(function () {
|
1386
|
-
}, null);
|
1387
|
-
});
|
1388
|
-
}
|
1389
1414
|
_loadGoogleMaps() {
|
1390
1415
|
const apiKey = this._config.maps.apiKey;
|
1391
1416
|
const loader = new Loader({
|
@@ -1407,6 +1432,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
|
|
1407
1432
|
type: Inject,
|
1408
1433
|
args: [BIZDOC_CONFIG]
|
1409
1434
|
}] }, { type: i1.HttpClient }, { type: i2.CookieService }, { type: HubService }, { type: i7.MatIconRegistry }, { type: i2$1.DomSanitizer }] });
|
1435
|
+
function loadServiceWorker() {
|
1436
|
+
window.addEventListener('load', function () {
|
1437
|
+
navigator.serviceWorker.register('/js/app-sw.js').then(function () {
|
1438
|
+
}, null);
|
1439
|
+
});
|
1440
|
+
}
|
1410
1441
|
|
1411
1442
|
class ToNowPipe {
|
1412
1443
|
transform(value, ...args) {
|
@@ -7189,18 +7220,17 @@ class MailboxService {
|
|
7189
7220
|
this._session = _session;
|
7190
7221
|
this._auth = _auth;
|
7191
7222
|
this._http = _http;
|
7192
|
-
this.
|
7193
|
-
this.
|
7194
|
-
|
7195
|
-
this.
|
7196
|
-
this.deleted = this._delete$.asObservable();
|
7223
|
+
this._changed$ = new Subject();
|
7224
|
+
this._deleted$ = new Subject();
|
7225
|
+
this.recordChange$ = this._changed$.asObservable();
|
7226
|
+
this.recordDelete$ = this._deleted$.asObservable();
|
7197
7227
|
/**
|
7198
7228
|
* Keep flags in sync.
|
7199
7229
|
*/
|
7200
7230
|
this._sync = () => (observe) => {
|
7201
7231
|
return observe.pipe(tap(m => {
|
7202
7232
|
m.loaded = true;
|
7203
|
-
this.
|
7233
|
+
this._changed$.next(m);
|
7204
7234
|
}));
|
7205
7235
|
};
|
7206
7236
|
}
|
@@ -7235,7 +7265,7 @@ class MailboxService {
|
|
7235
7265
|
}
|
7236
7266
|
updateTags(id, tags) {
|
7237
7267
|
return this._http.put(`/api/mailbox/tag/${id}`, { tags }).pipe(tap(() => {
|
7238
|
-
this.
|
7268
|
+
this._changed$.next({ id, tags });
|
7239
7269
|
}));
|
7240
7270
|
}
|
7241
7271
|
/**
|
@@ -7249,7 +7279,7 @@ class MailboxService {
|
|
7249
7279
|
}
|
7250
7280
|
move(id, folderId) {
|
7251
7281
|
return this._http.put(`/api/mailbox/move/${id}?folderId=${folderId}`, {}).pipe(tap(() => {
|
7252
|
-
this.
|
7282
|
+
this._changed$.next({
|
7253
7283
|
id,
|
7254
7284
|
folderId
|
7255
7285
|
});
|
@@ -7361,10 +7391,10 @@ class MailboxService {
|
|
7361
7391
|
});
|
7362
7392
|
}
|
7363
7393
|
toggleFlag(id, flag) {
|
7364
|
-
return this._http.put(`/api/mailbox/flag/${id}?flag=${flag}`, null).pipe(tap(() => this.
|
7394
|
+
return this._http.put(`/api/mailbox/flag/${id}?flag=${flag}`, null).pipe(tap(() => this._changed$.next({ id, flag })));
|
7365
7395
|
}
|
7366
7396
|
markCommentsViewed(id) {
|
7367
|
-
return this._http.put(`/api/comments/viewed/${id}`, {}, { headers: { 'no-progress': 'true' } }).pipe(tap((e) => this.
|
7397
|
+
return this._http.put(`/api/comments/viewed/${id}`, {}, { headers: { 'no-progress': 'true' } }).pipe(tap((e) => this._changed$.next({ id, viewed: e.time })));
|
7368
7398
|
}
|
7369
7399
|
reportTyping(id) {
|
7370
7400
|
return this._http.put(`/api/comments/typing/${id}`, {}, { headers: { 'no-progress': 'true' } });
|
@@ -7409,7 +7439,7 @@ class MailboxService {
|
|
7409
7439
|
_wrap(form, project) {
|
7410
7440
|
return this._geoLocation(form).pipe(switchMap(project), tap(m => {
|
7411
7441
|
m.loaded = true;
|
7412
|
-
this.
|
7442
|
+
this._changed$.next(m);
|
7413
7443
|
}));
|
7414
7444
|
}
|
7415
7445
|
/**
|
@@ -7443,18 +7473,29 @@ class MailboxService {
|
|
7443
7473
|
return this._http.get(`/api/mail/${id}`).pipe(tap((m) => read === false && m.read === true &&
|
7444
7474
|
this._updateUnreadWatermark(m.received, m.folderId, -1)));
|
7445
7475
|
}
|
7476
|
+
/**
|
7477
|
+
*
|
7478
|
+
* @param date
|
7479
|
+
* @param folderId
|
7480
|
+
* @param move
|
7481
|
+
*/
|
7446
7482
|
_updateUnreadWatermark(date, folderId, move) {
|
7447
|
-
const {
|
7448
|
-
if (
|
7483
|
+
const { folders } = this._session.profile;
|
7449
7484
|
// date is above watermark
|
7450
|
-
|
7451
|
-
inboxView < date)
|
7452
|
-
this._session.profile.inboxCount = !inboxCount ? 0 :
|
7453
|
-
inboxCount + move;
|
7485
|
+
this._session.reportInboxRead(date, move);
|
7454
7486
|
// decrease
|
7455
7487
|
const folder = folders.find(f => f.name === folderId);
|
7456
7488
|
folder.count = Math.max(0, (folder.count || 0) + move);
|
7457
7489
|
}
|
7490
|
+
/**
|
7491
|
+
*
|
7492
|
+
* @param id
|
7493
|
+
* @param form
|
7494
|
+
* @param version
|
7495
|
+
* @param model
|
7496
|
+
* @param files
|
7497
|
+
* @returns
|
7498
|
+
*/
|
7458
7499
|
save(id, form, version, model, files) {
|
7459
7500
|
//const fd = new FormData();
|
7460
7501
|
//const modelBlob = new Blob([JSON.stringify(model)], {
|
@@ -7487,7 +7528,7 @@ class MailboxService {
|
|
7487
7528
|
return this._geoLocation(form).pipe(switchMap(params => this._http.put(`/api/mail/${id}?version=${version}`, model, { params })), this._sync());
|
7488
7529
|
}
|
7489
7530
|
delete(id) {
|
7490
|
-
return this._http.delete(`/api/mail/${id}`).pipe(tap(() => this.
|
7531
|
+
return this._http.delete(`/api/mail/${id}`).pipe(tap(() => this._deleted$.next(id)));
|
7491
7532
|
}
|
7492
7533
|
toggleCommentHide(id, value) {
|
7493
7534
|
return this._http.delete(`/api/comments/${id}?value=${value}`);
|
@@ -8956,7 +8997,7 @@ class ExpandedItemComponent {
|
|
8956
8997
|
(e.userId !== this._session.userId) && this._accounts.get(e.userId).subscribe(u => this._sb.toast('MailVersionUpdate', this.model.number, u.name));
|
8957
8998
|
}
|
8958
8999
|
});
|
8959
|
-
this._mailbox.
|
9000
|
+
this._mailbox.recordChange$.pipe(takeUntil(this._destroy)).subscribe(e => (e.id === this.model.id) &&
|
8960
9001
|
this._refresh());
|
8961
9002
|
this._messaging.commentTyping$.pipe(takeUntil(this._destroy), filter$1(e => e.id === this.model.documentId)).subscribe(() => {
|
8962
9003
|
this.typing = true;
|
@@ -9259,7 +9300,7 @@ class BrowseItemsComponent {
|
|
9259
9300
|
}
|
9260
9301
|
ngOnInit() {
|
9261
9302
|
this.selection.changed.pipe(takeUntil(this._destroy)).subscribe(() => this._sharedActions());
|
9262
|
-
this._mailbox.
|
9303
|
+
this._mailbox.recordChange$.pipe(takeUntil(this._destroy)).subscribe(m => {
|
9263
9304
|
if (!this.dataSource)
|
9264
9305
|
return;
|
9265
9306
|
const item = this.dataSource.data.find(c => c.id === m.id);
|
@@ -9278,7 +9319,7 @@ class BrowseItemsComponent {
|
|
9278
9319
|
m.model &&
|
9279
9320
|
this._add(m);
|
9280
9321
|
});
|
9281
|
-
this._mailbox.
|
9322
|
+
this._mailbox.recordDelete$.pipe(takeUntil(this._destroy)).subscribe(id => {
|
9282
9323
|
if (!this.dataSource)
|
9283
9324
|
return;
|
9284
9325
|
const item = this.dataSource.data.find(c => c.id === id);
|
@@ -9867,7 +9908,7 @@ class ComposeFormComponent {
|
|
9867
9908
|
}
|
9868
9909
|
});
|
9869
9910
|
// form may have changed by browse actions
|
9870
|
-
this._mailbox.
|
9911
|
+
this._mailbox.recordChange$.pipe(takeUntil(this._destroy)).
|
9871
9912
|
subscribe(e => !this.working && e.id === this.model.id &&
|
9872
9913
|
this._assign(e));
|
9873
9914
|
}
|
@@ -10379,13 +10420,13 @@ class ComposePaneComponent {
|
|
10379
10420
|
}
|
10380
10421
|
this.page = page;
|
10381
10422
|
});
|
10382
|
-
this._mailbox.
|
10423
|
+
this._mailbox.recordChange$.pipe(takeUntil(this._destroy)).subscribe(e => {
|
10383
10424
|
if (e.id === this.model.id && !this.working) {
|
10384
10425
|
if (e.folderId && e.folderId !== this.model.folderId)
|
10385
10426
|
this._close();
|
10386
10427
|
}
|
10387
10428
|
});
|
10388
|
-
this._mailbox.
|
10429
|
+
this._mailbox.recordDelete$.pipe(takeUntil(this._destroy)).subscribe(e => e === this.model.id && !this.working &&
|
10389
10430
|
this._close());
|
10390
10431
|
const container = this.dropableElement.nativeElement;
|
10391
10432
|
this._dragDrop.pipe(debounceTime(100), takeUntil(this._destroy)).subscribe(ok => {
|
@@ -12837,6 +12878,11 @@ class AvatarComponent {
|
|
12837
12878
|
this.modeColor = state.color;
|
12838
12879
|
this._cd.markForCheck();
|
12839
12880
|
}
|
12881
|
+
/**
|
12882
|
+
*
|
12883
|
+
* @param name
|
12884
|
+
* @returns
|
12885
|
+
*/
|
12840
12886
|
_gen(name) {
|
12841
12887
|
const initials = name.split(REGEX).map(p => p.charAt(0).toUpperCase()).
|
12842
12888
|
join('').substring(0, 3);
|
@@ -12964,13 +13010,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
|
|
12964
13010
|
|
12965
13011
|
const TEXT_CHAR = /[\w\-]/, NEW_LINE$1 = /[\s\n]/, SYMBOL_CHAR = /[@#]/;
|
12966
13012
|
class TaggingDirective {
|
12967
|
-
constructor(_input, _dir, _element, _overlay) {
|
13013
|
+
constructor(_input, _dir, _element, router, _overlay) {
|
12968
13014
|
this._input = _input;
|
12969
13015
|
this._dir = _dir;
|
12970
13016
|
this._element = _element;
|
12971
13017
|
this._overlay = _overlay;
|
12972
13018
|
this.resourceChange = new EventEmitter();
|
13019
|
+
this._subscription = router?.events.pipe().subscribe(_ => this._close());
|
12973
13020
|
}
|
13021
|
+
/**
|
13022
|
+
*
|
13023
|
+
* @param _evt
|
13024
|
+
*/
|
12974
13025
|
_handleInput(_evt) {
|
12975
13026
|
const value = this._value;
|
12976
13027
|
if (value) {
|
@@ -12980,14 +13031,17 @@ class TaggingDirective {
|
|
12980
13031
|
this._popup(DocumentTaggingComponent, value.substring(1));
|
12981
13032
|
}
|
12982
13033
|
}
|
13034
|
+
/**
|
13035
|
+
*
|
13036
|
+
* @param evt
|
13037
|
+
* @returns
|
13038
|
+
*/
|
12983
13039
|
_handleKeydown(evt) {
|
12984
13040
|
if (!this._instance)
|
12985
13041
|
return;
|
12986
13042
|
const { key } = evt;
|
12987
13043
|
if (key == 'ArrowUp' || key == 'ArrowDown') {
|
12988
13044
|
this._instance.keyManager.onKeydown(evt);
|
12989
|
-
//const { key } = this._instance.keyManager.activeItem!;
|
12990
|
-
//this._assign(key);
|
12991
13045
|
evt.preventDefault();
|
12992
13046
|
evt.stopPropagation();
|
12993
13047
|
}
|
@@ -13016,7 +13070,7 @@ class TaggingDirective {
|
|
13016
13070
|
* @param comp
|
13017
13071
|
* @param value
|
13018
13072
|
*/
|
13019
|
-
_popup(comp, value
|
13073
|
+
_popup(comp, value) {
|
13020
13074
|
this._instance &&
|
13021
13075
|
this._close();
|
13022
13076
|
const position = this._overlay.position().
|
@@ -13065,13 +13119,20 @@ class TaggingDirective {
|
|
13065
13119
|
this._close();
|
13066
13120
|
this._input.focus();
|
13067
13121
|
}
|
13122
|
+
/**
|
13123
|
+
*
|
13124
|
+
* @param key
|
13125
|
+
*/
|
13068
13126
|
_assign(key) {
|
13069
13127
|
const val = this._value, position = this._element.nativeElement.selectionStart;
|
13070
13128
|
this._element.nativeElement.setRangeText(key, position - (val ? val.length - 1 : 0), position);
|
13071
13129
|
this._input.value = this._element.nativeElement.value;
|
13072
13130
|
this._element.nativeElement.selectionStart = position + key.length - (val ? val.length - 1 : 0);
|
13073
13131
|
}
|
13074
|
-
|
13132
|
+
ngOnDestroy() {
|
13133
|
+
this._subscription.unsubscribe();
|
13134
|
+
}
|
13135
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: TaggingDirective, deps: [{ token: i4$1.MatInput, self: true }, { token: i7$2.Directionality }, { token: i0.ElementRef }, { token: PanesRouter, optional: true }, { token: i2$3.Overlay }], target: i0.ɵɵFactoryTarget.Directive }); }
|
13075
13136
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.2", type: TaggingDirective, isStandalone: false, selector: "[bizdocTagging]", inputs: { resource: ["bizdocTagging", "resource"] }, outputs: { resourceChange: "bizdocTaggingChange" }, host: { listeners: { "keydown": "_handleKeydown($event)", "input": "_handleInput($event)" } }, ngImport: i0 }); }
|
13076
13137
|
}
|
13077
13138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: TaggingDirective, decorators: [{
|
@@ -13086,7 +13147,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
|
|
13086
13147
|
}]
|
13087
13148
|
}], ctorParameters: () => [{ type: i4$1.MatInput, decorators: [{
|
13088
13149
|
type: Self
|
13089
|
-
}] }, { type: i7$2.Directionality }, { type: i0.ElementRef }, { type:
|
13150
|
+
}] }, { type: i7$2.Directionality }, { type: i0.ElementRef }, { type: PanesRouter, decorators: [{
|
13151
|
+
type: Optional
|
13152
|
+
}] }, { type: i2$3.Overlay }], propDecorators: { resource: [{
|
13090
13153
|
type: Input,
|
13091
13154
|
args: ['bizdocTagging']
|
13092
13155
|
}], resourceChange: [{
|
@@ -13276,11 +13339,11 @@ class EditInputComponent {
|
|
13276
13339
|
delete this._image;
|
13277
13340
|
}
|
13278
13341
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EditInputComponent, deps: [{ token: Popup }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
13279
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: EditInputComponent, isStandalone: false, selector: "bizdoc-edit-text", inputs: { placeholder: "placeholder", text: "text", image: "image", resource: "resource", disabled: "disabled", autofocus: "autofocus", cache: "cache" }, outputs: { change: "change", onOk: "ok", onFocus: "focus", onBlur: "blur" }, viewQueries: [{ propertyName: "_textElement", first: true, predicate: ["textArea"], descendants: true }, { propertyName: "_rte", first: true, predicate: RichTextEditorComponent, descendants: true }], ngImport: i0, template: "<div class=\"column\">\r\n @switch (mode) {\r\n @case ('html') {\r\n <ejs-richtexteditor [value]=\"text\"\r\n (change)=\"_htmlChange($event)\"\r\n [toolbarSettings]=\"toolbarSettings\"></ejs-richtexteditor>\r\n }\r\n @default {\r\n <mat-form-field floatLabel=\"never\" class=\"flex\">\r\n <textarea matInput cdkTextareaAutosize
|
13342
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: EditInputComponent, isStandalone: false, selector: "bizdoc-edit-text", inputs: { placeholder: "placeholder", text: "text", image: "image", resource: "resource", disabled: "disabled", autofocus: "autofocus", cache: "cache" }, outputs: { change: "change", onOk: "ok", onFocus: "focus", onBlur: "blur" }, viewQueries: [{ propertyName: "_textElement", first: true, predicate: ["textArea"], descendants: true }, { propertyName: "_rte", first: true, predicate: RichTextEditorComponent, descendants: true }], ngImport: i0, template: "<div class=\"column\">\r\n @switch (mode) {\r\n @case ('html') {\r\n <ejs-richtexteditor [value]=\"text\"\r\n (change)=\"_htmlChange($event)\"\r\n [toolbarSettings]=\"toolbarSettings\"></ejs-richtexteditor>\r\n }\r\n @default {\r\n <mat-form-field floatLabel=\"never\" class=\"flex\">\r\n <textarea matInput cdkTextareaAutosize\r\n [autofocus]=\"autofocus\"\r\n [(bizdocTagging)]=\"resource\"\r\n (keydown)=\"_key($event)\"\r\n (input)=\"_textChange($event)\"\r\n [value]=\"text\"\r\n (paste)=\"_paste($event)\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\"\r\n (focus)=\"onFocus.emit()\"\r\n (focusout)=\"onBlur.emit()\"\r\n maxlength=\"2000\"\r\n #textArea></textarea>\r\n </mat-form-field>\r\n }\r\n }\r\n <div class=\"row nav-toolbar\">\r\n <button mat-icon-button (click)=\"_openDocument($event)\" [bizdocTooltip]=\"'Document'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>article</mat-icon></button>\r\n <button mat-icon-button (click)=\"_openMention($event)\" [bizdocTooltip]=\"'Mention'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>alternate_email</mat-icon></button>\r\n <button mat-icon-button (click)=\"_openEmoji($event)\" [bizdocTooltip]=\"'Emoji'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>insert_emoticon</mat-icon></button>\r\n <button mat-icon-button (click)=\"_toggleHtml()\" [bizdocTooltip]=\"'Text'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\"><mat-icon>text_fields</mat-icon></button>\r\n <span class=\"divider\"></span>\r\n <button mat-icon-button (click)=\"_ok()\" [disabled]=\"disabled\" class=\"tool\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\">send</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n@if (_image) {\r\n<div>\r\n <img [src]=\"'data:image/png;base64,'+ _image\" />\r\n <button mat-icon-button (click)=\"_clearImage()\" [disabled]=\"disabled\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n</div>\r\n}\r\n", styles: [":host{display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.mat-mdc-form-field{-ms-flex:1 auto;-webkit-flex:1 auto;flex:1 auto;padding:0 8px}.mat-mdc-form-field textarea{overflow:hidden}img{max-width:300px}\n"], dependencies: [{ kind: "component", type: i2$a.RichTextEditorComponent, selector: "ejs-richtexteditor", inputs: ["autoSaveOnIdle", "backgroundColor", "bulletFormatList", "codeBlockSettings", "cssClass", "editorMode", "emojiPickerSettings", "enableAutoUrl", "enableHtmlEncode", "enableHtmlSanitizer", "enablePersistence", "enableResize", "enableRtl", "enableTabKey", "enableXhtml", "enabled", "enterKey", "exportPdf", "exportWord", "fileManagerSettings", "floatingToolbarOffset", "fontColor", "fontFamily", "fontSize", "format", "formatPainterSettings", "formatter", "height", "htmlAttributes", "iframeSettings", "importWord", "inlineMode", "insertAudioSettings", "insertImageSettings", "insertVideoSettings", "keyConfig", "locale", "maxLength", "numberFormatList", "pasteCleanupSettings", "placeholder", "quickToolbarSettings", "readonly", "saveInterval", "shiftEnterKey", "showCharCount", "showTooltip", "slashMenuSettings", "tableSettings", "toolbarSettings", "undoRedoSteps", "undoRedoTimer", "value", "valueTemplate", "width"], outputs: ["actionBegin", "actionComplete", "afterImageDelete", "afterMediaDelete", "afterPasteCleanup", "beforeDialogClose", "beforeDialogOpen", "beforeFileUpload", "beforeImageDrop", "beforeImageUpload", "beforePasteCleanup", "beforeQuickToolbarOpen", "beforeSanitizeHtml", "blur", "change", "created", "destroyed", "dialogClose", "dialogOpen", "fileRemoving", "fileSelected", "fileUploadFailed", "fileUploadSuccess", "fileUploading", "focus", "imageRemoving", "imageSelected", "imageUploadFailed", "imageUploadSuccess", "imageUploading", "quickToolbarClose", "quickToolbarOpen", "resizeStart", "resizeStop", "resizing", "slashMenuItemSelect", "toolbarClick", "toolbarStatusUpdate", "updatedToolbarStatus", "valueChange"] }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i8.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: i4$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: i6.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: TaggingDirective, selector: "[bizdocTagging]", inputs: ["bizdocTagging"], outputs: ["bizdocTaggingChange"] }, { kind: "directive", type: TooltipDirective, selector: "[bizdocTooltip]", inputs: ["bizdocTooltip", "bizdocTooltipTemplate", "bizdocTooltipContext", "bizdocTooltipPosition", "bizdocTooltipDuration", "bizdocTooltipDisabled"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
|
13280
13343
|
}
|
13281
13344
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: EditInputComponent, decorators: [{
|
13282
13345
|
type: Component,
|
13283
|
-
args: [{ standalone: false, selector: 'bizdoc-edit-text', template: "<div class=\"column\">\r\n @switch (mode) {\r\n @case ('html') {\r\n <ejs-richtexteditor [value]=\"text\"\r\n (change)=\"_htmlChange($event)\"\r\n [toolbarSettings]=\"toolbarSettings\"></ejs-richtexteditor>\r\n }\r\n @default {\r\n <mat-form-field floatLabel=\"never\" class=\"flex\">\r\n <textarea matInput cdkTextareaAutosize
|
13346
|
+
args: [{ standalone: false, selector: 'bizdoc-edit-text', template: "<div class=\"column\">\r\n @switch (mode) {\r\n @case ('html') {\r\n <ejs-richtexteditor [value]=\"text\"\r\n (change)=\"_htmlChange($event)\"\r\n [toolbarSettings]=\"toolbarSettings\"></ejs-richtexteditor>\r\n }\r\n @default {\r\n <mat-form-field floatLabel=\"never\" class=\"flex\">\r\n <textarea matInput cdkTextareaAutosize\r\n [autofocus]=\"autofocus\"\r\n [(bizdocTagging)]=\"resource\"\r\n (keydown)=\"_key($event)\"\r\n (input)=\"_textChange($event)\"\r\n [value]=\"text\"\r\n (paste)=\"_paste($event)\"\r\n [placeholder]=\"placeholder ? (placeholder | translate) : null\"\r\n (focus)=\"onFocus.emit()\"\r\n (focusout)=\"onBlur.emit()\"\r\n maxlength=\"2000\"\r\n #textArea></textarea>\r\n </mat-form-field>\r\n }\r\n }\r\n <div class=\"row nav-toolbar\">\r\n <button mat-icon-button (click)=\"_openDocument($event)\" [bizdocTooltip]=\"'Document'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>article</mat-icon></button>\r\n <button mat-icon-button (click)=\"_openMention($event)\" [bizdocTooltip]=\"'Mention'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>alternate_email</mat-icon></button>\r\n <button mat-icon-button (click)=\"_openEmoji($event)\" [bizdocTooltip]=\"'Emoji'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\" [disabled]=\"mode !== 'text'\"><mat-icon>insert_emoticon</mat-icon></button>\r\n <button mat-icon-button (click)=\"_toggleHtml()\" [bizdocTooltip]=\"'Text'|translate\" bizdocTooltipPosition=\"above\" class=\"tool\"><mat-icon>text_fields</mat-icon></button>\r\n <span class=\"divider\"></span>\r\n <button mat-icon-button (click)=\"_ok()\" [disabled]=\"disabled\" class=\"tool\">\r\n <mat-icon class=\"mat-icon-rtl-mirror\">send</mat-icon>\r\n </button>\r\n </div>\r\n</div>\r\n@if (_image) {\r\n<div>\r\n <img [src]=\"'data:image/png;base64,'+ _image\" />\r\n <button mat-icon-button (click)=\"_clearImage()\" [disabled]=\"disabled\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n</div>\r\n}\r\n", styles: [":host{display:flex;-ms-flex-direction:column;-webkit-flex-direction:column;flex-direction:column}.mat-mdc-form-field{-ms-flex:1 auto;-webkit-flex:1 auto;flex:1 auto;padding:0 8px}.mat-mdc-form-field textarea{overflow:hidden}img{max-width:300px}\n"] }]
|
13284
13347
|
}], ctorParameters: () => [{ type: Popup }, { type: i0.ChangeDetectorRef }], propDecorators: { placeholder: [{
|
13285
13348
|
type: Input
|
13286
13349
|
}], text: [{
|
@@ -18306,20 +18369,13 @@ class NotificationsService {
|
|
18306
18369
|
});
|
18307
18370
|
}
|
18308
18371
|
markAsRead(id, date, read) {
|
18309
|
-
return this._http.put(`/api/notifications/${id}?read=${read}`, {}, { headers: { 'no-progress': 'true' } }).pipe(tap(() =>
|
18310
|
-
const { messagesCount, options: { notificationsView } } = this._session.profile;
|
18311
|
-
if (!this._session.isImpersonating &&
|
18312
|
-
notificationsView !== undefined &&
|
18313
|
-
notificationsView < date)
|
18314
|
-
this._session.profile.messagesCount = !messagesCount ? 0 :
|
18315
|
-
messagesCount - 1;
|
18316
|
-
}));
|
18372
|
+
return this._http.put(`/api/notifications/${id}?read=${read}`, {}, { headers: { 'no-progress': 'true' } }).pipe(tap(() => this._session.reportNotificationsRead(date, read ? -1 : 1)));
|
18317
18373
|
}
|
18318
18374
|
get(id) {
|
18319
18375
|
return this._http.get(`/api/notifications/${id}`);
|
18320
18376
|
}
|
18321
18377
|
mute(id, mute) {
|
18322
|
-
return this._http.put(`/api/notifications/${id}?mute=${mute}`, {});
|
18378
|
+
return this._http.put(`/api/notifications/${id}?mute=${mute}`, {}).pipe(tap(() => { }));
|
18323
18379
|
}
|
18324
18380
|
delete(id) {
|
18325
18381
|
return this._http.delete(`/api/notifications/${id}`);
|
@@ -19054,7 +19110,7 @@ class WindowTitleService {
|
|
19054
19110
|
else
|
19055
19111
|
this._show(translate.get('NewFrom', i.model.number));
|
19056
19112
|
});
|
19057
|
-
hub.
|
19113
|
+
hub.newNotification$.subscribe(n => !this._inFocus && this._show(n.model.title));
|
19058
19114
|
this._title = document.title;
|
19059
19115
|
}
|
19060
19116
|
set(value) {
|
@@ -19489,7 +19545,7 @@ class HomeBase {
|
|
19489
19545
|
playAudio('notification_simple-01');
|
19490
19546
|
});
|
19491
19547
|
//
|
19492
|
-
this._messaging.
|
19548
|
+
this._messaging.newNotification$.subscribe(n => {
|
19493
19549
|
const { options: { notifications }, messages, messagesCount } = this._session.profile;
|
19494
19550
|
notifications.sound && playAudio('notification_simple-01');
|
19495
19551
|
});
|
@@ -25155,7 +25211,7 @@ let RecentsWidget = class RecentsWidget {
|
|
25155
25211
|
this.enableInsights = session.profile.views.length > 0;
|
25156
25212
|
}
|
25157
25213
|
ngOnInit() {
|
25158
|
-
this._service.
|
25214
|
+
this._service.recordChange$.pipe(takeUntil(this._destroy)).
|
25159
25215
|
subscribe(m => {
|
25160
25216
|
const item = this.dataSource.data.find(i => i.id === m.id);
|
25161
25217
|
item &&
|