@ascentgl/ads-ui 0.0.91 → 0.0.92
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.
|
@@ -6208,20 +6208,33 @@ class AbstractSideNavBarComponent {
|
|
|
6208
6208
|
}
|
|
6209
6209
|
/** @ignore */
|
|
6210
6210
|
ngOnInit() {
|
|
6211
|
+
this.initSideBarSize();
|
|
6212
|
+
}
|
|
6213
|
+
/** @ignore */
|
|
6214
|
+
initSideBarSize() {
|
|
6211
6215
|
if (localStorage.getItem(this.localStorageName)) {
|
|
6212
6216
|
this.sidebarSize.set(JSON.parse(localStorage.getItem(this.localStorageName)));
|
|
6213
6217
|
}
|
|
6214
|
-
|
|
6218
|
+
setTimeout(() => {
|
|
6219
|
+
this.isCollapsed.set(this.sidebarSize() <= this.widthToCollapsed);
|
|
6220
|
+
});
|
|
6215
6221
|
}
|
|
6216
6222
|
/** @ignore */
|
|
6217
6223
|
ngAfterViewInit() {
|
|
6218
|
-
|
|
6219
|
-
this.splitterSubscription = this.splitter.dragProgress$.subscribe((data) => {
|
|
6220
|
-
const newSize = Number(data.sizes[0]);
|
|
6221
|
-
this.isCollapsed.set(newSize <= this.widthToCollapsed);
|
|
6222
|
-
});
|
|
6223
|
-
}
|
|
6224
|
+
this.splitterSubscribe();
|
|
6224
6225
|
}
|
|
6226
|
+
/** @ignore */
|
|
6227
|
+
splitterSubscribe() {
|
|
6228
|
+
setTimeout(() => {
|
|
6229
|
+
if (this.splitter) {
|
|
6230
|
+
this.splitterSubscription = this.splitter.dragProgress$.subscribe((data) => {
|
|
6231
|
+
const newSize = Number(data.sizes[0]);
|
|
6232
|
+
this.isCollapsed.set(newSize <= this.widthToCollapsed);
|
|
6233
|
+
});
|
|
6234
|
+
}
|
|
6235
|
+
});
|
|
6236
|
+
}
|
|
6237
|
+
/** @ignore */
|
|
6225
6238
|
dragEnd(event) {
|
|
6226
6239
|
const newSize = Number(event.sizes[0]);
|
|
6227
6240
|
this.saveLocalStorage(newSize);
|
|
@@ -6340,7 +6353,7 @@ class AdsScmsSideNavBarComponent extends AbstractSideNavBarComponent {
|
|
|
6340
6353
|
this.checkScreenWidth();
|
|
6341
6354
|
this.registry.register([adsIconChevronDown, adsIconChevronUp, adsIconCross, adsIconHamburgerMenu]);
|
|
6342
6355
|
effect(() => {
|
|
6343
|
-
if (this.isCollapsed()) {
|
|
6356
|
+
if (this.isCollapsed() && !this.isMobile) {
|
|
6344
6357
|
this.accordion().closeAll();
|
|
6345
6358
|
}
|
|
6346
6359
|
});
|
|
@@ -6363,9 +6376,16 @@ class AdsScmsSideNavBarComponent extends AbstractSideNavBarComponent {
|
|
|
6363
6376
|
});
|
|
6364
6377
|
}
|
|
6365
6378
|
checkScreenWidth() {
|
|
6366
|
-
|
|
6379
|
+
const mobileWidth = window.innerWidth < 482;
|
|
6380
|
+
if (mobileWidth !== this.isMobile && !mobileWidth) {
|
|
6381
|
+
this.initSideBarSize();
|
|
6382
|
+
this.splitterSubscribe();
|
|
6383
|
+
}
|
|
6384
|
+
this.isMobile = mobileWidth;
|
|
6367
6385
|
if (this.isMobile) {
|
|
6368
|
-
|
|
6386
|
+
setTimeout(() => {
|
|
6387
|
+
this.isCollapsed.set(!this.isMobile);
|
|
6388
|
+
});
|
|
6369
6389
|
}
|
|
6370
6390
|
}
|
|
6371
6391
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: AdsScmsSideNavBarComponent, deps: [{ token: i1$2.Router }, { token: i1.AdsIconRegistry }], target: i0.ɵɵFactoryTarget.Component }); }
|