@ngrdt/menu 0.0.68 → 0.0.71
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/ngrdt-menu.mjs +7 -8
- package/fesm2022/ngrdt-menu.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +5 -5
package/fesm2022/ngrdt-menu.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import * as i3 from '@ngrdt/router';
|
|
|
11
11
|
import { RdtRouterService, RdtAnyRouteActiveDirective } from '@ngrdt/router';
|
|
12
12
|
import * as i4 from '@ngrdt/shortcuts';
|
|
13
13
|
import { RdtShortcutService, RdtShortcut, RdtKeyListenerDirective } from '@ngrdt/shortcuts';
|
|
14
|
-
import { RdtStringUtils, KB_CODE, RdtObjectUtils } from '@ngrdt/utils';
|
|
14
|
+
import { RdtStringUtils, KB_CODE, RdtObjectUtils, RdtDomUtils } from '@ngrdt/utils';
|
|
15
15
|
import { delay, of, map, first, merge, fromEvent, throttleTime, animationFrameScheduler, switchMap, withLatestFrom } from 'rxjs';
|
|
16
16
|
import { RDT_BUTTON_BASE_PROVIDER } from '@ngrdt/button';
|
|
17
17
|
|
|
@@ -833,11 +833,9 @@ class RdtMenuBaseComponent {
|
|
|
833
833
|
constructor() {
|
|
834
834
|
this.listenShortcuts();
|
|
835
835
|
afterNextRender(() => {
|
|
836
|
-
this.
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
this.recalculateChildren();
|
|
840
|
-
});
|
|
836
|
+
this.listenResizeScroll();
|
|
837
|
+
this.measure();
|
|
838
|
+
this.recalculateChildren();
|
|
841
839
|
});
|
|
842
840
|
}
|
|
843
841
|
recalcChildrenEffect = effect(() => this.recalculateChildren());
|
|
@@ -1078,8 +1076,9 @@ class RdtMenuBaseComponent {
|
|
|
1078
1076
|
this._buttonContainerRect = undefined;
|
|
1079
1077
|
}
|
|
1080
1078
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1079
|
+
listenResizeScroll() {
|
|
1080
|
+
const element = this.elRef.nativeElement;
|
|
1081
|
+
merge(RdtDomUtils.getResizeEvent$(element), fromEvent(window, 'scroll'))
|
|
1083
1082
|
.pipe(throttleTime(0, animationFrameScheduler, { trailing: true }), takeUntilDestroyed(this.destroyRef))
|
|
1084
1083
|
.subscribe(() => {
|
|
1085
1084
|
this.measure();
|