ngx-stickybits
Advanced tools
Comparing version 0.1.1 to 8.0.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('stickybits'), require('@angular/common'), require('@angular/core')) : | ||
typeof define === 'function' && define.amd ? define('ngx-stickybits', ['exports', 'stickybits', '@angular/common', '@angular/core'], factory) : | ||
(factory((global['ngx-stickybits'] = {}),global.stickybits,global.ng.common,global.ng.core)); | ||
}(this, (function (exports,stickybits,common,core) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('stickybits'), require('@angular/common')) : | ||
typeof define === 'function' && define.amd ? define('ngx-stickybits', ['exports', '@angular/core', 'stickybits', '@angular/common'], factory) : | ||
(global = global || self, factory(global['ngx-stickybits'] = {}, global.ng.core, global.stickybits, global.ng.common)); | ||
}(this, function (exports, core, stickybits, common) { 'use strict'; | ||
@@ -34,5 +34,5 @@ stickybits = stickybits && stickybits.hasOwnProperty('default') ? stickybits['default'] : stickybits; | ||
*/ | ||
function () { | ||
this.init(); | ||
}; | ||
function () { | ||
this.init(); | ||
}; | ||
/** | ||
@@ -46,8 +46,8 @@ * @param {?} changes | ||
*/ | ||
function (changes) { | ||
if (this.instance) { | ||
this.destroy(); | ||
this.init(); | ||
} | ||
}; | ||
function (changes) { | ||
if (this.instance) { | ||
this.destroy(); | ||
this.init(); | ||
} | ||
}; | ||
/** | ||
@@ -59,5 +59,5 @@ * @return {?} | ||
*/ | ||
function () { | ||
this.destroy(); | ||
}; | ||
function () { | ||
this.destroy(); | ||
}; | ||
/** | ||
@@ -71,13 +71,14 @@ * @private | ||
*/ | ||
function () { | ||
var _this = this; | ||
/** @type {?} */ | ||
var element = (/** @type {?} */ (this.elementRef.nativeElement)); | ||
this.zone.runOutsideAngular((/** | ||
* @return {?} | ||
*/ | ||
function () { | ||
var _this = this; | ||
/** @type {?} */ | ||
var element = ( /** @type {?} */(this.elementRef.nativeElement)); | ||
this.zone.runOutsideAngular(( /** | ||
* @return {?} | ||
*/function () { | ||
_this.instance = _this.initStickybits(element); | ||
_this.cssClassObserver = _this.initClassObserver(element); | ||
})); | ||
}; | ||
_this.instance = _this.initStickybits(element); | ||
_this.cssClassObserver = _this.initClassObserver(element); | ||
})); | ||
}; | ||
/** | ||
@@ -93,18 +94,18 @@ * @private | ||
*/ | ||
function (element) { | ||
return stickybits(element, { | ||
customStickyChangeNumber: this.stickyChangeNumber, | ||
noStyles: this.noStyles, | ||
stickyBitStickyOffset: this.stickyOffset, | ||
scrollEl: this.scrollEl, | ||
parentClass: this.parentClass, | ||
stickyClass: this.stickyClass, | ||
stuckClass: this.stuckClass, | ||
stickyChangeClass: this.stickyChangeClass, | ||
useStickyClasses: this.useStickyClasses, | ||
useFixed: this.useFixed, | ||
useGetBoundingClientRect: this.useGetBoundingClientRect, | ||
verticalPosition: this.verticalPosition, | ||
}); | ||
}; | ||
function (element) { | ||
return stickybits(element, { | ||
customStickyChangeNumber: this.stickyChangeNumber, | ||
noStyles: this.noStyles, | ||
stickyBitStickyOffset: this.stickyOffset, | ||
scrollEl: this.scrollEl, | ||
parentClass: this.parentClass, | ||
stickyClass: this.stickyClass, | ||
stuckClass: this.stuckClass, | ||
stickyChangeClass: this.stickyChangeClass, | ||
useStickyClasses: this.useStickyClasses, | ||
useFixed: this.useFixed, | ||
useGetBoundingClientRect: this.useGetBoundingClientRect, | ||
verticalPosition: this.verticalPosition, | ||
}); | ||
}; | ||
/** | ||
@@ -120,45 +121,48 @@ * @private | ||
*/ | ||
function (element) { | ||
var _this = this; | ||
/** @type {?} */ | ||
var observer = new MutationObserver(( /** | ||
* @param {?} mutations | ||
* @return {?} | ||
*/function (mutations) { | ||
mutations | ||
.filter(( /** | ||
function (element) { | ||
var _this = this; | ||
/** @type {?} */ | ||
var observer = new MutationObserver((/** | ||
* @param {?} mutations | ||
* @return {?} | ||
*/ | ||
function (mutations) { | ||
mutations | ||
.filter((/** | ||
* @param {?} mutation | ||
* @return {?} | ||
*/function (mutation) { return mutation.oldValue !== element.classList.value; })) | ||
.forEach(( /** | ||
*/ | ||
function (mutation) { return mutation.oldValue !== element.classList.value; })) | ||
.forEach((/** | ||
* @return {?} | ||
*/function () { | ||
/** @type {?} */ | ||
var shouldDetectChanges = false; | ||
/** @type {?} */ | ||
var hasStickyClass = element.classList.contains(_this.stickyClass); | ||
if (hasStickyClass !== _this.isSticky) { | ||
_this.isSticky = hasStickyClass; | ||
_this.sticky.emit(_this.isSticky); | ||
shouldDetectChanges = true; | ||
} | ||
/** @type {?} */ | ||
var hasStuckClass = element.classList.contains(_this.stuckClass); | ||
if (hasStuckClass !== _this.isStuck) { | ||
_this.isStuck = hasStuckClass; | ||
_this.stuck.emit(_this.isStuck); | ||
shouldDetectChanges = true; | ||
} | ||
if (shouldDetectChanges) { | ||
_this.changeDetectorRef.detectChanges(); | ||
} | ||
})); | ||
*/ | ||
function () { | ||
/** @type {?} */ | ||
var shouldDetectChanges = false; | ||
/** @type {?} */ | ||
var hasStickyClass = element.classList.contains(_this.stickyClass); | ||
if (hasStickyClass !== _this.isSticky) { | ||
_this.isSticky = hasStickyClass; | ||
_this.sticky.emit(_this.isSticky); | ||
shouldDetectChanges = true; | ||
} | ||
/** @type {?} */ | ||
var hasStuckClass = element.classList.contains(_this.stuckClass); | ||
if (hasStuckClass !== _this.isStuck) { | ||
_this.isStuck = hasStuckClass; | ||
_this.stuck.emit(_this.isStuck); | ||
shouldDetectChanges = true; | ||
} | ||
if (shouldDetectChanges) { | ||
_this.changeDetectorRef.detectChanges(); | ||
} | ||
})); | ||
observer.observe(element, { | ||
attributes: true, | ||
attributeOldValue: true, | ||
attributeFilter: ['class'], | ||
}); | ||
return observer; | ||
}; | ||
})); | ||
observer.observe(element, { | ||
attributes: true, | ||
attributeOldValue: true, | ||
attributeFilter: ['class'], | ||
}); | ||
return observer; | ||
}; | ||
/** | ||
@@ -172,8 +176,8 @@ * @private | ||
*/ | ||
function () { | ||
this.instance.cleanup(); | ||
this.instance = null; | ||
this.cssClassObserver.disconnect(); | ||
this.cssClassObserver = null; | ||
}; | ||
function () { | ||
this.instance.cleanup(); | ||
this.instance = null; | ||
this.cssClassObserver.disconnect(); | ||
this.cssClassObserver = null; | ||
}; | ||
StickybitsDirective.decorators = [ | ||
@@ -185,9 +189,7 @@ { type: core.Directive, args: [{ | ||
/** @nocollapse */ | ||
StickybitsDirective.ctorParameters = function () { | ||
return [ | ||
{ type: core.ChangeDetectorRef }, | ||
{ type: core.ElementRef }, | ||
{ type: core.NgZone } | ||
]; | ||
}; | ||
StickybitsDirective.ctorParameters = function () { return [ | ||
{ type: core.ChangeDetectorRef }, | ||
{ type: core.ElementRef }, | ||
{ type: core.NgZone } | ||
]; }; | ||
StickybitsDirective.propDecorators = { | ||
@@ -231,17 +233,2 @@ noStyles: [{ type: core.Input }], | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
exports.StickybitsDirective = StickybitsDirective; | ||
@@ -252,4 +239,3 @@ exports.StickybitsModule = StickybitsModule; | ||
}))); | ||
//# sourceMappingURL=ngx-stickybits.umd.js.map | ||
})); | ||
//# sourceMappingURL=ngx-stickybits.umd.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("stickybits"),require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("ngx-stickybits",["exports","stickybits","@angular/common","@angular/core"],s):s(t["ngx-stickybits"]={},t.stickybits,t.ng.common,t.ng.core)}(this,function(t,s,e,i){"use strict";s=s&&s.hasOwnProperty("default")?s["default"]:s;var n=function(){function t(t,s,e){this.changeDetectorRef=t,this.elementRef=s,this.zone=e,this.isSticky=!1,this.isStuck=!1,this.parentClass="sticky-parent",this.stickyChangeClass="sticky--change",this.stickyClass="sticky",this.stuckClass="stucky",this.useStickyClasses=!0,this.sticky=new i.EventEmitter,this.stuck=new i.EventEmitter}return t.prototype.ngAfterContentInit=function(){this.init()},t.prototype.ngOnChanges=function(t){this.instance&&(this.destroy(),this.init())},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.init=function(){var t=this,s=this.elementRef.nativeElement;this.zone.runOutsideAngular(function(){t.instance=t.initStickybits(s),t.cssClassObserver=t.initClassObserver(s)})},t.prototype.initStickybits=function(t){return s(t,{customStickyChangeNumber:this.stickyChangeNumber,noStyles:this.noStyles,stickyBitStickyOffset:this.stickyOffset,scrollEl:this.scrollEl,parentClass:this.parentClass,stickyClass:this.stickyClass,stuckClass:this.stuckClass,stickyChangeClass:this.stickyChangeClass,useStickyClasses:this.useStickyClasses,useFixed:this.useFixed,useGetBoundingClientRect:this.useGetBoundingClientRect,verticalPosition:this.verticalPosition})},t.prototype.initClassObserver=function(i){var n=this,t=new MutationObserver(function(t){t.filter(function(t){return t.oldValue!==i.classList.value}).forEach(function(){var t=!1,s=i.classList.contains(n.stickyClass);s!==n.isSticky&&(n.isSticky=s,n.sticky.emit(n.isSticky),t=!0);var e=i.classList.contains(n.stuckClass);e!==n.isStuck&&(n.isStuck=e,n.stuck.emit(n.isStuck),t=!0),t&&n.changeDetectorRef.detectChanges()})});return t.observe(i,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),t},t.prototype.destroy=function(){this.instance.cleanup(),this.instance=null,this.cssClassObserver.disconnect(),this.cssClassObserver=null},t.decorators=[{type:i.Directive,args:[{selector:"[stickybits]"}]}],t.ctorParameters=function(){return[{type:i.ChangeDetectorRef},{type:i.ElementRef},{type:i.NgZone}]},t.propDecorators={noStyles:[{type:i.Input}],scrollEl:[{type:i.Input}],parentClass:[{type:i.Input}],stickyChangeClass:[{type:i.Input}],stickyChangeNumber:[{type:i.Input}],stickyClass:[{type:i.Input}],stickyOffset:[{type:i.Input}],stuckClass:[{type:i.Input}],useFixed:[{type:i.Input}],useGetBoundingClientRect:[{type:i.Input}],useStickyClasses:[{type:i.Input}],verticalPosition:[{type:i.Input}],sticky:[{type:i.Output}],stuck:[{type:i.Output}]},t}(),c=function(){function t(){}return t.decorators=[{type:i.NgModule,args:[{imports:[e.CommonModule],exports:[n],declarations:[n]}]}],t}();t.StickybitsDirective=n,t.StickybitsModule=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@angular/core"),require("stickybits"),require("@angular/common")):"function"==typeof define&&define.amd?define("ngx-stickybits",["exports","@angular/core","stickybits","@angular/common"],s):s((t=t||self)["ngx-stickybits"]={},t.ng.core,t.stickybits,t.ng.common)}(this,function(t,s,e,i){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;var n=function(){function t(t,e,i){this.changeDetectorRef=t,this.elementRef=e,this.zone=i,this.isSticky=!1,this.isStuck=!1,this.parentClass="sticky-parent",this.stickyChangeClass="sticky--change",this.stickyClass="sticky",this.stuckClass="stucky",this.useStickyClasses=!0,this.sticky=new s.EventEmitter,this.stuck=new s.EventEmitter}return t.prototype.ngAfterContentInit=function(){this.init()},t.prototype.ngOnChanges=function(t){this.instance&&(this.destroy(),this.init())},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.init=function(){var t=this,s=this.elementRef.nativeElement;this.zone.runOutsideAngular(function(){t.instance=t.initStickybits(s),t.cssClassObserver=t.initClassObserver(s)})},t.prototype.initStickybits=function(t){return e(t,{customStickyChangeNumber:this.stickyChangeNumber,noStyles:this.noStyles,stickyBitStickyOffset:this.stickyOffset,scrollEl:this.scrollEl,parentClass:this.parentClass,stickyClass:this.stickyClass,stuckClass:this.stuckClass,stickyChangeClass:this.stickyChangeClass,useStickyClasses:this.useStickyClasses,useFixed:this.useFixed,useGetBoundingClientRect:this.useGetBoundingClientRect,verticalPosition:this.verticalPosition})},t.prototype.initClassObserver=function(t){var s=this,e=new MutationObserver(function(e){e.filter(function(s){return s.oldValue!==t.classList.value}).forEach(function(){var e=!1,i=t.classList.contains(s.stickyClass);i!==s.isSticky&&(s.isSticky=i,s.sticky.emit(s.isSticky),e=!0);var n=t.classList.contains(s.stuckClass);n!==s.isStuck&&(s.isStuck=n,s.stuck.emit(s.isStuck),e=!0),e&&s.changeDetectorRef.detectChanges()})});return e.observe(t,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),e},t.prototype.destroy=function(){this.instance.cleanup(),this.instance=null,this.cssClassObserver.disconnect(),this.cssClassObserver=null},t.decorators=[{type:s.Directive,args:[{selector:"[stickybits]"}]}],t.ctorParameters=function(){return[{type:s.ChangeDetectorRef},{type:s.ElementRef},{type:s.NgZone}]},t.propDecorators={noStyles:[{type:s.Input}],scrollEl:[{type:s.Input}],parentClass:[{type:s.Input}],stickyChangeClass:[{type:s.Input}],stickyChangeNumber:[{type:s.Input}],stickyClass:[{type:s.Input}],stickyOffset:[{type:s.Input}],stuckClass:[{type:s.Input}],useFixed:[{type:s.Input}],useGetBoundingClientRect:[{type:s.Input}],useStickyClasses:[{type:s.Input}],verticalPosition:[{type:s.Input}],sticky:[{type:s.Output}],stuck:[{type:s.Output}]},t}(),c=function(){function t(){}return t.decorators=[{type:s.NgModule,args:[{imports:[i.CommonModule],exports:[n],declarations:[n]}]}],t}();t.StickybitsDirective=n,t.StickybitsModule=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-stickybits.umd.min.js.map |
@@ -0,4 +1,4 @@ | ||
import { EventEmitter, Directive, ChangeDetectorRef, ElementRef, NgZone, Input, Output, NgModule } from '@angular/core'; | ||
import stickybits from 'stickybits'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Input, NgZone, Output, NgModule } from '@angular/core'; | ||
@@ -192,19 +192,3 @@ /** | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
export { StickybitsDirective, StickybitsModule }; | ||
//# sourceMappingURL=ngx-stickybits.js.map | ||
//# sourceMappingURL=ngx-stickybits.js.map |
@@ -0,4 +1,4 @@ | ||
import { Directive, ChangeDetectorRef, ElementRef, NgZone, Input, Output, EventEmitter, NgModule } from '@angular/core'; | ||
import stickybits from 'stickybits'; | ||
import { CommonModule } from '@angular/common'; | ||
import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Input, NgZone, Output, NgModule } from '@angular/core'; | ||
@@ -221,19 +221,3 @@ /** | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc | ||
*/ | ||
export { StickybitsDirective, StickybitsModule }; | ||
//# sourceMappingURL=ngx-stickybits.js.map | ||
//# sourceMappingURL=ngx-stickybits.js.map |
{ | ||
"name": "ngx-stickybits", | ||
"version": "0.1.1", | ||
"version": "8.0.0", | ||
"description": "Angular sticky directive using Stickybits, a lightweight alternative to `position: sticky` polyfills", | ||
@@ -18,12 +18,12 @@ "homepage": "https://github.com/jfcere/ngx-stickybits", | ||
"ngx", | ||
"stickybits", | ||
"sticky" | ||
"sticky", | ||
"stickybits" | ||
], | ||
"dependencies": { | ||
"stickybits": "^3.6.4", | ||
"stickybits": "^3.6.6", | ||
"tslib": "^1.9.0" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": "^6.0.0 || ^7.0.0", | ||
"@angular/core": "^6.0.0 || ^7.0.0" | ||
"@angular/common": "^7.0.0 || ^8.0.0", | ||
"@angular/core": "^7.0.0 || ^8.0.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "main": "bundles/ngx-stickybits.umd.js", |
# ngx-stickybits | ||
[![version](https://img.shields.io/npm/v/ngx-stickybits.svg?style=flat)](https://www.npmjs.com/package/ngx-stickybits) [![npm](https://img.shields.io/npm/l/ngx-stickybits.svg)](https://opensource.org/licenses/MIT) [![dependencies Status](https://david-dm.org/jfcere/ngx-stickybits/status.svg?path=lib)](https://david-dm.org/jfcere/ngx-stickybits?path=lib) [![peerDependencies Status](https://david-dm.org/jfcere/ngx-stickybits/peer-status.svg?path=lib)](https://david-dm.org/jfcere/ngx-stickybits?path=lib&type=peer) [![downloads](https://img.shields.io/npm/dt/ngx-stickybits.svg)](https://www.npmjs.com/package/ngx-stickybits) | ||
[![CircleCI](https://circleci.com/gh/jfcere/ngx-stickybits/tree/master.svg?style=shield)](https://circleci.com/gh/jfcere/ngx-stickybits/tree/master) [![version](https://img.shields.io/npm/v/ngx-stickybits.svg?style=flat)](https://www.npmjs.com/package/ngx-stickybits) [![npm](https://img.shields.io/npm/l/ngx-stickybits.svg)](https://opensource.org/licenses/MIT) [![dependencies Status](https://david-dm.org/jfcere/ngx-stickybits/status.svg?path=lib)](https://david-dm.org/jfcere/ngx-stickybits?path=lib) [![peerDependencies Status](https://david-dm.org/jfcere/ngx-stickybits/peer-status.svg?path=lib)](https://david-dm.org/jfcere/ngx-stickybits?path=lib&type=peer) [![downloads](https://img.shields.io/npm/dt/ngx-stickybits.svg)](https://www.npmjs.com/package/ngx-stickybits) | ||
@@ -4,0 +4,0 @@ Angular sticky directive using [Stickybits](https://github.com/dollarshaveclub/stickybits), a lightweight alternative to `position: sticky` polyfills. |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
111209
1267
+ Added@angular/common@8.2.14(transitive)
+ Added@angular/core@8.2.14(transitive)
+ Addedzone.js@0.9.1(transitive)
- Removed@angular/common@7.2.16(transitive)
- Removed@angular/core@7.2.16(transitive)
- Removedzone.js@0.8.29(transitive)
Updatedstickybits@^3.6.6