@mintplayer/ng-bootstrap 21.5.1 → 21.6.0
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.
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, PLATFORM_ID, EventEmitter, Output, Directive } from '@angular/core';
|
|
3
|
+
import { isPlatformServer } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class BsInViewportDirective {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.elementRef = inject(ElementRef);
|
|
8
|
+
this.platformId = inject(PLATFORM_ID);
|
|
9
|
+
this.observer = null;
|
|
10
|
+
this.isDestroyed = false;
|
|
11
|
+
this.bsInViewport = new EventEmitter();
|
|
12
|
+
}
|
|
13
|
+
ngAfterViewInit() {
|
|
14
|
+
if (isPlatformServer(this.platformId)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
18
|
+
if (!this.isDestroyed) {
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
this.bsInViewport.emit(entry.isIntersecting);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.observer.observe(this.elementRef.nativeElement);
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.isDestroyed = true;
|
|
28
|
+
if (this.observer) {
|
|
29
|
+
this.observer.disconnect();
|
|
30
|
+
this.observer = null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsInViewportDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
34
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: BsInViewportDirective, isStandalone: true, selector: "[bsInViewport]", outputs: { bsInViewport: "bsInViewport" }, ngImport: i0 }); }
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsInViewportDirective, decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: '[bsInViewport]',
|
|
40
|
+
standalone: true,
|
|
41
|
+
}]
|
|
42
|
+
}], propDecorators: { bsInViewport: [{
|
|
43
|
+
type: Output
|
|
44
|
+
}] } });
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generated bundle index. Do not edit.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
export { BsInViewportDirective };
|
|
51
|
+
//# sourceMappingURL=mintplayer-ng-bootstrap-viewport.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-viewport.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/viewport/src/viewport/viewport.directive.ts","../../../../libs/mintplayer-ng-bootstrap/viewport/mintplayer-ng-bootstrap-viewport.ts"],"sourcesContent":["import { AfterViewInit, Directive, ElementRef, EventEmitter, inject, OnDestroy, Output, PLATFORM_ID } from '@angular/core';\nimport { isPlatformServer } from '@angular/common';\n\n@Directive({\n selector: '[bsInViewport]',\n standalone: true,\n})\nexport class BsInViewportDirective implements AfterViewInit, OnDestroy {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platformId = inject(PLATFORM_ID);\n private observer: IntersectionObserver | null = null;\n private isDestroyed = false;\n\n @Output() bsInViewport = new EventEmitter<boolean>();\n\n ngAfterViewInit() {\n if (isPlatformServer(this.platformId)) {\n return;\n }\n\n this.observer = new IntersectionObserver((entries) => {\n if (!this.isDestroyed) {\n for (const entry of entries) {\n this.bsInViewport.emit(entry.isIntersecting);\n }\n }\n });\n\n this.observer.observe(this.elementRef.nativeElement);\n }\n\n ngOnDestroy() {\n this.isDestroyed = true;\n if (this.observer) {\n this.observer.disconnect();\n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OAAA,EAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;sBAOE;;;ACbH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/ng-bootstrap",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "21.
|
|
4
|
+
"version": "21.6.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/MintPlayer/mintplayer-ng-bootstrap",
|
|
@@ -340,6 +340,10 @@
|
|
|
340
340
|
"types": "./types/mintplayer-ng-bootstrap-user-agent.d.ts",
|
|
341
341
|
"default": "./fesm2022/mintplayer-ng-bootstrap-user-agent.mjs"
|
|
342
342
|
},
|
|
343
|
+
"./viewport": {
|
|
344
|
+
"types": "./types/mintplayer-ng-bootstrap-viewport.d.ts",
|
|
345
|
+
"default": "./fesm2022/mintplayer-ng-bootstrap-viewport.mjs"
|
|
346
|
+
},
|
|
343
347
|
"./word-count": {
|
|
344
348
|
"types": "./types/mintplayer-ng-bootstrap-word-count.d.ts",
|
|
345
349
|
"default": "./fesm2022/mintplayer-ng-bootstrap-word-count.mjs"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, EventEmitter } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class BsInViewportDirective implements AfterViewInit, OnDestroy {
|
|
5
|
+
private readonly elementRef;
|
|
6
|
+
private readonly platformId;
|
|
7
|
+
private observer;
|
|
8
|
+
private isDestroyed;
|
|
9
|
+
bsInViewport: EventEmitter<boolean>;
|
|
10
|
+
ngAfterViewInit(): void;
|
|
11
|
+
ngOnDestroy(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BsInViewportDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BsInViewportDirective, "[bsInViewport]", never, {}, { "bsInViewport": "bsInViewport"; }, never, never, true, never>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { BsInViewportDirective };
|