@trademe/ng-defer-load
Advanced tools
Comparing version 8.2.1 to 14.0.0
import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit } from '@angular/core'; | ||
import * as i0 from "@angular/core"; | ||
export declare class DeferLoadDirective implements OnInit, AfterViewInit, OnDestroy { | ||
@@ -7,11 +8,8 @@ private _element; | ||
preRender: boolean; | ||
fallbackEnabled: boolean; | ||
removeListenersAfterLoad: boolean; | ||
deferLoad: EventEmitter<any>; | ||
private _intersectionObserver?; | ||
private _scrollSubscription?; | ||
constructor(_element: ElementRef, _zone: NgZone, platformId: Object); | ||
ngOnInit(): void; | ||
ngAfterViewInit(): void; | ||
hasCompatibleBrowser(): boolean; | ||
ngOnDestroy(): void; | ||
@@ -22,7 +20,7 @@ private registerIntersectionObserver; | ||
private load; | ||
private addScrollListeners; | ||
private removeListeners; | ||
private onScroll; | ||
private isVisible; | ||
private getScrollPosition; | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DeferLoadDirective, never>; | ||
static ɵdir: i0.ɵɵDirectiveDeclaration<DeferLoadDirective, "[deferLoad]", never, { "preRender": "preRender"; "removeListenersAfterLoad": "removeListenersAfterLoad"; }, { "deferLoad": "deferLoad"; }, never, never, false>; | ||
} |
@@ -0,2 +1,8 @@ | ||
import * as i0 from "@angular/core"; | ||
import * as i1 from "./defer-load.directive"; | ||
import * as i2 from "@angular/common"; | ||
export declare class DeferLoadModule { | ||
static ɵfac: i0.ɵɵFactoryDeclaration<DeferLoadModule, never>; | ||
static ɵmod: i0.ɵɵNgModuleDeclaration<DeferLoadModule, [typeof i1.DeferLoadDirective], [typeof i2.CommonModule], [typeof i1.DeferLoadDirective]>; | ||
static ɵinj: i0.ɵɵInjectorDeclaration<DeferLoadModule>; | ||
} |
{ | ||
"$schema": "./node_modules/ng-packagr/package.schema.json", | ||
"name": "@trademe/ng-defer-load", | ||
"version": "8.2.1", | ||
"version": "14.0.0", | ||
"description": "Angular directive to load elements lazily", | ||
"main": "bundles/trademe-ng-defer-load.umd.js", | ||
"typings": "trademe-ng-defer-load.d.ts", | ||
"author": "Vamsi Vempati, Michael Zoellner", | ||
"main": "dist/index.js", | ||
"typings": "index.d.ts", | ||
"author": "Vamsi Vempati, Michael Zoellner, Nick Webster", | ||
"license": "MIT", | ||
@@ -23,32 +22,30 @@ "repository": { | ||
"dependencies": { | ||
"tslib": "^1.9.0" | ||
"tslib": "^2.3.0" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": ">=8.0.0", | ||
"@angular/core": ">=8.0.0", | ||
"@angular/platform-browser": ">=8.0.0", | ||
"rxjs": "^6.4.0", | ||
"zone.js": ">=0.9.1" | ||
"@angular/common": "^14.2.12", | ||
"@angular/core": "^14.2.12", | ||
"@angular/platform-browser": "^14.2.12", | ||
"rxjs": "~7.5.7", | ||
"zone.js": "~0.11.8" | ||
}, | ||
"devDependencies": { | ||
"@angular/common": "8.2.14", | ||
"@angular/compiler": "8.2.14", | ||
"@angular/compiler-cli": "8.2.14", | ||
"@angular/core": "8.2.14", | ||
"@angular/platform-browser": "8.2.14", | ||
"ng-packagr": "5.7.1", | ||
"rimraf": "^3.0.0", | ||
"rxjs": "^6.4.0", | ||
"tslint": "^5.20.0", | ||
"typescript": "~3.5.3", | ||
"zone.js": "~0.9.1" | ||
"module": "fesm2015/trademe-ng-defer-load.mjs", | ||
"es2020": "fesm2020/trademe-ng-defer-load.mjs", | ||
"esm2020": "esm2020/trademe-ng-defer-load.mjs", | ||
"fesm2020": "fesm2020/trademe-ng-defer-load.mjs", | ||
"fesm2015": "fesm2015/trademe-ng-defer-load.mjs", | ||
"exports": { | ||
"./package.json": { | ||
"default": "./package.json" | ||
}, | ||
".": { | ||
"types": "./index.d.ts", | ||
"esm2020": "./esm2020/trademe-ng-defer-load.mjs", | ||
"es2020": "./fesm2020/trademe-ng-defer-load.mjs", | ||
"es2015": "./fesm2015/trademe-ng-defer-load.mjs", | ||
"node": "./fesm2015/trademe-ng-defer-load.mjs", | ||
"default": "./fesm2020/trademe-ng-defer-load.mjs" | ||
} | ||
}, | ||
"module": "fesm5/trademe-ng-defer-load.js", | ||
"es2015": "fesm2015/trademe-ng-defer-load.js", | ||
"esm5": "esm5/trademe-ng-defer-load.js", | ||
"esm2015": "esm2015/trademe-ng-defer-load.js", | ||
"fesm5": "fesm5/trademe-ng-defer-load.js", | ||
"fesm2015": "fesm2015/trademe-ng-defer-load.js", | ||
"metadata": "trademe-ng-defer-load.metadata.json", | ||
"sideEffects": false | ||
} | ||
} |
@@ -45,19 +45,2 @@ # ng-defer-load | ||
## Fall back support | ||
`ng-defer-load` supports a fall back in browsers that do not support the IntersectionObserver API. This uses the scroll position and the element's offset. This is enabled by default. | ||
If you do not want to allow this fallback, and would prefer the browser to just render the element regardless, you can set `fallbackEnabled` to false on the element as below: | ||
```html | ||
<div | ||
[fallbackEnabled]="false" | ||
(deferLoad)="showMyElement=true"> | ||
<my-element | ||
*ngIf=showMyElement> | ||
... | ||
</my-element> | ||
</div> | ||
``` | ||
## Demo | ||
@@ -89,2 +72,24 @@ | ||
v8.2.1 - Fix for IE11 and older browsers | ||
v8.2.1 - Fix for IE11 and older browsers | ||
v8.2.2 - Updated dependencies due to security advisories | ||
v14.0.0 - Supports Angular 12+ (targeting Angular 14) with partial Ivy builds. Additionally, drops support for IE11. | ||
## Deprecated features | ||
### Fall back support (<14) | ||
`ng-defer-load` supports a fall back in browsers that do not support the IntersectionObserver API. This uses the scroll position and the element's offset. This is enabled by default. | ||
If you do not want to allow this fallback, and would prefer the browser to just render the element regardless, you can set `fallbackEnabled` to false on the element as below: | ||
```html | ||
<div | ||
[fallbackEnabled]="false" | ||
(deferLoad)="showMyElement=true"> | ||
<my-element | ||
*ngIf=showMyElement> | ||
... | ||
</my-element> | ||
</div> | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
0
1
94
55802
15
371
2
+ Added@angular/common@14.3.0(transitive)
+ Added@angular/core@14.3.0(transitive)
+ Added@angular/platform-browser@14.3.0(transitive)
+ Addedrxjs@7.5.7(transitive)
+ Addedzone.js@0.11.8(transitive)
- Removed@angular/common@19.0.0(transitive)
- Removed@angular/core@19.0.0(transitive)
- Removed@angular/platform-browser@19.0.0(transitive)
- Removedrxjs@6.6.7(transitive)
- Removedtslib@1.14.1(transitive)
- Removedzone.js@0.15.0(transitive)
Updatedtslib@^2.3.0