ngx-slimscroll
Advanced tools
Comparing version 9.2.2 to 9.2.3
@@ -479,2 +479,3 @@ (function (global, factory) { | ||
this.getBarHeight(); | ||
this.setBarTop(); | ||
}; | ||
@@ -547,4 +548,2 @@ SlimScrollDirective.prototype.wrapContainer = function () { | ||
var from = this.el.scrollTop; | ||
var maxElScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
var barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
var paddingTop = parseInt(this.el.style.paddingTop, 10) || 0; | ||
@@ -572,9 +571,3 @@ var paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
} | ||
var percentScroll = _this.el.scrollTop / maxElScrollTop; | ||
if (paddingBottom === 0) { | ||
var delta = Math.round((_this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
_this.renderer.setStyle(_this.bar, 'top', delta + "px"); | ||
} | ||
} | ||
_this.setBarTop(); | ||
var isScrollAtStart = _this.el.scrollTop === 0; | ||
@@ -626,2 +619,14 @@ var isScrollAtEnd = _this.el.scrollTop === _this.el.scrollHeight - _this.el.offsetHeight; | ||
}; | ||
SlimScrollDirective.prototype.setBarTop = function () { | ||
var barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
var maxScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
var paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
var percentScroll = this.el.scrollTop / maxScrollTop; | ||
if (paddingBottom === 0) { | ||
var delta = Math.round((this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
this.renderer.setStyle(this.bar, 'top', delta + "px"); | ||
} | ||
} | ||
}; | ||
SlimScrollDirective.prototype.showBarAndGrid = function () { | ||
@@ -628,0 +633,0 @@ this.renderer.setStyle(this.grid, 'background', this.options.gridBackground); |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ngx-slimscroll",["exports","@angular/core","@angular/common","rxjs","rxjs/operators"],e):e((t=t||self)["ngx-slimscroll"]={},t.ng.core,t.ng.common,t.rxjs,t.rxjs.operators)}(this,(function(t,e,r,i,n){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function o(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function s(t,e){return function(r,i){e(r,i,t)}}function a(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}var d=function(t){this.type=t.type,this.y=t&&t.y?t.y:0,this.percent=t&&t.percent?t.percent:0,this.duration=t&&t.duration?t.duration:0,this.easing=t&&t.easing?t.easing:"linear"},h=new e.InjectionToken("NGX_SLIMSCROLL_DEFAULTS"),c=function(){function t(t){this.position=t&&t.position?t.position:"right",this.barBackground=t&&t.barBackground?t.barBackground:"#343a40",this.barOpacity=t&&t.barOpacity?t.barOpacity:"1",this.barWidth=t&&t.barWidth?t.barWidth:"12",this.barBorderRadius=t&&t.barBorderRadius?t.barBorderRadius:"5",this.barMargin=t&&t.barMargin?t.barMargin:"1px 0",this.gridBackground=t&&t.gridBackground?t.gridBackground:"#adb5bd",this.gridOpacity=t&&t.gridOpacity?t.gridOpacity:"1",this.gridWidth=t&&t.gridWidth?t.gridWidth:"8",this.gridBorderRadius=t&&t.gridBorderRadius?t.gridBorderRadius:"10",this.gridMargin=t&&t.gridMargin?t.gridMargin:"1px 2px",this.alwaysVisible=!t||void 0===t.alwaysVisible||t.alwaysVisible,this.visibleTimeout=t&&t.visibleTimeout?t.visibleTimeout:1e3,this.alwaysPreventDefaultScroll=!t||void 0===t.alwaysPreventDefaultScroll||t.alwaysPreventDefaultScroll}return t.prototype.merge=function(e){var r=new t;return r.position=e&&e.position?e.position:this.position,r.barBackground=e&&e.barBackground?e.barBackground:this.barBackground,r.barOpacity=e&&e.barOpacity?e.barOpacity:this.barOpacity,r.barWidth=e&&e.barWidth?e.barWidth:this.barWidth,r.barBorderRadius=e&&e.barBorderRadius?e.barBorderRadius:this.barBorderRadius,r.barMargin=e&&e.barMargin?e.barMargin:this.barMargin,r.gridBackground=e&&e.gridBackground?e.gridBackground:this.gridBackground,r.gridOpacity=e&&e.gridOpacity?e.gridOpacity:this.gridOpacity,r.gridWidth=e&&e.gridWidth?e.gridWidth:this.gridWidth,r.gridBorderRadius=e&&e.gridBorderRadius?e.gridBorderRadius:this.gridBorderRadius,r.gridMargin=e&&e.gridMargin?e.gridMargin:this.gridMargin,r.alwaysVisible=e&&void 0!==e.alwaysVisible?e.alwaysVisible:this.alwaysVisible,r.visibleTimeout=e&&e.visibleTimeout?e.visibleTimeout:this.visibleTimeout,r.alwaysPreventDefaultScroll=!e||void 0===e.alwaysPreventDefaultScroll||e.alwaysPreventDefaultScroll,r},t}(),u=function(t){this.scrollPosition=t&&t.scrollPosition?t.scrollPosition:0,this.isScrollAtStart=!t||void 0===t.isScrollAtStart||t.isScrollAtStart,this.isScrollAtEnd=!(!t||void 0===t.isScrollAtEnd)&&t.isScrollAtEnd},p=function(t){return t},g=function(t){return t*t},y=function(t){return t*(2-t)},f=function(t){return t<.5?2*t*t:(4-2*t)*t-1},b=function(t){return t*t*t},m=function(t){return--t*t*t+1},v=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},S=function(t){return t*t*t*t},w=function(t){return 1- --t*t*t*t},B=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},T=function(t){return t*t*t*t*t},O=function(t){return 1+--t*t*t*t*t},C=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},E={linear:p,inQuad:g,outQuad:y,inOutQuad:f,inCubic:b,outCubic:m,inOutCubic:v,inQuart:S,outQuart:w,inOutQuart:B,inQuint:T,outQuint:O,inOutQuint:C},M=function(){function t(t,r,o,s){var a=this;this.viewContainer=t,this.renderer=r,this.document=o,this.optionsDefaults=s,this.enabled=!0,this.scrollChanged=new e.EventEmitter,this.barVisibilityChange=new e.EventEmitter,this.initWheel=function(){var t=i.fromEvent(a.el,"DOMMouseScroll"),e=i.fromEvent(a.el,"mousewheel"),r=i.merge.apply(void 0,l([t,e])).subscribe((function(t){var e=0;t.wheelDelta&&(e=-t.wheelDelta/120),t.detail&&(e=t.detail/3);var r=a.scrollContent(e,!0,!1);t.preventDefault&&(a.options.alwaysPreventDefaultScroll||null===r)&&t.preventDefault()}));a.interactionSubscriptions.add(r)},this.initDrag=function(){var t=a.bar,e=i.fromEvent(a.document.documentElement,"mousemove"),r=i.fromEvent(a.document.documentElement,"touchmove"),o=i.fromEvent(t,"mousedown"),s=i.fromEvent(a.el,"touchstart"),d=i.fromEvent(a.document.documentElement,"mouseup"),h=i.fromEvent(a.document.documentElement,"touchend"),c=o.pipe(n.mergeMap((function(r){return a.pageY=r.pageY,a.top=parseFloat(getComputedStyle(t).top),e.pipe(n.map((function(t){return t.preventDefault(),a.top+t.pageY-a.pageY})),n.takeUntil(d))}))),u=s.pipe(n.mergeMap((function(e){return a.pageY=e.targetTouches[0].pageY,a.top=-parseFloat(getComputedStyle(t).top),r.pipe(n.map((function(t){return-(a.top+t.targetTouches[0].pageY-a.pageY)})),n.takeUntil(h))}))),p=i.merge.apply(void 0,l([c,u])).subscribe((function(t){a.body.addEventListener("selectstart",a.preventDefaultEvent,!1),a.renderer.setStyle(a.body,"touch-action","pan-y"),a.renderer.setStyle(a.body,"user-select","none"),a.renderer.setStyle(a.bar,"top",t+"px");var e=a.scrollContent(0,!0,!1),r=a.el.offsetHeight-a.bar.offsetHeight;e&&e<0&&-e<=r?a.renderer.setStyle(a.el,"paddingTop",-e+"px"):e&&e>0&&e<=r&&a.renderer.setStyle(a.el,"paddingBottom",e+"px")})),g=i.merge.apply(void 0,l([d,h])).subscribe((function(){a.body.removeEventListener("selectstart",a.preventDefaultEvent,!1);var t=parseInt(a.el.style.paddingTop,10),e=parseInt(a.el.style.paddingBottom,10);a.renderer.setStyle(a.body,"touch-action","unset"),a.renderer.setStyle(a.body,"user-select","default"),(t>0||e>0)&&a.scrollTo(0,300,"linear")}));a.interactionSubscriptions.add(p),a.interactionSubscriptions.add(g)},this.preventDefaultEvent=function(t){t.preventDefault(),t.stopPropagation()},this.el=this.viewContainer.element.nativeElement,this.body=this.document.querySelector("body"),this.mutationThrottleTimeout=50}return t.prototype.ngOnInit=function(){!this.interactionSubscriptions&&this.enabled&&this.setup()},t.prototype.ngOnChanges=function(t){t.enabled&&(this.enabled?this.setup():this.destroy())},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.setup=function(){var t=this;if(this.interactionSubscriptions=new i.Subscription,this.optionsDefaults?this.options=new c(this.optionsDefaults).merge(this.options):this.options=new c(this.options),this.setStyle(),this.wrapContainer(),this.initGrid(),this.initBar(),this.getBarHeight(),this.initWheel(),this.initDrag(),this.options.alwaysVisible||this.hideBarAndGrid(),MutationObserver&&(this.mutationObserver&&this.mutationObserver.disconnect(),this.mutationObserver=new MutationObserver((function(){t.mutationThrottleTimeout&&(clearTimeout(t.mutationThrottleTimeout),t.mutationThrottleTimeout=setTimeout(t.onMutation.bind(t),50))})),this.mutationObserver.observe(this.el,{subtree:!0,childList:!0})),this.scrollEvents&&this.scrollEvents instanceof e.EventEmitter){var r=this.scrollEvents.subscribe((function(e){return t.handleEvent(e)}));this.interactionSubscriptions.add(r)}},t.prototype.handleEvent=function(t){if("scrollToBottom"===t.type){var e=this.el.scrollHeight-this.el.clientHeight;this.scrollTo(e,t.duration,t.easing)}else if("scrollToTop"===t.type){e=0;this.scrollTo(e,t.duration,t.easing)}else if("scrollToPercent"===t.type&&t.percent>=0&&t.percent<=100){e=Math.round((this.el.scrollHeight-this.el.clientHeight)/100*t.percent);this.scrollTo(e,t.duration,t.easing)}else if("scrollTo"===t.type){var r=this.el.scrollHeight-this.el.clientHeight;(e=t.y<=r?t.y:r)>=0&&this.scrollTo(e,t.duration,t.easing)}else"recalculate"===t.type&&this.getBarHeight()},t.prototype.setStyle=function(){var t=this.el;this.renderer.setStyle(t,"overflow","hidden")},t.prototype.onMutation=function(){this.getBarHeight()},t.prototype.wrapContainer=function(){this.wrapper=this.renderer.createElement("div");var t=this.wrapper,e=this.el;this.renderer.addClass(t,"slimscroll-wrapper"),this.renderer.setStyle(t,"position","relative"),this.renderer.setStyle(t,"overflow","hidden"),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"margin",getComputedStyle(e).margin),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height",getComputedStyle(e).height),this.renderer.insertBefore(e.parentNode,t,e),this.renderer.appendChild(t,e)},t.prototype.initGrid=function(){this.grid=this.renderer.createElement("div");var t=this.grid;this.renderer.addClass(t,"slimscroll-grid"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"bottom","0"),this.renderer.setStyle(t,this.options.position,"0"),this.renderer.setStyle(t,"width",this.options.gridWidth+"px"),this.renderer.setStyle(t,"background",this.options.gridBackground),this.renderer.setStyle(t,"opacity",this.options.gridOpacity),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"cursor","pointer"),this.renderer.setStyle(t,"z-index","99"),this.renderer.setStyle(t,"border-radius",this.options.gridBorderRadius+"px"),this.renderer.setStyle(t,"margin",this.options.gridMargin),this.renderer.appendChild(this.wrapper,t)},t.prototype.initBar=function(){this.bar=this.renderer.createElement("div");var t=this.bar;this.renderer.addClass(t,"slimscroll-bar"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,this.options.position,"0"),this.renderer.setStyle(t,"width",this.options.barWidth+"px"),this.renderer.setStyle(t,"background",this.options.barBackground),this.renderer.setStyle(t,"opacity",this.options.barOpacity),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"cursor","pointer"),this.renderer.setStyle(t,"z-index","100"),this.renderer.setStyle(t,"border-radius",this.options.barBorderRadius+"px"),this.renderer.setStyle(t,"margin",this.options.barMargin),this.renderer.appendChild(this.wrapper,t),this.barVisibilityChange.emit(!0)},t.prototype.getBarHeight=function(){var t=this.el.offsetHeight,e=Math.max(t/this.el.scrollHeight*t,30)+"px",r=parseInt(e,10)===t?"none":"block";this.wrapper.offsetHeight!==t&&this.renderer.setStyle(this.wrapper,"height",t+"px"),this.renderer.setStyle(this.bar,"height",e),this.renderer.setStyle(this.bar,"display",r),this.renderer.setStyle(this.grid,"display",r),this.barVisibilityChange.emit("none"!==r)},t.prototype.scrollTo=function(t,e,r){var i=this,n=Date.now(),o=this.el.scrollTop,s=this.el.scrollHeight-this.el.clientHeight,a=Math.max(this.el.offsetHeight/this.el.scrollHeight*this.el.offsetHeight,30),l=parseInt(this.el.style.paddingTop,10)||0,d=parseInt(this.el.style.paddingBottom,10)||0,h=function(){var c=Date.now(),p=Math.min(1,(c-n)/e),g=E[r](p);if(l>0||d>0){var y=null;l>0&&(y=-(g*(t-(y=-l))+y),i.renderer.setStyle(i.el,"padding-top",y+"px")),d>0&&(y=g*(t-(y=d))+y,i.renderer.setStyle(i.el,"padding-bottom",y+"px"))}else i.el.scrollTop=g*(t-o)+o;var f=i.el.scrollTop/s;if(0===d){var b=Math.round((i.el.clientHeight-a)*f);b>0&&i.renderer.setStyle(i.bar,"top",b+"px")}var m=0===i.el.scrollTop,v=i.el.scrollTop===i.el.scrollHeight-i.el.offsetHeight,S=Math.ceil(i.el.scrollTop),w=new u({scrollPosition:S,isScrollAtStart:m,isScrollAtEnd:v});i.scrollChanged.emit(w),p<1&&requestAnimationFrame(h)};requestAnimationFrame(h)},t.prototype.scrollContent=function(t,e,r){var i=this,n=t,o=this.el.offsetHeight-this.bar.offsetHeight,s=this.el.scrollHeight-this.el.offsetHeight,a=null;e&&(((n=parseInt(getComputedStyle(this.bar).top,10)+20*t/100*this.bar.offsetHeight)<0||n>o)&&(a=n>o?n-o:n),n=Math.min(Math.max(n,0),o),n=t>0?Math.ceil(n):Math.floor(n),this.renderer.setStyle(this.bar,"top",n+"px")),n=parseInt(getComputedStyle(this.bar).top,10)/(this.el.offsetHeight-this.bar.offsetHeight)*s,this.el.scrollTop=n,this.showBarAndGrid(),this.options.alwaysVisible||(this.visibleTimeout&&clearTimeout(this.visibleTimeout),this.visibleTimeout=setTimeout((function(){i.hideBarAndGrid()}),this.options.visibleTimeout));var l=0===n,d=n===s,h=Math.ceil(n),c=new u({scrollPosition:h,isScrollAtStart:l,isScrollAtEnd:d});return this.scrollChanged.emit(c),a},t.prototype.showBarAndGrid=function(){this.renderer.setStyle(this.grid,"background",this.options.gridBackground),this.renderer.setStyle(this.bar,"background",this.options.barBackground)},t.prototype.hideBarAndGrid=function(){this.renderer.setStyle(this.grid,"background","transparent"),this.renderer.setStyle(this.bar,"background","transparent")},t.prototype.destroy=function(){if(this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.el.parentElement.classList.contains("slimscroll-wrapper")){var t=this.el.parentElement,e=t.querySelector(".slimscroll-bar");t.removeChild(e);var r=t.querySelector(".slimscroll-grid");t.removeChild(r),this.unwrap(t)}this.interactionSubscriptions&&this.interactionSubscriptions.unsubscribe()},t.prototype.unwrap=function(t){for(var e=document.createDocumentFragment();t.firstChild;){var r=t.removeChild(t.firstChild);e.appendChild(r)}t.parentNode.replaceChild(e,t)},t.prototype.onResize=function(t){this.getBarHeight()},t.ctorParameters=function(){return[{type:e.ViewContainerRef,decorators:[{type:e.Inject,args:[e.ViewContainerRef]}]},{type:e.Renderer2,decorators:[{type:e.Inject,args:[e.Renderer2]}]},{type:void 0,decorators:[{type:e.Inject,args:[r.DOCUMENT]}]},{type:void 0,decorators:[{type:e.Inject,args:[h]},{type:e.Optional}]}]},o([e.Input()],t.prototype,"enabled",void 0),o([e.Input()],t.prototype,"options",void 0),o([e.Input()],t.prototype,"scrollEvents",void 0),o([e.Output()],t.prototype,"scrollChanged",void 0),o([e.Output()],t.prototype,"barVisibilityChange",void 0),o([e.HostListener("window:resize",["$event"])],t.prototype,"onResize",null),t=o([e.Directive({selector:"[slimScroll]",exportAs:"slimScroll"}),s(0,e.Inject(e.ViewContainerRef)),s(1,e.Inject(e.Renderer2)),s(2,e.Inject(r.DOCUMENT)),s(3,e.Inject(h)),s(3,e.Optional())],t)}(),x=function(){function t(){}return t=o([e.NgModule({declarations:[M],exports:[M]})],t)}();t.NgSlimScrollModule=x,t.SLIMSCROLL_DEFAULTS=h,t.SlimScrollDirective=M,t.SlimScrollEvent=d,t.SlimScrollOptions=c,t.SlimScrollState=u,t.easing=E,t.ɵ0=p,t.ɵ1=g,t.ɵ10=T,t.ɵ11=O,t.ɵ12=C,t.ɵ2=y,t.ɵ3=f,t.ɵ4=b,t.ɵ5=m,t.ɵ6=v,t.ɵ7=S,t.ɵ8=w,t.ɵ9=B,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */function o(t,e,r,i){var n,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,r,s):n(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function s(t,e){return function(r,i){e(r,i,t)}}function a(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return s}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}var d=function(t){this.type=t.type,this.y=t&&t.y?t.y:0,this.percent=t&&t.percent?t.percent:0,this.duration=t&&t.duration?t.duration:0,this.easing=t&&t.easing?t.easing:"linear"},h=new e.InjectionToken("NGX_SLIMSCROLL_DEFAULTS"),p=function(){function t(t){this.position=t&&t.position?t.position:"right",this.barBackground=t&&t.barBackground?t.barBackground:"#343a40",this.barOpacity=t&&t.barOpacity?t.barOpacity:"1",this.barWidth=t&&t.barWidth?t.barWidth:"12",this.barBorderRadius=t&&t.barBorderRadius?t.barBorderRadius:"5",this.barMargin=t&&t.barMargin?t.barMargin:"1px 0",this.gridBackground=t&&t.gridBackground?t.gridBackground:"#adb5bd",this.gridOpacity=t&&t.gridOpacity?t.gridOpacity:"1",this.gridWidth=t&&t.gridWidth?t.gridWidth:"8",this.gridBorderRadius=t&&t.gridBorderRadius?t.gridBorderRadius:"10",this.gridMargin=t&&t.gridMargin?t.gridMargin:"1px 2px",this.alwaysVisible=!t||void 0===t.alwaysVisible||t.alwaysVisible,this.visibleTimeout=t&&t.visibleTimeout?t.visibleTimeout:1e3,this.alwaysPreventDefaultScroll=!t||void 0===t.alwaysPreventDefaultScroll||t.alwaysPreventDefaultScroll}return t.prototype.merge=function(e){var r=new t;return r.position=e&&e.position?e.position:this.position,r.barBackground=e&&e.barBackground?e.barBackground:this.barBackground,r.barOpacity=e&&e.barOpacity?e.barOpacity:this.barOpacity,r.barWidth=e&&e.barWidth?e.barWidth:this.barWidth,r.barBorderRadius=e&&e.barBorderRadius?e.barBorderRadius:this.barBorderRadius,r.barMargin=e&&e.barMargin?e.barMargin:this.barMargin,r.gridBackground=e&&e.gridBackground?e.gridBackground:this.gridBackground,r.gridOpacity=e&&e.gridOpacity?e.gridOpacity:this.gridOpacity,r.gridWidth=e&&e.gridWidth?e.gridWidth:this.gridWidth,r.gridBorderRadius=e&&e.gridBorderRadius?e.gridBorderRadius:this.gridBorderRadius,r.gridMargin=e&&e.gridMargin?e.gridMargin:this.gridMargin,r.alwaysVisible=e&&void 0!==e.alwaysVisible?e.alwaysVisible:this.alwaysVisible,r.visibleTimeout=e&&e.visibleTimeout?e.visibleTimeout:this.visibleTimeout,r.alwaysPreventDefaultScroll=!e||void 0===e.alwaysPreventDefaultScroll||e.alwaysPreventDefaultScroll,r},t}(),c=function(t){this.scrollPosition=t&&t.scrollPosition?t.scrollPosition:0,this.isScrollAtStart=!t||void 0===t.isScrollAtStart||t.isScrollAtStart,this.isScrollAtEnd=!(!t||void 0===t.isScrollAtEnd)&&t.isScrollAtEnd},u=function(t){return t},g=function(t){return t*t},y=function(t){return t*(2-t)},f=function(t){return t<.5?2*t*t:(4-2*t)*t-1},b=function(t){return t*t*t},m=function(t){return--t*t*t+1},v=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},S=function(t){return t*t*t*t},w=function(t){return 1- --t*t*t*t},B=function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},T=function(t){return t*t*t*t*t},O=function(t){return 1+--t*t*t*t*t},C=function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t},E={linear:u,inQuad:g,outQuad:y,inOutQuad:f,inCubic:b,outCubic:m,inOutCubic:v,inQuart:S,outQuart:w,inOutQuart:B,inQuint:T,outQuint:O,inOutQuint:C},M=function(){function t(t,r,o,s){var a=this;this.viewContainer=t,this.renderer=r,this.document=o,this.optionsDefaults=s,this.enabled=!0,this.scrollChanged=new e.EventEmitter,this.barVisibilityChange=new e.EventEmitter,this.initWheel=function(){var t=i.fromEvent(a.el,"DOMMouseScroll"),e=i.fromEvent(a.el,"mousewheel"),r=i.merge.apply(void 0,l([t,e])).subscribe((function(t){var e=0;t.wheelDelta&&(e=-t.wheelDelta/120),t.detail&&(e=t.detail/3);var r=a.scrollContent(e,!0,!1);t.preventDefault&&(a.options.alwaysPreventDefaultScroll||null===r)&&t.preventDefault()}));a.interactionSubscriptions.add(r)},this.initDrag=function(){var t=a.bar,e=i.fromEvent(a.document.documentElement,"mousemove"),r=i.fromEvent(a.document.documentElement,"touchmove"),o=i.fromEvent(t,"mousedown"),s=i.fromEvent(a.el,"touchstart"),d=i.fromEvent(a.document.documentElement,"mouseup"),h=i.fromEvent(a.document.documentElement,"touchend"),p=o.pipe(n.mergeMap((function(r){return a.pageY=r.pageY,a.top=parseFloat(getComputedStyle(t).top),e.pipe(n.map((function(t){return t.preventDefault(),a.top+t.pageY-a.pageY})),n.takeUntil(d))}))),c=s.pipe(n.mergeMap((function(e){return a.pageY=e.targetTouches[0].pageY,a.top=-parseFloat(getComputedStyle(t).top),r.pipe(n.map((function(t){return-(a.top+t.targetTouches[0].pageY-a.pageY)})),n.takeUntil(h))}))),u=i.merge.apply(void 0,l([p,c])).subscribe((function(t){a.body.addEventListener("selectstart",a.preventDefaultEvent,!1),a.renderer.setStyle(a.body,"touch-action","pan-y"),a.renderer.setStyle(a.body,"user-select","none"),a.renderer.setStyle(a.bar,"top",t+"px");var e=a.scrollContent(0,!0,!1),r=a.el.offsetHeight-a.bar.offsetHeight;e&&e<0&&-e<=r?a.renderer.setStyle(a.el,"paddingTop",-e+"px"):e&&e>0&&e<=r&&a.renderer.setStyle(a.el,"paddingBottom",e+"px")})),g=i.merge.apply(void 0,l([d,h])).subscribe((function(){a.body.removeEventListener("selectstart",a.preventDefaultEvent,!1);var t=parseInt(a.el.style.paddingTop,10),e=parseInt(a.el.style.paddingBottom,10);a.renderer.setStyle(a.body,"touch-action","unset"),a.renderer.setStyle(a.body,"user-select","default"),(t>0||e>0)&&a.scrollTo(0,300,"linear")}));a.interactionSubscriptions.add(u),a.interactionSubscriptions.add(g)},this.preventDefaultEvent=function(t){t.preventDefault(),t.stopPropagation()},this.el=this.viewContainer.element.nativeElement,this.body=this.document.querySelector("body"),this.mutationThrottleTimeout=50}return t.prototype.ngOnInit=function(){!this.interactionSubscriptions&&this.enabled&&this.setup()},t.prototype.ngOnChanges=function(t){t.enabled&&(this.enabled?this.setup():this.destroy())},t.prototype.ngOnDestroy=function(){this.destroy()},t.prototype.setup=function(){var t=this;if(this.interactionSubscriptions=new i.Subscription,this.optionsDefaults?this.options=new p(this.optionsDefaults).merge(this.options):this.options=new p(this.options),this.setStyle(),this.wrapContainer(),this.initGrid(),this.initBar(),this.getBarHeight(),this.initWheel(),this.initDrag(),this.options.alwaysVisible||this.hideBarAndGrid(),MutationObserver&&(this.mutationObserver&&this.mutationObserver.disconnect(),this.mutationObserver=new MutationObserver((function(){t.mutationThrottleTimeout&&(clearTimeout(t.mutationThrottleTimeout),t.mutationThrottleTimeout=setTimeout(t.onMutation.bind(t),50))})),this.mutationObserver.observe(this.el,{subtree:!0,childList:!0})),this.scrollEvents&&this.scrollEvents instanceof e.EventEmitter){var r=this.scrollEvents.subscribe((function(e){return t.handleEvent(e)}));this.interactionSubscriptions.add(r)}},t.prototype.handleEvent=function(t){if("scrollToBottom"===t.type){var e=this.el.scrollHeight-this.el.clientHeight;this.scrollTo(e,t.duration,t.easing)}else if("scrollToTop"===t.type){e=0;this.scrollTo(e,t.duration,t.easing)}else if("scrollToPercent"===t.type&&t.percent>=0&&t.percent<=100){e=Math.round((this.el.scrollHeight-this.el.clientHeight)/100*t.percent);this.scrollTo(e,t.duration,t.easing)}else if("scrollTo"===t.type){var r=this.el.scrollHeight-this.el.clientHeight;(e=t.y<=r?t.y:r)>=0&&this.scrollTo(e,t.duration,t.easing)}else"recalculate"===t.type&&this.getBarHeight()},t.prototype.setStyle=function(){var t=this.el;this.renderer.setStyle(t,"overflow","hidden")},t.prototype.onMutation=function(){this.getBarHeight(),this.setBarTop()},t.prototype.wrapContainer=function(){this.wrapper=this.renderer.createElement("div");var t=this.wrapper,e=this.el;this.renderer.addClass(t,"slimscroll-wrapper"),this.renderer.setStyle(t,"position","relative"),this.renderer.setStyle(t,"overflow","hidden"),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"margin",getComputedStyle(e).margin),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height",getComputedStyle(e).height),this.renderer.insertBefore(e.parentNode,t,e),this.renderer.appendChild(t,e)},t.prototype.initGrid=function(){this.grid=this.renderer.createElement("div");var t=this.grid;this.renderer.addClass(t,"slimscroll-grid"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,"bottom","0"),this.renderer.setStyle(t,this.options.position,"0"),this.renderer.setStyle(t,"width",this.options.gridWidth+"px"),this.renderer.setStyle(t,"background",this.options.gridBackground),this.renderer.setStyle(t,"opacity",this.options.gridOpacity),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"cursor","pointer"),this.renderer.setStyle(t,"z-index","99"),this.renderer.setStyle(t,"border-radius",this.options.gridBorderRadius+"px"),this.renderer.setStyle(t,"margin",this.options.gridMargin),this.renderer.appendChild(this.wrapper,t)},t.prototype.initBar=function(){this.bar=this.renderer.createElement("div");var t=this.bar;this.renderer.addClass(t,"slimscroll-bar"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0"),this.renderer.setStyle(t,this.options.position,"0"),this.renderer.setStyle(t,"width",this.options.barWidth+"px"),this.renderer.setStyle(t,"background",this.options.barBackground),this.renderer.setStyle(t,"opacity",this.options.barOpacity),this.renderer.setStyle(t,"display","block"),this.renderer.setStyle(t,"cursor","pointer"),this.renderer.setStyle(t,"z-index","100"),this.renderer.setStyle(t,"border-radius",this.options.barBorderRadius+"px"),this.renderer.setStyle(t,"margin",this.options.barMargin),this.renderer.appendChild(this.wrapper,t),this.barVisibilityChange.emit(!0)},t.prototype.getBarHeight=function(){var t=this.el.offsetHeight,e=Math.max(t/this.el.scrollHeight*t,30)+"px",r=parseInt(e,10)===t?"none":"block";this.wrapper.offsetHeight!==t&&this.renderer.setStyle(this.wrapper,"height",t+"px"),this.renderer.setStyle(this.bar,"height",e),this.renderer.setStyle(this.bar,"display",r),this.renderer.setStyle(this.grid,"display",r),this.barVisibilityChange.emit("none"!==r)},t.prototype.scrollTo=function(t,e,r){var i=this,n=Date.now(),o=this.el.scrollTop,s=parseInt(this.el.style.paddingTop,10)||0,a=parseInt(this.el.style.paddingBottom,10)||0,l=function(){var d=Date.now(),h=Math.min(1,(d-n)/e),p=E[r](h);if(s>0||a>0){var u=null;s>0&&(u=-(p*(t-(u=-s))+u),i.renderer.setStyle(i.el,"padding-top",u+"px")),a>0&&(u=p*(t-(u=a))+u,i.renderer.setStyle(i.el,"padding-bottom",u+"px"))}else i.el.scrollTop=p*(t-o)+o;i.setBarTop();var g=0===i.el.scrollTop,y=i.el.scrollTop===i.el.scrollHeight-i.el.offsetHeight,f=Math.ceil(i.el.scrollTop),b=new c({scrollPosition:f,isScrollAtStart:g,isScrollAtEnd:y});i.scrollChanged.emit(b),h<1&&requestAnimationFrame(l)};requestAnimationFrame(l)},t.prototype.scrollContent=function(t,e,r){var i=this,n=t,o=this.el.offsetHeight-this.bar.offsetHeight,s=this.el.scrollHeight-this.el.offsetHeight,a=null;e&&(((n=parseInt(getComputedStyle(this.bar).top,10)+20*t/100*this.bar.offsetHeight)<0||n>o)&&(a=n>o?n-o:n),n=Math.min(Math.max(n,0),o),n=t>0?Math.ceil(n):Math.floor(n),this.renderer.setStyle(this.bar,"top",n+"px")),n=parseInt(getComputedStyle(this.bar).top,10)/(this.el.offsetHeight-this.bar.offsetHeight)*s,this.el.scrollTop=n,this.showBarAndGrid(),this.options.alwaysVisible||(this.visibleTimeout&&clearTimeout(this.visibleTimeout),this.visibleTimeout=setTimeout((function(){i.hideBarAndGrid()}),this.options.visibleTimeout));var l=0===n,d=n===s,h=Math.ceil(n),p=new c({scrollPosition:h,isScrollAtStart:l,isScrollAtEnd:d});return this.scrollChanged.emit(p),a},t.prototype.setBarTop=function(){var t=Math.max(this.el.offsetHeight/this.el.scrollHeight*this.el.offsetHeight,30),e=this.el.scrollHeight-this.el.clientHeight,r=parseInt(this.el.style.paddingBottom,10)||0,i=this.el.scrollTop/e;if(0===r){var n=Math.round((this.el.clientHeight-t)*i);n>0&&this.renderer.setStyle(this.bar,"top",n+"px")}},t.prototype.showBarAndGrid=function(){this.renderer.setStyle(this.grid,"background",this.options.gridBackground),this.renderer.setStyle(this.bar,"background",this.options.barBackground)},t.prototype.hideBarAndGrid=function(){this.renderer.setStyle(this.grid,"background","transparent"),this.renderer.setStyle(this.bar,"background","transparent")},t.prototype.destroy=function(){if(this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.el.parentElement.classList.contains("slimscroll-wrapper")){var t=this.el.parentElement,e=t.querySelector(".slimscroll-bar");t.removeChild(e);var r=t.querySelector(".slimscroll-grid");t.removeChild(r),this.unwrap(t)}this.interactionSubscriptions&&this.interactionSubscriptions.unsubscribe()},t.prototype.unwrap=function(t){for(var e=document.createDocumentFragment();t.firstChild;){var r=t.removeChild(t.firstChild);e.appendChild(r)}t.parentNode.replaceChild(e,t)},t.prototype.onResize=function(t){this.getBarHeight()},t.ctorParameters=function(){return[{type:e.ViewContainerRef,decorators:[{type:e.Inject,args:[e.ViewContainerRef]}]},{type:e.Renderer2,decorators:[{type:e.Inject,args:[e.Renderer2]}]},{type:void 0,decorators:[{type:e.Inject,args:[r.DOCUMENT]}]},{type:void 0,decorators:[{type:e.Inject,args:[h]},{type:e.Optional}]}]},o([e.Input()],t.prototype,"enabled",void 0),o([e.Input()],t.prototype,"options",void 0),o([e.Input()],t.prototype,"scrollEvents",void 0),o([e.Output()],t.prototype,"scrollChanged",void 0),o([e.Output()],t.prototype,"barVisibilityChange",void 0),o([e.HostListener("window:resize",["$event"])],t.prototype,"onResize",null),t=o([e.Directive({selector:"[slimScroll]",exportAs:"slimScroll"}),s(0,e.Inject(e.ViewContainerRef)),s(1,e.Inject(e.Renderer2)),s(2,e.Inject(r.DOCUMENT)),s(3,e.Inject(h)),s(3,e.Optional())],t)}(),x=function(){function t(){}return t=o([e.NgModule({declarations:[M],exports:[M]})],t)}();t.NgSlimScrollModule=x,t.SLIMSCROLL_DEFAULTS=h,t.SlimScrollDirective=M,t.SlimScrollEvent=d,t.SlimScrollOptions=p,t.SlimScrollState=c,t.easing=E,t.ɵ0=u,t.ɵ1=g,t.ɵ10=T,t.ɵ11=O,t.ɵ12=C,t.ɵ2=y,t.ɵ3=f,t.ɵ4=b,t.ɵ5=m,t.ɵ6=v,t.ɵ7=S,t.ɵ8=w,t.ɵ9=B,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-slimscroll.umd.min.js.map |
@@ -255,2 +255,3 @@ import { InjectionToken, EventEmitter, ViewContainerRef, Inject, Renderer2, Optional, Input, Output, HostListener, Directive, NgModule } from '@angular/core'; | ||
this.getBarHeight(); | ||
this.setBarTop(); | ||
} | ||
@@ -322,4 +323,2 @@ wrapContainer() { | ||
const from = this.el.scrollTop; | ||
const maxElScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
const barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
const paddingTop = parseInt(this.el.style.paddingTop, 10) || 0; | ||
@@ -347,9 +346,3 @@ const paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
} | ||
const percentScroll = this.el.scrollTop / maxElScrollTop; | ||
if (paddingBottom === 0) { | ||
const delta = Math.round((this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
this.renderer.setStyle(this.bar, 'top', `${delta}px`); | ||
} | ||
} | ||
this.setBarTop(); | ||
const isScrollAtStart = this.el.scrollTop === 0; | ||
@@ -400,2 +393,14 @@ const isScrollAtEnd = this.el.scrollTop === this.el.scrollHeight - this.el.offsetHeight; | ||
} | ||
setBarTop() { | ||
const barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
const maxScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
const paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
const percentScroll = this.el.scrollTop / maxScrollTop; | ||
if (paddingBottom === 0) { | ||
const delta = Math.round((this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
this.renderer.setStyle(this.bar, 'top', `${delta}px`); | ||
} | ||
} | ||
} | ||
showBarAndGrid() { | ||
@@ -402,0 +407,0 @@ this.renderer.setStyle(this.grid, 'background', this.options.gridBackground); |
@@ -260,2 +260,3 @@ import { InjectionToken, EventEmitter, ViewContainerRef, Inject, Renderer2, Optional, Input, Output, HostListener, Directive, NgModule } from '@angular/core'; | ||
this.getBarHeight(); | ||
this.setBarTop(); | ||
}; | ||
@@ -328,4 +329,2 @@ SlimScrollDirective.prototype.wrapContainer = function () { | ||
var from = this.el.scrollTop; | ||
var maxElScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
var barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
var paddingTop = parseInt(this.el.style.paddingTop, 10) || 0; | ||
@@ -353,9 +352,3 @@ var paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
} | ||
var percentScroll = _this.el.scrollTop / maxElScrollTop; | ||
if (paddingBottom === 0) { | ||
var delta = Math.round((_this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
_this.renderer.setStyle(_this.bar, 'top', delta + "px"); | ||
} | ||
} | ||
_this.setBarTop(); | ||
var isScrollAtStart = _this.el.scrollTop === 0; | ||
@@ -407,2 +400,14 @@ var isScrollAtEnd = _this.el.scrollTop === _this.el.scrollHeight - _this.el.offsetHeight; | ||
}; | ||
SlimScrollDirective.prototype.setBarTop = function () { | ||
var barHeight = Math.max((this.el.offsetHeight / this.el.scrollHeight) * this.el.offsetHeight, 30); | ||
var maxScrollTop = this.el.scrollHeight - this.el.clientHeight; | ||
var paddingBottom = parseInt(this.el.style.paddingBottom, 10) || 0; | ||
var percentScroll = this.el.scrollTop / maxScrollTop; | ||
if (paddingBottom === 0) { | ||
var delta = Math.round((this.el.clientHeight - barHeight) * percentScroll); | ||
if (delta > 0) { | ||
this.renderer.setStyle(this.bar, 'top', delta + "px"); | ||
} | ||
} | ||
}; | ||
SlimScrollDirective.prototype.showBarAndGrid = function () { | ||
@@ -409,0 +414,0 @@ this.renderer.setStyle(this.grid, 'background', this.options.gridBackground); |
@@ -48,2 +48,3 @@ import { EventEmitter, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges, ViewContainerRef } from '@angular/core'; | ||
initDrag: () => void; | ||
setBarTop(): void; | ||
showBarAndGrid(): void; | ||
@@ -50,0 +51,0 @@ hideBarAndGrid(): void; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"ISlimScrollEvent":{"__symbolic":"interface"},"SlimScrollEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}},"ISlimScrollOptions":{"__symbolic":"interface"},"SLIMSCROLL_DEFAULTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":8},"arguments":["NGX_SLIMSCROLL_DEFAULTS"]},"SlimScrollOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"merge":[{"__symbolic":"method"}]}},"ISlimScrollState":{"__symbolic":"interface"},"SlimScrollState":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}},"easing":{"__symbolic":"error","message":"Lambda not supported","line":23,"character":10,"module":"./lib/slimscroll.directive"},"SlimScrollDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":38,"character":1},"arguments":[{"selector":"[slimScroll]","exportAs":"slimScroll"}]}],"members":{"enabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"scrollEvents":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"scrollChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":46,"character":3}}]}],"barVisibilityChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":47,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":64,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":65,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":65,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":66,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":66,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":67,"character":5},"arguments":[{"__symbolic":"reference","name":"SLIMSCROLL_DEFAULTS"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":67,"character":34}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":64,"character":53},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":65,"character":41},{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"ISlimScrollOptions"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"setup":[{"__symbolic":"method"}],"handleEvent":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}],"onMutation":[{"__symbolic":"method"}],"wrapContainer":[{"__symbolic":"method"}],"initGrid":[{"__symbolic":"method"}],"initBar":[{"__symbolic":"method"}],"getBarHeight":[{"__symbolic":"method"}],"scrollTo":[{"__symbolic":"method"}],"scrollContent":[{"__symbolic":"method"}],"showBarAndGrid":[{"__symbolic":"method"}],"hideBarAndGrid":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"unwrap":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":480,"character":3},"arguments":["window:resize",["$event"]]}]}]}},"NgSlimScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SlimScrollDirective"}],"exports":[{"__symbolic":"reference","name":"SlimScrollDirective"}]}]}],"members":{}}},"origins":{"ISlimScrollEvent":"./lib/slimscroll-event.class","SlimScrollEvent":"./lib/slimscroll-event.class","ISlimScrollOptions":"./lib/slimscroll-options.class","SLIMSCROLL_DEFAULTS":"./lib/slimscroll-options.class","SlimScrollOptions":"./lib/slimscroll-options.class","ISlimScrollState":"./lib/slimscroll-state.class","SlimScrollState":"./lib/slimscroll-state.class","easing":"./lib/slimscroll.directive","SlimScrollDirective":"./lib/slimscroll.directive","NgSlimScrollModule":"./lib/slimscroll.module"},"importAs":"ngx-slimscroll"} | ||
{"__symbolic":"module","version":4,"metadata":{"ISlimScrollEvent":{"__symbolic":"interface"},"SlimScrollEvent":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}},"ISlimScrollOptions":{"__symbolic":"interface"},"SLIMSCROLL_DEFAULTS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":8},"arguments":["NGX_SLIMSCROLL_DEFAULTS"]},"SlimScrollOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"merge":[{"__symbolic":"method"}]}},"ISlimScrollState":{"__symbolic":"interface"},"SlimScrollState":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}]}},"easing":{"__symbolic":"error","message":"Lambda not supported","line":23,"character":10,"module":"./lib/slimscroll.directive"},"SlimScrollDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":38,"character":1},"arguments":[{"selector":"[slimScroll]","exportAs":"slimScroll"}]}],"members":{"enabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}}]}],"scrollEvents":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"scrollChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":46,"character":3}}]}],"barVisibilityChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":47,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":64,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":64,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":65,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":65,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":66,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":66,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":67,"character":5},"arguments":[{"__symbolic":"reference","name":"SLIMSCROLL_DEFAULTS"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":67,"character":34}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":64,"character":53},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":65,"character":41},{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"ISlimScrollOptions"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"setup":[{"__symbolic":"method"}],"handleEvent":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}],"onMutation":[{"__symbolic":"method"}],"wrapContainer":[{"__symbolic":"method"}],"initGrid":[{"__symbolic":"method"}],"initBar":[{"__symbolic":"method"}],"getBarHeight":[{"__symbolic":"method"}],"scrollTo":[{"__symbolic":"method"}],"scrollContent":[{"__symbolic":"method"}],"setBarTop":[{"__symbolic":"method"}],"showBarAndGrid":[{"__symbolic":"method"}],"hideBarAndGrid":[{"__symbolic":"method"}],"destroy":[{"__symbolic":"method"}],"unwrap":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":486,"character":3},"arguments":["window:resize",["$event"]]}]}]}},"NgSlimScrollModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"SlimScrollDirective"}],"exports":[{"__symbolic":"reference","name":"SlimScrollDirective"}]}]}],"members":{}}},"origins":{"ISlimScrollEvent":"./lib/slimscroll-event.class","SlimScrollEvent":"./lib/slimscroll-event.class","ISlimScrollOptions":"./lib/slimscroll-options.class","SLIMSCROLL_DEFAULTS":"./lib/slimscroll-options.class","SlimScrollOptions":"./lib/slimscroll-options.class","ISlimScrollState":"./lib/slimscroll-state.class","SlimScrollState":"./lib/slimscroll-state.class","easing":"./lib/slimscroll.directive","SlimScrollDirective":"./lib/slimscroll.directive","NgSlimScrollModule":"./lib/slimscroll.module"},"importAs":"ngx-slimscroll"} |
{ | ||
"name": "ngx-slimscroll", | ||
"version": "9.2.2", | ||
"version": "9.2.3", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^9.1.9", |
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 too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
517989
2915