@memberjunction/ng-container-directives 0.9.115 → 0.9.117
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.
|
@@ -15,6 +15,7 @@ export declare class FillContainer implements OnInit, OnDestroy {
|
|
|
15
15
|
ngOnDestroy(): void;
|
|
16
16
|
getParent(element: HTMLElement): HTMLElement | null;
|
|
17
17
|
resizeElement(): void;
|
|
18
|
+
protected shouldSkipResize(el: HTMLElement): boolean;
|
|
18
19
|
protected elementBelowHiddenTab(element: HTMLElement): boolean;
|
|
19
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<FillContainer, never>;
|
|
20
21
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FillContainer, "[mjFillContainer]", never, { "fillWidth": { "alias": "fillWidth"; "required": false; }; "fillHeight": { "alias": "fillHeight"; "required": false; }; "rightMargin": { "alias": "rightMargin"; "required": false; }; "bottomMargin": { "alias": "bottomMargin"; "required": false; }; }, {}, never, never, false, never>;
|
|
@@ -68,7 +68,7 @@ export class FillContainer {
|
|
|
68
68
|
resizeElement() {
|
|
69
69
|
const element = this.elementRef.nativeElement;
|
|
70
70
|
try {
|
|
71
|
-
if (element && element.style) {
|
|
71
|
+
if (element && element.style && !this.shouldSkipResize(element)) {
|
|
72
72
|
const parent = this.getParent(element);
|
|
73
73
|
if (parent && !this.elementBelowHiddenTab(element)) {
|
|
74
74
|
let parentStyle = window.getComputedStyle(parent);
|
|
@@ -88,7 +88,6 @@ export class FillContainer {
|
|
|
88
88
|
const newWidth = Math.floor(parentRect.width - this.rightMargin - widthVariance);
|
|
89
89
|
if (Math.floor(elementRect.width) !== newWidth) {
|
|
90
90
|
element.style.width = newWidth + 'px';
|
|
91
|
-
//LogStatus('setting ' + element.nodeName + ' width to ' + newWidth + ' from ' + elementRect.width)
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
if (this.fillHeight) {
|
|
@@ -96,7 +95,6 @@ export class FillContainer {
|
|
|
96
95
|
const newHeight = Math.floor(parentRect.height - this.bottomMargin - heightVariance);
|
|
97
96
|
if (Math.floor(elementRect.height) !== newHeight) {
|
|
98
97
|
element.style.height = newHeight + 'px';
|
|
99
|
-
//LogStatus('setting ' + element.nodeName + ' height to ' + newHeight + ' from ' + elementRect.height)
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
}
|
|
@@ -107,6 +105,18 @@ export class FillContainer {
|
|
|
107
105
|
LogError(err);
|
|
108
106
|
}
|
|
109
107
|
}
|
|
108
|
+
// Function to check if element or its parents have the 'mjSkipResize' attribute
|
|
109
|
+
shouldSkipResize(el) {
|
|
110
|
+
let cur = el;
|
|
111
|
+
while (cur) {
|
|
112
|
+
if (cur.hasAttribute('mjSkipResize')) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
cur = cur.parentElement;
|
|
116
|
+
}
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
;
|
|
110
120
|
elementBelowHiddenTab(element) {
|
|
111
121
|
// check if the element is below a hidden tab, a hidden tab will have a class of .k-tabstrip-content and also have .k-active applied
|
|
112
122
|
// we can go all the way up the tree to look for this
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-container-directives",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.117",
|
|
4
4
|
"description": "MemberJunction: Angular Container Directives - Fill Container for Auto-Resizing, and plain container just for element identification/binding",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@angular/router": "^17.1.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@memberjunction/core": "^0.9.
|
|
33
|
-
"@memberjunction/global": "^0.9.
|
|
32
|
+
"@memberjunction/core": "^0.9.149",
|
|
33
|
+
"@memberjunction/global": "^0.9.136",
|
|
34
34
|
"tslib": "^2.3.0"
|
|
35
35
|
},
|
|
36
36
|
"sideEffects": false
|