monkey-front-core 0.0.211 → 0.0.214

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.
@@ -1909,7 +1909,7 @@ class MonkeyEcxPopoverDirective {
1909
1909
  return event instanceof NavigationStart;
1910
1910
  }))
1911
1911
  .subscribe(() => {
1912
- this.popover = false;
1912
+ this.onHandleClose();
1913
1913
  });
1914
1914
  }
1915
1915
  get popover() {
@@ -1930,6 +1930,16 @@ class MonkeyEcxPopoverDirective {
1930
1930
  set target(target) {
1931
1931
  this._target = target;
1932
1932
  }
1933
+ onHandleClose(e) {
1934
+ this.popover = false;
1935
+ this.subs.unsubscribe();
1936
+ this.resizeObserver?.disconnect();
1937
+ this.zone.run(() => {
1938
+ if (this.closed) {
1939
+ this.closed(e);
1940
+ }
1941
+ });
1942
+ }
1933
1943
  getDirPositions(dir) {
1934
1944
  const revert = {
1935
1945
  start: 'end', end: 'start', bottom: 'top', top: 'bottom', center: 'center'
@@ -2013,22 +2023,14 @@ class MonkeyEcxPopoverDirective {
2013
2023
  maxHeight: '95%',
2014
2024
  height: this.height
2015
2025
  });
2016
- let resizeObserver;
2017
- const subs = this.overlayRef.backdropClick().subscribe((e) => {
2018
- this.popover = false;
2019
- subs.unsubscribe();
2020
- resizeObserver?.disconnect();
2021
- this.zone.run(() => {
2022
- if (this.closed) {
2023
- this.closed(e);
2024
- }
2025
- });
2026
+ this.subs = this.overlayRef.backdropClick().subscribe((e) => {
2027
+ this.onHandleClose(e);
2026
2028
  });
2027
2029
  const attached = this.overlayRef.attach(this.templatePortal);
2028
2030
  if (this.watch) {
2029
2031
  try {
2030
2032
  if ('ResizeObserver' in window) {
2031
- resizeObserver = new ResizeObserver(([{ contentRect }]) => {
2033
+ this.resizeObserver = new ResizeObserver(([{ contentRect }]) => {
2032
2034
  this.overlayRef.updatePosition();
2033
2035
  })
2034
2036
  .observe(attached.rootNodes[0]);