@memberjunction/ng-container-directives 0.9.119 → 0.9.120
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.
|
@@ -2,6 +2,7 @@ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class FillContainer implements OnInit, OnDestroy {
|
|
4
4
|
private elementRef;
|
|
5
|
+
private static _instanceCount;
|
|
5
6
|
fillWidth: boolean;
|
|
6
7
|
fillHeight: boolean;
|
|
7
8
|
rightMargin: number;
|
|
@@ -17,6 +18,7 @@ export declare class FillContainer implements OnInit, OnDestroy {
|
|
|
17
18
|
resizeElement(): void;
|
|
18
19
|
protected shouldSkipResize(el: HTMLElement): boolean;
|
|
19
20
|
protected elementBelowHiddenTab(element: HTMLElement): boolean;
|
|
21
|
+
protected elementWithinGrid(element: HTMLElement): boolean;
|
|
20
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<FillContainer, never>;
|
|
21
23
|
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>;
|
|
22
24
|
}
|
|
@@ -15,6 +15,8 @@ export class FillContainer {
|
|
|
15
15
|
this._resizeEndDebounceTime = 500;
|
|
16
16
|
this.resizeImmediateSubscription = null;
|
|
17
17
|
this.resizeEndSubscription = null;
|
|
18
|
+
FillContainer._instanceCount++;
|
|
19
|
+
console.log('FillContainer instances: ' + FillContainer._instanceCount);
|
|
18
20
|
}
|
|
19
21
|
ngOnInit() {
|
|
20
22
|
const el = this.elementRef.nativeElement;
|
|
@@ -41,6 +43,8 @@ export class FillContainer {
|
|
|
41
43
|
var _a, _b;
|
|
42
44
|
(_a = this.resizeImmediateSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
43
45
|
(_b = this.resizeEndSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
|
|
46
|
+
FillContainer._instanceCount--;
|
|
47
|
+
console.log('FillContainer instances: ' + FillContainer._instanceCount);
|
|
44
48
|
}
|
|
45
49
|
getParent(element) {
|
|
46
50
|
const parent = element.parentElement;
|
|
@@ -105,11 +109,11 @@ export class FillContainer {
|
|
|
105
109
|
LogError(err);
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
|
-
// Function to check if element or its parents have the 'mjSkipResize' attribute
|
|
112
|
+
// Function to check if element or its parents have the 'mjSkipResize' attribute or if a parent is within a grid
|
|
109
113
|
shouldSkipResize(el) {
|
|
110
114
|
let cur = el;
|
|
111
115
|
while (cur) {
|
|
112
|
-
if (cur.hasAttribute('mjSkipResize')) {
|
|
116
|
+
if (cur.hasAttribute('mjSkipResize') || cur.role === 'grid') {
|
|
113
117
|
return true;
|
|
114
118
|
}
|
|
115
119
|
cur = cur.parentElement;
|
|
@@ -134,7 +138,21 @@ export class FillContainer {
|
|
|
134
138
|
// not below a tab at all
|
|
135
139
|
return false;
|
|
136
140
|
}
|
|
141
|
+
elementWithinGrid(element) {
|
|
142
|
+
// check if the element is within a kendo grid
|
|
143
|
+
let parent = element.parentElement;
|
|
144
|
+
while (parent) {
|
|
145
|
+
if (parent.role === 'grid') {
|
|
146
|
+
// element is below a grid
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
parent = parent.parentElement;
|
|
150
|
+
}
|
|
151
|
+
// not below a grid
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
137
154
|
}
|
|
155
|
+
FillContainer._instanceCount = 0;
|
|
138
156
|
FillContainer.ɵfac = function FillContainer_Factory(t) { return new (t || FillContainer)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
139
157
|
FillContainer.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: FillContainer, selectors: [["", "mjFillContainer", ""]], inputs: { fillWidth: "fillWidth", fillHeight: "fillHeight", rightMargin: "rightMargin", bottomMargin: "bottomMargin" } });
|
|
140
158
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FillContainer, [{
|
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.120",
|
|
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",
|