@brggroup/share-lib 0.0.60 → 0.0.61
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/brggroup-share-lib.mjs +35 -2
- package/fesm2022/brggroup-share-lib.mjs.map +1 -1
- package/lib/components/layout/layout.component.d.ts +3 -0
- package/lib/components/layout/layout.component.d.ts.map +1 -1
- package/lib/helper/date.helper.d.ts +3 -0
- package/lib/helper/date.helper.d.ts.map +1 -1
- package/lib/services/device-service.d.ts +9 -0
- package/lib/services/device-service.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -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, fromEvent, map } from 'rxjs';
|
|
8
|
+
import { firstValueFrom, BehaviorSubject, of, catchError, throwError, finalize, from, switchMap as switchMap$1, take, filter, fromEvent, startWith, map, 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';
|
|
@@ -1754,6 +1754,15 @@ class DateTimeHelper {
|
|
|
1754
1754
|
}
|
|
1755
1755
|
return result;
|
|
1756
1756
|
}
|
|
1757
|
+
static firstDayOfMonth(date = new Date()) {
|
|
1758
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1759
|
+
}
|
|
1760
|
+
static lastDayOfMonth(date = new Date()) {
|
|
1761
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
1762
|
+
}
|
|
1763
|
+
static firstDayOfNextMonth(date = new Date()) {
|
|
1764
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 1);
|
|
1765
|
+
}
|
|
1757
1766
|
}
|
|
1758
1767
|
|
|
1759
1768
|
/**
|
|
@@ -6163,6 +6172,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImpor
|
|
|
6163
6172
|
}]
|
|
6164
6173
|
}] });
|
|
6165
6174
|
|
|
6175
|
+
class DeviceService {
|
|
6176
|
+
isMobile$() {
|
|
6177
|
+
return fromEvent(window, 'resize').pipe(startWith(null), // emit lần đầu
|
|
6178
|
+
map(() => window.innerWidth <= 768));
|
|
6179
|
+
}
|
|
6180
|
+
get isMobile() {
|
|
6181
|
+
return window.innerWidth <= 500;
|
|
6182
|
+
}
|
|
6183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
6184
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, providedIn: 'root' });
|
|
6185
|
+
}
|
|
6186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.7", ngImport: i0, type: DeviceService, decorators: [{
|
|
6187
|
+
type: Injectable,
|
|
6188
|
+
args: [{ providedIn: 'root' }]
|
|
6189
|
+
}] });
|
|
6190
|
+
|
|
6166
6191
|
class App_Menu {
|
|
6167
6192
|
// #region properties
|
|
6168
6193
|
App_Menu_Id;
|
|
@@ -6224,6 +6249,7 @@ class LayoutComponent extends BaseComponent {
|
|
|
6224
6249
|
loadingService = inject(LoadingService);
|
|
6225
6250
|
fileService = inject(FileService);
|
|
6226
6251
|
breakpointObserver = inject(BreakpointObserver);
|
|
6252
|
+
device = inject(DeviceService);
|
|
6227
6253
|
TokenStorage = TokenStorage;
|
|
6228
6254
|
MENU_TYPE = 0;
|
|
6229
6255
|
HEADER_MENU_IN_USE = false;
|
|
@@ -6253,6 +6279,7 @@ class LayoutComponent extends BaseComponent {
|
|
|
6253
6279
|
logoUrl$ = this.fileService
|
|
6254
6280
|
.getFileVersion('LOGO')
|
|
6255
6281
|
.pipe(map((res) => `${AppGlobals.apiEndpoint}/api/file/image?code=LOGO&v=${res || ''}`));
|
|
6282
|
+
destroy$ = new Subject();
|
|
6256
6283
|
async ngOnInit() {
|
|
6257
6284
|
this.vscService.initVersionCheck();
|
|
6258
6285
|
SignalRService.initNoti();
|
|
@@ -6299,11 +6326,17 @@ class LayoutComponent extends BaseComponent {
|
|
|
6299
6326
|
this.selectNodeByUrl(url);
|
|
6300
6327
|
});
|
|
6301
6328
|
setTimeout(() => {
|
|
6302
|
-
this.isCollapsed = localStorage.getItem('MENU_isCollapsed') == '1';
|
|
6329
|
+
this.isCollapsed = localStorage.getItem('MENU_isCollapsed') == '1' || this.device.isMobile;
|
|
6303
6330
|
if (this.isCollapsed) {
|
|
6304
6331
|
this.visibleMenuDrawer = true;
|
|
6305
6332
|
}
|
|
6306
6333
|
}, 0);
|
|
6334
|
+
this.device
|
|
6335
|
+
.isMobile$()
|
|
6336
|
+
.pipe(takeUntil$1(this.destroy$))
|
|
6337
|
+
.subscribe((isMobile) => {
|
|
6338
|
+
this.isCollapsed = isMobile;
|
|
6339
|
+
});
|
|
6307
6340
|
}
|
|
6308
6341
|
divuser;
|
|
6309
6342
|
ngOnDestroy() {
|