@nova-ui/bits 15.0.10 → 15.0.12

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.
@@ -1830,11 +1830,15 @@ class EventBusService extends EventBus {
1830
1830
  // This is moved from popup code.
1831
1831
  // Every event that is triggered for document should be handled by popup,
1832
1832
  // but we should register listener only once
1833
- this.renderer.listen("document", "click", (event) => {
1833
+ this.listenerUnsubscriber = this.renderer.listen("document", "click", (event) => {
1834
1834
  // separate stream to detect document-body clicks in case of popup in popover
1835
1835
  this.getStream(DOCUMENT_CLICK_EVENT).next(event);
1836
1836
  });
1837
1837
  }
1838
+ ngOnDestroy() {
1839
+ super.ngOnDestroy();
1840
+ this.listenerUnsubscriber?.();
1841
+ }
1838
1842
  }
1839
1843
  EventBusService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: EventBusService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
1840
1844
  EventBusService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: EventBusService, providedIn: "root" });
@@ -8223,7 +8227,7 @@ class MenuComponent {
8223
8227
  // It's more powerful than just listening for focus or blur events because it tells you how the element was focused
8224
8228
  // (via mouse, keyboard, touch, or programmatically).
8225
8229
  this.focusMonitorSubscription = this.focusMonitor
8226
- .monitor(this.menuToggle.nativeElement)
8230
+ .monitor(this.menuToggle)
8227
8231
  .subscribe((origin) => {
8228
8232
  if (origin === "keyboard") {
8229
8233
  if (!this.popup.popupToggle.disabled) {
@@ -8259,6 +8263,7 @@ class MenuComponent {
8259
8263
  ngOnDestroy() {
8260
8264
  this.menuKeyControlListeners.forEach((listener) => listener());
8261
8265
  this.focusMonitorSubscription.unsubscribe();
8266
+ this.focusMonitor.stopMonitoring(this.menuToggle);
8262
8267
  }
8263
8268
  }
8264
8269
  MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: MenuComponent, deps: [{ token: MenuKeyControlService }, { token: i0.Renderer2 }, { token: i1$2.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
@@ -26716,6 +26721,9 @@ class ThemeSwitchService {
26716
26721
  .subscribe((route) => {
26717
26722
  const showThemeSwitcher = (route.snapshot.data || {})
26718
26723
  .showThemeSwitcher;
26724
+ if (typeof showThemeSwitcher === "undefined") {
26725
+ return;
26726
+ }
26719
26727
  this.showThemeSwitcherSubject.next(showThemeSwitcher);
26720
26728
  if (showThemeSwitcher) {
26721
26729
  /** Case when route is changed on the same page (see on breadcrumb component docs page) */