ngx-masonry
Advanced tools
Comparing version 10.0.1 to 10.0.2
@@ -482,5 +482,8 @@ (function (global, factory) { | ||
if (images.length === 0) { | ||
this.parent.add(this); | ||
setTimeout(function () { | ||
_this.parent.add(_this); | ||
}); | ||
} | ||
else { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '-1'); | ||
var _loop_1 = function (imageRef) { | ||
@@ -519,2 +522,3 @@ this_1.renderer.listen(imageRef, 'load', function (_) { | ||
if (this.images.size === 0) { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '0'); | ||
this.parent.add(this); | ||
@@ -521,0 +525,0 @@ } |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/animations")):"function"==typeof define&&define.amd?define("ngx-masonry",["exports","@angular/core","@angular/common","@angular/animations"],e):e((t=t||self)["ngx-masonry"]={},t.ng.core,t.ng.common,t.ng.animations)}(this,(function(t,e,n,o){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */Object.create;function i(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}var a;Object.create;var s=function(){function t(t,n){this.platformId=t,this._element=n,this.updateLayout=!1,this.ordered=!1,this.layoutComplete=new e.EventEmitter,this.removeComplete=new e.EventEmitter,this.itemsLoaded=new e.EventEmitter,this.pendingItems=[]}return t.prototype.ngOnInit=function(){var t=this;n.isPlatformBrowser(this.platformId)&&void 0===a&&(a=require("masonry-layout")),this.options||(this.options={}),this.options.itemSelector||(this.options.itemSelector="[ngxMasonryItem], ngxMasonryItem"),this.options.transitionDuration="0s",n.isPlatformBrowser(this.platformId)&&(this.masonryInstance=new a(this._element.nativeElement,this.options),this.masonryInstance.on("layoutComplete",(function(e){t.layoutComplete.emit(e)})),this.masonryInstance.on("removeComplete",(function(e){t.removeComplete.emit(e)})))},t.prototype.ngOnChanges=function(t){t.updateLayout&&(t.updateLayout.firstChange||this.layout())},t.prototype.ngOnDestroy=function(){this.masonryInstance&&this.masonryInstance.destroy()},t.prototype.layout=function(){var t=this;setTimeout((function(){t.masonryInstance.layout()}))},t.prototype.reloadItems=function(){var t=this;setTimeout((function(){t.masonryInstance.reloadItems()}))},t.prototype.addPendingItem=function(t){this.pendingItems.push(t)},t.prototype.add=function(t){var e,n;if(this.ordered)try{for(var o=i(this.pendingItems.entries()),a=o.next();!a.done;a=o.next()){var s=r(a.value,2),m=s[0],p=s[1];if(p){if(0!==p.images.size)return;this.pendingItems[m]=void 0,this.itemLoaded(p),m+1===this.pendingItems.length&&(this.itemsLoaded.emit(this.pendingItems.length),this.pendingItems=[])}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}else this.itemLoaded(t)},t.prototype.itemLoaded=function(t){t.prepend?this.masonryInstance.prepended(t.element.nativeElement):this.masonryInstance.appended(t.element.nativeElement),1===this.masonryInstance.items.length&&this.masonryInstance.layout(),t.playAnimation(!0)},t.prototype.remove=function(t){this.masonryInstance.remove(t),this.layout()},t}();s.decorators=[{type:e.Component,args:[{selector:"[ngx-masonry], ngx-masonry",template:"<ng-content></ng-content>",styles:["\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t"]}]}],s.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:e.ElementRef}]},s.propDecorators={options:[{type:e.Input}],updateLayout:[{type:e.Input}],ordered:[{type:e.Input}],layoutComplete:[{type:e.Output}],removeComplete:[{type:e.Output}],itemsLoaded:[{type:e.Output}]};var m=function(){function t(t,e,n,i){this.element=t,this.builder=e,this.parent=n,this.renderer=i,this.prepend=!1,this.animations={show:[o.style({opacity:0}),o.animate("400ms ease-in",o.style({opacity:1}))],hide:[o.style({opacity:"*"}),o.animate("400ms ease-in",o.style({opacity:0}))]}}return t.prototype.ngOnInit=function(){void 0!==this.parent.options.animations&&(this.animations=this.parent.options.animations),this.parent.addPendingItem(this)},t.prototype.ngAfterViewInit=function(){var t,e,n=this,o=this.element.nativeElement.getElementsByTagName("img");if(this.renderer.setStyle(this.element.nativeElement,"opacity","0"),this.images=new Set(o),0===o.length)this.parent.add(this);else{var r=function(t){a.renderer.listen(t,"load",(function(e){n.imageLoaded(t)})),a.renderer.listen(t,"error",(function(e){n.imageLoaded(t)}))},a=this;try{for(var s=i(o),m=s.next();!m.done;m=s.next()){r(m.value)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}},t.prototype.ngOnDestroy=function(){0===this.images.size&&this.element.nativeElement.parentNode&&(this.playAnimation(!1),this.parent.remove(this.element.nativeElement))},t.prototype.imageLoaded=function(t){this.images.delete(t),0===this.images.size&&this.parent.add(this)},t.prototype.playAnimation=function(t){var e=t?this.animations.show:this.animations.hide;e&&this.builder.build(e).create(this.element.nativeElement).play()},t}();m.decorators=[{type:e.Directive,args:[{selector:"[ngxMasonryItem], ngxMasonryItem"}]}],m.ctorParameters=function(){return[{type:e.ElementRef},{type:o.AnimationBuilder},{type:s,decorators:[{type:e.Inject,args:[e.forwardRef((function(){return s}))]}]},{type:e.Renderer2}]},m.propDecorators={prepend:[{type:e.Input}]};var p=function(){};p.decorators=[{type:e.NgModule,args:[{imports:[],declarations:[s,m],exports:[s,m]}]}],t.NgxMasonryComponent=s,t.NgxMasonryDirective=m,t.NgxMasonryModule=p,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */Object.create;function i(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return a}var a;Object.create;var s=function(){function t(t,n){this.platformId=t,this._element=n,this.updateLayout=!1,this.ordered=!1,this.layoutComplete=new e.EventEmitter,this.removeComplete=new e.EventEmitter,this.itemsLoaded=new e.EventEmitter,this.pendingItems=[]}return t.prototype.ngOnInit=function(){var t=this;n.isPlatformBrowser(this.platformId)&&void 0===a&&(a=require("masonry-layout")),this.options||(this.options={}),this.options.itemSelector||(this.options.itemSelector="[ngxMasonryItem], ngxMasonryItem"),this.options.transitionDuration="0s",n.isPlatformBrowser(this.platformId)&&(this.masonryInstance=new a(this._element.nativeElement,this.options),this.masonryInstance.on("layoutComplete",(function(e){t.layoutComplete.emit(e)})),this.masonryInstance.on("removeComplete",(function(e){t.removeComplete.emit(e)})))},t.prototype.ngOnChanges=function(t){t.updateLayout&&(t.updateLayout.firstChange||this.layout())},t.prototype.ngOnDestroy=function(){this.masonryInstance&&this.masonryInstance.destroy()},t.prototype.layout=function(){var t=this;setTimeout((function(){t.masonryInstance.layout()}))},t.prototype.reloadItems=function(){var t=this;setTimeout((function(){t.masonryInstance.reloadItems()}))},t.prototype.addPendingItem=function(t){this.pendingItems.push(t)},t.prototype.add=function(t){var e,n;if(this.ordered)try{for(var o=i(this.pendingItems.entries()),a=o.next();!a.done;a=o.next()){var s=r(a.value,2),m=s[0],p=s[1];if(p){if(0!==p.images.size)return;this.pendingItems[m]=void 0,this.itemLoaded(p),m+1===this.pendingItems.length&&(this.itemsLoaded.emit(this.pendingItems.length),this.pendingItems=[])}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}else this.itemLoaded(t)},t.prototype.itemLoaded=function(t){t.prepend?this.masonryInstance.prepended(t.element.nativeElement):this.masonryInstance.appended(t.element.nativeElement),1===this.masonryInstance.items.length&&this.masonryInstance.layout(),t.playAnimation(!0)},t.prototype.remove=function(t){this.masonryInstance.remove(t),this.layout()},t}();s.decorators=[{type:e.Component,args:[{selector:"[ngx-masonry], ngx-masonry",template:"<ng-content></ng-content>",styles:["\n\t\t:host {\n\t\t\tdisplay: block;\n\t\t}\n\t"]}]}],s.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:e.ElementRef}]},s.propDecorators={options:[{type:e.Input}],updateLayout:[{type:e.Input}],ordered:[{type:e.Input}],layoutComplete:[{type:e.Output}],removeComplete:[{type:e.Output}],itemsLoaded:[{type:e.Output}]};var m=function(){function t(t,e,n,i){this.element=t,this.builder=e,this.parent=n,this.renderer=i,this.prepend=!1,this.animations={show:[o.style({opacity:0}),o.animate("400ms ease-in",o.style({opacity:1}))],hide:[o.style({opacity:"*"}),o.animate("400ms ease-in",o.style({opacity:0}))]}}return t.prototype.ngOnInit=function(){void 0!==this.parent.options.animations&&(this.animations=this.parent.options.animations),this.parent.addPendingItem(this)},t.prototype.ngAfterViewInit=function(){var t,e,n=this,o=this.element.nativeElement.getElementsByTagName("img");if(this.renderer.setStyle(this.element.nativeElement,"opacity","0"),this.images=new Set(o),0===o.length)setTimeout((function(){n.parent.add(n)}));else{this.renderer.setStyle(this.element.nativeElement,"z-index","-1");var r=function(t){a.renderer.listen(t,"load",(function(e){n.imageLoaded(t)})),a.renderer.listen(t,"error",(function(e){n.imageLoaded(t)}))},a=this;try{for(var s=i(o),m=s.next();!m.done;m=s.next()){r(m.value)}}catch(e){t={error:e}}finally{try{m&&!m.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}}},t.prototype.ngOnDestroy=function(){0===this.images.size&&this.element.nativeElement.parentNode&&(this.playAnimation(!1),this.parent.remove(this.element.nativeElement))},t.prototype.imageLoaded=function(t){this.images.delete(t),0===this.images.size&&(this.renderer.setStyle(this.element.nativeElement,"z-index","0"),this.parent.add(this))},t.prototype.playAnimation=function(t){var e=t?this.animations.show:this.animations.hide;e&&this.builder.build(e).create(this.element.nativeElement).play()},t}();m.decorators=[{type:e.Directive,args:[{selector:"[ngxMasonryItem], ngxMasonryItem"}]}],m.ctorParameters=function(){return[{type:e.ElementRef},{type:o.AnimationBuilder},{type:s,decorators:[{type:e.Inject,args:[e.forwardRef((function(){return s}))]}]},{type:e.Renderer2}]},m.propDecorators={prepend:[{type:e.Input}]};var p=function(){};p.decorators=[{type:e.NgModule,args:[{imports:[],declarations:[s,m],exports:[s,m]}]}],t.NgxMasonryComponent=s,t.NgxMasonryDirective=m,t.NgxMasonryModule=p,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-masonry.umd.min.js.map |
# Change log | ||
## 10.0.2 | ||
- delay the event when there is no image | ||
- set z-index to -1 when item is not loaded | ||
## 10.0.1 | ||
@@ -4,0 +9,0 @@ |
@@ -33,5 +33,8 @@ import { Directive, Inject, ElementRef, forwardRef, Renderer2, Input } from '@angular/core'; | ||
if (images.length === 0) { | ||
this.parent.add(this); | ||
setTimeout(() => { | ||
this.parent.add(this); | ||
}); | ||
} | ||
else { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '-1'); | ||
for (const imageRef of images) { | ||
@@ -56,2 +59,3 @@ this.renderer.listen(imageRef, 'load', _ => { | ||
if (this.images.size === 0) { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '0'); | ||
this.parent.add(this); | ||
@@ -82,2 +86,2 @@ } | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJm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N0IG1ldGFkYXRhID0gc2hvdyA/IHRoaXMuYW5pbWF0aW9ucy5zaG93IDogdGhpcy5hbmltYXRpb25zLmhpZGU7XG4gICAgaWYgKG1ldGFkYXRhKSB7XG4gICAgICBjb25zdCBwbGF5ZXIgPSB0aGlzLmJ1aWxkZXIuYnVpbGQobWV0YWRhdGEpLmNyZWF0ZSh0aGlzLmVsZW1lbnQubmF0aXZlRWxlbWVudCk7XG4gICAgICBwbGF5ZXIucGxheSgpO1xuICAgIH1cbiAgfVxufVxuIl19 |
@@ -166,5 +166,8 @@ import { EventEmitter, Component, Inject, PLATFORM_ID, ElementRef, Input, Output, Directive, forwardRef, Renderer2, NgModule } from '@angular/core'; | ||
if (images.length === 0) { | ||
this.parent.add(this); | ||
setTimeout(() => { | ||
this.parent.add(this); | ||
}); | ||
} | ||
else { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '-1'); | ||
for (const imageRef of images) { | ||
@@ -189,2 +192,3 @@ this.renderer.listen(imageRef, 'load', _ => { | ||
if (this.images.size === 0) { | ||
this.renderer.setStyle(this.element.nativeElement, 'z-index', '0'); | ||
this.parent.add(this); | ||
@@ -191,0 +195,0 @@ } |
{ | ||
"name": "ngx-masonry", | ||
"version": "10.0.1", | ||
"version": "10.0.2", | ||
"description": "Angular Module for displaying a feed of items in a masonry layout using https://github.com/desandro/masonry", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
159516
1143