monkey-front-core 0.0.210 → 0.0.213
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/core/directives/monkeyecx-popover.directive.mjs +30 -16
- package/fesm2015/monkey-front-core.mjs +27 -15
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +26 -15
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/directives/monkeyecx-popover.directive.d.ts +8 -3
- package/monkey-front-core-0.0.213.tgz +0 -0
- package/package.json +3 -3
- package/monkey-front-core-0.0.210.tgz +0 -0
|
@@ -1886,7 +1886,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
1886
1886
|
}] } });
|
|
1887
1887
|
|
|
1888
1888
|
class MonkeyEcxPopoverDirective {
|
|
1889
|
-
constructor(tpl, vcr, el, zone, _viewContainerRef, _cd, overlay, overlayPositionBuilder, options) {
|
|
1889
|
+
constructor(tpl, vcr, el, zone, _viewContainerRef, _cd, overlay, overlayPositionBuilder, router, options) {
|
|
1890
1890
|
this.tpl = tpl;
|
|
1891
1891
|
this.vcr = vcr;
|
|
1892
1892
|
this.el = el;
|
|
@@ -1895,6 +1895,7 @@ class MonkeyEcxPopoverDirective {
|
|
|
1895
1895
|
this._cd = _cd;
|
|
1896
1896
|
this.overlay = overlay;
|
|
1897
1897
|
this.overlayPositionBuilder = overlayPositionBuilder;
|
|
1898
|
+
this.router = router;
|
|
1898
1899
|
this.options = options;
|
|
1899
1900
|
this.minwidth = false;
|
|
1900
1901
|
this.backdrop = true;
|
|
@@ -1902,7 +1903,14 @@ class MonkeyEcxPopoverDirective {
|
|
|
1902
1903
|
this.dir = 'ltr';
|
|
1903
1904
|
this.contextmenu = false;
|
|
1904
1905
|
this.subs = new Subscription();
|
|
1905
|
-
|
|
1906
|
+
this.eventsSubs = new Subscription();
|
|
1907
|
+
this.eventsSubs = this.router.events
|
|
1908
|
+
.pipe(filter((event) => {
|
|
1909
|
+
return event instanceof NavigationStart;
|
|
1910
|
+
}))
|
|
1911
|
+
.subscribe(() => {
|
|
1912
|
+
this.onHandleClose();
|
|
1913
|
+
});
|
|
1906
1914
|
}
|
|
1907
1915
|
get popover() {
|
|
1908
1916
|
return this._popover;
|
|
@@ -1922,6 +1930,16 @@ class MonkeyEcxPopoverDirective {
|
|
|
1922
1930
|
set target(target) {
|
|
1923
1931
|
this._target = target;
|
|
1924
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
|
+
}
|
|
1925
1943
|
getDirPositions(dir) {
|
|
1926
1944
|
const revert = {
|
|
1927
1945
|
start: 'end', end: 'start', bottom: 'top', top: 'bottom', center: 'center'
|
|
@@ -2005,22 +2023,14 @@ class MonkeyEcxPopoverDirective {
|
|
|
2005
2023
|
maxHeight: '95%',
|
|
2006
2024
|
height: this.height
|
|
2007
2025
|
});
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
this.popover = false;
|
|
2011
|
-
subs.unsubscribe();
|
|
2012
|
-
resizeObserver?.disconnect();
|
|
2013
|
-
this.zone.run(() => {
|
|
2014
|
-
if (this.closed) {
|
|
2015
|
-
this.closed(e);
|
|
2016
|
-
}
|
|
2017
|
-
});
|
|
2026
|
+
this.subs = this.overlayRef.backdropClick().subscribe((e) => {
|
|
2027
|
+
this.onHandleClose(e);
|
|
2018
2028
|
});
|
|
2019
2029
|
const attached = this.overlayRef.attach(this.templatePortal);
|
|
2020
2030
|
if (this.watch) {
|
|
2021
2031
|
try {
|
|
2022
2032
|
if ('ResizeObserver' in window) {
|
|
2023
|
-
resizeObserver = new ResizeObserver(([{ contentRect }]) => {
|
|
2033
|
+
this.resizeObserver = new ResizeObserver(([{ contentRect }]) => {
|
|
2024
2034
|
this.overlayRef.updatePosition();
|
|
2025
2035
|
})
|
|
2026
2036
|
.observe(attached.rootNodes[0]);
|
|
@@ -2034,16 +2044,17 @@ class MonkeyEcxPopoverDirective {
|
|
|
2034
2044
|
ngOnDestroy() {
|
|
2035
2045
|
this.popover = false;
|
|
2036
2046
|
this.subs.unsubscribe();
|
|
2047
|
+
this.eventsSubs.unsubscribe();
|
|
2037
2048
|
}
|
|
2038
2049
|
}
|
|
2039
|
-
MonkeyEcxPopoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.Overlay }, { token: i1$4.OverlayPositionBuilder }, { token: POPOVER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2050
|
+
MonkeyEcxPopoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.Overlay }, { token: i1$4.OverlayPositionBuilder }, { token: i1$3.Router }, { token: POPOVER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2040
2051
|
MonkeyEcxPopoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: MonkeyEcxPopoverDirective, selector: "[monkeyecxPopover]", inputs: { popover: ["monkeyecxPopover", "popover"], closed: ["monkeyecxPopoverClosed", "closed"], target: ["monkeyecxPopoverTarget", "target"], minwidth: ["monkeyecxPopoverMinwidth", "minwidth"], backdrop: ["monkeyecxPopoverBackdrop", "backdrop"], watch: ["monkeyecxPopoverWatch", "watch"], dir: ["monkeyecxPopoverDir", "dir"], contextmenu: ["monkeyecxPopoverContextmenu", "contextmenu"], height: ["monkeyecxPopoverHeight", "height"] }, ngImport: i0 });
|
|
2041
2052
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: MonkeyEcxPopoverDirective, decorators: [{
|
|
2042
2053
|
type: Directive,
|
|
2043
2054
|
args: [{
|
|
2044
2055
|
selector: '[monkeyecxPopover]'
|
|
2045
2056
|
}]
|
|
2046
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.Overlay }, { type: i1$4.OverlayPositionBuilder }, { type: undefined, decorators: [{
|
|
2057
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.Overlay }, { type: i1$4.OverlayPositionBuilder }, { type: i1$3.Router }, { type: undefined, decorators: [{
|
|
2047
2058
|
type: Inject,
|
|
2048
2059
|
args: [POPOVER_OPTIONS]
|
|
2049
2060
|
}, {
|