@nova-ui/bits 15.0.11 → 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.
- package/esm2020/lib/menu/menu/menu.component.mjs +3 -2
- package/esm2020/services/event-bus.service.mjs +7 -3
- package/fesm2015/nova-ui-bits.mjs +8 -2
- package/fesm2015/nova-ui-bits.mjs.map +1 -1
- package/fesm2020/nova-ui-bits.mjs +7 -2
- package/fesm2020/nova-ui-bits.mjs.map +1 -1
- package/package.json +1 -1
- package/services/event-bus.service.d.ts +4 -2
|
@@ -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
|
|
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 });
|