@brggroup/share-lib 0.0.72 → 0.0.73
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.
|
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute, NavigationEnd, RouterLink, RouterOutlet } from
|
|
|
5
5
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
6
6
|
import * as i3 from '@ngx-translate/core';
|
|
7
7
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
8
|
-
import { firstValueFrom, BehaviorSubject, of, catchError, throwError, finalize, from, switchMap as switchMap$1, take, filter,
|
|
8
|
+
import { firstValueFrom, fromEvent, startWith, map, BehaviorSubject, of, catchError, throwError, finalize, from, switchMap as switchMap$1, take, filter, Subject, takeUntil as takeUntil$1 } from 'rxjs';
|
|
9
9
|
import { NzNotificationService } from 'ng-zorro-antd/notification';
|
|
10
10
|
import * as i1 from 'ng-zorro-antd/modal';
|
|
11
11
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
|
@@ -254,6 +254,22 @@ class HTTPService {
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
class DeviceService {
|
|
258
|
+
isMobile$() {
|
|
259
|
+
return fromEvent(window, 'resize').pipe(startWith(null), // emit lần đầu
|
|
260
|
+
map(() => window.innerWidth <= 768));
|
|
261
|
+
}
|
|
262
|
+
get isMobile() {
|
|
263
|
+
return window.innerWidth <= 500;
|
|
264
|
+
}
|
|
265
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
266
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, providedIn: 'root' });
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, decorators: [{
|
|
269
|
+
type: Injectable,
|
|
270
|
+
args: [{ providedIn: 'root' }]
|
|
271
|
+
}] });
|
|
272
|
+
|
|
257
273
|
function escapeHtml(str) {
|
|
258
274
|
return str.replace(/</g, '<').replace(/>/g, '>');
|
|
259
275
|
}
|
|
@@ -261,6 +277,7 @@ class NotiService {
|
|
|
261
277
|
modal = inject(NzModalService);
|
|
262
278
|
notification = inject(NzNotificationService);
|
|
263
279
|
translate = inject(TranslateService);
|
|
280
|
+
device = inject(DeviceService);
|
|
264
281
|
async success(title, content = '', showPopup = false) {
|
|
265
282
|
if (showPopup) {
|
|
266
283
|
return new Promise((resolve) => {
|
|
@@ -318,7 +335,7 @@ class NotiService {
|
|
|
318
335
|
this.modal.error({
|
|
319
336
|
nzTitle: 'Lỗi phát sinh',
|
|
320
337
|
nzContent: this.translate.instant('NO_CONNECT_TO_SERVER'),
|
|
321
|
-
nzWidth:
|
|
338
|
+
nzWidth: this.modalWidth,
|
|
322
339
|
nzOkText: 'Đóng',
|
|
323
340
|
});
|
|
324
341
|
return;
|
|
@@ -344,7 +361,7 @@ class NotiService {
|
|
|
344
361
|
this.modal.error({
|
|
345
362
|
nzTitle: 'Lỗi phát sinh',
|
|
346
363
|
nzContent: this.translate.instant('UNKNOWN_ERROR'),
|
|
347
|
-
nzWidth:
|
|
364
|
+
nzWidth: this.modalWidth,
|
|
348
365
|
nzOkText: 'Đóng',
|
|
349
366
|
});
|
|
350
367
|
}
|
|
@@ -354,7 +371,7 @@ class NotiService {
|
|
|
354
371
|
this.modal.error({
|
|
355
372
|
nzTitle: 'Lỗi phát sinh',
|
|
356
373
|
nzContent: this.translate.instant('UNKNOWN_ERROR'),
|
|
357
|
-
nzWidth:
|
|
374
|
+
nzWidth: this.modalWidth,
|
|
358
375
|
nzOkText: 'Đóng',
|
|
359
376
|
});
|
|
360
377
|
};
|
|
@@ -394,7 +411,7 @@ class NotiService {
|
|
|
394
411
|
const modalRef = this.modal.error({
|
|
395
412
|
nzTitle: 'Lỗi phát sinh',
|
|
396
413
|
nzContent: errorMsg,
|
|
397
|
-
nzWidth:
|
|
414
|
+
nzWidth: this.modalWidth,
|
|
398
415
|
nzClosable: false,
|
|
399
416
|
nzCancelText: 'Đóng',
|
|
400
417
|
nzOkText: 'Chi tiết',
|
|
@@ -403,7 +420,7 @@ class NotiService {
|
|
|
403
420
|
this.modal.error({
|
|
404
421
|
nzTitle: 'Chi tiết lỗi',
|
|
405
422
|
nzContent: escapeHtml(JSON.stringify(_data, null, 2)),
|
|
406
|
-
nzWidth: '60vw',
|
|
423
|
+
nzWidth: this.device.isMobile ? '90vw' : '60vw',
|
|
407
424
|
nzDraggable: true,
|
|
408
425
|
nzCentered: true,
|
|
409
426
|
nzOkText: 'Đóng',
|
|
@@ -411,6 +428,9 @@ class NotiService {
|
|
|
411
428
|
},
|
|
412
429
|
});
|
|
413
430
|
}
|
|
431
|
+
get modalWidth() {
|
|
432
|
+
return this.device.isMobile ? '80vw' : '40vw';
|
|
433
|
+
}
|
|
414
434
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: NotiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
415
435
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: NotiService, providedIn: 'root' });
|
|
416
436
|
}
|
|
@@ -6231,22 +6251,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
6231
6251
|
}]
|
|
6232
6252
|
}] });
|
|
6233
6253
|
|
|
6234
|
-
class DeviceService {
|
|
6235
|
-
isMobile$() {
|
|
6236
|
-
return fromEvent(window, 'resize').pipe(startWith(null), // emit lần đầu
|
|
6237
|
-
map(() => window.innerWidth <= 768));
|
|
6238
|
-
}
|
|
6239
|
-
get isMobile() {
|
|
6240
|
-
return window.innerWidth <= 500;
|
|
6241
|
-
}
|
|
6242
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6243
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, providedIn: 'root' });
|
|
6244
|
-
}
|
|
6245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, decorators: [{
|
|
6246
|
-
type: Injectable,
|
|
6247
|
-
args: [{ providedIn: 'root' }]
|
|
6248
|
-
}] });
|
|
6249
|
-
|
|
6250
6254
|
class App_Menu {
|
|
6251
6255
|
// #region properties
|
|
6252
6256
|
App_Menu_Id;
|