monkey-front-core 0.0.173 → 0.0.176
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 +82 -43
- package/fesm2015/monkey-front-core.mjs +81 -42
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +81 -42
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.176.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.173.tgz +0 -0
|
@@ -1908,11 +1908,19 @@ class MonkeyEcxPopoverDirective {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
set popover(show) {
|
|
1910
1910
|
this._popover = show;
|
|
1911
|
-
|
|
1912
|
-
|
|
1911
|
+
console.log('show');
|
|
1912
|
+
console.log(show);
|
|
1913
|
+
try {
|
|
1914
|
+
if (show) {
|
|
1915
|
+
this.createPopover();
|
|
1916
|
+
}
|
|
1917
|
+
else if (this.overlayRef) {
|
|
1918
|
+
this.overlayRef.dispose();
|
|
1919
|
+
}
|
|
1913
1920
|
}
|
|
1914
|
-
|
|
1915
|
-
|
|
1921
|
+
catch (e) {
|
|
1922
|
+
console.log('e -> popover');
|
|
1923
|
+
console.log(e);
|
|
1916
1924
|
}
|
|
1917
1925
|
}
|
|
1918
1926
|
get target() {
|
|
@@ -1987,48 +1995,79 @@ class MonkeyEcxPopoverDirective {
|
|
|
1987
1995
|
return [];
|
|
1988
1996
|
}
|
|
1989
1997
|
createPopover(origin, options) {
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
.
|
|
1993
|
-
.
|
|
1994
|
-
.
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
1998
|
+
console.log('1');
|
|
1999
|
+
try {
|
|
2000
|
+
this.templatePortal = new TemplatePortal(this.tpl, this._viewContainerRef);
|
|
2001
|
+
console.log('2');
|
|
2002
|
+
this.positionStrategy = this.overlayPositionBuilder
|
|
2003
|
+
.flexibleConnectedTo(origin || this.target)
|
|
2004
|
+
.withPush(true)
|
|
2005
|
+
.withGrowAfterOpen(true)
|
|
2006
|
+
.withPositions(this.getDirPositions(options?.dir));
|
|
2007
|
+
console.log('3');
|
|
2008
|
+
let width = 0;
|
|
2009
|
+
if (this.options?.minwidth || this.minwidth) {
|
|
2010
|
+
width = this.target.offsetWidth - 2;
|
|
2011
|
+
}
|
|
2012
|
+
console.log('4');
|
|
2013
|
+
console.log('width');
|
|
2014
|
+
console.log(width);
|
|
2015
|
+
this.overlayRef = this.overlay.create({
|
|
2016
|
+
positionStrategy: this.positionStrategy,
|
|
2017
|
+
disposeOnNavigation: true,
|
|
2018
|
+
direction: 'ltr',
|
|
2019
|
+
hasBackdrop: this.backdrop,
|
|
2020
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition({}),
|
|
2021
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
2022
|
+
width,
|
|
2023
|
+
maxHeight: '95%',
|
|
2024
|
+
height: this.height
|
|
2016
2025
|
});
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
+
console.log('5');
|
|
2027
|
+
let resizeObserver;
|
|
2028
|
+
const subs = this.overlayRef.backdropClick().subscribe((e) => {
|
|
2029
|
+
this.popover = false;
|
|
2030
|
+
console.log('6');
|
|
2031
|
+
subs.unsubscribe();
|
|
2032
|
+
console.log('7');
|
|
2033
|
+
resizeObserver?.disconnect();
|
|
2034
|
+
console.log('8');
|
|
2035
|
+
this.zone.run(() => {
|
|
2036
|
+
console.log('9');
|
|
2037
|
+
if (this.closed) {
|
|
2038
|
+
console.log('10');
|
|
2039
|
+
this.closed(e);
|
|
2040
|
+
}
|
|
2041
|
+
});
|
|
2042
|
+
});
|
|
2043
|
+
console.log('11');
|
|
2044
|
+
const attached = this.overlayRef.attach(this.templatePortal);
|
|
2045
|
+
console.log('12');
|
|
2046
|
+
if (this.watch) {
|
|
2047
|
+
console.log('13');
|
|
2048
|
+
try {
|
|
2049
|
+
console.log('14');
|
|
2050
|
+
if ('ResizeObserver' in window) {
|
|
2051
|
+
console.log('16');
|
|
2052
|
+
resizeObserver = new ResizeObserver(([{ contentRect }]) => {
|
|
2053
|
+
console.log('17');
|
|
2054
|
+
this.overlayRef.updatePosition();
|
|
2055
|
+
})
|
|
2056
|
+
.observe(attached.rootNodes[0]);
|
|
2057
|
+
}
|
|
2026
2058
|
}
|
|
2059
|
+
catch (e) {
|
|
2060
|
+
// not to do
|
|
2061
|
+
}
|
|
2062
|
+
console.log('18');
|
|
2027
2063
|
}
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2064
|
+
console.log('19');
|
|
2065
|
+
}
|
|
2066
|
+
catch (e) {
|
|
2067
|
+
console.log('error no popover');
|
|
2068
|
+
console.log(e);
|
|
2031
2069
|
}
|
|
2070
|
+
console.log('20');
|
|
2032
2071
|
}
|
|
2033
2072
|
ngOnDestroy() {
|
|
2034
2073
|
this.popover = false;
|