From 48fb8ce6db3d31edf4821424cd34f72e70040d71 Mon Sep 17 00:00:00 2001 From: "k.pienkowska" Date: Tue, 29 Oct 2024 12:37:05 +0100 Subject: [PATCH] v1.5.6 Please refer to Releases for changelog. https://github.com/mdbootstrap/perfect-scrollbar/releases --- dist/perfect-scrollbar.common.js | 330 +++++++++++++-------------- dist/perfect-scrollbar.common.js.map | 2 +- dist/perfect-scrollbar.esm.js | 330 +++++++++++++-------------- dist/perfect-scrollbar.esm.js.map | 2 +- dist/perfect-scrollbar.js | 330 +++++++++++++-------------- dist/perfect-scrollbar.js.map | 2 +- dist/perfect-scrollbar.min.js | 20 +- dist/perfect-scrollbar.min.js.map | 2 +- docs/perfect-scrollbar.min.js | 20 +- package-lock.json | 6 +- package.json | 2 +- release | 2 +- src/handlers/click-rail.js | 23 +- src/handlers/drag-thumb.js | 138 +++++------ src/handlers/keyboard.js | 11 +- src/handlers/mouse-wheel.js | 10 +- src/handlers/touch.js | 83 ++++--- src/index.js | 26 +-- src/process-scroll-diff.js | 34 +-- src/update-geometry.js | 29 +-- 20 files changed, 650 insertions(+), 752 deletions(-) mode change 100644 => 100755 release diff --git a/dist/perfect-scrollbar.common.js b/dist/perfect-scrollbar.common.js index 2406df3..cd42961 100644 --- a/dist/perfect-scrollbar.common.js +++ b/dist/perfect-scrollbar.common.js @@ -1,6 +1,6 @@ /*! - * perfect-scrollbar v1.5.3 - * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * perfect-scrollbar v1.5.6 + * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT */ @@ -188,40 +188,22 @@ EventManager.prototype.once = function once (element, eventName, handler) { function createEvent(name) { if (typeof window.CustomEvent === 'function') { return new CustomEvent(name); - } else { - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(name, false, false, undefined); - return evt; } + + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(name, false, false, undefined); + return evt; } -function processScrollDiff( - i, - axis, - diff, - useScrollingClass, - forceFireReachEvent -) { +function processScrollDiff (i, axis, diff, useScrollingClass, forceFireReachEvent) { if ( useScrollingClass === void 0 ) useScrollingClass = true; if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false; var fields; if (axis === 'top') { - fields = [ - 'contentHeight', - 'containerHeight', - 'scrollTop', - 'y', - 'up', - 'down' ]; + fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down']; } else if (axis === 'left') { - fields = [ - 'contentWidth', - 'containerWidth', - 'scrollLeft', - 'x', - 'left', - 'right' ]; + fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right']; } else { throw new Error('A proper axis should be provided'); } @@ -320,27 +302,27 @@ var env = { /Chrome/i.test(navigator && navigator.userAgent), }; -function updateGeometry(i) { +/* eslint-disable no-lonely-if */ + +function updateGeometry (i) { var element = i.element; var roundedScrollTop = Math.floor(element.scrollTop); var rect = element.getBoundingClientRect(); - i.containerWidth = Math.round(rect.width); - i.containerHeight = Math.round(rect.height); + i.containerWidth = Math.floor(rect.width); + i.containerHeight = Math.floor(rect.height); i.contentWidth = element.scrollWidth; i.contentHeight = element.scrollHeight; if (!element.contains(i.scrollbarXRail)) { // clean up and append - queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarXRail); } if (!element.contains(i.scrollbarYRail)) { // clean up and append - queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarYRail); } @@ -351,13 +333,9 @@ function updateGeometry(i) { i.scrollbarXActive = true; i.railXWidth = i.containerWidth - i.railXMarginWidth; i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize( - i, - toInt((i.railXWidth * i.containerWidth) / i.contentWidth) - ); + i.scrollbarXWidth = getThumbSize(i, toInt((i.railXWidth * i.containerWidth) / i.contentWidth)); i.scrollbarXLeft = toInt( - ((i.negativeScrollAdjustment + element.scrollLeft) * - (i.railXWidth - i.scrollbarXWidth)) / + ((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth)) / (i.contentWidth - i.containerWidth) ); } else { @@ -426,10 +404,7 @@ function updateCss(element, i) { if (i.isRtl) { xRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth - - i.contentWidth; + i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; } else { xRailOffset.left = element.scrollLeft; } @@ -477,15 +452,14 @@ function updateCss(element, i) { }); } -function clickRail(i) { - var element = i.element; +/* eslint-disable */ + +function clickRail (i) { + // const element = i.element; i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarYRail, 'mousedown', function (e) { - var positionTop = - e.pageY - - window.pageYOffset - - i.scrollbarYRail.getBoundingClientRect().top; + var positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top; var direction = positionTop > i.scrollbarYTop ? 1 : -1; i.element.scrollTop += direction * i.containerHeight; @@ -497,9 +471,7 @@ function clickRail(i) { i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarXRail, 'mousedown', function (e) { var positionLeft = - e.pageX - - window.pageXOffset - - i.scrollbarXRail.getBoundingClientRect().left; + e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left; var direction = positionLeft > i.scrollbarXLeft ? 1 : -1; i.element.scrollLeft += direction * i.containerWidth; @@ -509,17 +481,9 @@ function clickRail(i) { }); } -function dragThumb(i) { - bindMouseScrollHandler(i, [ - 'containerWidth', - 'contentWidth', - 'pageX', - 'railXWidth', - 'scrollbarX', - 'scrollbarXWidth', - 'scrollLeft', - 'x', - 'scrollbarXRail' ]); +var activeSlider = null; // Variable to track the currently active slider + +function setupScrollHandlers(i) { bindMouseScrollHandler(i, [ 'containerHeight', 'contentHeight', @@ -530,80 +494,102 @@ function dragThumb(i) { 'scrollTop', 'y', 'scrollbarYRail' ]); + + bindMouseScrollHandler(i, [ + 'containerWidth', + 'contentWidth', + 'pageX', + 'railXWidth', + 'scrollbarX', + 'scrollbarXWidth', + 'scrollLeft', + 'x', + 'scrollbarXRail' ]); } function bindMouseScrollHandler( i, ref ) { - var containerHeight = ref[0]; - var contentHeight = ref[1]; - var pageY = ref[2]; - var railYHeight = ref[3]; - var scrollbarY = ref[4]; - var scrollbarYHeight = ref[5]; - var scrollTop = ref[6]; - var y = ref[7]; - var scrollbarYRail = ref[8]; + var containerDimension = ref[0]; + var contentDimension = ref[1]; + var pageAxis = ref[2]; + var railDimension = ref[3]; + var scrollbarAxis = ref[4]; + var scrollbarDimension = ref[5]; + var scrollAxis = ref[6]; + var axis = ref[7]; + var scrollbarRail = ref[8]; var element = i.element; - - var startingScrollTop = null; - var startingMousePageY = null; + var startingScrollPosition = null; + var startingMousePagePosition = null; var scrollBy = null; - function mouseMoveHandler(e) { + function moveHandler(e) { if (e.touches && e.touches[0]) { - e[pageY] = e.touches[0].pageY; + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; } - element[scrollTop] = - startingScrollTop + scrollBy * (e[pageY] - startingMousePageY); - addScrollingClass(i, y); - updateGeometry(i); - e.stopPropagation(); - if (e.type.startsWith('touch') && e.changedTouches.length > 1) { + // Only move if the active slider is the one we started with + if (activeSlider === scrollbarAxis) { + element[scrollAxis] = + startingScrollPosition + scrollBy * (e[pageAxis] - startingMousePagePosition); + addScrollingClass(i, axis); + updateGeometry(i); + + e.stopPropagation(); e.preventDefault(); } } - function mouseUpHandler() { - removeScrollingClass(i, y); - i[scrollbarYRail].classList.remove(cls.state.clicking); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + function endHandler() { + removeScrollingClass(i, axis); + i[scrollbarRail].classList.remove(cls.state.clicking); + document.removeEventListener('mousemove', moveHandler); + document.removeEventListener('mouseup', endHandler); + document.removeEventListener('touchmove', moveHandler); + document.removeEventListener('touchend', endHandler); + activeSlider = null; // Reset active slider when interaction ends } - function bindMoves(e, touchMode) { - startingScrollTop = element[scrollTop]; - if (touchMode && e.touches) { - e[pageY] = e.touches[0].pageY; - } - startingMousePageY = e[pageY]; - scrollBy = - (i[contentHeight] - i[containerHeight]) / - (i[railYHeight] - i[scrollbarYHeight]); - if (!touchMode) { - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - e.preventDefault(); - } else { - i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler); - } + function bindMoves(e) { + if (activeSlider === null) { + // Only bind if no slider is currently active + activeSlider = scrollbarAxis; // Set current slider as active - i[scrollbarYRail].classList.add(cls.state.clicking); + startingScrollPosition = element[scrollAxis]; + if (e.touches) { + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; + } + startingMousePagePosition = e[pageAxis]; + scrollBy = + (i[contentDimension] - i[containerDimension]) / (i[railDimension] - i[scrollbarDimension]); + + if (!e.touches) { + document.addEventListener('mousemove', moveHandler); + document.addEventListener('mouseup', endHandler); + } else { + document.addEventListener('touchmove', moveHandler, { passive: false }); + document.addEventListener('touchend', endHandler); + } + + i[scrollbarRail].classList.add(cls.state.clicking); + } e.stopPropagation(); + if (e.cancelable) { + e.preventDefault(); + } } - i.event.bind(i[scrollbarY], 'mousedown', function (e) { - bindMoves(e); - }); - i.event.bind(i[scrollbarY], 'touchstart', function (e) { - bindMoves(e, true); - }); + i[scrollbarAxis].addEventListener('mousedown', bindMoves); + i[scrollbarAxis].addEventListener('touchstart', bindMoves); } -function keyboard(i) { +/* eslint-disable */ + +function keyboard (i) { var element = i.element; var elementHovered = function () { return matches(element, ':hover'); }; @@ -639,10 +625,7 @@ function keyboard(i) { } i.event.bind(i.ownerDocument, 'keydown', function (e) { - if ( - (e.isDefaultPrevented && e.isDefaultPrevented()) || - e.defaultPrevented - ) { + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) { return; } @@ -747,17 +730,17 @@ function keyboard(i) { }); } -function wheel(i) { +/* eslint-disable */ + +function wheel (i) { var element = i.element; function shouldPreventDefault(deltaX, deltaY) { var roundedScrollTop = Math.floor(element.scrollTop); var isTop = element.scrollTop === 0; - var isBottom = - roundedScrollTop + element.offsetHeight === element.scrollHeight; + var isBottom = roundedScrollTop + element.offsetHeight === element.scrollHeight; var isLeft = element.scrollLeft === 0; - var isRight = - element.scrollLeft + element.offsetWidth === element.scrollWidth; + var isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth; var hitsBound; @@ -901,13 +884,20 @@ function wheel(i) { } } -function touch(i) { +function touch (i) { if (!env.supportsTouch && !env.supportsIePointer) { return; } var element = i.element; + var state = { + startOffset: {}, + startTime: 0, + speed: {}, + easingLoop: null, + }; + function shouldPrevent(deltaX, deltaY) { var scrollTop = Math.floor(element.scrollTop); var scrollLeft = element.scrollLeft; @@ -945,32 +935,25 @@ function touch(i) { updateGeometry(i); } - var startOffset = {}; - var startTime = 0; - var speed = {}; - var easingLoop = null; - function getTouch(e) { if (e.targetTouches) { return e.targetTouches[0]; - } else { - // Maybe IE pointer - return e; } + // Maybe IE pointer + return e; } function shouldHandle(e) { + if (e.target === i.scrollbarX || e.target === i.scrollbarY) { + return false; + } if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) { return false; } if (e.targetTouches && e.targetTouches.length === 1) { return true; } - if ( - e.pointerType && - e.pointerType !== 'mouse' && - e.pointerType !== e.MSPOINTER_TYPE_MOUSE - ) { + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { return true; } return false; @@ -983,13 +966,13 @@ function touch(i) { var touch = getTouch(e); - startOffset.pageX = touch.pageX; - startOffset.pageY = touch.pageY; + state.startOffset.pageX = touch.pageX; + state.startOffset.pageY = touch.pageY; - startTime = new Date().getTime(); + state.startTime = new Date().getTime(); - if (easingLoop !== null) { - clearInterval(easingLoop); + if (state.easingLoop !== null) { + clearInterval(state.easingLoop); } } @@ -1044,58 +1027,57 @@ function touch(i) { var currentOffset = { pageX: touch.pageX, pageY: touch.pageY }; - var differenceX = currentOffset.pageX - startOffset.pageX; - var differenceY = currentOffset.pageY - startOffset.pageY; + var differenceX = currentOffset.pageX - state.startOffset.pageX; + var differenceY = currentOffset.pageY - state.startOffset.pageY; if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) { return; } applyTouchMove(differenceX, differenceY); - startOffset = currentOffset; + state.startOffset = currentOffset; var currentTime = new Date().getTime(); - var timeGap = currentTime - startTime; + var timeGap = currentTime - state.startTime; if (timeGap > 0) { - speed.x = differenceX / timeGap; - speed.y = differenceY / timeGap; - startTime = currentTime; + state.speed.x = differenceX / timeGap; + state.speed.y = differenceY / timeGap; + state.startTime = currentTime; } if (shouldPrevent(differenceX, differenceY)) { - e.preventDefault(); + // Prevent the default behavior if the event is cancelable + if (e.cancelable) { + e.preventDefault(); + } } } } + function touchEnd() { if (i.settings.swipeEasing) { - clearInterval(easingLoop); - easingLoop = setInterval(function() { + clearInterval(state.easingLoop); + state.easingLoop = setInterval(function () { if (i.isInitialized) { - clearInterval(easingLoop); - return; - } - - if (!speed.x && !speed.y) { - clearInterval(easingLoop); + clearInterval(state.easingLoop); return; } - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { - clearInterval(easingLoop); + if (!state.speed.x && !state.speed.y) { + clearInterval(state.easingLoop); return; } - if (!i.element) { - clearInterval(easingLoop); + if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) { + clearInterval(state.easingLoop); return; } - applyTouchMove(speed.x * 30, speed.y * 30); + applyTouchMove(state.speed.x * 30, state.speed.y * 30); - speed.x *= 0.8; - speed.y *= 0.8; + state.speed.x *= 0.8; + state.speed.y *= 0.8; }, 10); } } @@ -1117,6 +1099,8 @@ function touch(i) { } } +/* eslint-disable */ + var defaultSettings = function () { return ({ handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'], maxScrollbarLength: null, @@ -1134,7 +1118,7 @@ var defaultSettings = function () { return ({ var handlers = { 'click-rail': clickRail, - 'drag-thumb': dragThumb, + 'drag-thumb': setupScrollHandlers, keyboard: keyboard, wheel: wheel, touch: touch, @@ -1205,12 +1189,10 @@ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) { } else { this.isScrollbarXUsingBottom = true; } - this.railBorderXWidth = - toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); + this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); // Set rail to display:block to calculate margins set(this.scrollbarXRail, { display: 'block' }); - this.railXMarginWidth = - toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); + this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); set(this.scrollbarXRail, { display: '' }); this.railXWidth = null; this.railXRatio = null; @@ -1234,11 +1216,9 @@ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) { this.isScrollbarYUsingRight = true; } this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null; - this.railBorderYWidth = - toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); + this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); set(this.scrollbarYRail, { display: 'block' }); - this.railYMarginHeight = - toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); + this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); set(this.scrollbarYRail, { display: '' }); this.railYHeight = null; this.railYRatio = null; @@ -1308,11 +1288,7 @@ PerfectScrollbar.prototype.onScroll = function onScroll (e) { updateGeometry(this); processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop); - processScrollDiff( - this, - 'left', - this.element.scrollLeft - this.lastScrollLeft - ); + processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft); this.lastScrollTop = Math.floor(this.element.scrollTop); this.lastScrollLeft = this.element.scrollLeft; diff --git a/dist/perfect-scrollbar.common.js.map b/dist/perfect-scrollbar.common.js.map index 95cc707..47e9748 100644 --- a/dist/perfect-scrollbar.common.js.map +++ b/dist/perfect-scrollbar.common.js.map @@ -1 +1 @@ -{"version":3,"file":"perfect-scrollbar.common.js","sources":["../src/lib/css.js","../src/lib/dom.js","../src/lib/class-names.js","../src/lib/event-manager.js","../src/process-scroll-diff.js","../src/lib/util.js","../src/update-geometry.js","../src/handlers/click-rail.js","../src/handlers/drag-thumb.js","../src/handlers/keyboard.js","../src/handlers/mouse-wheel.js","../src/handlers/touch.js","../src/index.js"],"sourcesContent":["export function get(element) {\n return getComputedStyle(element);\n}\n\nexport function set(element, obj) {\n for (const key in obj) {\n let val = obj[key];\n if (typeof val === 'number') {\n val = `${val}px`;\n }\n element.style[key] = val;\n }\n return element;\n}\n","export function div(className) {\n const div = document.createElement('div');\n div.className = className;\n return div;\n}\n\nconst elMatches =\n typeof Element !== 'undefined' &&\n (Element.prototype.matches ||\n Element.prototype.webkitMatchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector);\n\nexport function matches(element, query) {\n if (!elMatches) {\n throw new Error('No element matching method supported');\n }\n\n return elMatches.call(element, query);\n}\n\nexport function remove(element) {\n if (element.remove) {\n element.remove();\n } else {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n\nexport function queryChildren(element, selector) {\n return Array.prototype.filter.call(element.children, child =>\n matches(child, selector)\n );\n}\n","const cls = {\n main: 'ps',\n rtl: 'ps__rtl',\n element: {\n thumb: x => `ps__thumb-${x}`,\n rail: x => `ps__rail-${x}`,\n consuming: 'ps__child--consume',\n },\n state: {\n focus: 'ps--focus',\n clicking: 'ps--clicking',\n active: x => `ps--active-${x}`,\n scrolling: x => `ps--scrolling-${x}`,\n },\n};\n\nexport default cls;\n\n/*\n * Helper methods\n */\nconst scrollingClassTimeout = { x: null, y: null };\n\nexport function addScrollingClass(i, x) {\n const classList = i.element.classList;\n const className = cls.state.scrolling(x);\n\n if (classList.contains(className)) {\n clearTimeout(scrollingClassTimeout[x]);\n } else {\n classList.add(className);\n }\n}\n\nexport function removeScrollingClass(i, x) {\n scrollingClassTimeout[x] = setTimeout(\n () => i.isAlive && i.element.classList.remove(cls.state.scrolling(x)),\n i.settings.scrollingThreshold\n );\n}\n\nexport function setScrollingClassInstantly(i, x) {\n addScrollingClass(i, x);\n removeScrollingClass(i, x);\n}\n","class EventElement {\n constructor(element) {\n this.element = element;\n this.handlers = {};\n }\n\n bind(eventName, handler) {\n if (typeof this.handlers[eventName] === 'undefined') {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(handler);\n this.element.addEventListener(eventName, handler, false);\n }\n\n unbind(eventName, target) {\n this.handlers[eventName] = this.handlers[eventName].filter(handler => {\n if (target && handler !== target) {\n return true;\n }\n this.element.removeEventListener(eventName, handler, false);\n return false;\n });\n }\n\n unbindAll() {\n for (const name in this.handlers) {\n this.unbind(name);\n }\n }\n\n get isEmpty() {\n return Object.keys(this.handlers).every(\n key => this.handlers[key].length === 0\n );\n }\n}\n\nexport default class EventManager {\n constructor() {\n this.eventElements = [];\n }\n\n eventElement(element) {\n let ee = this.eventElements.filter(ee => ee.element === element)[0];\n if (!ee) {\n ee = new EventElement(element);\n this.eventElements.push(ee);\n }\n return ee;\n }\n\n bind(element, eventName, handler) {\n this.eventElement(element).bind(eventName, handler);\n }\n\n unbind(element, eventName, handler) {\n const ee = this.eventElement(element);\n ee.unbind(eventName, handler);\n\n if (ee.isEmpty) {\n // remove\n this.eventElements.splice(this.eventElements.indexOf(ee), 1);\n }\n }\n\n unbindAll() {\n this.eventElements.forEach(e => e.unbindAll());\n this.eventElements = [];\n }\n\n once(element, eventName, handler) {\n const ee = this.eventElement(element);\n const onceHandler = evt => {\n ee.unbind(eventName, onceHandler);\n handler(evt);\n };\n ee.bind(eventName, onceHandler);\n }\n}\n","import { setScrollingClassInstantly } from './lib/class-names';\n\nfunction createEvent(name) {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(name);\n } else {\n const evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(name, false, false, undefined);\n return evt;\n }\n}\n\nexport default function(\n i,\n axis,\n diff,\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n let fields;\n if (axis === 'top') {\n fields = [\n 'contentHeight',\n 'containerHeight',\n 'scrollTop',\n 'y',\n 'up',\n 'down',\n ];\n } else if (axis === 'left') {\n fields = [\n 'contentWidth',\n 'containerWidth',\n 'scrollLeft',\n 'x',\n 'left',\n 'right',\n ];\n } else {\n throw new Error('A proper axis should be provided');\n }\n\n processScrollDiff(i, diff, fields, useScrollingClass, forceFireReachEvent);\n}\n\nfunction processScrollDiff(\n i,\n diff,\n [contentHeight, containerHeight, scrollTop, y, up, down],\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n const element = i.element;\n\n // reset reach\n i.reach[y] = null;\n\n // 1 for subpixel rounding\n if (element[scrollTop] < 1) {\n i.reach[y] = 'start';\n }\n\n // 1 for subpixel rounding\n if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {\n i.reach[y] = 'end';\n }\n\n if (diff) {\n element.dispatchEvent(createEvent(`ps-scroll-${y}`));\n\n if (diff < 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${up}`));\n } else if (diff > 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${down}`));\n }\n\n if (useScrollingClass) {\n setScrollingClassInstantly(i, y);\n }\n }\n\n if (i.reach[y] && (diff || forceFireReachEvent)) {\n element.dispatchEvent(createEvent(`ps-${y}-reach-${i.reach[y]}`));\n }\n}\n","import * as CSS from './css';\nimport * as DOM from './dom';\n\nexport function toInt(x) {\n return parseInt(x, 10) || 0;\n}\n\nexport function isEditable(el) {\n return (\n DOM.matches(el, 'input,[contenteditable]') ||\n DOM.matches(el, 'select,[contenteditable]') ||\n DOM.matches(el, 'textarea,[contenteditable]') ||\n DOM.matches(el, 'button,[contenteditable]')\n );\n}\n\nexport function outerWidth(element) {\n const styles = CSS.get(element);\n return (\n toInt(styles.width) +\n toInt(styles.paddingLeft) +\n toInt(styles.paddingRight) +\n toInt(styles.borderLeftWidth) +\n toInt(styles.borderRightWidth)\n );\n}\n\nexport const env = {\n isWebKit:\n typeof document !== 'undefined' &&\n 'WebkitAppearance' in document.documentElement.style,\n supportsTouch:\n typeof window !== 'undefined' &&\n ('ontouchstart' in window ||\n ('maxTouchPoints' in window.navigator &&\n window.navigator.maxTouchPoints > 0) ||\n (window.DocumentTouch && document instanceof window.DocumentTouch)),\n supportsIePointer:\n typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,\n isChrome:\n typeof navigator !== 'undefined' &&\n /Chrome/i.test(navigator && navigator.userAgent),\n};\n","import * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport { toInt } from './lib/util';\n\nexport default function(i) {\n const element = i.element;\n const roundedScrollTop = Math.floor(element.scrollTop);\n const rect = element.getBoundingClientRect();\n\n i.containerWidth = Math.round(rect.width);\n i.containerHeight = Math.round(rect.height);\n\n i.contentWidth = element.scrollWidth;\n i.contentHeight = element.scrollHeight;\n\n if (!element.contains(i.scrollbarXRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('x')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarXRail);\n }\n if (!element.contains(i.scrollbarYRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('y')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarYRail);\n }\n\n if (\n !i.settings.suppressScrollX &&\n i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth\n ) {\n i.scrollbarXActive = true;\n i.railXWidth = i.containerWidth - i.railXMarginWidth;\n i.railXRatio = i.containerWidth / i.railXWidth;\n i.scrollbarXWidth = getThumbSize(\n i,\n toInt((i.railXWidth * i.containerWidth) / i.contentWidth)\n );\n i.scrollbarXLeft = toInt(\n ((i.negativeScrollAdjustment + element.scrollLeft) *\n (i.railXWidth - i.scrollbarXWidth)) /\n (i.contentWidth - i.containerWidth)\n );\n } else {\n i.scrollbarXActive = false;\n }\n\n if (\n !i.settings.suppressScrollY &&\n i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight\n ) {\n i.scrollbarYActive = true;\n i.railYHeight = i.containerHeight - i.railYMarginHeight;\n i.railYRatio = i.containerHeight / i.railYHeight;\n i.scrollbarYHeight = getThumbSize(\n i,\n toInt((i.railYHeight * i.containerHeight) / i.contentHeight)\n );\n i.scrollbarYTop = toInt(\n (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /\n (i.contentHeight - i.containerHeight)\n );\n } else {\n i.scrollbarYActive = false;\n }\n\n if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {\n i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;\n }\n if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {\n i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;\n }\n\n updateCss(element, i);\n\n if (i.scrollbarXActive) {\n element.classList.add(cls.state.active('x'));\n } else {\n element.classList.remove(cls.state.active('x'));\n i.scrollbarXWidth = 0;\n i.scrollbarXLeft = 0;\n element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;\n }\n if (i.scrollbarYActive) {\n element.classList.add(cls.state.active('y'));\n } else {\n element.classList.remove(cls.state.active('y'));\n i.scrollbarYHeight = 0;\n i.scrollbarYTop = 0;\n element.scrollTop = 0;\n }\n}\n\nfunction getThumbSize(i, thumbSize) {\n if (i.settings.minScrollbarLength) {\n thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);\n }\n if (i.settings.maxScrollbarLength) {\n thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);\n }\n return thumbSize;\n}\n\nfunction updateCss(element, i) {\n const xRailOffset = { width: i.railXWidth };\n const roundedScrollTop = Math.floor(element.scrollTop);\n\n if (i.isRtl) {\n xRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth -\n i.contentWidth;\n } else {\n xRailOffset.left = element.scrollLeft;\n }\n if (i.isScrollbarXUsingBottom) {\n xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;\n } else {\n xRailOffset.top = i.scrollbarXTop + roundedScrollTop;\n }\n CSS.set(i.scrollbarXRail, xRailOffset);\n\n const yRailOffset = { top: roundedScrollTop, height: i.railYHeight };\n if (i.isScrollbarYUsingRight) {\n if (i.isRtl) {\n yRailOffset.right =\n i.contentWidth -\n (i.negativeScrollAdjustment + element.scrollLeft) -\n i.scrollbarYRight -\n i.scrollbarYOuterWidth -\n 9;\n } else {\n yRailOffset.right = i.scrollbarYRight - element.scrollLeft;\n }\n } else {\n if (i.isRtl) {\n yRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth * 2 -\n i.contentWidth -\n i.scrollbarYLeft -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;\n }\n }\n CSS.set(i.scrollbarYRail, yRailOffset);\n\n CSS.set(i.scrollbarX, {\n left: i.scrollbarXLeft,\n width: i.scrollbarXWidth - i.railBorderXWidth,\n });\n CSS.set(i.scrollbarY, {\n top: i.scrollbarYTop,\n height: i.scrollbarYHeight - i.railBorderYWidth,\n });\n}\n","import updateGeometry from '../update-geometry';\n\nexport default function(i) {\n const element = i.element;\n\n i.event.bind(i.scrollbarY, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarYRail, 'mousedown', e => {\n const positionTop =\n e.pageY -\n window.pageYOffset -\n i.scrollbarYRail.getBoundingClientRect().top;\n const direction = positionTop > i.scrollbarYTop ? 1 : -1;\n\n i.element.scrollTop += direction * i.containerHeight;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n\n i.event.bind(i.scrollbarX, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarXRail, 'mousedown', e => {\n const positionLeft =\n e.pageX -\n window.pageXOffset -\n i.scrollbarXRail.getBoundingClientRect().left;\n const direction = positionLeft > i.scrollbarXLeft ? 1 : -1;\n\n i.element.scrollLeft += direction * i.containerWidth;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n}\n","import * as CSS from '../lib/css';\nimport * as DOM from '../lib/dom';\nimport cls, {\n addScrollingClass,\n removeScrollingClass,\n} from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { toInt } from '../lib/util';\n\nexport default function(i) {\n bindMouseScrollHandler(i, [\n 'containerWidth',\n 'contentWidth',\n 'pageX',\n 'railXWidth',\n 'scrollbarX',\n 'scrollbarXWidth',\n 'scrollLeft',\n 'x',\n 'scrollbarXRail',\n ]);\n bindMouseScrollHandler(i, [\n 'containerHeight',\n 'contentHeight',\n 'pageY',\n 'railYHeight',\n 'scrollbarY',\n 'scrollbarYHeight',\n 'scrollTop',\n 'y',\n 'scrollbarYRail',\n ]);\n}\n\nfunction bindMouseScrollHandler(\n i,\n [\n containerHeight,\n contentHeight,\n pageY,\n railYHeight,\n scrollbarY,\n scrollbarYHeight,\n scrollTop,\n y,\n scrollbarYRail,\n ]\n) {\n const element = i.element;\n\n let startingScrollTop = null;\n let startingMousePageY = null;\n let scrollBy = null;\n\n function mouseMoveHandler(e) {\n if (e.touches && e.touches[0]) {\n e[pageY] = e.touches[0].pageY;\n }\n element[scrollTop] =\n startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);\n addScrollingClass(i, y);\n updateGeometry(i);\n\n e.stopPropagation();\n if (e.type.startsWith('touch') && e.changedTouches.length > 1) {\n e.preventDefault();\n }\n }\n\n function mouseUpHandler() {\n removeScrollingClass(i, y);\n i[scrollbarYRail].classList.remove(cls.state.clicking);\n i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n }\n\n function bindMoves(e, touchMode) {\n startingScrollTop = element[scrollTop];\n if (touchMode && e.touches) {\n e[pageY] = e.touches[0].pageY;\n }\n startingMousePageY = e[pageY];\n scrollBy =\n (i[contentHeight] - i[containerHeight]) /\n (i[railYHeight] - i[scrollbarYHeight]);\n if (!touchMode) {\n i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);\n e.preventDefault();\n } else {\n i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);\n }\n\n i[scrollbarYRail].classList.add(cls.state.clicking);\n\n e.stopPropagation();\n }\n\n i.event.bind(i[scrollbarY], 'mousedown', e => {\n bindMoves(e);\n });\n i.event.bind(i[scrollbarY], 'touchstart', e => {\n bindMoves(e, true);\n });\n}\n","import * as DOM from '../lib/dom';\nimport updateGeometry from '../update-geometry';\nimport { isEditable } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n const elementHovered = () => DOM.matches(element, ':hover');\n const scrollbarFocused = () =>\n DOM.matches(i.scrollbarX, ':focus') || DOM.matches(i.scrollbarY, ':focus');\n\n function shouldPreventDefault(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n if (deltaX === 0) {\n if (!i.scrollbarYActive) {\n return false;\n }\n if (\n (scrollTop === 0 && deltaY > 0) ||\n (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n\n const scrollLeft = element.scrollLeft;\n if (deltaY === 0) {\n if (!i.scrollbarXActive) {\n return false;\n }\n if (\n (scrollLeft === 0 && deltaX < 0) ||\n (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n return true;\n }\n\n i.event.bind(i.ownerDocument, 'keydown', e => {\n if (\n (e.isDefaultPrevented && e.isDefaultPrevented()) ||\n e.defaultPrevented\n ) {\n return;\n }\n\n if (!elementHovered() && !scrollbarFocused()) {\n return;\n }\n\n let activeElement = document.activeElement\n ? document.activeElement\n : i.ownerDocument.activeElement;\n if (activeElement) {\n if (activeElement.tagName === 'IFRAME') {\n activeElement = activeElement.contentDocument.activeElement;\n } else {\n // go deeper if element is a webcomponent\n while (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n }\n if (isEditable(activeElement)) {\n return;\n }\n }\n\n let deltaX = 0;\n let deltaY = 0;\n\n switch (e.which) {\n case 37: // left\n if (e.metaKey) {\n deltaX = -i.contentWidth;\n } else if (e.altKey) {\n deltaX = -i.containerWidth;\n } else {\n deltaX = -30;\n }\n break;\n case 38: // up\n if (e.metaKey) {\n deltaY = i.contentHeight;\n } else if (e.altKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = 30;\n }\n break;\n case 39: // right\n if (e.metaKey) {\n deltaX = i.contentWidth;\n } else if (e.altKey) {\n deltaX = i.containerWidth;\n } else {\n deltaX = 30;\n }\n break;\n case 40: // down\n if (e.metaKey) {\n deltaY = -i.contentHeight;\n } else if (e.altKey) {\n deltaY = -i.containerHeight;\n } else {\n deltaY = -30;\n }\n break;\n case 32: // space bar\n if (e.shiftKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = -i.containerHeight;\n }\n break;\n case 33: // page up\n deltaY = i.containerHeight;\n break;\n case 34: // page down\n deltaY = -i.containerHeight;\n break;\n case 36: // home\n deltaY = i.contentHeight;\n break;\n case 35: // end\n deltaY = -i.contentHeight;\n break;\n default:\n return;\n }\n\n if (i.settings.suppressScrollX && deltaX !== 0) {\n return;\n }\n if (i.settings.suppressScrollY && deltaY !== 0) {\n return;\n }\n\n element.scrollTop -= deltaY;\n element.scrollLeft += deltaX;\n updateGeometry(i);\n\n if (shouldPreventDefault(deltaX, deltaY)) {\n e.preventDefault();\n }\n });\n}\n","import * as CSS from '../lib/css';\nimport cls from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { env } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n let shouldPrevent = false;\n\n function shouldPreventDefault(deltaX, deltaY) {\n const roundedScrollTop = Math.floor(element.scrollTop);\n const isTop = element.scrollTop === 0;\n const isBottom =\n roundedScrollTop + element.offsetHeight === element.scrollHeight;\n const isLeft = element.scrollLeft === 0;\n const isRight =\n element.scrollLeft + element.offsetWidth === element.scrollWidth;\n\n let hitsBound;\n\n // pick axis with primary direction\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n hitsBound = isTop || isBottom;\n } else {\n hitsBound = isLeft || isRight;\n }\n\n return hitsBound ? !i.settings.wheelPropagation : true;\n }\n\n function getDeltaFromEvent(e) {\n let deltaX = e.deltaX;\n let deltaY = -1 * e.deltaY;\n\n if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {\n // OS X Safari\n deltaX = (-1 * e.wheelDeltaX) / 6;\n deltaY = e.wheelDeltaY / 6;\n }\n\n if (e.deltaMode && e.deltaMode === 1) {\n // Firefox in deltaMode 1: Line scrolling\n deltaX *= 10;\n deltaY *= 10;\n }\n\n if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {\n // IE in some mouse drivers\n deltaX = 0;\n deltaY = e.wheelDelta;\n }\n\n if (e.shiftKey) {\n // reverse axis with shift key\n return [-deltaY, -deltaX];\n }\n return [deltaX, deltaY];\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n // FIXME: this is a workaround for issue in FF and IE #571\n if (!env.isWebKit && element.querySelector('select:focus')) {\n return true;\n }\n\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function mousewheelHandler(e) {\n const [deltaX, deltaY] = getDeltaFromEvent(e);\n\n if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {\n return;\n }\n\n let shouldPrevent = false;\n if (!i.settings.useBothWheelAxes) {\n // deltaX will only be used for horizontal scrolling and deltaY will\n // only be used for vertical scrolling - this is the default\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else if (i.scrollbarYActive && !i.scrollbarXActive) {\n // only vertical scrollbar is active and useBothWheelAxes option is\n // active, so let's scroll vertical bar using both mouse wheel axes\n if (deltaY) {\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n } else {\n element.scrollTop += deltaX * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n } else if (i.scrollbarXActive && !i.scrollbarYActive) {\n // useBothWheelAxes and only horizontal bar is active, so use both\n // wheel axes for horizontal bar\n if (deltaX) {\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else {\n element.scrollLeft -= deltaY * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n }\n\n updateGeometry(i);\n\n shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);\n if (shouldPrevent && !e.ctrlKey) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n if (typeof window.onwheel !== 'undefined') {\n i.event.bind(element, 'wheel', mousewheelHandler);\n } else if (typeof window.onmousewheel !== 'undefined') {\n i.event.bind(element, 'mousewheel', mousewheelHandler);\n }\n}\n","import updateGeometry from '../update-geometry';\nimport cls from '../lib/class-names';\nimport * as CSS from '../lib/css';\nimport { env } from '../lib/util';\n\nexport default function (i) {\n if (!env.supportsTouch && !env.supportsIePointer) {\n return;\n }\n\n const element = i.element;\n\n const state = {\n startOffset: {},\n startTime: 0,\n speed: {},\n easingLoop: null,\n };\n\n function shouldPrevent(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n const scrollLeft = element.scrollLeft;\n const magnitudeX = Math.abs(deltaX);\n const magnitudeY = Math.abs(deltaY);\n\n if (magnitudeY > magnitudeX) {\n // user is perhaps trying to swipe up/down the page\n\n if (\n (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||\n (deltaY > 0 && scrollTop === 0)\n ) {\n // set prevent for mobile Chrome refresh\n return window.scrollY === 0 && deltaY > 0 && env.isChrome;\n }\n } else if (magnitudeX > magnitudeY) {\n // user is perhaps trying to swipe left/right across the page\n\n if (\n (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||\n (deltaX > 0 && scrollLeft === 0)\n ) {\n return true;\n }\n }\n\n return true;\n }\n\n function applyTouchMove(differenceX, differenceY) {\n element.scrollTop -= differenceY;\n element.scrollLeft -= differenceX;\n\n updateGeometry(i);\n }\n\n function getTouch(e) {\n if (e.targetTouches) {\n return e.targetTouches[0];\n }\n // Maybe IE pointer\n return e;\n }\n\n function shouldHandle(e) {\n if (e.target === i.scrollbarX || e.target === i.scrollbarY) {\n return false;\n }\n if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {\n return false;\n }\n if (e.targetTouches && e.targetTouches.length === 1) {\n return true;\n }\n if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n return true;\n }\n return false;\n }\n\n function touchStart(e) {\n if (!shouldHandle(e)) {\n return;\n }\n\n const touch = getTouch(e);\n\n state.startOffset.pageX = touch.pageX;\n state.startOffset.pageY = touch.pageY;\n\n state.startTime = new Date().getTime();\n\n if (state.easingLoop !== null) {\n clearInterval(state.easingLoop);\n }\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function touchMove(e) {\n if (shouldHandle(e)) {\n const touch = getTouch(e);\n\n const currentOffset = { pageX: touch.pageX, pageY: touch.pageY };\n\n const differenceX = currentOffset.pageX - state.startOffset.pageX;\n const differenceY = currentOffset.pageY - state.startOffset.pageY;\n\n if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {\n return;\n }\n\n applyTouchMove(differenceX, differenceY);\n state.startOffset = currentOffset;\n\n const currentTime = new Date().getTime();\n\n const timeGap = currentTime - state.startTime;\n if (timeGap > 0) {\n state.speed.x = differenceX / timeGap;\n state.speed.y = differenceY / timeGap;\n state.startTime = currentTime;\n }\n\n if (shouldPrevent(differenceX, differenceY)) {\n // Prevent the default behavior if the event is cancelable\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n }\n }\n\n function touchEnd() {\n if (i.settings.swipeEasing) {\n clearInterval(state.easingLoop);\n state.easingLoop = setInterval(() => {\n if (i.isInitialized) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (!state.speed.x && !state.speed.y) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) {\n clearInterval(state.easingLoop);\n return;\n }\n\n applyTouchMove(state.speed.x * 30, state.speed.y * 30);\n\n state.speed.x *= 0.8;\n state.speed.y *= 0.8;\n }, 10);\n }\n }\n\n if (env.supportsTouch) {\n i.event.bind(element, 'touchstart', touchStart);\n i.event.bind(element, 'touchmove', touchMove);\n i.event.bind(element, 'touchend', touchEnd);\n } else if (env.supportsIePointer) {\n if (window.PointerEvent) {\n i.event.bind(element, 'pointerdown', touchStart);\n i.event.bind(element, 'pointermove', touchMove);\n i.event.bind(element, 'pointerup', touchEnd);\n } else if (window.MSPointerEvent) {\n i.event.bind(element, 'MSPointerDown', touchStart);\n i.event.bind(element, 'MSPointerMove', touchMove);\n i.event.bind(element, 'MSPointerUp', touchEnd);\n }\n }\n}\n","/* eslint-disable */\n\nimport * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport EventManager from './lib/event-manager';\nimport processScrollDiff from './process-scroll-diff';\nimport updateGeometry from './update-geometry';\nimport { toInt, outerWidth } from './lib/util';\n\nimport clickRail from './handlers/click-rail';\nimport dragThumb from './handlers/drag-thumb';\nimport keyboard from './handlers/keyboard';\nimport wheel from './handlers/mouse-wheel';\nimport touch from './handlers/touch';\n\nconst defaultSettings = () => ({\n handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],\n maxScrollbarLength: null,\n minScrollbarLength: null,\n scrollingThreshold: 1000,\n scrollXMarginOffset: 0,\n scrollYMarginOffset: 0,\n suppressScrollX: false,\n suppressScrollY: false,\n swipeEasing: true,\n useBothWheelAxes: false,\n wheelPropagation: true,\n wheelSpeed: 1,\n});\n\nconst handlers = {\n 'click-rail': clickRail,\n 'drag-thumb': dragThumb,\n keyboard,\n wheel,\n touch,\n};\n\nexport default class PerfectScrollbar {\n constructor(element, userSettings = {}) {\n if (typeof element === 'string') {\n element = document.querySelector(element);\n }\n\n if (!element || !element.nodeName) {\n throw new Error('no element is specified to initialize PerfectScrollbar');\n }\n\n this.element = element;\n\n element.classList.add(cls.main);\n\n this.settings = defaultSettings();\n for (const key in userSettings) {\n this.settings[key] = userSettings[key];\n }\n\n this.containerWidth = null;\n this.containerHeight = null;\n this.contentWidth = null;\n this.contentHeight = null;\n\n const focus = () => element.classList.add(cls.state.focus);\n const blur = () => element.classList.remove(cls.state.focus);\n\n this.isRtl = CSS.get(element).direction === 'rtl';\n if (this.isRtl === true) {\n element.classList.add(cls.rtl);\n }\n this.isNegativeScroll = (() => {\n const originalScrollLeft = element.scrollLeft;\n let result = null;\n element.scrollLeft = -1;\n result = element.scrollLeft < 0;\n element.scrollLeft = originalScrollLeft;\n return result;\n })();\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? element.scrollWidth - element.clientWidth\n : 0;\n this.event = new EventManager();\n this.ownerDocument = element.ownerDocument || document;\n\n this.scrollbarXRail = DOM.div(cls.element.rail('x'));\n element.appendChild(this.scrollbarXRail);\n this.scrollbarX = DOM.div(cls.element.thumb('x'));\n this.scrollbarXRail.appendChild(this.scrollbarX);\n this.scrollbarX.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarX, 'focus', focus);\n this.event.bind(this.scrollbarX, 'blur', blur);\n this.scrollbarXActive = null;\n this.scrollbarXWidth = null;\n this.scrollbarXLeft = null;\n const railXStyle = CSS.get(this.scrollbarXRail);\n this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);\n if (isNaN(this.scrollbarXBottom)) {\n this.isScrollbarXUsingBottom = false;\n this.scrollbarXTop = toInt(railXStyle.top);\n } else {\n this.isScrollbarXUsingBottom = true;\n }\n this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);\n // Set rail to display:block to calculate margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);\n CSS.set(this.scrollbarXRail, { display: '' });\n this.railXWidth = null;\n this.railXRatio = null;\n\n this.scrollbarYRail = DOM.div(cls.element.rail('y'));\n element.appendChild(this.scrollbarYRail);\n this.scrollbarY = DOM.div(cls.element.thumb('y'));\n this.scrollbarYRail.appendChild(this.scrollbarY);\n this.scrollbarY.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarY, 'focus', focus);\n this.event.bind(this.scrollbarY, 'blur', blur);\n this.scrollbarYActive = null;\n this.scrollbarYHeight = null;\n this.scrollbarYTop = null;\n const railYStyle = CSS.get(this.scrollbarYRail);\n this.scrollbarYRight = parseInt(railYStyle.right, 10);\n if (isNaN(this.scrollbarYRight)) {\n this.isScrollbarYUsingRight = false;\n this.scrollbarYLeft = toInt(railYStyle.left);\n } else {\n this.isScrollbarYUsingRight = true;\n }\n this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;\n this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);\n CSS.set(this.scrollbarYRail, { display: '' });\n this.railYHeight = null;\n this.railYRatio = null;\n\n this.reach = {\n x:\n element.scrollLeft <= 0\n ? 'start'\n : element.scrollLeft >= this.contentWidth - this.containerWidth\n ? 'end'\n : null,\n y:\n element.scrollTop <= 0\n ? 'start'\n : element.scrollTop >= this.contentHeight - this.containerHeight\n ? 'end'\n : null,\n };\n\n this.isAlive = true;\n\n this.settings.handlers.forEach((handlerName) => handlers[handlerName](this));\n\n this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only\n this.lastScrollLeft = element.scrollLeft; // for onScroll only\n this.event.bind(this.element, 'scroll', (e) => this.onScroll(e));\n updateGeometry(this);\n }\n\n update() {\n if (!this.isAlive) {\n return;\n }\n\n // Recalcuate negative scrollLeft adjustment\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? this.element.scrollWidth - this.element.clientWidth\n : 0;\n\n // Recalculate rail margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railXMarginWidth =\n toInt(CSS.get(this.scrollbarXRail).marginLeft) +\n toInt(CSS.get(this.scrollbarXRail).marginRight);\n this.railYMarginHeight =\n toInt(CSS.get(this.scrollbarYRail).marginTop) +\n toInt(CSS.get(this.scrollbarYRail).marginBottom);\n\n // Hide scrollbars not to affect scrollWidth and scrollHeight\n CSS.set(this.scrollbarXRail, { display: 'none' });\n CSS.set(this.scrollbarYRail, { display: 'none' });\n\n updateGeometry(this);\n\n processScrollDiff(this, 'top', 0, false, true);\n processScrollDiff(this, 'left', 0, false, true);\n\n CSS.set(this.scrollbarXRail, { display: '' });\n CSS.set(this.scrollbarYRail, { display: '' });\n }\n\n onScroll(e) {\n if (!this.isAlive) {\n return;\n }\n\n updateGeometry(this);\n processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);\n processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);\n\n this.lastScrollTop = Math.floor(this.element.scrollTop);\n this.lastScrollLeft = this.element.scrollLeft;\n }\n\n destroy() {\n if (!this.isAlive) {\n return;\n }\n\n this.event.unbindAll();\n DOM.remove(this.scrollbarX);\n DOM.remove(this.scrollbarY);\n DOM.remove(this.scrollbarXRail);\n DOM.remove(this.scrollbarYRail);\n this.removePsClasses();\n\n // unset elements\n this.element = null;\n this.scrollbarX = null;\n this.scrollbarY = null;\n this.scrollbarXRail = null;\n this.scrollbarYRail = null;\n\n this.isAlive = false;\n }\n\n removePsClasses() {\n this.element.className = this.element.className\n .split(' ')\n .filter((name) => !name.match(/^ps([-_].+|)$/))\n .join(' ');\n }\n}\n"],"names":["const","let","this","processScrollDiff","DOM.matches","CSS.get","DOM.queryChildren","DOM.remove","CSS.set","dragThumb","DOM.div"],"mappings":";;;;;;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;EAC3B,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAClC;;AAEM,SAAS,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE;EAChC,KAAKA,IA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AC,IAAI,CAAC,UAAU,CAAC,CAAC;EAC9BA,MAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EAC9BA,MAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;EAClCA,MAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;EAChC,IAAI,CAAC,eAAe,EAAE,CAAC;;;EAGvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;EACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;EACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;EACvB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;EAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;EAE3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;AACvB,EAAC;;AAEH,2BAAE,8CAAkB;EAClB,IAAM,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS;KAC5C,KAAK,CAAC,GAAG,CAAC;KACV,MAAM,WAAE,IAAI,EAAE,SAAG,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,IAAC,CAAC;KAC9C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;;;;"} \ No newline at end of file diff --git a/dist/perfect-scrollbar.esm.js b/dist/perfect-scrollbar.esm.js index 4215b17..d54e121 100644 --- a/dist/perfect-scrollbar.esm.js +++ b/dist/perfect-scrollbar.esm.js @@ -1,6 +1,6 @@ /*! - * perfect-scrollbar v1.5.3 - * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * perfect-scrollbar v1.5.6 + * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT */ @@ -186,40 +186,22 @@ EventManager.prototype.once = function once (element, eventName, handler) { function createEvent(name) { if (typeof window.CustomEvent === 'function') { return new CustomEvent(name); - } else { - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(name, false, false, undefined); - return evt; } + + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(name, false, false, undefined); + return evt; } -function processScrollDiff( - i, - axis, - diff, - useScrollingClass, - forceFireReachEvent -) { +function processScrollDiff (i, axis, diff, useScrollingClass, forceFireReachEvent) { if ( useScrollingClass === void 0 ) useScrollingClass = true; if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false; var fields; if (axis === 'top') { - fields = [ - 'contentHeight', - 'containerHeight', - 'scrollTop', - 'y', - 'up', - 'down' ]; + fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down']; } else if (axis === 'left') { - fields = [ - 'contentWidth', - 'containerWidth', - 'scrollLeft', - 'x', - 'left', - 'right' ]; + fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right']; } else { throw new Error('A proper axis should be provided'); } @@ -318,27 +300,27 @@ var env = { /Chrome/i.test(navigator && navigator.userAgent), }; -function updateGeometry(i) { +/* eslint-disable no-lonely-if */ + +function updateGeometry (i) { var element = i.element; var roundedScrollTop = Math.floor(element.scrollTop); var rect = element.getBoundingClientRect(); - i.containerWidth = Math.round(rect.width); - i.containerHeight = Math.round(rect.height); + i.containerWidth = Math.floor(rect.width); + i.containerHeight = Math.floor(rect.height); i.contentWidth = element.scrollWidth; i.contentHeight = element.scrollHeight; if (!element.contains(i.scrollbarXRail)) { // clean up and append - queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarXRail); } if (!element.contains(i.scrollbarYRail)) { // clean up and append - queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarYRail); } @@ -349,13 +331,9 @@ function updateGeometry(i) { i.scrollbarXActive = true; i.railXWidth = i.containerWidth - i.railXMarginWidth; i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize( - i, - toInt((i.railXWidth * i.containerWidth) / i.contentWidth) - ); + i.scrollbarXWidth = getThumbSize(i, toInt((i.railXWidth * i.containerWidth) / i.contentWidth)); i.scrollbarXLeft = toInt( - ((i.negativeScrollAdjustment + element.scrollLeft) * - (i.railXWidth - i.scrollbarXWidth)) / + ((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth)) / (i.contentWidth - i.containerWidth) ); } else { @@ -424,10 +402,7 @@ function updateCss(element, i) { if (i.isRtl) { xRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth - - i.contentWidth; + i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; } else { xRailOffset.left = element.scrollLeft; } @@ -475,15 +450,14 @@ function updateCss(element, i) { }); } -function clickRail(i) { - var element = i.element; +/* eslint-disable */ + +function clickRail (i) { + // const element = i.element; i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarYRail, 'mousedown', function (e) { - var positionTop = - e.pageY - - window.pageYOffset - - i.scrollbarYRail.getBoundingClientRect().top; + var positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top; var direction = positionTop > i.scrollbarYTop ? 1 : -1; i.element.scrollTop += direction * i.containerHeight; @@ -495,9 +469,7 @@ function clickRail(i) { i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarXRail, 'mousedown', function (e) { var positionLeft = - e.pageX - - window.pageXOffset - - i.scrollbarXRail.getBoundingClientRect().left; + e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left; var direction = positionLeft > i.scrollbarXLeft ? 1 : -1; i.element.scrollLeft += direction * i.containerWidth; @@ -507,17 +479,9 @@ function clickRail(i) { }); } -function dragThumb(i) { - bindMouseScrollHandler(i, [ - 'containerWidth', - 'contentWidth', - 'pageX', - 'railXWidth', - 'scrollbarX', - 'scrollbarXWidth', - 'scrollLeft', - 'x', - 'scrollbarXRail' ]); +var activeSlider = null; // Variable to track the currently active slider + +function setupScrollHandlers(i) { bindMouseScrollHandler(i, [ 'containerHeight', 'contentHeight', @@ -528,80 +492,102 @@ function dragThumb(i) { 'scrollTop', 'y', 'scrollbarYRail' ]); + + bindMouseScrollHandler(i, [ + 'containerWidth', + 'contentWidth', + 'pageX', + 'railXWidth', + 'scrollbarX', + 'scrollbarXWidth', + 'scrollLeft', + 'x', + 'scrollbarXRail' ]); } function bindMouseScrollHandler( i, ref ) { - var containerHeight = ref[0]; - var contentHeight = ref[1]; - var pageY = ref[2]; - var railYHeight = ref[3]; - var scrollbarY = ref[4]; - var scrollbarYHeight = ref[5]; - var scrollTop = ref[6]; - var y = ref[7]; - var scrollbarYRail = ref[8]; + var containerDimension = ref[0]; + var contentDimension = ref[1]; + var pageAxis = ref[2]; + var railDimension = ref[3]; + var scrollbarAxis = ref[4]; + var scrollbarDimension = ref[5]; + var scrollAxis = ref[6]; + var axis = ref[7]; + var scrollbarRail = ref[8]; var element = i.element; - - var startingScrollTop = null; - var startingMousePageY = null; + var startingScrollPosition = null; + var startingMousePagePosition = null; var scrollBy = null; - function mouseMoveHandler(e) { + function moveHandler(e) { if (e.touches && e.touches[0]) { - e[pageY] = e.touches[0].pageY; + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; } - element[scrollTop] = - startingScrollTop + scrollBy * (e[pageY] - startingMousePageY); - addScrollingClass(i, y); - updateGeometry(i); - e.stopPropagation(); - if (e.type.startsWith('touch') && e.changedTouches.length > 1) { + // Only move if the active slider is the one we started with + if (activeSlider === scrollbarAxis) { + element[scrollAxis] = + startingScrollPosition + scrollBy * (e[pageAxis] - startingMousePagePosition); + addScrollingClass(i, axis); + updateGeometry(i); + + e.stopPropagation(); e.preventDefault(); } } - function mouseUpHandler() { - removeScrollingClass(i, y); - i[scrollbarYRail].classList.remove(cls.state.clicking); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + function endHandler() { + removeScrollingClass(i, axis); + i[scrollbarRail].classList.remove(cls.state.clicking); + document.removeEventListener('mousemove', moveHandler); + document.removeEventListener('mouseup', endHandler); + document.removeEventListener('touchmove', moveHandler); + document.removeEventListener('touchend', endHandler); + activeSlider = null; // Reset active slider when interaction ends } - function bindMoves(e, touchMode) { - startingScrollTop = element[scrollTop]; - if (touchMode && e.touches) { - e[pageY] = e.touches[0].pageY; - } - startingMousePageY = e[pageY]; - scrollBy = - (i[contentHeight] - i[containerHeight]) / - (i[railYHeight] - i[scrollbarYHeight]); - if (!touchMode) { - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - e.preventDefault(); - } else { - i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler); - } + function bindMoves(e) { + if (activeSlider === null) { + // Only bind if no slider is currently active + activeSlider = scrollbarAxis; // Set current slider as active - i[scrollbarYRail].classList.add(cls.state.clicking); + startingScrollPosition = element[scrollAxis]; + if (e.touches) { + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; + } + startingMousePagePosition = e[pageAxis]; + scrollBy = + (i[contentDimension] - i[containerDimension]) / (i[railDimension] - i[scrollbarDimension]); + + if (!e.touches) { + document.addEventListener('mousemove', moveHandler); + document.addEventListener('mouseup', endHandler); + } else { + document.addEventListener('touchmove', moveHandler, { passive: false }); + document.addEventListener('touchend', endHandler); + } + + i[scrollbarRail].classList.add(cls.state.clicking); + } e.stopPropagation(); + if (e.cancelable) { + e.preventDefault(); + } } - i.event.bind(i[scrollbarY], 'mousedown', function (e) { - bindMoves(e); - }); - i.event.bind(i[scrollbarY], 'touchstart', function (e) { - bindMoves(e, true); - }); + i[scrollbarAxis].addEventListener('mousedown', bindMoves); + i[scrollbarAxis].addEventListener('touchstart', bindMoves); } -function keyboard(i) { +/* eslint-disable */ + +function keyboard (i) { var element = i.element; var elementHovered = function () { return matches(element, ':hover'); }; @@ -637,10 +623,7 @@ function keyboard(i) { } i.event.bind(i.ownerDocument, 'keydown', function (e) { - if ( - (e.isDefaultPrevented && e.isDefaultPrevented()) || - e.defaultPrevented - ) { + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) { return; } @@ -745,17 +728,17 @@ function keyboard(i) { }); } -function wheel(i) { +/* eslint-disable */ + +function wheel (i) { var element = i.element; function shouldPreventDefault(deltaX, deltaY) { var roundedScrollTop = Math.floor(element.scrollTop); var isTop = element.scrollTop === 0; - var isBottom = - roundedScrollTop + element.offsetHeight === element.scrollHeight; + var isBottom = roundedScrollTop + element.offsetHeight === element.scrollHeight; var isLeft = element.scrollLeft === 0; - var isRight = - element.scrollLeft + element.offsetWidth === element.scrollWidth; + var isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth; var hitsBound; @@ -899,13 +882,20 @@ function wheel(i) { } } -function touch(i) { +function touch (i) { if (!env.supportsTouch && !env.supportsIePointer) { return; } var element = i.element; + var state = { + startOffset: {}, + startTime: 0, + speed: {}, + easingLoop: null, + }; + function shouldPrevent(deltaX, deltaY) { var scrollTop = Math.floor(element.scrollTop); var scrollLeft = element.scrollLeft; @@ -943,32 +933,25 @@ function touch(i) { updateGeometry(i); } - var startOffset = {}; - var startTime = 0; - var speed = {}; - var easingLoop = null; - function getTouch(e) { if (e.targetTouches) { return e.targetTouches[0]; - } else { - // Maybe IE pointer - return e; } + // Maybe IE pointer + return e; } function shouldHandle(e) { + if (e.target === i.scrollbarX || e.target === i.scrollbarY) { + return false; + } if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) { return false; } if (e.targetTouches && e.targetTouches.length === 1) { return true; } - if ( - e.pointerType && - e.pointerType !== 'mouse' && - e.pointerType !== e.MSPOINTER_TYPE_MOUSE - ) { + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { return true; } return false; @@ -981,13 +964,13 @@ function touch(i) { var touch = getTouch(e); - startOffset.pageX = touch.pageX; - startOffset.pageY = touch.pageY; + state.startOffset.pageX = touch.pageX; + state.startOffset.pageY = touch.pageY; - startTime = new Date().getTime(); + state.startTime = new Date().getTime(); - if (easingLoop !== null) { - clearInterval(easingLoop); + if (state.easingLoop !== null) { + clearInterval(state.easingLoop); } } @@ -1042,58 +1025,57 @@ function touch(i) { var currentOffset = { pageX: touch.pageX, pageY: touch.pageY }; - var differenceX = currentOffset.pageX - startOffset.pageX; - var differenceY = currentOffset.pageY - startOffset.pageY; + var differenceX = currentOffset.pageX - state.startOffset.pageX; + var differenceY = currentOffset.pageY - state.startOffset.pageY; if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) { return; } applyTouchMove(differenceX, differenceY); - startOffset = currentOffset; + state.startOffset = currentOffset; var currentTime = new Date().getTime(); - var timeGap = currentTime - startTime; + var timeGap = currentTime - state.startTime; if (timeGap > 0) { - speed.x = differenceX / timeGap; - speed.y = differenceY / timeGap; - startTime = currentTime; + state.speed.x = differenceX / timeGap; + state.speed.y = differenceY / timeGap; + state.startTime = currentTime; } if (shouldPrevent(differenceX, differenceY)) { - e.preventDefault(); + // Prevent the default behavior if the event is cancelable + if (e.cancelable) { + e.preventDefault(); + } } } } + function touchEnd() { if (i.settings.swipeEasing) { - clearInterval(easingLoop); - easingLoop = setInterval(function() { + clearInterval(state.easingLoop); + state.easingLoop = setInterval(function () { if (i.isInitialized) { - clearInterval(easingLoop); - return; - } - - if (!speed.x && !speed.y) { - clearInterval(easingLoop); + clearInterval(state.easingLoop); return; } - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { - clearInterval(easingLoop); + if (!state.speed.x && !state.speed.y) { + clearInterval(state.easingLoop); return; } - if (!i.element) { - clearInterval(easingLoop); + if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) { + clearInterval(state.easingLoop); return; } - applyTouchMove(speed.x * 30, speed.y * 30); + applyTouchMove(state.speed.x * 30, state.speed.y * 30); - speed.x *= 0.8; - speed.y *= 0.8; + state.speed.x *= 0.8; + state.speed.y *= 0.8; }, 10); } } @@ -1115,6 +1097,8 @@ function touch(i) { } } +/* eslint-disable */ + var defaultSettings = function () { return ({ handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'], maxScrollbarLength: null, @@ -1132,7 +1116,7 @@ var defaultSettings = function () { return ({ var handlers = { 'click-rail': clickRail, - 'drag-thumb': dragThumb, + 'drag-thumb': setupScrollHandlers, keyboard: keyboard, wheel: wheel, touch: touch, @@ -1203,12 +1187,10 @@ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) { } else { this.isScrollbarXUsingBottom = true; } - this.railBorderXWidth = - toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); + this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); // Set rail to display:block to calculate margins set(this.scrollbarXRail, { display: 'block' }); - this.railXMarginWidth = - toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); + this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); set(this.scrollbarXRail, { display: '' }); this.railXWidth = null; this.railXRatio = null; @@ -1232,11 +1214,9 @@ var PerfectScrollbar = function PerfectScrollbar(element, userSettings) { this.isScrollbarYUsingRight = true; } this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null; - this.railBorderYWidth = - toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); + this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); set(this.scrollbarYRail, { display: 'block' }); - this.railYMarginHeight = - toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); + this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); set(this.scrollbarYRail, { display: '' }); this.railYHeight = null; this.railYRatio = null; @@ -1306,11 +1286,7 @@ PerfectScrollbar.prototype.onScroll = function onScroll (e) { updateGeometry(this); processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop); - processScrollDiff( - this, - 'left', - this.element.scrollLeft - this.lastScrollLeft - ); + processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft); this.lastScrollTop = Math.floor(this.element.scrollTop); this.lastScrollLeft = this.element.scrollLeft; diff --git a/dist/perfect-scrollbar.esm.js.map b/dist/perfect-scrollbar.esm.js.map index 8a306e9..64ea834 100644 --- a/dist/perfect-scrollbar.esm.js.map +++ b/dist/perfect-scrollbar.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"perfect-scrollbar.esm.js","sources":["../src/lib/css.js","../src/lib/dom.js","../src/lib/class-names.js","../src/lib/event-manager.js","../src/process-scroll-diff.js","../src/lib/util.js","../src/update-geometry.js","../src/handlers/click-rail.js","../src/handlers/drag-thumb.js","../src/handlers/keyboard.js","../src/handlers/mouse-wheel.js","../src/handlers/touch.js","../src/index.js"],"sourcesContent":["export function get(element) {\n return getComputedStyle(element);\n}\n\nexport function set(element, obj) {\n for (const key in obj) {\n let val = obj[key];\n if (typeof val === 'number') {\n val = `${val}px`;\n }\n element.style[key] = val;\n }\n return element;\n}\n","export function div(className) {\n const div = document.createElement('div');\n div.className = className;\n return div;\n}\n\nconst elMatches =\n typeof Element !== 'undefined' &&\n (Element.prototype.matches ||\n Element.prototype.webkitMatchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector);\n\nexport function matches(element, query) {\n if (!elMatches) {\n throw new Error('No element matching method supported');\n }\n\n return elMatches.call(element, query);\n}\n\nexport function remove(element) {\n if (element.remove) {\n element.remove();\n } else {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n\nexport function queryChildren(element, selector) {\n return Array.prototype.filter.call(element.children, child =>\n matches(child, selector)\n );\n}\n","const cls = {\n main: 'ps',\n rtl: 'ps__rtl',\n element: {\n thumb: x => `ps__thumb-${x}`,\n rail: x => `ps__rail-${x}`,\n consuming: 'ps__child--consume',\n },\n state: {\n focus: 'ps--focus',\n clicking: 'ps--clicking',\n active: x => `ps--active-${x}`,\n scrolling: x => `ps--scrolling-${x}`,\n },\n};\n\nexport default cls;\n\n/*\n * Helper methods\n */\nconst scrollingClassTimeout = { x: null, y: null };\n\nexport function addScrollingClass(i, x) {\n const classList = i.element.classList;\n const className = cls.state.scrolling(x);\n\n if (classList.contains(className)) {\n clearTimeout(scrollingClassTimeout[x]);\n } else {\n classList.add(className);\n }\n}\n\nexport function removeScrollingClass(i, x) {\n scrollingClassTimeout[x] = setTimeout(\n () => i.isAlive && i.element.classList.remove(cls.state.scrolling(x)),\n i.settings.scrollingThreshold\n );\n}\n\nexport function setScrollingClassInstantly(i, x) {\n addScrollingClass(i, x);\n removeScrollingClass(i, x);\n}\n","class EventElement {\n constructor(element) {\n this.element = element;\n this.handlers = {};\n }\n\n bind(eventName, handler) {\n if (typeof this.handlers[eventName] === 'undefined') {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(handler);\n this.element.addEventListener(eventName, handler, false);\n }\n\n unbind(eventName, target) {\n this.handlers[eventName] = this.handlers[eventName].filter(handler => {\n if (target && handler !== target) {\n return true;\n }\n this.element.removeEventListener(eventName, handler, false);\n return false;\n });\n }\n\n unbindAll() {\n for (const name in this.handlers) {\n this.unbind(name);\n }\n }\n\n get isEmpty() {\n return Object.keys(this.handlers).every(\n key => this.handlers[key].length === 0\n );\n }\n}\n\nexport default class EventManager {\n constructor() {\n this.eventElements = [];\n }\n\n eventElement(element) {\n let ee = this.eventElements.filter(ee => ee.element === element)[0];\n if (!ee) {\n ee = new EventElement(element);\n this.eventElements.push(ee);\n }\n return ee;\n }\n\n bind(element, eventName, handler) {\n this.eventElement(element).bind(eventName, handler);\n }\n\n unbind(element, eventName, handler) {\n const ee = this.eventElement(element);\n ee.unbind(eventName, handler);\n\n if (ee.isEmpty) {\n // remove\n this.eventElements.splice(this.eventElements.indexOf(ee), 1);\n }\n }\n\n unbindAll() {\n this.eventElements.forEach(e => e.unbindAll());\n this.eventElements = [];\n }\n\n once(element, eventName, handler) {\n const ee = this.eventElement(element);\n const onceHandler = evt => {\n ee.unbind(eventName, onceHandler);\n handler(evt);\n };\n ee.bind(eventName, onceHandler);\n }\n}\n","import { setScrollingClassInstantly } from './lib/class-names';\n\nfunction createEvent(name) {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(name);\n } else {\n const evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(name, false, false, undefined);\n return evt;\n }\n}\n\nexport default function(\n i,\n axis,\n diff,\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n let fields;\n if (axis === 'top') {\n fields = [\n 'contentHeight',\n 'containerHeight',\n 'scrollTop',\n 'y',\n 'up',\n 'down',\n ];\n } else if (axis === 'left') {\n fields = [\n 'contentWidth',\n 'containerWidth',\n 'scrollLeft',\n 'x',\n 'left',\n 'right',\n ];\n } else {\n throw new Error('A proper axis should be provided');\n }\n\n processScrollDiff(i, diff, fields, useScrollingClass, forceFireReachEvent);\n}\n\nfunction processScrollDiff(\n i,\n diff,\n [contentHeight, containerHeight, scrollTop, y, up, down],\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n const element = i.element;\n\n // reset reach\n i.reach[y] = null;\n\n // 1 for subpixel rounding\n if (element[scrollTop] < 1) {\n i.reach[y] = 'start';\n }\n\n // 1 for subpixel rounding\n if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {\n i.reach[y] = 'end';\n }\n\n if (diff) {\n element.dispatchEvent(createEvent(`ps-scroll-${y}`));\n\n if (diff < 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${up}`));\n } else if (diff > 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${down}`));\n }\n\n if (useScrollingClass) {\n setScrollingClassInstantly(i, y);\n }\n }\n\n if (i.reach[y] && (diff || forceFireReachEvent)) {\n element.dispatchEvent(createEvent(`ps-${y}-reach-${i.reach[y]}`));\n }\n}\n","import * as CSS from './css';\nimport * as DOM from './dom';\n\nexport function toInt(x) {\n return parseInt(x, 10) || 0;\n}\n\nexport function isEditable(el) {\n return (\n DOM.matches(el, 'input,[contenteditable]') ||\n DOM.matches(el, 'select,[contenteditable]') ||\n DOM.matches(el, 'textarea,[contenteditable]') ||\n DOM.matches(el, 'button,[contenteditable]')\n );\n}\n\nexport function outerWidth(element) {\n const styles = CSS.get(element);\n return (\n toInt(styles.width) +\n toInt(styles.paddingLeft) +\n toInt(styles.paddingRight) +\n toInt(styles.borderLeftWidth) +\n toInt(styles.borderRightWidth)\n );\n}\n\nexport const env = {\n isWebKit:\n typeof document !== 'undefined' &&\n 'WebkitAppearance' in document.documentElement.style,\n supportsTouch:\n typeof window !== 'undefined' &&\n ('ontouchstart' in window ||\n ('maxTouchPoints' in window.navigator &&\n window.navigator.maxTouchPoints > 0) ||\n (window.DocumentTouch && document instanceof window.DocumentTouch)),\n supportsIePointer:\n typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,\n isChrome:\n typeof navigator !== 'undefined' &&\n /Chrome/i.test(navigator && navigator.userAgent),\n};\n","import * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport { toInt } from './lib/util';\n\nexport default function(i) {\n const element = i.element;\n const roundedScrollTop = Math.floor(element.scrollTop);\n const rect = element.getBoundingClientRect();\n\n i.containerWidth = Math.round(rect.width);\n i.containerHeight = Math.round(rect.height);\n\n i.contentWidth = element.scrollWidth;\n i.contentHeight = element.scrollHeight;\n\n if (!element.contains(i.scrollbarXRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('x')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarXRail);\n }\n if (!element.contains(i.scrollbarYRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('y')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarYRail);\n }\n\n if (\n !i.settings.suppressScrollX &&\n i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth\n ) {\n i.scrollbarXActive = true;\n i.railXWidth = i.containerWidth - i.railXMarginWidth;\n i.railXRatio = i.containerWidth / i.railXWidth;\n i.scrollbarXWidth = getThumbSize(\n i,\n toInt((i.railXWidth * i.containerWidth) / i.contentWidth)\n );\n i.scrollbarXLeft = toInt(\n ((i.negativeScrollAdjustment + element.scrollLeft) *\n (i.railXWidth - i.scrollbarXWidth)) /\n (i.contentWidth - i.containerWidth)\n );\n } else {\n i.scrollbarXActive = false;\n }\n\n if (\n !i.settings.suppressScrollY &&\n i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight\n ) {\n i.scrollbarYActive = true;\n i.railYHeight = i.containerHeight - i.railYMarginHeight;\n i.railYRatio = i.containerHeight / i.railYHeight;\n i.scrollbarYHeight = getThumbSize(\n i,\n toInt((i.railYHeight * i.containerHeight) / i.contentHeight)\n );\n i.scrollbarYTop = toInt(\n (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /\n (i.contentHeight - i.containerHeight)\n );\n } else {\n i.scrollbarYActive = false;\n }\n\n if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {\n i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;\n }\n if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {\n i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;\n }\n\n updateCss(element, i);\n\n if (i.scrollbarXActive) {\n element.classList.add(cls.state.active('x'));\n } else {\n element.classList.remove(cls.state.active('x'));\n i.scrollbarXWidth = 0;\n i.scrollbarXLeft = 0;\n element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;\n }\n if (i.scrollbarYActive) {\n element.classList.add(cls.state.active('y'));\n } else {\n element.classList.remove(cls.state.active('y'));\n i.scrollbarYHeight = 0;\n i.scrollbarYTop = 0;\n element.scrollTop = 0;\n }\n}\n\nfunction getThumbSize(i, thumbSize) {\n if (i.settings.minScrollbarLength) {\n thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);\n }\n if (i.settings.maxScrollbarLength) {\n thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);\n }\n return thumbSize;\n}\n\nfunction updateCss(element, i) {\n const xRailOffset = { width: i.railXWidth };\n const roundedScrollTop = Math.floor(element.scrollTop);\n\n if (i.isRtl) {\n xRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth -\n i.contentWidth;\n } else {\n xRailOffset.left = element.scrollLeft;\n }\n if (i.isScrollbarXUsingBottom) {\n xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;\n } else {\n xRailOffset.top = i.scrollbarXTop + roundedScrollTop;\n }\n CSS.set(i.scrollbarXRail, xRailOffset);\n\n const yRailOffset = { top: roundedScrollTop, height: i.railYHeight };\n if (i.isScrollbarYUsingRight) {\n if (i.isRtl) {\n yRailOffset.right =\n i.contentWidth -\n (i.negativeScrollAdjustment + element.scrollLeft) -\n i.scrollbarYRight -\n i.scrollbarYOuterWidth -\n 9;\n } else {\n yRailOffset.right = i.scrollbarYRight - element.scrollLeft;\n }\n } else {\n if (i.isRtl) {\n yRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth * 2 -\n i.contentWidth -\n i.scrollbarYLeft -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;\n }\n }\n CSS.set(i.scrollbarYRail, yRailOffset);\n\n CSS.set(i.scrollbarX, {\n left: i.scrollbarXLeft,\n width: i.scrollbarXWidth - i.railBorderXWidth,\n });\n CSS.set(i.scrollbarY, {\n top: i.scrollbarYTop,\n height: i.scrollbarYHeight - i.railBorderYWidth,\n });\n}\n","import updateGeometry from '../update-geometry';\n\nexport default function(i) {\n const element = i.element;\n\n i.event.bind(i.scrollbarY, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarYRail, 'mousedown', e => {\n const positionTop =\n e.pageY -\n window.pageYOffset -\n i.scrollbarYRail.getBoundingClientRect().top;\n const direction = positionTop > i.scrollbarYTop ? 1 : -1;\n\n i.element.scrollTop += direction * i.containerHeight;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n\n i.event.bind(i.scrollbarX, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarXRail, 'mousedown', e => {\n const positionLeft =\n e.pageX -\n window.pageXOffset -\n i.scrollbarXRail.getBoundingClientRect().left;\n const direction = positionLeft > i.scrollbarXLeft ? 1 : -1;\n\n i.element.scrollLeft += direction * i.containerWidth;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n}\n","import * as CSS from '../lib/css';\nimport * as DOM from '../lib/dom';\nimport cls, {\n addScrollingClass,\n removeScrollingClass,\n} from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { toInt } from '../lib/util';\n\nexport default function(i) {\n bindMouseScrollHandler(i, [\n 'containerWidth',\n 'contentWidth',\n 'pageX',\n 'railXWidth',\n 'scrollbarX',\n 'scrollbarXWidth',\n 'scrollLeft',\n 'x',\n 'scrollbarXRail',\n ]);\n bindMouseScrollHandler(i, [\n 'containerHeight',\n 'contentHeight',\n 'pageY',\n 'railYHeight',\n 'scrollbarY',\n 'scrollbarYHeight',\n 'scrollTop',\n 'y',\n 'scrollbarYRail',\n ]);\n}\n\nfunction bindMouseScrollHandler(\n i,\n [\n containerHeight,\n contentHeight,\n pageY,\n railYHeight,\n scrollbarY,\n scrollbarYHeight,\n scrollTop,\n y,\n scrollbarYRail,\n ]\n) {\n const element = i.element;\n\n let startingScrollTop = null;\n let startingMousePageY = null;\n let scrollBy = null;\n\n function mouseMoveHandler(e) {\n if (e.touches && e.touches[0]) {\n e[pageY] = e.touches[0].pageY;\n }\n element[scrollTop] =\n startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);\n addScrollingClass(i, y);\n updateGeometry(i);\n\n e.stopPropagation();\n if (e.type.startsWith('touch') && e.changedTouches.length > 1) {\n e.preventDefault();\n }\n }\n\n function mouseUpHandler() {\n removeScrollingClass(i, y);\n i[scrollbarYRail].classList.remove(cls.state.clicking);\n i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n }\n\n function bindMoves(e, touchMode) {\n startingScrollTop = element[scrollTop];\n if (touchMode && e.touches) {\n e[pageY] = e.touches[0].pageY;\n }\n startingMousePageY = e[pageY];\n scrollBy =\n (i[contentHeight] - i[containerHeight]) /\n (i[railYHeight] - i[scrollbarYHeight]);\n if (!touchMode) {\n i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);\n e.preventDefault();\n } else {\n i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);\n }\n\n i[scrollbarYRail].classList.add(cls.state.clicking);\n\n e.stopPropagation();\n }\n\n i.event.bind(i[scrollbarY], 'mousedown', e => {\n bindMoves(e);\n });\n i.event.bind(i[scrollbarY], 'touchstart', e => {\n bindMoves(e, true);\n });\n}\n","import * as DOM from '../lib/dom';\nimport updateGeometry from '../update-geometry';\nimport { isEditable } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n const elementHovered = () => DOM.matches(element, ':hover');\n const scrollbarFocused = () =>\n DOM.matches(i.scrollbarX, ':focus') || DOM.matches(i.scrollbarY, ':focus');\n\n function shouldPreventDefault(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n if (deltaX === 0) {\n if (!i.scrollbarYActive) {\n return false;\n }\n if (\n (scrollTop === 0 && deltaY > 0) ||\n (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n\n const scrollLeft = element.scrollLeft;\n if (deltaY === 0) {\n if (!i.scrollbarXActive) {\n return false;\n }\n if (\n (scrollLeft === 0 && deltaX < 0) ||\n (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n return true;\n }\n\n i.event.bind(i.ownerDocument, 'keydown', e => {\n if (\n (e.isDefaultPrevented && e.isDefaultPrevented()) ||\n e.defaultPrevented\n ) {\n return;\n }\n\n if (!elementHovered() && !scrollbarFocused()) {\n return;\n }\n\n let activeElement = document.activeElement\n ? document.activeElement\n : i.ownerDocument.activeElement;\n if (activeElement) {\n if (activeElement.tagName === 'IFRAME') {\n activeElement = activeElement.contentDocument.activeElement;\n } else {\n // go deeper if element is a webcomponent\n while (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n }\n if (isEditable(activeElement)) {\n return;\n }\n }\n\n let deltaX = 0;\n let deltaY = 0;\n\n switch (e.which) {\n case 37: // left\n if (e.metaKey) {\n deltaX = -i.contentWidth;\n } else if (e.altKey) {\n deltaX = -i.containerWidth;\n } else {\n deltaX = -30;\n }\n break;\n case 38: // up\n if (e.metaKey) {\n deltaY = i.contentHeight;\n } else if (e.altKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = 30;\n }\n break;\n case 39: // right\n if (e.metaKey) {\n deltaX = i.contentWidth;\n } else if (e.altKey) {\n deltaX = i.containerWidth;\n } else {\n deltaX = 30;\n }\n break;\n case 40: // down\n if (e.metaKey) {\n deltaY = -i.contentHeight;\n } else if (e.altKey) {\n deltaY = -i.containerHeight;\n } else {\n deltaY = -30;\n }\n break;\n case 32: // space bar\n if (e.shiftKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = -i.containerHeight;\n }\n break;\n case 33: // page up\n deltaY = i.containerHeight;\n break;\n case 34: // page down\n deltaY = -i.containerHeight;\n break;\n case 36: // home\n deltaY = i.contentHeight;\n break;\n case 35: // end\n deltaY = -i.contentHeight;\n break;\n default:\n return;\n }\n\n if (i.settings.suppressScrollX && deltaX !== 0) {\n return;\n }\n if (i.settings.suppressScrollY && deltaY !== 0) {\n return;\n }\n\n element.scrollTop -= deltaY;\n element.scrollLeft += deltaX;\n updateGeometry(i);\n\n if (shouldPreventDefault(deltaX, deltaY)) {\n e.preventDefault();\n }\n });\n}\n","import * as CSS from '../lib/css';\nimport cls from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { env } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n let shouldPrevent = false;\n\n function shouldPreventDefault(deltaX, deltaY) {\n const roundedScrollTop = Math.floor(element.scrollTop);\n const isTop = element.scrollTop === 0;\n const isBottom =\n roundedScrollTop + element.offsetHeight === element.scrollHeight;\n const isLeft = element.scrollLeft === 0;\n const isRight =\n element.scrollLeft + element.offsetWidth === element.scrollWidth;\n\n let hitsBound;\n\n // pick axis with primary direction\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n hitsBound = isTop || isBottom;\n } else {\n hitsBound = isLeft || isRight;\n }\n\n return hitsBound ? !i.settings.wheelPropagation : true;\n }\n\n function getDeltaFromEvent(e) {\n let deltaX = e.deltaX;\n let deltaY = -1 * e.deltaY;\n\n if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {\n // OS X Safari\n deltaX = (-1 * e.wheelDeltaX) / 6;\n deltaY = e.wheelDeltaY / 6;\n }\n\n if (e.deltaMode && e.deltaMode === 1) {\n // Firefox in deltaMode 1: Line scrolling\n deltaX *= 10;\n deltaY *= 10;\n }\n\n if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {\n // IE in some mouse drivers\n deltaX = 0;\n deltaY = e.wheelDelta;\n }\n\n if (e.shiftKey) {\n // reverse axis with shift key\n return [-deltaY, -deltaX];\n }\n return [deltaX, deltaY];\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n // FIXME: this is a workaround for issue in FF and IE #571\n if (!env.isWebKit && element.querySelector('select:focus')) {\n return true;\n }\n\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function mousewheelHandler(e) {\n const [deltaX, deltaY] = getDeltaFromEvent(e);\n\n if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {\n return;\n }\n\n let shouldPrevent = false;\n if (!i.settings.useBothWheelAxes) {\n // deltaX will only be used for horizontal scrolling and deltaY will\n // only be used for vertical scrolling - this is the default\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else if (i.scrollbarYActive && !i.scrollbarXActive) {\n // only vertical scrollbar is active and useBothWheelAxes option is\n // active, so let's scroll vertical bar using both mouse wheel axes\n if (deltaY) {\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n } else {\n element.scrollTop += deltaX * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n } else if (i.scrollbarXActive && !i.scrollbarYActive) {\n // useBothWheelAxes and only horizontal bar is active, so use both\n // wheel axes for horizontal bar\n if (deltaX) {\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else {\n element.scrollLeft -= deltaY * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n }\n\n updateGeometry(i);\n\n shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);\n if (shouldPrevent && !e.ctrlKey) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n if (typeof window.onwheel !== 'undefined') {\n i.event.bind(element, 'wheel', mousewheelHandler);\n } else if (typeof window.onmousewheel !== 'undefined') {\n i.event.bind(element, 'mousewheel', mousewheelHandler);\n }\n}\n","import updateGeometry from '../update-geometry';\nimport cls from '../lib/class-names';\nimport * as CSS from '../lib/css';\nimport { env } from '../lib/util';\n\nexport default function (i) {\n if (!env.supportsTouch && !env.supportsIePointer) {\n return;\n }\n\n const element = i.element;\n\n const state = {\n startOffset: {},\n startTime: 0,\n speed: {},\n easingLoop: null,\n };\n\n function shouldPrevent(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n const scrollLeft = element.scrollLeft;\n const magnitudeX = Math.abs(deltaX);\n const magnitudeY = Math.abs(deltaY);\n\n if (magnitudeY > magnitudeX) {\n // user is perhaps trying to swipe up/down the page\n\n if (\n (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||\n (deltaY > 0 && scrollTop === 0)\n ) {\n // set prevent for mobile Chrome refresh\n return window.scrollY === 0 && deltaY > 0 && env.isChrome;\n }\n } else if (magnitudeX > magnitudeY) {\n // user is perhaps trying to swipe left/right across the page\n\n if (\n (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||\n (deltaX > 0 && scrollLeft === 0)\n ) {\n return true;\n }\n }\n\n return true;\n }\n\n function applyTouchMove(differenceX, differenceY) {\n element.scrollTop -= differenceY;\n element.scrollLeft -= differenceX;\n\n updateGeometry(i);\n }\n\n function getTouch(e) {\n if (e.targetTouches) {\n return e.targetTouches[0];\n }\n // Maybe IE pointer\n return e;\n }\n\n function shouldHandle(e) {\n if (e.target === i.scrollbarX || e.target === i.scrollbarY) {\n return false;\n }\n if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {\n return false;\n }\n if (e.targetTouches && e.targetTouches.length === 1) {\n return true;\n }\n if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n return true;\n }\n return false;\n }\n\n function touchStart(e) {\n if (!shouldHandle(e)) {\n return;\n }\n\n const touch = getTouch(e);\n\n state.startOffset.pageX = touch.pageX;\n state.startOffset.pageY = touch.pageY;\n\n state.startTime = new Date().getTime();\n\n if (state.easingLoop !== null) {\n clearInterval(state.easingLoop);\n }\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function touchMove(e) {\n if (shouldHandle(e)) {\n const touch = getTouch(e);\n\n const currentOffset = { pageX: touch.pageX, pageY: touch.pageY };\n\n const differenceX = currentOffset.pageX - state.startOffset.pageX;\n const differenceY = currentOffset.pageY - state.startOffset.pageY;\n\n if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {\n return;\n }\n\n applyTouchMove(differenceX, differenceY);\n state.startOffset = currentOffset;\n\n const currentTime = new Date().getTime();\n\n const timeGap = currentTime - state.startTime;\n if (timeGap > 0) {\n state.speed.x = differenceX / timeGap;\n state.speed.y = differenceY / timeGap;\n state.startTime = currentTime;\n }\n\n if (shouldPrevent(differenceX, differenceY)) {\n // Prevent the default behavior if the event is cancelable\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n }\n }\n\n function touchEnd() {\n if (i.settings.swipeEasing) {\n clearInterval(state.easingLoop);\n state.easingLoop = setInterval(() => {\n if (i.isInitialized) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (!state.speed.x && !state.speed.y) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) {\n clearInterval(state.easingLoop);\n return;\n }\n\n applyTouchMove(state.speed.x * 30, state.speed.y * 30);\n\n state.speed.x *= 0.8;\n state.speed.y *= 0.8;\n }, 10);\n }\n }\n\n if (env.supportsTouch) {\n i.event.bind(element, 'touchstart', touchStart);\n i.event.bind(element, 'touchmove', touchMove);\n i.event.bind(element, 'touchend', touchEnd);\n } else if (env.supportsIePointer) {\n if (window.PointerEvent) {\n i.event.bind(element, 'pointerdown', touchStart);\n i.event.bind(element, 'pointermove', touchMove);\n i.event.bind(element, 'pointerup', touchEnd);\n } else if (window.MSPointerEvent) {\n i.event.bind(element, 'MSPointerDown', touchStart);\n i.event.bind(element, 'MSPointerMove', touchMove);\n i.event.bind(element, 'MSPointerUp', touchEnd);\n }\n }\n}\n","/* eslint-disable */\n\nimport * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport EventManager from './lib/event-manager';\nimport processScrollDiff from './process-scroll-diff';\nimport updateGeometry from './update-geometry';\nimport { toInt, outerWidth } from './lib/util';\n\nimport clickRail from './handlers/click-rail';\nimport dragThumb from './handlers/drag-thumb';\nimport keyboard from './handlers/keyboard';\nimport wheel from './handlers/mouse-wheel';\nimport touch from './handlers/touch';\n\nconst defaultSettings = () => ({\n handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],\n maxScrollbarLength: null,\n minScrollbarLength: null,\n scrollingThreshold: 1000,\n scrollXMarginOffset: 0,\n scrollYMarginOffset: 0,\n suppressScrollX: false,\n suppressScrollY: false,\n swipeEasing: true,\n useBothWheelAxes: false,\n wheelPropagation: true,\n wheelSpeed: 1,\n});\n\nconst handlers = {\n 'click-rail': clickRail,\n 'drag-thumb': dragThumb,\n keyboard,\n wheel,\n touch,\n};\n\nexport default class PerfectScrollbar {\n constructor(element, userSettings = {}) {\n if (typeof element === 'string') {\n element = document.querySelector(element);\n }\n\n if (!element || !element.nodeName) {\n throw new Error('no element is specified to initialize PerfectScrollbar');\n }\n\n this.element = element;\n\n element.classList.add(cls.main);\n\n this.settings = defaultSettings();\n for (const key in userSettings) {\n this.settings[key] = userSettings[key];\n }\n\n this.containerWidth = null;\n this.containerHeight = null;\n this.contentWidth = null;\n this.contentHeight = null;\n\n const focus = () => element.classList.add(cls.state.focus);\n const blur = () => element.classList.remove(cls.state.focus);\n\n this.isRtl = CSS.get(element).direction === 'rtl';\n if (this.isRtl === true) {\n element.classList.add(cls.rtl);\n }\n this.isNegativeScroll = (() => {\n const originalScrollLeft = element.scrollLeft;\n let result = null;\n element.scrollLeft = -1;\n result = element.scrollLeft < 0;\n element.scrollLeft = originalScrollLeft;\n return result;\n })();\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? element.scrollWidth - element.clientWidth\n : 0;\n this.event = new EventManager();\n this.ownerDocument = element.ownerDocument || document;\n\n this.scrollbarXRail = DOM.div(cls.element.rail('x'));\n element.appendChild(this.scrollbarXRail);\n this.scrollbarX = DOM.div(cls.element.thumb('x'));\n this.scrollbarXRail.appendChild(this.scrollbarX);\n this.scrollbarX.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarX, 'focus', focus);\n this.event.bind(this.scrollbarX, 'blur', blur);\n this.scrollbarXActive = null;\n this.scrollbarXWidth = null;\n this.scrollbarXLeft = null;\n const railXStyle = CSS.get(this.scrollbarXRail);\n this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);\n if (isNaN(this.scrollbarXBottom)) {\n this.isScrollbarXUsingBottom = false;\n this.scrollbarXTop = toInt(railXStyle.top);\n } else {\n this.isScrollbarXUsingBottom = true;\n }\n this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);\n // Set rail to display:block to calculate margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);\n CSS.set(this.scrollbarXRail, { display: '' });\n this.railXWidth = null;\n this.railXRatio = null;\n\n this.scrollbarYRail = DOM.div(cls.element.rail('y'));\n element.appendChild(this.scrollbarYRail);\n this.scrollbarY = DOM.div(cls.element.thumb('y'));\n this.scrollbarYRail.appendChild(this.scrollbarY);\n this.scrollbarY.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarY, 'focus', focus);\n this.event.bind(this.scrollbarY, 'blur', blur);\n this.scrollbarYActive = null;\n this.scrollbarYHeight = null;\n this.scrollbarYTop = null;\n const railYStyle = CSS.get(this.scrollbarYRail);\n this.scrollbarYRight = parseInt(railYStyle.right, 10);\n if (isNaN(this.scrollbarYRight)) {\n this.isScrollbarYUsingRight = false;\n this.scrollbarYLeft = toInt(railYStyle.left);\n } else {\n this.isScrollbarYUsingRight = true;\n }\n this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;\n this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);\n CSS.set(this.scrollbarYRail, { display: '' });\n this.railYHeight = null;\n this.railYRatio = null;\n\n this.reach = {\n x:\n element.scrollLeft <= 0\n ? 'start'\n : element.scrollLeft >= this.contentWidth - this.containerWidth\n ? 'end'\n : null,\n y:\n element.scrollTop <= 0\n ? 'start'\n : element.scrollTop >= this.contentHeight - this.containerHeight\n ? 'end'\n : null,\n };\n\n this.isAlive = true;\n\n this.settings.handlers.forEach((handlerName) => handlers[handlerName](this));\n\n this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only\n this.lastScrollLeft = element.scrollLeft; // for onScroll only\n this.event.bind(this.element, 'scroll', (e) => this.onScroll(e));\n updateGeometry(this);\n }\n\n update() {\n if (!this.isAlive) {\n return;\n }\n\n // Recalcuate negative scrollLeft adjustment\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? this.element.scrollWidth - this.element.clientWidth\n : 0;\n\n // Recalculate rail margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railXMarginWidth =\n toInt(CSS.get(this.scrollbarXRail).marginLeft) +\n toInt(CSS.get(this.scrollbarXRail).marginRight);\n this.railYMarginHeight =\n toInt(CSS.get(this.scrollbarYRail).marginTop) +\n toInt(CSS.get(this.scrollbarYRail).marginBottom);\n\n // Hide scrollbars not to affect scrollWidth and scrollHeight\n CSS.set(this.scrollbarXRail, { display: 'none' });\n CSS.set(this.scrollbarYRail, { display: 'none' });\n\n updateGeometry(this);\n\n processScrollDiff(this, 'top', 0, false, true);\n processScrollDiff(this, 'left', 0, false, true);\n\n CSS.set(this.scrollbarXRail, { display: '' });\n CSS.set(this.scrollbarYRail, { display: '' });\n }\n\n onScroll(e) {\n if (!this.isAlive) {\n return;\n }\n\n updateGeometry(this);\n processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);\n processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);\n\n this.lastScrollTop = Math.floor(this.element.scrollTop);\n this.lastScrollLeft = this.element.scrollLeft;\n }\n\n destroy() {\n if (!this.isAlive) {\n return;\n }\n\n this.event.unbindAll();\n DOM.remove(this.scrollbarX);\n DOM.remove(this.scrollbarY);\n DOM.remove(this.scrollbarXRail);\n DOM.remove(this.scrollbarYRail);\n this.removePsClasses();\n\n // unset elements\n this.element = null;\n this.scrollbarX = null;\n this.scrollbarY = null;\n this.scrollbarXRail = null;\n this.scrollbarYRail = null;\n\n this.isAlive = false;\n }\n\n removePsClasses() {\n this.element.className = this.element.className\n .split(' ')\n .filter((name) => !name.match(/^ps([-_].+|)$/))\n .join(' ');\n }\n}\n"],"names":["const","let","this","processScrollDiff","DOM.matches","CSS.get","DOM.queryChildren","DOM.remove","CSS.set","dragThumb","DOM.div"],"mappings":";;;;;;AAAO,SAAS,GAAG,CAAC,OAAO,EAAE;EAC3B,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;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O;GACR;;EAED,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;EACzBD,MAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EAC9BA,MAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EAC9BA,MAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;EAClCA,MAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;EAChC,IAAI,CAAC,eAAe,EAAE,CAAC;;;EAGvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;EACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;EACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;EACvB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;EAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;EAE3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;AACvB,EAAC;;AAEH,2BAAE,8CAAkB;EAClB,IAAM,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS;KAC5C,KAAK,CAAC,GAAG,CAAC;KACV,MAAM,WAAE,IAAI,EAAE,SAAG,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,IAAC,CAAC;KAC9C,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;;;;"} \ No newline at end of file diff --git a/dist/perfect-scrollbar.js b/dist/perfect-scrollbar.js index 966362d..5fb3e21 100644 --- a/dist/perfect-scrollbar.js +++ b/dist/perfect-scrollbar.js @@ -1,6 +1,6 @@ /*! - * perfect-scrollbar v1.5.3 - * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * perfect-scrollbar v1.5.6 + * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT */ @@ -192,40 +192,22 @@ function createEvent(name) { if (typeof window.CustomEvent === 'function') { return new CustomEvent(name); - } else { - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(name, false, false, undefined); - return evt; } + + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(name, false, false, undefined); + return evt; } - function processScrollDiff( - i, - axis, - diff, - useScrollingClass, - forceFireReachEvent - ) { + function processScrollDiff (i, axis, diff, useScrollingClass, forceFireReachEvent) { if ( useScrollingClass === void 0 ) useScrollingClass = true; if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false; var fields; if (axis === 'top') { - fields = [ - 'contentHeight', - 'containerHeight', - 'scrollTop', - 'y', - 'up', - 'down' ]; + fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down']; } else if (axis === 'left') { - fields = [ - 'contentWidth', - 'containerWidth', - 'scrollLeft', - 'x', - 'left', - 'right' ]; + fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right']; } else { throw new Error('A proper axis should be provided'); } @@ -324,27 +306,27 @@ /Chrome/i.test(navigator && navigator.userAgent), }; - function updateGeometry(i) { + /* eslint-disable no-lonely-if */ + + function updateGeometry (i) { var element = i.element; var roundedScrollTop = Math.floor(element.scrollTop); var rect = element.getBoundingClientRect(); - i.containerWidth = Math.round(rect.width); - i.containerHeight = Math.round(rect.height); + i.containerWidth = Math.floor(rect.width); + i.containerHeight = Math.floor(rect.height); i.contentWidth = element.scrollWidth; i.contentHeight = element.scrollHeight; if (!element.contains(i.scrollbarXRail)) { // clean up and append - queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarXRail); } if (!element.contains(i.scrollbarYRail)) { // clean up and append - queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); } - ); + queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }); element.appendChild(i.scrollbarYRail); } @@ -355,13 +337,9 @@ i.scrollbarXActive = true; i.railXWidth = i.containerWidth - i.railXMarginWidth; i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize( - i, - toInt((i.railXWidth * i.containerWidth) / i.contentWidth) - ); + i.scrollbarXWidth = getThumbSize(i, toInt((i.railXWidth * i.containerWidth) / i.contentWidth)); i.scrollbarXLeft = toInt( - ((i.negativeScrollAdjustment + element.scrollLeft) * - (i.railXWidth - i.scrollbarXWidth)) / + ((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth)) / (i.contentWidth - i.containerWidth) ); } else { @@ -430,10 +408,7 @@ if (i.isRtl) { xRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth - - i.contentWidth; + i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; } else { xRailOffset.left = element.scrollLeft; } @@ -481,15 +456,14 @@ }); } - function clickRail(i) { - var element = i.element; + /* eslint-disable */ + + function clickRail (i) { + // const element = i.element; i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarYRail, 'mousedown', function (e) { - var positionTop = - e.pageY - - window.pageYOffset - - i.scrollbarYRail.getBoundingClientRect().top; + var positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top; var direction = positionTop > i.scrollbarYTop ? 1 : -1; i.element.scrollTop += direction * i.containerHeight; @@ -501,9 +475,7 @@ i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); }); i.event.bind(i.scrollbarXRail, 'mousedown', function (e) { var positionLeft = - e.pageX - - window.pageXOffset - - i.scrollbarXRail.getBoundingClientRect().left; + e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left; var direction = positionLeft > i.scrollbarXLeft ? 1 : -1; i.element.scrollLeft += direction * i.containerWidth; @@ -513,17 +485,9 @@ }); } - function dragThumb(i) { - bindMouseScrollHandler(i, [ - 'containerWidth', - 'contentWidth', - 'pageX', - 'railXWidth', - 'scrollbarX', - 'scrollbarXWidth', - 'scrollLeft', - 'x', - 'scrollbarXRail' ]); + var activeSlider = null; // Variable to track the currently active slider + + function setupScrollHandlers(i) { bindMouseScrollHandler(i, [ 'containerHeight', 'contentHeight', @@ -534,80 +498,102 @@ 'scrollTop', 'y', 'scrollbarYRail' ]); + + bindMouseScrollHandler(i, [ + 'containerWidth', + 'contentWidth', + 'pageX', + 'railXWidth', + 'scrollbarX', + 'scrollbarXWidth', + 'scrollLeft', + 'x', + 'scrollbarXRail' ]); } function bindMouseScrollHandler( i, ref ) { - var containerHeight = ref[0]; - var contentHeight = ref[1]; - var pageY = ref[2]; - var railYHeight = ref[3]; - var scrollbarY = ref[4]; - var scrollbarYHeight = ref[5]; - var scrollTop = ref[6]; - var y = ref[7]; - var scrollbarYRail = ref[8]; + var containerDimension = ref[0]; + var contentDimension = ref[1]; + var pageAxis = ref[2]; + var railDimension = ref[3]; + var scrollbarAxis = ref[4]; + var scrollbarDimension = ref[5]; + var scrollAxis = ref[6]; + var axis = ref[7]; + var scrollbarRail = ref[8]; var element = i.element; - - var startingScrollTop = null; - var startingMousePageY = null; + var startingScrollPosition = null; + var startingMousePagePosition = null; var scrollBy = null; - function mouseMoveHandler(e) { + function moveHandler(e) { if (e.touches && e.touches[0]) { - e[pageY] = e.touches[0].pageY; + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; } - element[scrollTop] = - startingScrollTop + scrollBy * (e[pageY] - startingMousePageY); - addScrollingClass(i, y); - updateGeometry(i); - e.stopPropagation(); - if (e.type.startsWith('touch') && e.changedTouches.length > 1) { + // Only move if the active slider is the one we started with + if (activeSlider === scrollbarAxis) { + element[scrollAxis] = + startingScrollPosition + scrollBy * (e[pageAxis] - startingMousePagePosition); + addScrollingClass(i, axis); + updateGeometry(i); + + e.stopPropagation(); e.preventDefault(); } } - function mouseUpHandler() { - removeScrollingClass(i, y); - i[scrollbarYRail].classList.remove(cls.state.clicking); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + function endHandler() { + removeScrollingClass(i, axis); + i[scrollbarRail].classList.remove(cls.state.clicking); + document.removeEventListener('mousemove', moveHandler); + document.removeEventListener('mouseup', endHandler); + document.removeEventListener('touchmove', moveHandler); + document.removeEventListener('touchend', endHandler); + activeSlider = null; // Reset active slider when interaction ends } - function bindMoves(e, touchMode) { - startingScrollTop = element[scrollTop]; - if (touchMode && e.touches) { - e[pageY] = e.touches[0].pageY; - } - startingMousePageY = e[pageY]; - scrollBy = - (i[contentHeight] - i[containerHeight]) / - (i[railYHeight] - i[scrollbarYHeight]); - if (!touchMode) { - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - e.preventDefault(); - } else { - i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler); - } + function bindMoves(e) { + if (activeSlider === null) { + // Only bind if no slider is currently active + activeSlider = scrollbarAxis; // Set current slider as active - i[scrollbarYRail].classList.add(cls.state.clicking); + startingScrollPosition = element[scrollAxis]; + if (e.touches) { + e[pageAxis] = e.touches[0][("page" + (axis.toUpperCase()))]; + } + startingMousePagePosition = e[pageAxis]; + scrollBy = + (i[contentDimension] - i[containerDimension]) / (i[railDimension] - i[scrollbarDimension]); + + if (!e.touches) { + document.addEventListener('mousemove', moveHandler); + document.addEventListener('mouseup', endHandler); + } else { + document.addEventListener('touchmove', moveHandler, { passive: false }); + document.addEventListener('touchend', endHandler); + } + + i[scrollbarRail].classList.add(cls.state.clicking); + } e.stopPropagation(); + if (e.cancelable) { + e.preventDefault(); + } } - i.event.bind(i[scrollbarY], 'mousedown', function (e) { - bindMoves(e); - }); - i.event.bind(i[scrollbarY], 'touchstart', function (e) { - bindMoves(e, true); - }); + i[scrollbarAxis].addEventListener('mousedown', bindMoves); + i[scrollbarAxis].addEventListener('touchstart', bindMoves); } - function keyboard(i) { + /* eslint-disable */ + + function keyboard (i) { var element = i.element; var elementHovered = function () { return matches(element, ':hover'); }; @@ -643,10 +629,7 @@ } i.event.bind(i.ownerDocument, 'keydown', function (e) { - if ( - (e.isDefaultPrevented && e.isDefaultPrevented()) || - e.defaultPrevented - ) { + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) { return; } @@ -751,17 +734,17 @@ }); } - function wheel(i) { + /* eslint-disable */ + + function wheel (i) { var element = i.element; function shouldPreventDefault(deltaX, deltaY) { var roundedScrollTop = Math.floor(element.scrollTop); var isTop = element.scrollTop === 0; - var isBottom = - roundedScrollTop + element.offsetHeight === element.scrollHeight; + var isBottom = roundedScrollTop + element.offsetHeight === element.scrollHeight; var isLeft = element.scrollLeft === 0; - var isRight = - element.scrollLeft + element.offsetWidth === element.scrollWidth; + var isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth; var hitsBound; @@ -905,13 +888,20 @@ } } - function touch(i) { + function touch (i) { if (!env.supportsTouch && !env.supportsIePointer) { return; } var element = i.element; + var state = { + startOffset: {}, + startTime: 0, + speed: {}, + easingLoop: null, + }; + function shouldPrevent(deltaX, deltaY) { var scrollTop = Math.floor(element.scrollTop); var scrollLeft = element.scrollLeft; @@ -949,32 +939,25 @@ updateGeometry(i); } - var startOffset = {}; - var startTime = 0; - var speed = {}; - var easingLoop = null; - function getTouch(e) { if (e.targetTouches) { return e.targetTouches[0]; - } else { - // Maybe IE pointer - return e; } + // Maybe IE pointer + return e; } function shouldHandle(e) { + if (e.target === i.scrollbarX || e.target === i.scrollbarY) { + return false; + } if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) { return false; } if (e.targetTouches && e.targetTouches.length === 1) { return true; } - if ( - e.pointerType && - e.pointerType !== 'mouse' && - e.pointerType !== e.MSPOINTER_TYPE_MOUSE - ) { + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { return true; } return false; @@ -987,13 +970,13 @@ var touch = getTouch(e); - startOffset.pageX = touch.pageX; - startOffset.pageY = touch.pageY; + state.startOffset.pageX = touch.pageX; + state.startOffset.pageY = touch.pageY; - startTime = new Date().getTime(); + state.startTime = new Date().getTime(); - if (easingLoop !== null) { - clearInterval(easingLoop); + if (state.easingLoop !== null) { + clearInterval(state.easingLoop); } } @@ -1048,58 +1031,57 @@ var currentOffset = { pageX: touch.pageX, pageY: touch.pageY }; - var differenceX = currentOffset.pageX - startOffset.pageX; - var differenceY = currentOffset.pageY - startOffset.pageY; + var differenceX = currentOffset.pageX - state.startOffset.pageX; + var differenceY = currentOffset.pageY - state.startOffset.pageY; if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) { return; } applyTouchMove(differenceX, differenceY); - startOffset = currentOffset; + state.startOffset = currentOffset; var currentTime = new Date().getTime(); - var timeGap = currentTime - startTime; + var timeGap = currentTime - state.startTime; if (timeGap > 0) { - speed.x = differenceX / timeGap; - speed.y = differenceY / timeGap; - startTime = currentTime; + state.speed.x = differenceX / timeGap; + state.speed.y = differenceY / timeGap; + state.startTime = currentTime; } if (shouldPrevent(differenceX, differenceY)) { - e.preventDefault(); + // Prevent the default behavior if the event is cancelable + if (e.cancelable) { + e.preventDefault(); + } } } } + function touchEnd() { if (i.settings.swipeEasing) { - clearInterval(easingLoop); - easingLoop = setInterval(function() { + clearInterval(state.easingLoop); + state.easingLoop = setInterval(function () { if (i.isInitialized) { - clearInterval(easingLoop); - return; - } - - if (!speed.x && !speed.y) { - clearInterval(easingLoop); + clearInterval(state.easingLoop); return; } - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { - clearInterval(easingLoop); + if (!state.speed.x && !state.speed.y) { + clearInterval(state.easingLoop); return; } - if (!i.element) { - clearInterval(easingLoop); + if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) { + clearInterval(state.easingLoop); return; } - applyTouchMove(speed.x * 30, speed.y * 30); + applyTouchMove(state.speed.x * 30, state.speed.y * 30); - speed.x *= 0.8; - speed.y *= 0.8; + state.speed.x *= 0.8; + state.speed.y *= 0.8; }, 10); } } @@ -1121,6 +1103,8 @@ } } + /* eslint-disable */ + var defaultSettings = function () { return ({ handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'], maxScrollbarLength: null, @@ -1138,7 +1122,7 @@ var handlers = { 'click-rail': clickRail, - 'drag-thumb': dragThumb, + 'drag-thumb': setupScrollHandlers, keyboard: keyboard, wheel: wheel, touch: touch, @@ -1209,12 +1193,10 @@ } else { this.isScrollbarXUsingBottom = true; } - this.railBorderXWidth = - toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); + this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); // Set rail to display:block to calculate margins set(this.scrollbarXRail, { display: 'block' }); - this.railXMarginWidth = - toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); + this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); set(this.scrollbarXRail, { display: '' }); this.railXWidth = null; this.railXRatio = null; @@ -1238,11 +1220,9 @@ this.isScrollbarYUsingRight = true; } this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null; - this.railBorderYWidth = - toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); + this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); set(this.scrollbarYRail, { display: 'block' }); - this.railYMarginHeight = - toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); + this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); set(this.scrollbarYRail, { display: '' }); this.railYHeight = null; this.railYRatio = null; @@ -1312,11 +1292,7 @@ updateGeometry(this); processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop); - processScrollDiff( - this, - 'left', - this.element.scrollLeft - this.lastScrollLeft - ); + processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft); this.lastScrollTop = Math.floor(this.element.scrollTop); this.lastScrollLeft = this.element.scrollLeft; diff --git a/dist/perfect-scrollbar.js.map b/dist/perfect-scrollbar.js.map index 5d909e3..2cff147 100644 --- a/dist/perfect-scrollbar.js.map +++ b/dist/perfect-scrollbar.js.map @@ -1 +1 @@ -{"version":3,"file":"perfect-scrollbar.js","sources":["../src/lib/css.js","../src/lib/dom.js","../src/lib/class-names.js","../src/lib/event-manager.js","../src/process-scroll-diff.js","../src/lib/util.js","../src/update-geometry.js","../src/handlers/click-rail.js","../src/handlers/drag-thumb.js","../src/handlers/keyboard.js","../src/handlers/mouse-wheel.js","../src/handlers/touch.js","../src/index.js"],"sourcesContent":["export function get(element) {\n return getComputedStyle(element);\n}\n\nexport function set(element, obj) {\n for (const key in obj) {\n let val = obj[key];\n if (typeof val === 'number') {\n val = `${val}px`;\n }\n element.style[key] = val;\n }\n return element;\n}\n","export function div(className) {\n const div = document.createElement('div');\n div.className = className;\n return div;\n}\n\nconst elMatches =\n typeof Element !== 'undefined' &&\n (Element.prototype.matches ||\n Element.prototype.webkitMatchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector);\n\nexport function matches(element, query) {\n if (!elMatches) {\n throw new Error('No element matching method supported');\n }\n\n return elMatches.call(element, query);\n}\n\nexport function remove(element) {\n if (element.remove) {\n element.remove();\n } else {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n\nexport function queryChildren(element, selector) {\n return Array.prototype.filter.call(element.children, child =>\n matches(child, selector)\n );\n}\n","const cls = {\n main: 'ps',\n rtl: 'ps__rtl',\n element: {\n thumb: x => `ps__thumb-${x}`,\n rail: x => `ps__rail-${x}`,\n consuming: 'ps__child--consume',\n },\n state: {\n focus: 'ps--focus',\n clicking: 'ps--clicking',\n active: x => `ps--active-${x}`,\n scrolling: x => `ps--scrolling-${x}`,\n },\n};\n\nexport default cls;\n\n/*\n * Helper methods\n */\nconst scrollingClassTimeout = { x: null, y: null };\n\nexport function addScrollingClass(i, x) {\n const classList = i.element.classList;\n const className = cls.state.scrolling(x);\n\n if (classList.contains(className)) {\n clearTimeout(scrollingClassTimeout[x]);\n } else {\n classList.add(className);\n }\n}\n\nexport function removeScrollingClass(i, x) {\n scrollingClassTimeout[x] = setTimeout(\n () => i.isAlive && i.element.classList.remove(cls.state.scrolling(x)),\n i.settings.scrollingThreshold\n );\n}\n\nexport function setScrollingClassInstantly(i, x) {\n addScrollingClass(i, x);\n removeScrollingClass(i, x);\n}\n","class EventElement {\n constructor(element) {\n this.element = element;\n this.handlers = {};\n }\n\n bind(eventName, handler) {\n if (typeof this.handlers[eventName] === 'undefined') {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(handler);\n this.element.addEventListener(eventName, handler, false);\n }\n\n unbind(eventName, target) {\n this.handlers[eventName] = this.handlers[eventName].filter(handler => {\n if (target && handler !== target) {\n return true;\n }\n this.element.removeEventListener(eventName, handler, false);\n return false;\n });\n }\n\n unbindAll() {\n for (const name in this.handlers) {\n this.unbind(name);\n }\n }\n\n get isEmpty() {\n return Object.keys(this.handlers).every(\n key => this.handlers[key].length === 0\n );\n }\n}\n\nexport default class EventManager {\n constructor() {\n this.eventElements = [];\n }\n\n eventElement(element) {\n let ee = this.eventElements.filter(ee => ee.element === element)[0];\n if (!ee) {\n ee = new EventElement(element);\n this.eventElements.push(ee);\n }\n return ee;\n }\n\n bind(element, eventName, handler) {\n this.eventElement(element).bind(eventName, handler);\n }\n\n unbind(element, eventName, handler) {\n const ee = this.eventElement(element);\n ee.unbind(eventName, handler);\n\n if (ee.isEmpty) {\n // remove\n this.eventElements.splice(this.eventElements.indexOf(ee), 1);\n }\n }\n\n unbindAll() {\n this.eventElements.forEach(e => e.unbindAll());\n this.eventElements = [];\n }\n\n once(element, eventName, handler) {\n const ee = this.eventElement(element);\n const onceHandler = evt => {\n ee.unbind(eventName, onceHandler);\n handler(evt);\n };\n ee.bind(eventName, onceHandler);\n }\n}\n","import { setScrollingClassInstantly } from './lib/class-names';\n\nfunction createEvent(name) {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(name);\n } else {\n const evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(name, false, false, undefined);\n return evt;\n }\n}\n\nexport default function(\n i,\n axis,\n diff,\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n let fields;\n if (axis === 'top') {\n fields = [\n 'contentHeight',\n 'containerHeight',\n 'scrollTop',\n 'y',\n 'up',\n 'down',\n ];\n } else if (axis === 'left') {\n fields = [\n 'contentWidth',\n 'containerWidth',\n 'scrollLeft',\n 'x',\n 'left',\n 'right',\n ];\n } else {\n throw new Error('A proper axis should be provided');\n }\n\n processScrollDiff(i, diff, fields, useScrollingClass, forceFireReachEvent);\n}\n\nfunction processScrollDiff(\n i,\n diff,\n [contentHeight, containerHeight, scrollTop, y, up, down],\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n const element = i.element;\n\n // reset reach\n i.reach[y] = null;\n\n // 1 for subpixel rounding\n if (element[scrollTop] < 1) {\n i.reach[y] = 'start';\n }\n\n // 1 for subpixel rounding\n if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {\n i.reach[y] = 'end';\n }\n\n if (diff) {\n element.dispatchEvent(createEvent(`ps-scroll-${y}`));\n\n if (diff < 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${up}`));\n } else if (diff > 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${down}`));\n }\n\n if (useScrollingClass) {\n setScrollingClassInstantly(i, y);\n }\n }\n\n if (i.reach[y] && (diff || forceFireReachEvent)) {\n element.dispatchEvent(createEvent(`ps-${y}-reach-${i.reach[y]}`));\n }\n}\n","import * as CSS from './css';\nimport * as DOM from './dom';\n\nexport function toInt(x) {\n return parseInt(x, 10) || 0;\n}\n\nexport function isEditable(el) {\n return (\n DOM.matches(el, 'input,[contenteditable]') ||\n DOM.matches(el, 'select,[contenteditable]') ||\n DOM.matches(el, 'textarea,[contenteditable]') ||\n DOM.matches(el, 'button,[contenteditable]')\n );\n}\n\nexport function outerWidth(element) {\n const styles = CSS.get(element);\n return (\n toInt(styles.width) +\n toInt(styles.paddingLeft) +\n toInt(styles.paddingRight) +\n toInt(styles.borderLeftWidth) +\n toInt(styles.borderRightWidth)\n );\n}\n\nexport const env = {\n isWebKit:\n typeof document !== 'undefined' &&\n 'WebkitAppearance' in document.documentElement.style,\n supportsTouch:\n typeof window !== 'undefined' &&\n ('ontouchstart' in window ||\n ('maxTouchPoints' in window.navigator &&\n window.navigator.maxTouchPoints > 0) ||\n (window.DocumentTouch && document instanceof window.DocumentTouch)),\n supportsIePointer:\n typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,\n isChrome:\n typeof navigator !== 'undefined' &&\n /Chrome/i.test(navigator && navigator.userAgent),\n};\n","import * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport { toInt } from './lib/util';\n\nexport default function(i) {\n const element = i.element;\n const roundedScrollTop = Math.floor(element.scrollTop);\n const rect = element.getBoundingClientRect();\n\n i.containerWidth = Math.round(rect.width);\n i.containerHeight = Math.round(rect.height);\n\n i.contentWidth = element.scrollWidth;\n i.contentHeight = element.scrollHeight;\n\n if (!element.contains(i.scrollbarXRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('x')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarXRail);\n }\n if (!element.contains(i.scrollbarYRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('y')).forEach(el =>\n DOM.remove(el)\n );\n element.appendChild(i.scrollbarYRail);\n }\n\n if (\n !i.settings.suppressScrollX &&\n i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth\n ) {\n i.scrollbarXActive = true;\n i.railXWidth = i.containerWidth - i.railXMarginWidth;\n i.railXRatio = i.containerWidth / i.railXWidth;\n i.scrollbarXWidth = getThumbSize(\n i,\n toInt((i.railXWidth * i.containerWidth) / i.contentWidth)\n );\n i.scrollbarXLeft = toInt(\n ((i.negativeScrollAdjustment + element.scrollLeft) *\n (i.railXWidth - i.scrollbarXWidth)) /\n (i.contentWidth - i.containerWidth)\n );\n } else {\n i.scrollbarXActive = false;\n }\n\n if (\n !i.settings.suppressScrollY &&\n i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight\n ) {\n i.scrollbarYActive = true;\n i.railYHeight = i.containerHeight - i.railYMarginHeight;\n i.railYRatio = i.containerHeight / i.railYHeight;\n i.scrollbarYHeight = getThumbSize(\n i,\n toInt((i.railYHeight * i.containerHeight) / i.contentHeight)\n );\n i.scrollbarYTop = toInt(\n (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /\n (i.contentHeight - i.containerHeight)\n );\n } else {\n i.scrollbarYActive = false;\n }\n\n if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {\n i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;\n }\n if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {\n i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;\n }\n\n updateCss(element, i);\n\n if (i.scrollbarXActive) {\n element.classList.add(cls.state.active('x'));\n } else {\n element.classList.remove(cls.state.active('x'));\n i.scrollbarXWidth = 0;\n i.scrollbarXLeft = 0;\n element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;\n }\n if (i.scrollbarYActive) {\n element.classList.add(cls.state.active('y'));\n } else {\n element.classList.remove(cls.state.active('y'));\n i.scrollbarYHeight = 0;\n i.scrollbarYTop = 0;\n element.scrollTop = 0;\n }\n}\n\nfunction getThumbSize(i, thumbSize) {\n if (i.settings.minScrollbarLength) {\n thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);\n }\n if (i.settings.maxScrollbarLength) {\n thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);\n }\n return thumbSize;\n}\n\nfunction updateCss(element, i) {\n const xRailOffset = { width: i.railXWidth };\n const roundedScrollTop = Math.floor(element.scrollTop);\n\n if (i.isRtl) {\n xRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth -\n i.contentWidth;\n } else {\n xRailOffset.left = element.scrollLeft;\n }\n if (i.isScrollbarXUsingBottom) {\n xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;\n } else {\n xRailOffset.top = i.scrollbarXTop + roundedScrollTop;\n }\n CSS.set(i.scrollbarXRail, xRailOffset);\n\n const yRailOffset = { top: roundedScrollTop, height: i.railYHeight };\n if (i.isScrollbarYUsingRight) {\n if (i.isRtl) {\n yRailOffset.right =\n i.contentWidth -\n (i.negativeScrollAdjustment + element.scrollLeft) -\n i.scrollbarYRight -\n i.scrollbarYOuterWidth -\n 9;\n } else {\n yRailOffset.right = i.scrollbarYRight - element.scrollLeft;\n }\n } else {\n if (i.isRtl) {\n yRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth * 2 -\n i.contentWidth -\n i.scrollbarYLeft -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;\n }\n }\n CSS.set(i.scrollbarYRail, yRailOffset);\n\n CSS.set(i.scrollbarX, {\n left: i.scrollbarXLeft,\n width: i.scrollbarXWidth - i.railBorderXWidth,\n });\n CSS.set(i.scrollbarY, {\n top: i.scrollbarYTop,\n height: i.scrollbarYHeight - i.railBorderYWidth,\n });\n}\n","import updateGeometry from '../update-geometry';\n\nexport default function(i) {\n const element = i.element;\n\n i.event.bind(i.scrollbarY, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarYRail, 'mousedown', e => {\n const positionTop =\n e.pageY -\n window.pageYOffset -\n i.scrollbarYRail.getBoundingClientRect().top;\n const direction = positionTop > i.scrollbarYTop ? 1 : -1;\n\n i.element.scrollTop += direction * i.containerHeight;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n\n i.event.bind(i.scrollbarX, 'mousedown', e => e.stopPropagation());\n i.event.bind(i.scrollbarXRail, 'mousedown', e => {\n const positionLeft =\n e.pageX -\n window.pageXOffset -\n i.scrollbarXRail.getBoundingClientRect().left;\n const direction = positionLeft > i.scrollbarXLeft ? 1 : -1;\n\n i.element.scrollLeft += direction * i.containerWidth;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n}\n","import * as CSS from '../lib/css';\nimport * as DOM from '../lib/dom';\nimport cls, {\n addScrollingClass,\n removeScrollingClass,\n} from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { toInt } from '../lib/util';\n\nexport default function(i) {\n bindMouseScrollHandler(i, [\n 'containerWidth',\n 'contentWidth',\n 'pageX',\n 'railXWidth',\n 'scrollbarX',\n 'scrollbarXWidth',\n 'scrollLeft',\n 'x',\n 'scrollbarXRail',\n ]);\n bindMouseScrollHandler(i, [\n 'containerHeight',\n 'contentHeight',\n 'pageY',\n 'railYHeight',\n 'scrollbarY',\n 'scrollbarYHeight',\n 'scrollTop',\n 'y',\n 'scrollbarYRail',\n ]);\n}\n\nfunction bindMouseScrollHandler(\n i,\n [\n containerHeight,\n contentHeight,\n pageY,\n railYHeight,\n scrollbarY,\n scrollbarYHeight,\n scrollTop,\n y,\n scrollbarYRail,\n ]\n) {\n const element = i.element;\n\n let startingScrollTop = null;\n let startingMousePageY = null;\n let scrollBy = null;\n\n function mouseMoveHandler(e) {\n if (e.touches && e.touches[0]) {\n e[pageY] = e.touches[0].pageY;\n }\n element[scrollTop] =\n startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);\n addScrollingClass(i, y);\n updateGeometry(i);\n\n e.stopPropagation();\n if (e.type.startsWith('touch') && e.changedTouches.length > 1) {\n e.preventDefault();\n }\n }\n\n function mouseUpHandler() {\n removeScrollingClass(i, y);\n i[scrollbarYRail].classList.remove(cls.state.clicking);\n i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n }\n\n function bindMoves(e, touchMode) {\n startingScrollTop = element[scrollTop];\n if (touchMode && e.touches) {\n e[pageY] = e.touches[0].pageY;\n }\n startingMousePageY = e[pageY];\n scrollBy =\n (i[contentHeight] - i[containerHeight]) /\n (i[railYHeight] - i[scrollbarYHeight]);\n if (!touchMode) {\n i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);\n i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);\n e.preventDefault();\n } else {\n i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);\n }\n\n i[scrollbarYRail].classList.add(cls.state.clicking);\n\n e.stopPropagation();\n }\n\n i.event.bind(i[scrollbarY], 'mousedown', e => {\n bindMoves(e);\n });\n i.event.bind(i[scrollbarY], 'touchstart', e => {\n bindMoves(e, true);\n });\n}\n","import * as DOM from '../lib/dom';\nimport updateGeometry from '../update-geometry';\nimport { isEditable } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n const elementHovered = () => DOM.matches(element, ':hover');\n const scrollbarFocused = () =>\n DOM.matches(i.scrollbarX, ':focus') || DOM.matches(i.scrollbarY, ':focus');\n\n function shouldPreventDefault(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n if (deltaX === 0) {\n if (!i.scrollbarYActive) {\n return false;\n }\n if (\n (scrollTop === 0 && deltaY > 0) ||\n (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n\n const scrollLeft = element.scrollLeft;\n if (deltaY === 0) {\n if (!i.scrollbarXActive) {\n return false;\n }\n if (\n (scrollLeft === 0 && deltaX < 0) ||\n (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n return true;\n }\n\n i.event.bind(i.ownerDocument, 'keydown', e => {\n if (\n (e.isDefaultPrevented && e.isDefaultPrevented()) ||\n e.defaultPrevented\n ) {\n return;\n }\n\n if (!elementHovered() && !scrollbarFocused()) {\n return;\n }\n\n let activeElement = document.activeElement\n ? document.activeElement\n : i.ownerDocument.activeElement;\n if (activeElement) {\n if (activeElement.tagName === 'IFRAME') {\n activeElement = activeElement.contentDocument.activeElement;\n } else {\n // go deeper if element is a webcomponent\n while (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n }\n if (isEditable(activeElement)) {\n return;\n }\n }\n\n let deltaX = 0;\n let deltaY = 0;\n\n switch (e.which) {\n case 37: // left\n if (e.metaKey) {\n deltaX = -i.contentWidth;\n } else if (e.altKey) {\n deltaX = -i.containerWidth;\n } else {\n deltaX = -30;\n }\n break;\n case 38: // up\n if (e.metaKey) {\n deltaY = i.contentHeight;\n } else if (e.altKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = 30;\n }\n break;\n case 39: // right\n if (e.metaKey) {\n deltaX = i.contentWidth;\n } else if (e.altKey) {\n deltaX = i.containerWidth;\n } else {\n deltaX = 30;\n }\n break;\n case 40: // down\n if (e.metaKey) {\n deltaY = -i.contentHeight;\n } else if (e.altKey) {\n deltaY = -i.containerHeight;\n } else {\n deltaY = -30;\n }\n break;\n case 32: // space bar\n if (e.shiftKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = -i.containerHeight;\n }\n break;\n case 33: // page up\n deltaY = i.containerHeight;\n break;\n case 34: // page down\n deltaY = -i.containerHeight;\n break;\n case 36: // home\n deltaY = i.contentHeight;\n break;\n case 35: // end\n deltaY = -i.contentHeight;\n break;\n default:\n return;\n }\n\n if (i.settings.suppressScrollX && deltaX !== 0) {\n return;\n }\n if (i.settings.suppressScrollY && deltaY !== 0) {\n return;\n }\n\n element.scrollTop -= deltaY;\n element.scrollLeft += deltaX;\n updateGeometry(i);\n\n if (shouldPreventDefault(deltaX, deltaY)) {\n e.preventDefault();\n }\n });\n}\n","import * as CSS from '../lib/css';\nimport cls from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { env } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n let shouldPrevent = false;\n\n function shouldPreventDefault(deltaX, deltaY) {\n const roundedScrollTop = Math.floor(element.scrollTop);\n const isTop = element.scrollTop === 0;\n const isBottom =\n roundedScrollTop + element.offsetHeight === element.scrollHeight;\n const isLeft = element.scrollLeft === 0;\n const isRight =\n element.scrollLeft + element.offsetWidth === element.scrollWidth;\n\n let hitsBound;\n\n // pick axis with primary direction\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n hitsBound = isTop || isBottom;\n } else {\n hitsBound = isLeft || isRight;\n }\n\n return hitsBound ? !i.settings.wheelPropagation : true;\n }\n\n function getDeltaFromEvent(e) {\n let deltaX = e.deltaX;\n let deltaY = -1 * e.deltaY;\n\n if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {\n // OS X Safari\n deltaX = (-1 * e.wheelDeltaX) / 6;\n deltaY = e.wheelDeltaY / 6;\n }\n\n if (e.deltaMode && e.deltaMode === 1) {\n // Firefox in deltaMode 1: Line scrolling\n deltaX *= 10;\n deltaY *= 10;\n }\n\n if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {\n // IE in some mouse drivers\n deltaX = 0;\n deltaY = e.wheelDelta;\n }\n\n if (e.shiftKey) {\n // reverse axis with shift key\n return [-deltaY, -deltaX];\n }\n return [deltaX, deltaY];\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n // FIXME: this is a workaround for issue in FF and IE #571\n if (!env.isWebKit && element.querySelector('select:focus')) {\n return true;\n }\n\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function mousewheelHandler(e) {\n const [deltaX, deltaY] = getDeltaFromEvent(e);\n\n if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {\n return;\n }\n\n let shouldPrevent = false;\n if (!i.settings.useBothWheelAxes) {\n // deltaX will only be used for horizontal scrolling and deltaY will\n // only be used for vertical scrolling - this is the default\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else if (i.scrollbarYActive && !i.scrollbarXActive) {\n // only vertical scrollbar is active and useBothWheelAxes option is\n // active, so let's scroll vertical bar using both mouse wheel axes\n if (deltaY) {\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n } else {\n element.scrollTop += deltaX * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n } else if (i.scrollbarXActive && !i.scrollbarYActive) {\n // useBothWheelAxes and only horizontal bar is active, so use both\n // wheel axes for horizontal bar\n if (deltaX) {\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else {\n element.scrollLeft -= deltaY * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n }\n\n updateGeometry(i);\n\n shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);\n if (shouldPrevent && !e.ctrlKey) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n if (typeof window.onwheel !== 'undefined') {\n i.event.bind(element, 'wheel', mousewheelHandler);\n } else if (typeof window.onmousewheel !== 'undefined') {\n i.event.bind(element, 'mousewheel', mousewheelHandler);\n }\n}\n","import updateGeometry from '../update-geometry';\nimport cls from '../lib/class-names';\nimport * as CSS from '../lib/css';\nimport { env } from '../lib/util';\n\nexport default function (i) {\n if (!env.supportsTouch && !env.supportsIePointer) {\n return;\n }\n\n const element = i.element;\n\n const state = {\n startOffset: {},\n startTime: 0,\n speed: {},\n easingLoop: null,\n };\n\n function shouldPrevent(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n const scrollLeft = element.scrollLeft;\n const magnitudeX = Math.abs(deltaX);\n const magnitudeY = Math.abs(deltaY);\n\n if (magnitudeY > magnitudeX) {\n // user is perhaps trying to swipe up/down the page\n\n if (\n (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||\n (deltaY > 0 && scrollTop === 0)\n ) {\n // set prevent for mobile Chrome refresh\n return window.scrollY === 0 && deltaY > 0 && env.isChrome;\n }\n } else if (magnitudeX > magnitudeY) {\n // user is perhaps trying to swipe left/right across the page\n\n if (\n (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||\n (deltaX > 0 && scrollLeft === 0)\n ) {\n return true;\n }\n }\n\n return true;\n }\n\n function applyTouchMove(differenceX, differenceY) {\n element.scrollTop -= differenceY;\n element.scrollLeft -= differenceX;\n\n updateGeometry(i);\n }\n\n function getTouch(e) {\n if (e.targetTouches) {\n return e.targetTouches[0];\n }\n // Maybe IE pointer\n return e;\n }\n\n function shouldHandle(e) {\n if (e.target === i.scrollbarX || e.target === i.scrollbarY) {\n return false;\n }\n if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {\n return false;\n }\n if (e.targetTouches && e.targetTouches.length === 1) {\n return true;\n }\n if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n return true;\n }\n return false;\n }\n\n function touchStart(e) {\n if (!shouldHandle(e)) {\n return;\n }\n\n const touch = getTouch(e);\n\n state.startOffset.pageX = touch.pageX;\n state.startOffset.pageY = touch.pageY;\n\n state.startTime = new Date().getTime();\n\n if (state.easingLoop !== null) {\n clearInterval(state.easingLoop);\n }\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function touchMove(e) {\n if (shouldHandle(e)) {\n const touch = getTouch(e);\n\n const currentOffset = { pageX: touch.pageX, pageY: touch.pageY };\n\n const differenceX = currentOffset.pageX - state.startOffset.pageX;\n const differenceY = currentOffset.pageY - state.startOffset.pageY;\n\n if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {\n return;\n }\n\n applyTouchMove(differenceX, differenceY);\n state.startOffset = currentOffset;\n\n const currentTime = new Date().getTime();\n\n const timeGap = currentTime - state.startTime;\n if (timeGap > 0) {\n state.speed.x = differenceX / timeGap;\n state.speed.y = differenceY / timeGap;\n state.startTime = currentTime;\n }\n\n if (shouldPrevent(differenceX, differenceY)) {\n // Prevent the default behavior if the event is cancelable\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n }\n }\n\n function touchEnd() {\n if (i.settings.swipeEasing) {\n clearInterval(state.easingLoop);\n state.easingLoop = setInterval(() => {\n if (i.isInitialized) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (!state.speed.x && !state.speed.y) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) {\n clearInterval(state.easingLoop);\n return;\n }\n\n applyTouchMove(state.speed.x * 30, state.speed.y * 30);\n\n state.speed.x *= 0.8;\n state.speed.y *= 0.8;\n }, 10);\n }\n }\n\n if (env.supportsTouch) {\n i.event.bind(element, 'touchstart', touchStart);\n i.event.bind(element, 'touchmove', touchMove);\n i.event.bind(element, 'touchend', touchEnd);\n } else if (env.supportsIePointer) {\n if (window.PointerEvent) {\n i.event.bind(element, 'pointerdown', touchStart);\n i.event.bind(element, 'pointermove', touchMove);\n i.event.bind(element, 'pointerup', touchEnd);\n } else if (window.MSPointerEvent) {\n i.event.bind(element, 'MSPointerDown', touchStart);\n i.event.bind(element, 'MSPointerMove', touchMove);\n i.event.bind(element, 'MSPointerUp', touchEnd);\n }\n }\n}\n","/* eslint-disable */\n\nimport * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport EventManager from './lib/event-manager';\nimport processScrollDiff from './process-scroll-diff';\nimport updateGeometry from './update-geometry';\nimport { toInt, outerWidth } from './lib/util';\n\nimport clickRail from './handlers/click-rail';\nimport dragThumb from './handlers/drag-thumb';\nimport keyboard from './handlers/keyboard';\nimport wheel from './handlers/mouse-wheel';\nimport touch from './handlers/touch';\n\nconst defaultSettings = () => ({\n handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],\n maxScrollbarLength: null,\n minScrollbarLength: null,\n scrollingThreshold: 1000,\n scrollXMarginOffset: 0,\n scrollYMarginOffset: 0,\n suppressScrollX: false,\n suppressScrollY: false,\n swipeEasing: true,\n useBothWheelAxes: false,\n wheelPropagation: true,\n wheelSpeed: 1,\n});\n\nconst handlers = {\n 'click-rail': clickRail,\n 'drag-thumb': dragThumb,\n keyboard,\n wheel,\n touch,\n};\n\nexport default class PerfectScrollbar {\n constructor(element, userSettings = {}) {\n if (typeof element === 'string') {\n element = document.querySelector(element);\n }\n\n if (!element || !element.nodeName) {\n throw new Error('no element is specified to initialize PerfectScrollbar');\n }\n\n this.element = element;\n\n element.classList.add(cls.main);\n\n this.settings = defaultSettings();\n for (const key in userSettings) {\n this.settings[key] = userSettings[key];\n }\n\n this.containerWidth = null;\n this.containerHeight = null;\n this.contentWidth = null;\n this.contentHeight = null;\n\n const focus = () => element.classList.add(cls.state.focus);\n const blur = () => element.classList.remove(cls.state.focus);\n\n this.isRtl = CSS.get(element).direction === 'rtl';\n if (this.isRtl === true) {\n element.classList.add(cls.rtl);\n }\n this.isNegativeScroll = (() => {\n const originalScrollLeft = element.scrollLeft;\n let result = null;\n element.scrollLeft = -1;\n result = element.scrollLeft < 0;\n element.scrollLeft = originalScrollLeft;\n return result;\n })();\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? element.scrollWidth - element.clientWidth\n : 0;\n this.event = new EventManager();\n this.ownerDocument = element.ownerDocument || document;\n\n this.scrollbarXRail = DOM.div(cls.element.rail('x'));\n element.appendChild(this.scrollbarXRail);\n this.scrollbarX = DOM.div(cls.element.thumb('x'));\n this.scrollbarXRail.appendChild(this.scrollbarX);\n this.scrollbarX.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarX, 'focus', focus);\n this.event.bind(this.scrollbarX, 'blur', blur);\n this.scrollbarXActive = null;\n this.scrollbarXWidth = null;\n this.scrollbarXLeft = null;\n const railXStyle = CSS.get(this.scrollbarXRail);\n this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);\n if (isNaN(this.scrollbarXBottom)) {\n this.isScrollbarXUsingBottom = false;\n this.scrollbarXTop = toInt(railXStyle.top);\n } else {\n this.isScrollbarXUsingBottom = true;\n }\n this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);\n // Set rail to display:block to calculate margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);\n CSS.set(this.scrollbarXRail, { display: '' });\n this.railXWidth = null;\n this.railXRatio = null;\n\n this.scrollbarYRail = DOM.div(cls.element.rail('y'));\n element.appendChild(this.scrollbarYRail);\n this.scrollbarY = DOM.div(cls.element.thumb('y'));\n this.scrollbarYRail.appendChild(this.scrollbarY);\n this.scrollbarY.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarY, 'focus', focus);\n this.event.bind(this.scrollbarY, 'blur', blur);\n this.scrollbarYActive = null;\n this.scrollbarYHeight = null;\n this.scrollbarYTop = null;\n const railYStyle = CSS.get(this.scrollbarYRail);\n this.scrollbarYRight = parseInt(railYStyle.right, 10);\n if (isNaN(this.scrollbarYRight)) {\n this.isScrollbarYUsingRight = false;\n this.scrollbarYLeft = toInt(railYStyle.left);\n } else {\n this.isScrollbarYUsingRight = true;\n }\n this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;\n this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);\n CSS.set(this.scrollbarYRail, { display: '' });\n this.railYHeight = null;\n this.railYRatio = null;\n\n this.reach = {\n x:\n element.scrollLeft <= 0\n ? 'start'\n : element.scrollLeft >= this.contentWidth - this.containerWidth\n ? 'end'\n : null,\n y:\n element.scrollTop <= 0\n ? 'start'\n : element.scrollTop >= this.contentHeight - this.containerHeight\n ? 'end'\n : null,\n };\n\n this.isAlive = true;\n\n this.settings.handlers.forEach((handlerName) => handlers[handlerName](this));\n\n this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only\n this.lastScrollLeft = element.scrollLeft; // for onScroll only\n this.event.bind(this.element, 'scroll', (e) => this.onScroll(e));\n updateGeometry(this);\n }\n\n update() {\n if (!this.isAlive) {\n return;\n }\n\n // Recalcuate negative scrollLeft adjustment\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? this.element.scrollWidth - this.element.clientWidth\n : 0;\n\n // Recalculate rail margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railXMarginWidth =\n toInt(CSS.get(this.scrollbarXRail).marginLeft) +\n toInt(CSS.get(this.scrollbarXRail).marginRight);\n this.railYMarginHeight =\n toInt(CSS.get(this.scrollbarYRail).marginTop) +\n toInt(CSS.get(this.scrollbarYRail).marginBottom);\n\n // Hide scrollbars not to affect scrollWidth and scrollHeight\n CSS.set(this.scrollbarXRail, { display: 'none' });\n CSS.set(this.scrollbarYRail, { display: 'none' });\n\n updateGeometry(this);\n\n processScrollDiff(this, 'top', 0, false, true);\n processScrollDiff(this, 'left', 0, false, true);\n\n CSS.set(this.scrollbarXRail, { display: '' });\n CSS.set(this.scrollbarYRail, { display: '' });\n }\n\n onScroll(e) {\n if (!this.isAlive) {\n return;\n }\n\n updateGeometry(this);\n processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);\n processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);\n\n this.lastScrollTop = Math.floor(this.element.scrollTop);\n this.lastScrollLeft = this.element.scrollLeft;\n }\n\n destroy() {\n if (!this.isAlive) {\n return;\n }\n\n this.event.unbindAll();\n DOM.remove(this.scrollbarX);\n DOM.remove(this.scrollbarY);\n DOM.remove(this.scrollbarXRail);\n DOM.remove(this.scrollbarYRail);\n this.removePsClasses();\n\n // unset elements\n this.element = null;\n this.scrollbarX = null;\n this.scrollbarY = null;\n this.scrollbarXRail = null;\n this.scrollbarYRail = null;\n\n this.isAlive = false;\n }\n\n removePsClasses() {\n this.element.className = this.element.className\n .split(' ')\n .filter((name) => !name.match(/^ps([-_].+|)$/))\n .join(' ');\n }\n}\n"],"names":["const","let","this","processScrollDiff","DOM.matches","CSS.get","DOM.queryChildren","DOM.remove","CSS.set","dragThumb","DOM.div"],"mappings":";;;;;;;;;;;;EAAO,SAAS,GAAG,CAAC,OAAO,EAAE;IAC3B,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;GAClC;;EAEM,SAAS,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE;IAChC,KAAKA,IAAM,GAAG,IAAI,GAAG,EAAE;MACrBC,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;MACnB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,GAAG,GAAM,GAAG,OAAI,CAAC;OAClB;MACD,OA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,CAAC;IAChC,IAAI,CAAC,eAAe,EAAE,CAAC;;;IAGvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;;IAE3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;EACvB,EAAC;;EAEH,2BAAE,8CAAkB;IAClB,IAAM,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS;OAC5C,KAAK,CAAC,GAAG,CAAC;OACV,MAAM,WAAE,IAAI,EAAE,SAAG,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,IAAC,CAAC;OAC9C,IAAI,CAAC,GAAG,CAAC,CAAC;EACf,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/perfect-scrollbar.min.js b/dist/perfect-scrollbar.min.js index 1b6359c..8ad7bfa 100644 --- a/dist/perfect-scrollbar.min.js +++ b/dist/perfect-scrollbar.min.js @@ -1,18 +1,20 @@ /*! - * perfect-scrollbar v1.5.3 - * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * perfect-scrollbar v1.5.6 + * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a=a||self,a.PerfectScrollbar=b())})(this,function(){'use strict';var u=Math.abs,v=Math.floor;function a(a){return getComputedStyle(a)}function b(a,b){for(var c in b){var d=b[c];"number"==typeof d&&(d+="px"),a.style[c]=d}return a}function c(a){var b=document.createElement("div");return b.className=a,b}function d(a,b){if(!w)throw new Error("No element matching method supported");return w.call(a,b)}function e(a){a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a)}function f(a,b){return Array.prototype.filter.call(a.children,function(a){return d(a,b)})}function g(a,b){var c=a.element.classList,d=z.state.scrolling(b);c.contains(d)?clearTimeout(A[b]):c.add(d)}function h(a,b){A[b]=setTimeout(function(){return a.isAlive&&a.element.classList.remove(z.state.scrolling(b))},a.settings.scrollingThreshold)}function j(a,b){g(a,b),h(a,b)}function k(a){if("function"==typeof window.CustomEvent)return new CustomEvent(a);var b=document.createEvent("CustomEvent");return b.initCustomEvent(a,!1,!1,void 0),b}function l(a,b,c,d,e){void 0===d&&(d=!0),void 0===e&&(e=!1);var f;if("top"===b)f=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===b)f=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");m(a,c,f,d,e)}function m(a,b,c,d,e){var f=c[0],g=c[1],h=c[2],i=c[3],l=c[4],m=c[5];void 0===d&&(d=!0),void 0===e&&(e=!1);var n=a.element;// reset reach -a.reach[i]=null,1>n[h]&&(a.reach[i]="start"),n[h]>a[f]-a[g]-1&&(a.reach[i]="end"),b&&(n.dispatchEvent(k("ps-scroll-"+i)),0>b?n.dispatchEvent(k("ps-scroll-"+l)):0=a.railXWidth-a.scrollbarXWidth&&(a.scrollbarXLeft=a.railXWidth-a.scrollbarXWidth),a.scrollbarYTop>=a.railYHeight-a.scrollbarYHeight&&(a.scrollbarYTop=a.railYHeight-a.scrollbarYHeight),s(c,a),a.scrollbarXActive?c.classList.add(z.state.active("x")):(c.classList.remove(z.state.active("x")),a.scrollbarXWidth=0,a.scrollbarXLeft=0,c.scrollLeft=!0===a.isRtl?a.contentWidth:0),a.scrollbarYActive?c.classList.add(z.state.active("y")):(c.classList.remove(z.state.active("y")),a.scrollbarYHeight=0,a.scrollbarYTop=0,c.scrollTop=0)}function r(a,b){var c=Math.min,d=Math.max;return a.settings.minScrollbarLength&&(b=d(b,a.settings.minScrollbarLength)),a.settings.maxScrollbarLength&&(b=c(b,a.settings.maxScrollbarLength)),b}function s(a,c){var d={width:c.railXWidth},e=v(a.scrollTop);d.left=c.isRtl?c.negativeScrollAdjustment+a.scrollLeft+c.containerWidth-c.contentWidth:a.scrollLeft,c.isScrollbarXUsingBottom?d.bottom=c.scrollbarXBottom-e:d.top=c.scrollbarXTop+e,b(c.scrollbarXRail,d);var f={top:e,height:c.railYHeight};c.isScrollbarYUsingRight?c.isRtl?f.right=c.contentWidth-(c.negativeScrollAdjustment+a.scrollLeft)-c.scrollbarYRight-c.scrollbarYOuterWidth-9:f.right=c.scrollbarYRight-a.scrollLeft:c.isRtl?f.left=c.negativeScrollAdjustment+a.scrollLeft+2*c.containerWidth-c.contentWidth-c.scrollbarYLeft-c.scrollbarYOuterWidth:f.left=c.scrollbarYLeft+a.scrollLeft,b(c.scrollbarYRail,f),b(c.scrollbarX,{left:c.scrollbarXLeft,width:c.scrollbarXWidth-c.railBorderXWidth}),b(c.scrollbarY,{top:c.scrollbarYTop,height:c.scrollbarYHeight-c.railBorderYWidth})}function t(a,b){function c(b){b.touches&&b.touches[0]&&(b[k]=b.touches[0].pageY),s[o]=t+v*(b[k]-u),g(a,p),q(a),b.stopPropagation(),b.type.startsWith("touch")&&1a.scrollbarYTop?1:-1;a.element.scrollTop+=d*a.containerHeight,q(a),b.stopPropagation()}),a.event.bind(a.scrollbarX,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarXRail,"mousedown",function(b){var c=b.pageX-window.pageXOffset-a.scrollbarXRail.getBoundingClientRect().left,d=c>a.scrollbarXLeft?1:-1;a.element.scrollLeft+=d*a.containerWidth,q(a),b.stopPropagation()})},"drag-thumb":function(a){t(a,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),t(a,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(a){function b(b,d){var e=v(c.scrollTop);if(0===b){if(!a.scrollbarYActive)return!1;if(0===e&&0=a.contentHeight-a.containerHeight&&0>d)return!a.settings.wheelPropagation}var f=c.scrollLeft;if(0===d){if(!a.scrollbarXActive)return!1;if(0===f&&0>b||f>=a.contentWidth-a.containerWidth&&0u(a)?f||g:i||j,!d||!b.settings.wheelPropagation}function d(a){var b=a.deltaX,c=-1*a.deltaY;return("undefined"==typeof b||"undefined"==typeof c)&&(b=-1*a.wheelDeltaX/6,c=a.wheelDeltaY/6),a.deltaMode&&1===a.deltaMode&&(b*=10,c*=10),b!==b&&c!==c/* NaN checks */&&(b=0,c=a.wheelDelta),a.shiftKey?[-c,-b]:[b,c]}function f(b,c,d){// FIXME: this is a workaround for issue in FF and IE #571 +if(!D.isWebKit&&h.querySelector("select:focus"))return!0;if(!h.contains(b))return!1;for(var e=b;e&&e!==h;){if(e.classList.contains(y.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0d||e.scrollTopc||e.scrollLeftf){// user is perhaps trying to swipe up/down the page if(0>c&&d===b.contentHeight-b.containerHeight||0g&&(0>a&&e===b.contentWidth-b.containerWidth||0g&&(0>a&&e===b.contentWidth-b.containerWidth||0d||e.scrollTopc||e.scrollLeftu(o.x)&&.01>u(o.y)?void clearInterval(p):b.element?void(d(30*o.x,30*o.y),o.x*=.8,o.y*=.8):void clearInterval(p):void clearInterval(p)},10))}if(E.supportsTouch||E.supportsIePointer){var l=b.element,m={},n=0,o={},p=null;E.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):E.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(z.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(z.state.focus)},i=function(){return d.classList.remove(z.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(z.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new D,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(z.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(z.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(z.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(z.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment +if(c&&f.overflowX.match(/(scroll|auto)/)){var h=e.scrollWidth-e.clientWidth;if(0c||e.scrollLeftu(m.speed.x)&&.01>u(m.speed.y)?void clearInterval(m.easingLoop):void(d(30*m.speed.x,30*m.speed.y),m.speed.x*=.8,m.speed.y*=.8):void clearInterval(m.easingLoop)},10))}if(D.supportsTouch||D.supportsIePointer){var l=b.element,m={startOffset:{},startTime:0,speed:{},easingLoop:null};D.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):D.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}/* eslint-disable */},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(y.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(y.state.focus)},i=function(){return d.classList.remove(y.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(y.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new C,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(y.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(y.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(y.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(y.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment // Recalculate rail margins // Hide scrollbars not to affect scrollWidth and scrollHeight this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,b(this.scrollbarXRail,{display:"block"}),b(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n(a(this.scrollbarXRail).marginLeft)+n(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=n(a(this.scrollbarYRail).marginTop)+n(a(this.scrollbarYRail).marginBottom),b(this.scrollbarXRail,{display:"none"}),b(this.scrollbarYRail,{display:"none"}),q(this),l(this,"top",0,!1,!0),l(this,"left",0,!1,!0),b(this.scrollbarXRail,{display:""}),b(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(){this.isAlive&&(q(this),l(this,"top",this.element.scrollTop-this.lastScrollTop),l(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=v(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(// unset elements diff --git a/dist/perfect-scrollbar.min.js.map b/dist/perfect-scrollbar.min.js.map index 8bb68d5..64b3cd1 100644 --- a/dist/perfect-scrollbar.min.js.map +++ b/dist/perfect-scrollbar.min.js.map @@ -1 +1 @@ -{"version":3,"file":"perfect-scrollbar.min.js","sources":["../src/handlers/mouse-wheel.js","../src/update-geometry.js","../src/lib/css.js","../src/lib/dom.js","../src/lib/class-names.js","../src/process-scroll-diff.js","../src/lib/util.js","../src/handlers/drag-thumb.js","../src/lib/event-manager.js","../src/index.js","../src/handlers/click-rail.js","../src/handlers/keyboard.js","../src/handlers/touch.js"],"sourcesContent":["import * as CSS from '../lib/css';\nimport cls from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\nimport { env } from '../lib/util';\n\nexport default function(i) {\n const element = i.element;\n\n let shouldPrevent = false;\n\n function shouldPreventDefault(deltaX, deltaY) {\n const roundedScrollTop = Math.floor(element.scrollTop);\n const isTop = element.scrollTop === 0;\n const isBottom =\n roundedScrollTop + element.offsetHeight === element.scrollHeight;\n const isLeft = element.scrollLeft === 0;\n const isRight =\n element.scrollLeft + element.offsetWidth === element.scrollWidth;\n\n let hitsBound;\n\n // pick axis with primary direction\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n hitsBound = isTop || isBottom;\n } else {\n hitsBound = isLeft || isRight;\n }\n\n return hitsBound ? !i.settings.wheelPropagation : true;\n }\n\n function getDeltaFromEvent(e) {\n let deltaX = e.deltaX;\n let deltaY = -1 * e.deltaY;\n\n if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {\n // OS X Safari\n deltaX = (-1 * e.wheelDeltaX) / 6;\n deltaY = e.wheelDeltaY / 6;\n }\n\n if (e.deltaMode && e.deltaMode === 1) {\n // Firefox in deltaMode 1: Line scrolling\n deltaX *= 10;\n deltaY *= 10;\n }\n\n if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {\n // IE in some mouse drivers\n deltaX = 0;\n deltaY = e.wheelDelta;\n }\n\n if (e.shiftKey) {\n // reverse axis with shift key\n return [-deltaY, -deltaX];\n }\n return [deltaX, deltaY];\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n // FIXME: this is a workaround for issue in FF and IE #571\n if (!env.isWebKit && element.querySelector('select:focus')) {\n return true;\n }\n\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function mousewheelHandler(e) {\n const [deltaX, deltaY] = getDeltaFromEvent(e);\n\n if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {\n return;\n }\n\n let shouldPrevent = false;\n if (!i.settings.useBothWheelAxes) {\n // deltaX will only be used for horizontal scrolling and deltaY will\n // only be used for vertical scrolling - this is the default\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else if (i.scrollbarYActive && !i.scrollbarXActive) {\n // only vertical scrollbar is active and useBothWheelAxes option is\n // active, so let's scroll vertical bar using both mouse wheel axes\n if (deltaY) {\n element.scrollTop -= deltaY * i.settings.wheelSpeed;\n } else {\n element.scrollTop += deltaX * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n } else if (i.scrollbarXActive && !i.scrollbarYActive) {\n // useBothWheelAxes and only horizontal bar is active, so use both\n // wheel axes for horizontal bar\n if (deltaX) {\n element.scrollLeft += deltaX * i.settings.wheelSpeed;\n } else {\n element.scrollLeft -= deltaY * i.settings.wheelSpeed;\n }\n shouldPrevent = true;\n }\n\n updateGeometry(i);\n\n shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);\n if (shouldPrevent && !e.ctrlKey) {\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n if (typeof window.onwheel !== 'undefined') {\n i.event.bind(element, 'wheel', mousewheelHandler);\n } else if (typeof window.onmousewheel !== 'undefined') {\n i.event.bind(element, 'mousewheel', mousewheelHandler);\n }\n}\n","import * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport { toInt } from './lib/util';\n\n/* eslint-disable no-lonely-if */\n\nexport default function (i) {\n const element = i.element;\n const roundedScrollTop = Math.floor(element.scrollTop);\n const rect = element.getBoundingClientRect();\n\n i.containerWidth = Math.floor(rect.width);\n i.containerHeight = Math.floor(rect.height);\n\n i.contentWidth = element.scrollWidth;\n i.contentHeight = element.scrollHeight;\n\n if (!element.contains(i.scrollbarXRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('x')).forEach((el) => DOM.remove(el));\n element.appendChild(i.scrollbarXRail);\n }\n if (!element.contains(i.scrollbarYRail)) {\n // clean up and append\n DOM.queryChildren(element, cls.element.rail('y')).forEach((el) => DOM.remove(el));\n element.appendChild(i.scrollbarYRail);\n }\n\n if (\n !i.settings.suppressScrollX &&\n i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth\n ) {\n i.scrollbarXActive = true;\n i.railXWidth = i.containerWidth - i.railXMarginWidth;\n i.railXRatio = i.containerWidth / i.railXWidth;\n i.scrollbarXWidth = getThumbSize(i, toInt((i.railXWidth * i.containerWidth) / i.contentWidth));\n i.scrollbarXLeft = toInt(\n ((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth)) /\n (i.contentWidth - i.containerWidth)\n );\n } else {\n i.scrollbarXActive = false;\n }\n\n if (\n !i.settings.suppressScrollY &&\n i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight\n ) {\n i.scrollbarYActive = true;\n i.railYHeight = i.containerHeight - i.railYMarginHeight;\n i.railYRatio = i.containerHeight / i.railYHeight;\n i.scrollbarYHeight = getThumbSize(\n i,\n toInt((i.railYHeight * i.containerHeight) / i.contentHeight)\n );\n i.scrollbarYTop = toInt(\n (roundedScrollTop * (i.railYHeight - i.scrollbarYHeight)) /\n (i.contentHeight - i.containerHeight)\n );\n } else {\n i.scrollbarYActive = false;\n }\n\n if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {\n i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;\n }\n if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {\n i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;\n }\n\n updateCss(element, i);\n\n if (i.scrollbarXActive) {\n element.classList.add(cls.state.active('x'));\n } else {\n element.classList.remove(cls.state.active('x'));\n i.scrollbarXWidth = 0;\n i.scrollbarXLeft = 0;\n element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;\n }\n if (i.scrollbarYActive) {\n element.classList.add(cls.state.active('y'));\n } else {\n element.classList.remove(cls.state.active('y'));\n i.scrollbarYHeight = 0;\n i.scrollbarYTop = 0;\n element.scrollTop = 0;\n }\n}\n\nfunction getThumbSize(i, thumbSize) {\n if (i.settings.minScrollbarLength) {\n thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);\n }\n if (i.settings.maxScrollbarLength) {\n thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);\n }\n return thumbSize;\n}\n\nfunction updateCss(element, i) {\n const xRailOffset = { width: i.railXWidth };\n const roundedScrollTop = Math.floor(element.scrollTop);\n\n if (i.isRtl) {\n xRailOffset.left =\n i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;\n } else {\n xRailOffset.left = element.scrollLeft;\n }\n if (i.isScrollbarXUsingBottom) {\n xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;\n } else {\n xRailOffset.top = i.scrollbarXTop + roundedScrollTop;\n }\n CSS.set(i.scrollbarXRail, xRailOffset);\n\n const yRailOffset = { top: roundedScrollTop, height: i.railYHeight };\n if (i.isScrollbarYUsingRight) {\n if (i.isRtl) {\n yRailOffset.right =\n i.contentWidth -\n (i.negativeScrollAdjustment + element.scrollLeft) -\n i.scrollbarYRight -\n i.scrollbarYOuterWidth -\n 9;\n } else {\n yRailOffset.right = i.scrollbarYRight - element.scrollLeft;\n }\n } else {\n if (i.isRtl) {\n yRailOffset.left =\n i.negativeScrollAdjustment +\n element.scrollLeft +\n i.containerWidth * 2 -\n i.contentWidth -\n i.scrollbarYLeft -\n i.scrollbarYOuterWidth;\n } else {\n yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;\n }\n }\n CSS.set(i.scrollbarYRail, yRailOffset);\n\n CSS.set(i.scrollbarX, {\n left: i.scrollbarXLeft,\n width: i.scrollbarXWidth - i.railBorderXWidth,\n });\n CSS.set(i.scrollbarY, {\n top: i.scrollbarYTop,\n height: i.scrollbarYHeight - i.railBorderYWidth,\n });\n}\n","export function get(element) {\n return getComputedStyle(element);\n}\n\nexport function set(element, obj) {\n for (const key in obj) {\n let val = obj[key];\n if (typeof val === 'number') {\n val = `${val}px`;\n }\n element.style[key] = val;\n }\n return element;\n}\n","export function div(className) {\n const div = document.createElement('div');\n div.className = className;\n return div;\n}\n\nconst elMatches =\n typeof Element !== 'undefined' &&\n (Element.prototype.matches ||\n Element.prototype.webkitMatchesSelector ||\n Element.prototype.mozMatchesSelector ||\n Element.prototype.msMatchesSelector);\n\nexport function matches(element, query) {\n if (!elMatches) {\n throw new Error('No element matching method supported');\n }\n\n return elMatches.call(element, query);\n}\n\nexport function remove(element) {\n if (element.remove) {\n element.remove();\n } else {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }\n}\n\nexport function queryChildren(element, selector) {\n return Array.prototype.filter.call(element.children, child =>\n matches(child, selector)\n );\n}\n","const cls = {\n main: 'ps',\n rtl: 'ps__rtl',\n element: {\n thumb: x => `ps__thumb-${x}`,\n rail: x => `ps__rail-${x}`,\n consuming: 'ps__child--consume',\n },\n state: {\n focus: 'ps--focus',\n clicking: 'ps--clicking',\n active: x => `ps--active-${x}`,\n scrolling: x => `ps--scrolling-${x}`,\n },\n};\n\nexport default cls;\n\n/*\n * Helper methods\n */\nconst scrollingClassTimeout = { x: null, y: null };\n\nexport function addScrollingClass(i, x) {\n const classList = i.element.classList;\n const className = cls.state.scrolling(x);\n\n if (classList.contains(className)) {\n clearTimeout(scrollingClassTimeout[x]);\n } else {\n classList.add(className);\n }\n}\n\nexport function removeScrollingClass(i, x) {\n scrollingClassTimeout[x] = setTimeout(\n () => i.isAlive && i.element.classList.remove(cls.state.scrolling(x)),\n i.settings.scrollingThreshold\n );\n}\n\nexport function setScrollingClassInstantly(i, x) {\n addScrollingClass(i, x);\n removeScrollingClass(i, x);\n}\n","import { setScrollingClassInstantly } from './lib/class-names';\n\nfunction createEvent(name) {\n if (typeof window.CustomEvent === 'function') {\n return new CustomEvent(name);\n }\n\n const evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(name, false, false, undefined);\n return evt;\n}\n\nexport default function (i, axis, diff, useScrollingClass = true, forceFireReachEvent = false) {\n let fields;\n if (axis === 'top') {\n fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down'];\n } else if (axis === 'left') {\n fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right'];\n } else {\n throw new Error('A proper axis should be provided');\n }\n\n processScrollDiff(i, diff, fields, useScrollingClass, forceFireReachEvent);\n}\n\nfunction processScrollDiff(\n i,\n diff,\n [contentHeight, containerHeight, scrollTop, y, up, down],\n useScrollingClass = true,\n forceFireReachEvent = false\n) {\n const element = i.element;\n\n // reset reach\n i.reach[y] = null;\n\n // 1 for subpixel rounding\n if (element[scrollTop] < 1) {\n i.reach[y] = 'start';\n }\n\n // 1 for subpixel rounding\n if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {\n i.reach[y] = 'end';\n }\n\n if (diff) {\n element.dispatchEvent(createEvent(`ps-scroll-${y}`));\n\n if (diff < 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${up}`));\n } else if (diff > 0) {\n element.dispatchEvent(createEvent(`ps-scroll-${down}`));\n }\n\n if (useScrollingClass) {\n setScrollingClassInstantly(i, y);\n }\n }\n\n if (i.reach[y] && (diff || forceFireReachEvent)) {\n element.dispatchEvent(createEvent(`ps-${y}-reach-${i.reach[y]}`));\n }\n}\n","import * as CSS from './css';\nimport * as DOM from './dom';\n\nexport function toInt(x) {\n return parseInt(x, 10) || 0;\n}\n\nexport function isEditable(el) {\n return (\n DOM.matches(el, 'input,[contenteditable]') ||\n DOM.matches(el, 'select,[contenteditable]') ||\n DOM.matches(el, 'textarea,[contenteditable]') ||\n DOM.matches(el, 'button,[contenteditable]')\n );\n}\n\nexport function outerWidth(element) {\n const styles = CSS.get(element);\n return (\n toInt(styles.width) +\n toInt(styles.paddingLeft) +\n toInt(styles.paddingRight) +\n toInt(styles.borderLeftWidth) +\n toInt(styles.borderRightWidth)\n );\n}\n\nexport const env = {\n isWebKit:\n typeof document !== 'undefined' &&\n 'WebkitAppearance' in document.documentElement.style,\n supportsTouch:\n typeof window !== 'undefined' &&\n ('ontouchstart' in window ||\n ('maxTouchPoints' in window.navigator &&\n window.navigator.maxTouchPoints > 0) ||\n (window.DocumentTouch && document instanceof window.DocumentTouch)),\n supportsIePointer:\n typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,\n isChrome:\n typeof navigator !== 'undefined' &&\n /Chrome/i.test(navigator && navigator.userAgent),\n};\n","/* eslint-disable */\n\nimport updateGeometry from '../update-geometry';\n\nexport default function (i) {\n // const element = i.element;\n\n i.event.bind(i.scrollbarY, 'mousedown', (e) => e.stopPropagation());\n i.event.bind(i.scrollbarYRail, 'mousedown', (e) => {\n const positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top;\n const direction = positionTop > i.scrollbarYTop ? 1 : -1;\n\n i.element.scrollTop += direction * i.containerHeight;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n\n i.event.bind(i.scrollbarX, 'mousedown', (e) => e.stopPropagation());\n i.event.bind(i.scrollbarXRail, 'mousedown', (e) => {\n const positionLeft =\n e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left;\n const direction = positionLeft > i.scrollbarXLeft ? 1 : -1;\n\n i.element.scrollLeft += direction * i.containerWidth;\n updateGeometry(i);\n\n e.stopPropagation();\n });\n}\n","import cls, { addScrollingClass, removeScrollingClass } from '../lib/class-names';\nimport updateGeometry from '../update-geometry';\n\nlet activeSlider = null; // Variable to track the currently active slider\n\nexport default function setupScrollHandlers(i) {\n bindMouseScrollHandler(i, [\n 'containerHeight',\n 'contentHeight',\n 'pageY',\n 'railYHeight',\n 'scrollbarY',\n 'scrollbarYHeight',\n 'scrollTop',\n 'y',\n 'scrollbarYRail',\n ]);\n\n bindMouseScrollHandler(i, [\n 'containerWidth',\n 'contentWidth',\n 'pageX',\n 'railXWidth',\n 'scrollbarX',\n 'scrollbarXWidth',\n 'scrollLeft',\n 'x',\n 'scrollbarXRail',\n ]);\n}\n\nfunction bindMouseScrollHandler(\n i,\n [\n containerDimension,\n contentDimension,\n pageAxis,\n railDimension,\n scrollbarAxis,\n scrollbarDimension,\n scrollAxis,\n axis,\n scrollbarRail,\n ]\n) {\n const element = i.element;\n let startingScrollPosition = null;\n let startingMousePagePosition = null;\n let scrollBy = null;\n\n function moveHandler(e) {\n if (e.touches && e.touches[0]) {\n e[pageAxis] = e.touches[0][`page${axis.toUpperCase()}`];\n }\n\n // Only move if the active slider is the one we started with\n if (activeSlider === scrollbarAxis) {\n element[scrollAxis] =\n startingScrollPosition + scrollBy * (e[pageAxis] - startingMousePagePosition);\n addScrollingClass(i, axis);\n updateGeometry(i);\n\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n function endHandler() {\n removeScrollingClass(i, axis);\n i[scrollbarRail].classList.remove(cls.state.clicking);\n document.removeEventListener('mousemove', moveHandler);\n document.removeEventListener('mouseup', endHandler);\n document.removeEventListener('touchmove', moveHandler);\n document.removeEventListener('touchend', endHandler);\n activeSlider = null; // Reset active slider when interaction ends\n }\n\n function bindMoves(e) {\n if (activeSlider === null) {\n // Only bind if no slider is currently active\n activeSlider = scrollbarAxis; // Set current slider as active\n\n startingScrollPosition = element[scrollAxis];\n if (e.touches) {\n e[pageAxis] = e.touches[0][`page${axis.toUpperCase()}`];\n }\n startingMousePagePosition = e[pageAxis];\n scrollBy =\n (i[contentDimension] - i[containerDimension]) / (i[railDimension] - i[scrollbarDimension]);\n\n if (!e.touches) {\n document.addEventListener('mousemove', moveHandler);\n document.addEventListener('mouseup', endHandler);\n } else {\n document.addEventListener('touchmove', moveHandler, { passive: false });\n document.addEventListener('touchend', endHandler);\n }\n\n i[scrollbarRail].classList.add(cls.state.clicking);\n }\n\n e.stopPropagation();\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n\n i[scrollbarAxis].addEventListener('mousedown', bindMoves);\n i[scrollbarAxis].addEventListener('touchstart', bindMoves);\n}\n","/* eslint-disable */\n\nimport * as DOM from '../lib/dom';\nimport updateGeometry from '../update-geometry';\nimport { isEditable } from '../lib/util';\n\nexport default function (i) {\n const element = i.element;\n\n const elementHovered = () => DOM.matches(element, ':hover');\n const scrollbarFocused = () =>\n DOM.matches(i.scrollbarX, ':focus') || DOM.matches(i.scrollbarY, ':focus');\n\n function shouldPreventDefault(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n if (deltaX === 0) {\n if (!i.scrollbarYActive) {\n return false;\n }\n if (\n (scrollTop === 0 && deltaY > 0) ||\n (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n\n const scrollLeft = element.scrollLeft;\n if (deltaY === 0) {\n if (!i.scrollbarXActive) {\n return false;\n }\n if (\n (scrollLeft === 0 && deltaX < 0) ||\n (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)\n ) {\n return !i.settings.wheelPropagation;\n }\n }\n return true;\n }\n\n i.event.bind(i.ownerDocument, 'keydown', (e) => {\n if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) {\n return;\n }\n\n if (!elementHovered() && !scrollbarFocused()) {\n return;\n }\n\n let activeElement = document.activeElement\n ? document.activeElement\n : i.ownerDocument.activeElement;\n if (activeElement) {\n if (activeElement.tagName === 'IFRAME') {\n activeElement = activeElement.contentDocument.activeElement;\n } else {\n // go deeper if element is a webcomponent\n while (activeElement.shadowRoot) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n }\n if (isEditable(activeElement)) {\n return;\n }\n }\n\n let deltaX = 0;\n let deltaY = 0;\n\n switch (e.which) {\n case 37: // left\n if (e.metaKey) {\n deltaX = -i.contentWidth;\n } else if (e.altKey) {\n deltaX = -i.containerWidth;\n } else {\n deltaX = -30;\n }\n break;\n case 38: // up\n if (e.metaKey) {\n deltaY = i.contentHeight;\n } else if (e.altKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = 30;\n }\n break;\n case 39: // right\n if (e.metaKey) {\n deltaX = i.contentWidth;\n } else if (e.altKey) {\n deltaX = i.containerWidth;\n } else {\n deltaX = 30;\n }\n break;\n case 40: // down\n if (e.metaKey) {\n deltaY = -i.contentHeight;\n } else if (e.altKey) {\n deltaY = -i.containerHeight;\n } else {\n deltaY = -30;\n }\n break;\n case 32: // space bar\n if (e.shiftKey) {\n deltaY = i.containerHeight;\n } else {\n deltaY = -i.containerHeight;\n }\n break;\n case 33: // page up\n deltaY = i.containerHeight;\n break;\n case 34: // page down\n deltaY = -i.containerHeight;\n break;\n case 36: // home\n deltaY = i.contentHeight;\n break;\n case 35: // end\n deltaY = -i.contentHeight;\n break;\n default:\n return;\n }\n\n if (i.settings.suppressScrollX && deltaX !== 0) {\n return;\n }\n if (i.settings.suppressScrollY && deltaY !== 0) {\n return;\n }\n\n element.scrollTop -= deltaY;\n element.scrollLeft += deltaX;\n updateGeometry(i);\n\n if (shouldPreventDefault(deltaX, deltaY)) {\n e.preventDefault();\n }\n });\n}\n","class EventElement {\n constructor(element) {\n this.element = element;\n this.handlers = {};\n }\n\n bind(eventName, handler) {\n if (typeof this.handlers[eventName] === 'undefined') {\n this.handlers[eventName] = [];\n }\n this.handlers[eventName].push(handler);\n this.element.addEventListener(eventName, handler, false);\n }\n\n unbind(eventName, target) {\n this.handlers[eventName] = this.handlers[eventName].filter(handler => {\n if (target && handler !== target) {\n return true;\n }\n this.element.removeEventListener(eventName, handler, false);\n return false;\n });\n }\n\n unbindAll() {\n for (const name in this.handlers) {\n this.unbind(name);\n }\n }\n\n get isEmpty() {\n return Object.keys(this.handlers).every(\n key => this.handlers[key].length === 0\n );\n }\n}\n\nexport default class EventManager {\n constructor() {\n this.eventElements = [];\n }\n\n eventElement(element) {\n let ee = this.eventElements.filter(ee => ee.element === element)[0];\n if (!ee) {\n ee = new EventElement(element);\n this.eventElements.push(ee);\n }\n return ee;\n }\n\n bind(element, eventName, handler) {\n this.eventElement(element).bind(eventName, handler);\n }\n\n unbind(element, eventName, handler) {\n const ee = this.eventElement(element);\n ee.unbind(eventName, handler);\n\n if (ee.isEmpty) {\n // remove\n this.eventElements.splice(this.eventElements.indexOf(ee), 1);\n }\n }\n\n unbindAll() {\n this.eventElements.forEach(e => e.unbindAll());\n this.eventElements = [];\n }\n\n once(element, eventName, handler) {\n const ee = this.eventElement(element);\n const onceHandler = evt => {\n ee.unbind(eventName, onceHandler);\n handler(evt);\n };\n ee.bind(eventName, onceHandler);\n }\n}\n","/* eslint-disable */\n\nimport * as CSS from './lib/css';\nimport * as DOM from './lib/dom';\nimport cls from './lib/class-names';\nimport EventManager from './lib/event-manager';\nimport processScrollDiff from './process-scroll-diff';\nimport updateGeometry from './update-geometry';\nimport { toInt, outerWidth } from './lib/util';\n\nimport clickRail from './handlers/click-rail';\nimport dragThumb from './handlers/drag-thumb';\nimport keyboard from './handlers/keyboard';\nimport wheel from './handlers/mouse-wheel';\nimport touch from './handlers/touch';\n\nconst defaultSettings = () => ({\n handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],\n maxScrollbarLength: null,\n minScrollbarLength: null,\n scrollingThreshold: 1000,\n scrollXMarginOffset: 0,\n scrollYMarginOffset: 0,\n suppressScrollX: false,\n suppressScrollY: false,\n swipeEasing: true,\n useBothWheelAxes: false,\n wheelPropagation: true,\n wheelSpeed: 1,\n});\n\nconst handlers = {\n 'click-rail': clickRail,\n 'drag-thumb': dragThumb,\n keyboard,\n wheel,\n touch,\n};\n\nexport default class PerfectScrollbar {\n constructor(element, userSettings = {}) {\n if (typeof element === 'string') {\n element = document.querySelector(element);\n }\n\n if (!element || !element.nodeName) {\n throw new Error('no element is specified to initialize PerfectScrollbar');\n }\n\n this.element = element;\n\n element.classList.add(cls.main);\n\n this.settings = defaultSettings();\n for (const key in userSettings) {\n this.settings[key] = userSettings[key];\n }\n\n this.containerWidth = null;\n this.containerHeight = null;\n this.contentWidth = null;\n this.contentHeight = null;\n\n const focus = () => element.classList.add(cls.state.focus);\n const blur = () => element.classList.remove(cls.state.focus);\n\n this.isRtl = CSS.get(element).direction === 'rtl';\n if (this.isRtl === true) {\n element.classList.add(cls.rtl);\n }\n this.isNegativeScroll = (() => {\n const originalScrollLeft = element.scrollLeft;\n let result = null;\n element.scrollLeft = -1;\n result = element.scrollLeft < 0;\n element.scrollLeft = originalScrollLeft;\n return result;\n })();\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? element.scrollWidth - element.clientWidth\n : 0;\n this.event = new EventManager();\n this.ownerDocument = element.ownerDocument || document;\n\n this.scrollbarXRail = DOM.div(cls.element.rail('x'));\n element.appendChild(this.scrollbarXRail);\n this.scrollbarX = DOM.div(cls.element.thumb('x'));\n this.scrollbarXRail.appendChild(this.scrollbarX);\n this.scrollbarX.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarX, 'focus', focus);\n this.event.bind(this.scrollbarX, 'blur', blur);\n this.scrollbarXActive = null;\n this.scrollbarXWidth = null;\n this.scrollbarXLeft = null;\n const railXStyle = CSS.get(this.scrollbarXRail);\n this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);\n if (isNaN(this.scrollbarXBottom)) {\n this.isScrollbarXUsingBottom = false;\n this.scrollbarXTop = toInt(railXStyle.top);\n } else {\n this.isScrollbarXUsingBottom = true;\n }\n this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);\n // Set rail to display:block to calculate margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);\n CSS.set(this.scrollbarXRail, { display: '' });\n this.railXWidth = null;\n this.railXRatio = null;\n\n this.scrollbarYRail = DOM.div(cls.element.rail('y'));\n element.appendChild(this.scrollbarYRail);\n this.scrollbarY = DOM.div(cls.element.thumb('y'));\n this.scrollbarYRail.appendChild(this.scrollbarY);\n this.scrollbarY.setAttribute('tabindex', 0);\n this.event.bind(this.scrollbarY, 'focus', focus);\n this.event.bind(this.scrollbarY, 'blur', blur);\n this.scrollbarYActive = null;\n this.scrollbarYHeight = null;\n this.scrollbarYTop = null;\n const railYStyle = CSS.get(this.scrollbarYRail);\n this.scrollbarYRight = parseInt(railYStyle.right, 10);\n if (isNaN(this.scrollbarYRight)) {\n this.isScrollbarYUsingRight = false;\n this.scrollbarYLeft = toInt(railYStyle.left);\n } else {\n this.isScrollbarYUsingRight = true;\n }\n this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;\n this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);\n CSS.set(this.scrollbarYRail, { display: '' });\n this.railYHeight = null;\n this.railYRatio = null;\n\n this.reach = {\n x:\n element.scrollLeft <= 0\n ? 'start'\n : element.scrollLeft >= this.contentWidth - this.containerWidth\n ? 'end'\n : null,\n y:\n element.scrollTop <= 0\n ? 'start'\n : element.scrollTop >= this.contentHeight - this.containerHeight\n ? 'end'\n : null,\n };\n\n this.isAlive = true;\n\n this.settings.handlers.forEach((handlerName) => handlers[handlerName](this));\n\n this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only\n this.lastScrollLeft = element.scrollLeft; // for onScroll only\n this.event.bind(this.element, 'scroll', (e) => this.onScroll(e));\n updateGeometry(this);\n }\n\n update() {\n if (!this.isAlive) {\n return;\n }\n\n // Recalcuate negative scrollLeft adjustment\n this.negativeScrollAdjustment = this.isNegativeScroll\n ? this.element.scrollWidth - this.element.clientWidth\n : 0;\n\n // Recalculate rail margins\n CSS.set(this.scrollbarXRail, { display: 'block' });\n CSS.set(this.scrollbarYRail, { display: 'block' });\n this.railXMarginWidth =\n toInt(CSS.get(this.scrollbarXRail).marginLeft) +\n toInt(CSS.get(this.scrollbarXRail).marginRight);\n this.railYMarginHeight =\n toInt(CSS.get(this.scrollbarYRail).marginTop) +\n toInt(CSS.get(this.scrollbarYRail).marginBottom);\n\n // Hide scrollbars not to affect scrollWidth and scrollHeight\n CSS.set(this.scrollbarXRail, { display: 'none' });\n CSS.set(this.scrollbarYRail, { display: 'none' });\n\n updateGeometry(this);\n\n processScrollDiff(this, 'top', 0, false, true);\n processScrollDiff(this, 'left', 0, false, true);\n\n CSS.set(this.scrollbarXRail, { display: '' });\n CSS.set(this.scrollbarYRail, { display: '' });\n }\n\n onScroll(e) {\n if (!this.isAlive) {\n return;\n }\n\n updateGeometry(this);\n processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);\n processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);\n\n this.lastScrollTop = Math.floor(this.element.scrollTop);\n this.lastScrollLeft = this.element.scrollLeft;\n }\n\n destroy() {\n if (!this.isAlive) {\n return;\n }\n\n this.event.unbindAll();\n DOM.remove(this.scrollbarX);\n DOM.remove(this.scrollbarY);\n DOM.remove(this.scrollbarXRail);\n DOM.remove(this.scrollbarYRail);\n this.removePsClasses();\n\n // unset elements\n this.element = null;\n this.scrollbarX = null;\n this.scrollbarY = null;\n this.scrollbarXRail = null;\n this.scrollbarYRail = null;\n\n this.isAlive = false;\n }\n\n removePsClasses() {\n this.element.className = this.element.className\n .split(' ')\n .filter((name) => !name.match(/^ps([-_].+|)$/))\n .join(' ');\n }\n}\n","import updateGeometry from '../update-geometry';\nimport cls from '../lib/class-names';\nimport * as CSS from '../lib/css';\nimport { env } from '../lib/util';\n\nexport default function (i) {\n if (!env.supportsTouch && !env.supportsIePointer) {\n return;\n }\n\n const element = i.element;\n\n const state = {\n startOffset: {},\n startTime: 0,\n speed: {},\n easingLoop: null,\n };\n\n function shouldPrevent(deltaX, deltaY) {\n const scrollTop = Math.floor(element.scrollTop);\n const scrollLeft = element.scrollLeft;\n const magnitudeX = Math.abs(deltaX);\n const magnitudeY = Math.abs(deltaY);\n\n if (magnitudeY > magnitudeX) {\n // user is perhaps trying to swipe up/down the page\n\n if (\n (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||\n (deltaY > 0 && scrollTop === 0)\n ) {\n // set prevent for mobile Chrome refresh\n return window.scrollY === 0 && deltaY > 0 && env.isChrome;\n }\n } else if (magnitudeX > magnitudeY) {\n // user is perhaps trying to swipe left/right across the page\n\n if (\n (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||\n (deltaX > 0 && scrollLeft === 0)\n ) {\n return true;\n }\n }\n\n return true;\n }\n\n function applyTouchMove(differenceX, differenceY) {\n element.scrollTop -= differenceY;\n element.scrollLeft -= differenceX;\n\n updateGeometry(i);\n }\n\n function getTouch(e) {\n if (e.targetTouches) {\n return e.targetTouches[0];\n }\n // Maybe IE pointer\n return e;\n }\n\n function shouldHandle(e) {\n if (e.target === i.scrollbarX || e.target === i.scrollbarY) {\n return false;\n }\n if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {\n return false;\n }\n if (e.targetTouches && e.targetTouches.length === 1) {\n return true;\n }\n if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {\n return true;\n }\n return false;\n }\n\n function touchStart(e) {\n if (!shouldHandle(e)) {\n return;\n }\n\n const touch = getTouch(e);\n\n state.startOffset.pageX = touch.pageX;\n state.startOffset.pageY = touch.pageY;\n\n state.startTime = new Date().getTime();\n\n if (state.easingLoop !== null) {\n clearInterval(state.easingLoop);\n }\n }\n\n function shouldBeConsumedByChild(target, deltaX, deltaY) {\n if (!element.contains(target)) {\n return false;\n }\n\n let cursor = target;\n\n while (cursor && cursor !== element) {\n if (cursor.classList.contains(cls.element.consuming)) {\n return true;\n }\n\n const style = CSS.get(cursor);\n\n // if deltaY && vertical scrollable\n if (deltaY && style.overflowY.match(/(scroll|auto)/)) {\n const maxScrollTop = cursor.scrollHeight - cursor.clientHeight;\n if (maxScrollTop > 0) {\n if (\n (cursor.scrollTop > 0 && deltaY < 0) ||\n (cursor.scrollTop < maxScrollTop && deltaY > 0)\n ) {\n return true;\n }\n }\n }\n // if deltaX && horizontal scrollable\n if (deltaX && style.overflowX.match(/(scroll|auto)/)) {\n const maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;\n if (maxScrollLeft > 0) {\n if (\n (cursor.scrollLeft > 0 && deltaX < 0) ||\n (cursor.scrollLeft < maxScrollLeft && deltaX > 0)\n ) {\n return true;\n }\n }\n }\n\n cursor = cursor.parentNode;\n }\n\n return false;\n }\n\n function touchMove(e) {\n if (shouldHandle(e)) {\n const touch = getTouch(e);\n\n const currentOffset = { pageX: touch.pageX, pageY: touch.pageY };\n\n const differenceX = currentOffset.pageX - state.startOffset.pageX;\n const differenceY = currentOffset.pageY - state.startOffset.pageY;\n\n if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {\n return;\n }\n\n applyTouchMove(differenceX, differenceY);\n state.startOffset = currentOffset;\n\n const currentTime = new Date().getTime();\n\n const timeGap = currentTime - state.startTime;\n if (timeGap > 0) {\n state.speed.x = differenceX / timeGap;\n state.speed.y = differenceY / timeGap;\n state.startTime = currentTime;\n }\n\n if (shouldPrevent(differenceX, differenceY)) {\n // Prevent the default behavior if the event is cancelable\n if (e.cancelable) {\n e.preventDefault();\n }\n }\n }\n }\n\n function touchEnd() {\n if (i.settings.swipeEasing) {\n clearInterval(state.easingLoop);\n state.easingLoop = setInterval(() => {\n if (i.isInitialized) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (!state.speed.x && !state.speed.y) {\n clearInterval(state.easingLoop);\n return;\n }\n\n if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) {\n clearInterval(state.easingLoop);\n return;\n }\n\n applyTouchMove(state.speed.x * 30, state.speed.y * 30);\n\n state.speed.x *= 0.8;\n state.speed.y *= 0.8;\n }, 10);\n }\n }\n\n if (env.supportsTouch) {\n i.event.bind(element, 'touchstart', touchStart);\n i.event.bind(element, 'touchmove', touchMove);\n i.event.bind(element, 'touchend', touchEnd);\n } else if (env.supportsIePointer) {\n if (window.PointerEvent) {\n i.event.bind(element, 'pointerdown', touchStart);\n i.event.bind(element, 'pointermove', touchMove);\n i.event.bind(element, 'pointerup', touchEnd);\n } else if (window.MSPointerEvent) {\n i.event.bind(element, 'MSPointerDown', touchStart);\n i.event.bind(element, 'MSPointerMove', touchMove);\n i.event.bind(element, 'MSPointerUp', touchEnd);\n }\n }\n}\n"],"names":["Math","abs","floor","get","element","getComputedStyle","set","obj","const","key","let","val","style","div","className","document","createElement","matches","query","elMatches","Error","call","remove","parentNode","removeChild","queryChildren","selector","Array","prototype","filter","children","child","addScrollingClass","i","x","classList","cls","state","scrolling","contains","clearTimeout","scrollingClassTimeout","add","removeScrollingClass","setTimeout","isAlive","settings","scrollingThreshold","setScrollingClassInstantly","createEvent","name","window","CustomEvent","evt","initCustomEvent","axis","diff","useScrollingClass","forceFireReachEvent","fields","processScrollDiff","ref","reach","y","scrollTop","contentHeight","containerHeight","dispatchEvent","up","down","toInt","parseInt","isEditable","el","DOM.matches","outerWidth","styles","CSS.get","width","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","roundedScrollTop","rect","getBoundingClientRect","containerWidth","height","contentWidth","scrollWidth","scrollHeight","scrollbarXRail","DOM.queryChildren","rail","forEach","DOM.remove","appendChild","scrollbarYRail","suppressScrollX","scrollXMarginOffset","scrollbarXActive","railXWidth","railXMarginWidth","railXRatio","scrollbarXWidth","getThumbSize","scrollbarXLeft","negativeScrollAdjustment","scrollLeft","suppressScrollY","scrollYMarginOffset","scrollbarYActive","railYHeight","railYMarginHeight","railYRatio","scrollbarYHeight","scrollbarYTop","updateCss","active","isRtl","thumbSize","min","max","minScrollbarLength","maxScrollbarLength","xRailOffset","left","isScrollbarXUsingBottom","bottom","scrollbarXBottom","top","scrollbarXTop","CSS.set","yRailOffset","isScrollbarYUsingRight","right","scrollbarYRight","scrollbarYOuterWidth","scrollbarYLeft","scrollbarX","railBorderXWidth","scrollbarY","railBorderYWidth","bindMouseScrollHandler","moveHandler","e","touches","pageAxis","toUpperCase","activeSlider","scrollbarAxis","scrollAxis","startingScrollPosition","scrollBy","startingMousePagePosition","updateGeometry","stopPropagation","preventDefault","endHandler","scrollbarRail","clicking","removeEventListener","bindMoves","contentDimension","containerDimension","railDimension","scrollbarDimension","addEventListener","passive","cancelable","Element","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","main","rtl","thumb","consuming","focus","EventElement","handlers","bind","eventName","handler","push","unbind","target","this","unbindAll","prototypeAccessors","isEmpty","Object","keys","every","length","EventManager","eventElements","eventElement","ee","splice","indexOf","once","onceHandler","env","isWebKit","documentElement","supportsTouch","navigator","maxTouchPoints","DocumentTouch","supportsIePointer","msMaxTouchPoints","isChrome","test","userAgent","defaultSettings","swipeEasing","useBothWheelAxes","wheelPropagation","wheelSpeed","event","positionTop","pageY","pageYOffset","direction","positionLeft","pageX","pageXOffset","shouldPreventDefault","deltaX","deltaY","elementHovered","scrollbarFocused","ownerDocument","isDefaultPrevented","defaultPrevented","activeElement","tagName","contentDocument","shadowRoot","which","metaKey","altKey","shiftKey","hitsBound","isTop","isBottom","offsetHeight","isLeft","isRight","offsetWidth","getDeltaFromEvent","wheelDeltaX","wheelDeltaY","deltaMode","wheelDelta","shouldBeConsumedByChild","querySelector","cursor","overflowY","match","maxScrollTop","clientHeight","overflowX","maxScrollLeft","clientWidth","mousewheelHandler","shouldPrevent","ctrlKey","onwheel","onmousewheel","magnitudeX","magnitudeY","scrollY","applyTouchMove","differenceX","differenceY","getTouch","targetTouches","shouldHandle","pointerType","buttons","MSPOINTER_TYPE_MOUSE","touchStart","touch","startOffset","startTime","Date","getTime","easingLoop","clearInterval","touchMove","currentOffset","currentTime","timeGap","speed","touchEnd","setInterval","isInitialized","PointerEvent","MSPointerEvent","PerfectScrollbar","userSettings","nodeName","blur","isNegativeScroll","originalScrollLeft","result","DOM.div","setAttribute","railXStyle","isNaN","display","marginLeft","marginRight","railYStyle","borderTopWidth","borderBottomWidth","marginTop","marginBottom","handlerName","lastScrollTop","lastScrollLeft","onScroll","update","destroy","removePsClasses","split","join"],"mappings":";;;;kNAsBQA,IAAI,CAACC,MCbcD,IAAI,CAACE,MCTzB,QAASC,CAAAA,CAAT,CAAaC,CAAb,CAAsB,CAC3B,MAAOC,CAAAA,gBAAgB,CAACD,CAAD,CACxB,CAEM,QAASE,CAAAA,CAAT,CAAaF,CAAb,CAAsBG,CAAtB,CAA2B,CAChC,IAAKC,GAAMC,CAAAA,CAAX,GAAkBF,CAAAA,CAAlB,CAAuB,CACrBG,GAAIC,CAAAA,CAAG,CAAGJ,CAAG,CAACE,CAAD,CAAbC,CACmB,QAAf,QAAOC,CAAAA,CAFU,GAGnBA,CAHmB,MAAA,EAKrBP,CAAO,CAACQ,KAAR,CAAcH,CAAd,EAAqBE,CACtB,CACD,MAAOP,CAAAA,ECZF,QAASS,CAAAA,CAAT,CAAaC,CAAb,CAAwB,CAC7BN,GAAMK,CAAAA,CAAG,C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awG,UAAb,CAA0B,KAAKsN,cAA9C,CAPP,CASV,KAAKD,aAAL,CAAqB,EAAW,KAAK7T,OAAL,CAAa4D,SAAxB,CATX,CAUZ,KAAOkQ,cAAP,CAAwB,KAAK9T,OAAL,CAAawG,UAVzB,GAadiM,WAAA,CAAEwB,OAAF,WAAY,CACH,KAAKxR,OADF;AAKR,KAAK+K,KAAL,CAAWhC,SAAX,EALQ,CAMV7F,CAAY,CAAC,KAAK4C,UAAN,CANF,CAOV5C,CAAY,CAAC,KAAK8C,UAAN,CAPF,CAQV9C,CAAY,CAAC,KAAKJ,cAAN,CARF,CASVI,CAAY,CAAC,KAAKE,cAAN,CATF,CAUR,KAAKqO,eAAL,EAVQ,CAaR,KAAKlU,OAAL,CAAe,IAbP,CAcR,KAAKuI,UAAL,CAAkB,IAdV,CAeR,KAAKE,UAAL,CAAkB,IAfV,CAgBR,KAAKlD,cAAL,CAAsB,IAhBd,CAiBR,KAAKM,cAAL,CAAsB,IAjBd,CAmBR,KAAKpD,OAAL,GAnBQ,GAsBZgQ,WAAA,CAAEyB,eAAF,WAAoB,CAClB,KAAOlU,OAAP,CAAeU,SAAf,CAA2B,KAAKV,OAAL,CAAaU,SAAb,CACtByT,KADsB,CAChB,GADgB,EAEtB1S,MAFsB,UAEdqB,EAAM,OAAG,CAACA,CAAI,CAACkN,KAAL,CAAW,eAAX,CAA2B,CAFvB,EAGtBoE,IAHsB,CAGjB,GAHiB,CAI1B"} \ No newline at end of file diff --git a/docs/perfect-scrollbar.min.js b/docs/perfect-scrollbar.min.js index bc567e7..8ad7bfa 100644 --- a/docs/perfect-scrollbar.min.js +++ b/docs/perfect-scrollbar.min.js @@ -1,18 +1,20 @@ /*! - * perfect-scrollbar v1.5.2 - * Copyright 2021 Hyunje Jun, MDBootstrap and Contributors + * perfect-scrollbar v1.5.6 + * Copyright 2024 Hyunje Jun, MDBootstrap and Contributors * Licensed under MIT - */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a=a||self,a.PerfectScrollbar=b())})(this,function(){'use strict';var u=Math.abs,v=Math.floor;function a(a){return getComputedStyle(a)}function b(a,b){for(var c in b){var d=b[c];"number"==typeof d&&(d+="px"),a.style[c]=d}return a}function c(a){var b=document.createElement("div");return b.className=a,b}function d(a,b){if(!w)throw new Error("No element matching method supported");return w.call(a,b)}function e(a){a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a)}function f(a,b){return Array.prototype.filter.call(a.children,function(a){return d(a,b)})}function g(a,b){var c=a.element.classList,d=z.state.scrolling(b);c.contains(d)?clearTimeout(A[b]):c.add(d)}function h(a,b){A[b]=setTimeout(function(){return a.isAlive&&a.element.classList.remove(z.state.scrolling(b))},a.settings.scrollingThreshold)}function j(a,b){g(a,b),h(a,b)}function k(a){if("function"==typeof window.CustomEvent)return new CustomEvent(a);var b=document.createEvent("CustomEvent");return b.initCustomEvent(a,!1,!1,void 0),b}function l(a,b,c,d,e){void 0===d&&(d=!0),void 0===e&&(e=!1);var f;if("top"===b)f=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===b)f=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");m(a,c,f,d,e)}function m(a,b,c,d,e){var f=c[0],g=c[1],h=c[2],i=c[3],l=c[4],m=c[5];void 0===d&&(d=!0),void 0===e&&(e=!1);var n=a.element;// reset reach -a.reach[i]=null,1>n[h]&&(a.reach[i]="start"),n[h]>a[f]-a[g]-1&&(a.reach[i]="end"),b&&(n.dispatchEvent(k("ps-scroll-"+i)),0>b?n.dispatchEvent(k("ps-scroll-"+l)):0=a.railXWidth-a.scrollbarXWidth&&(a.scrollbarXLeft=a.railXWidth-a.scrollbarXWidth),a.scrollbarYTop>=a.railYHeight-a.scrollbarYHeight&&(a.scrollbarYTop=a.railYHeight-a.scrollbarYHeight),s(c,a),a.scrollbarXActive?c.classList.add(z.state.active("x")):(c.classList.remove(z.state.active("x")),a.scrollbarXWidth=0,a.scrollbarXLeft=0,c.scrollLeft=!0===a.isRtl?a.contentWidth:0),a.scrollbarYActive?c.classList.add(z.state.active("y")):(c.classList.remove(z.state.active("y")),a.scrollbarYHeight=0,a.scrollbarYTop=0,c.scrollTop=0)}function r(a,b){var c=Math.min,d=Math.max;return a.settings.minScrollbarLength&&(b=d(b,a.settings.minScrollbarLength)),a.settings.maxScrollbarLength&&(b=c(b,a.settings.maxScrollbarLength)),b}function s(a,c){var d={width:c.railXWidth},e=v(a.scrollTop);d.left=c.isRtl?c.negativeScrollAdjustment+a.scrollLeft+c.containerWidth-c.contentWidth:a.scrollLeft,c.isScrollbarXUsingBottom?d.bottom=c.scrollbarXBottom-e:d.top=c.scrollbarXTop+e,b(c.scrollbarXRail,d);var f={top:e,height:c.railYHeight};c.isScrollbarYUsingRight?c.isRtl?f.right=c.contentWidth-(c.negativeScrollAdjustment+a.scrollLeft)-c.scrollbarYRight-c.scrollbarYOuterWidth-9:f.right=c.scrollbarYRight-a.scrollLeft:c.isRtl?f.left=c.negativeScrollAdjustment+a.scrollLeft+2*c.containerWidth-c.contentWidth-c.scrollbarYLeft-c.scrollbarYOuterWidth:f.left=c.scrollbarYLeft+a.scrollLeft,b(c.scrollbarYRail,f),b(c.scrollbarX,{left:c.scrollbarXLeft,width:c.scrollbarXWidth-c.railBorderXWidth}),b(c.scrollbarY,{top:c.scrollbarYTop,height:c.scrollbarYHeight-c.railBorderYWidth})}function t(a,b){function c(b){b.touches&&b.touches[0]&&(b[k]=b.touches[0].pageY),s[o]=t+v*(b[k]-u),g(a,p),q(a),b.stopPropagation(),b.preventDefault()}function d(){h(a,p),a[r].classList.remove(z.state.clicking),a.event.unbind(a.ownerDocument,"mousemove",c)}function f(b,e){t=s[o],e&&b.touches&&(b[k]=b.touches[0].pageY),u=b[k],v=(a[j]-a[i])/(a[l]-a[n]),e?a.event.bind(a.ownerDocument,"touchmove",c):(a.event.bind(a.ownerDocument,"mousemove",c),a.event.once(a.ownerDocument,"mouseup",d),b.preventDefault()),a[r].classList.add(z.state.clicking),b.stopPropagation()}var i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],r=b[8],s=a.element,t=null,u=null,v=null;a.event.bind(a[m],"mousedown",function(a){f(a)}),a.event.bind(a[m],"touchstart",function(a){f(a,!0)})}var w="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector),z={main:"ps",rtl:"ps__rtl",element:{thumb:function(a){return"ps__thumb-"+a},rail:function(a){return"ps__rail-"+a},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(a){return"ps--active-"+a},scrolling:function(a){return"ps--scrolling-"+a}}},A={x:null,y:null},B=function(a){this.element=a,this.handlers={}},C={isEmpty:{configurable:!0}};B.prototype.bind=function(a,b){"undefined"==typeof this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this.element.addEventListener(a,b,!1)},B.prototype.unbind=function(a,b){var c=this;this.handlers[a]=this.handlers[a].filter(function(d){return!!(b&&d!==b)||(c.element.removeEventListener(a,d,!1),!1)})},B.prototype.unbindAll=function(){for(var a in this.handlers)this.unbind(a)},C.isEmpty.get=function(){var a=this;return Object.keys(this.handlers).every(function(b){return 0===a.handlers[b].length})},Object.defineProperties(B.prototype,C);var D=function(){this.eventElements=[]};D.prototype.eventElement=function(a){var b=this.eventElements.filter(function(b){return b.element===a})[0];return b||(b=new B(a),this.eventElements.push(b)),b},D.prototype.bind=function(a,b,c){this.eventElement(a).bind(b,c)},D.prototype.unbind=function(a,b,c){var d=this.eventElement(a);d.unbind(b,c),d.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(d),1)},D.prototype.unbindAll=function(){this.eventElements.forEach(function(a){return a.unbindAll()}),this.eventElements=[]},D.prototype.once=function(a,b,c){var d=this.eventElement(a),e=function(a){d.unbind(b,e),c(a)};d.bind(b,e)};var E={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&0a.scrollbarYTop?1:-1;a.element.scrollTop+=d*a.containerHeight,q(a),b.stopPropagation()}),a.event.bind(a.scrollbarX,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarXRail,"mousedown",function(b){var c=b.pageX-window.pageXOffset-a.scrollbarXRail.getBoundingClientRect().left,d=c>a.scrollbarXLeft?1:-1;a.element.scrollLeft+=d*a.containerWidth,q(a),b.stopPropagation()})},"drag-thumb":function(a){t(a,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),t(a,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(a){function b(b,d){var e=v(c.scrollTop);if(0===b){if(!a.scrollbarYActive)return!1;if(0===e&&0=a.contentHeight-a.containerHeight&&0>d)return!a.settings.wheelPropagation}var f=c.scrollLeft;if(0===d){if(!a.scrollbarXActive)return!1;if(0===f&&0>b||f>=a.contentWidth-a.containerWidth&&0u(a)?f||g:i||j,!d||!b.settings.wheelPropagation}function d(a){var b=a.deltaX,c=-1*a.deltaY;return("undefined"==typeof b||"undefined"==typeof c)&&(b=-1*a.wheelDeltaX/6,c=a.wheelDeltaY/6),a.deltaMode&&1===a.deltaMode&&(b*=10,c*=10),b!==b&&c!==c/* NaN checks */&&(b=0,c=a.wheelDelta),a.shiftKey?[-c,-b]:[b,c]}function f(b,c,d){// FIXME: this is a workaround for issue in FF and IE #571 +if(!D.isWebKit&&h.querySelector("select:focus"))return!0;if(!h.contains(b))return!1;for(var e=b;e&&e!==h;){if(e.classList.contains(y.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0d||e.scrollTopc||e.scrollLeftf){// user is perhaps trying to swipe up/down the page if(0>c&&d===b.contentHeight-b.containerHeight||0g&&(0>a&&e===b.contentWidth-b.containerWidth||0g&&(0>a&&e===b.contentWidth-b.containerWidth||0d||e.scrollTopc||e.scrollLeftu(o.x)&&.01>u(o.y)?void clearInterval(p):b.element?void(d(30*o.x,30*o.y),o.x*=.8,o.y*=.8):void clearInterval(p):void clearInterval(p)},10))}if(E.supportsTouch||E.supportsIePointer){var l=b.element,m={},n=0,o={},p=null;E.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):E.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(z.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(z.state.focus)},i=function(){return d.classList.remove(z.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(z.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new D,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(z.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(z.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(z.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(z.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment +if(c&&f.overflowX.match(/(scroll|auto)/)){var h=e.scrollWidth-e.clientWidth;if(0c||e.scrollLeftu(m.speed.x)&&.01>u(m.speed.y)?void clearInterval(m.easingLoop):void(d(30*m.speed.x,30*m.speed.y),m.speed.x*=.8,m.speed.y*=.8):void clearInterval(m.easingLoop)},10))}if(D.supportsTouch||D.supportsIePointer){var l=b.element,m={startOffset:{},startTime:0,speed:{},easingLoop:null};D.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):D.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}/* eslint-disable */},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(y.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(y.state.focus)},i=function(){return d.classList.remove(y.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(y.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new C,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(y.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(y.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(y.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(y.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment // Recalculate rail margins // Hide scrollbars not to affect scrollWidth and scrollHeight this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,b(this.scrollbarXRail,{display:"block"}),b(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n(a(this.scrollbarXRail).marginLeft)+n(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=n(a(this.scrollbarYRail).marginTop)+n(a(this.scrollbarYRail).marginBottom),b(this.scrollbarXRail,{display:"none"}),b(this.scrollbarYRail,{display:"none"}),q(this),l(this,"top",0,!1,!0),l(this,"left",0,!1,!0),b(this.scrollbarXRail,{display:""}),b(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(){this.isAlive&&(q(this),l(this,"top",this.element.scrollTop-this.lastScrollTop),l(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=v(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(// unset elements diff --git a/package-lock.json b/package-lock.json index 4f0d8da..2b10a95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "perfect-scrollbar", - "version": "1.5.3", + "version": "1.5.6", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.5.3", + "name": "perfect-scrollbar", + "version": "1.5.6", "license": "MIT", "devDependencies": { "chokidar-cli": "^2.1.0", @@ -589,7 +590,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", diff --git a/package.json b/package.json index 4f53628..1b1d568 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "perfect-scrollbar", - "version": "1.5.5", + "version": "1.5.6", "description": "Minimalistic but perfect custom scrollbar plugin", "author": "Hyunje Jun ", "keywords": [ diff --git a/release b/release old mode 100644 new mode 100755 index 1d34e44..4694748 --- a/release +++ b/release @@ -19,7 +19,7 @@ message="v$version Please refer to Releases for changelog. -https://github.com/utatti/perfect-scrollbar/releases" +https://github.com/mdbootstrap/perfect-scrollbar/releases" # Commit, tag, and show detail and file names git commit . -m "$message" diff --git a/src/handlers/click-rail.js b/src/handlers/click-rail.js index 39cb593..060db25 100644 --- a/src/handlers/click-rail.js +++ b/src/handlers/click-rail.js @@ -1,14 +1,13 @@ +/* eslint-disable */ + import updateGeometry from '../update-geometry'; -export default function(i) { - const element = i.element; +export default function (i) { + // const element = i.element; - i.event.bind(i.scrollbarY, 'mousedown', e => e.stopPropagation()); - i.event.bind(i.scrollbarYRail, 'mousedown', e => { - const positionTop = - e.pageY - - window.pageYOffset - - i.scrollbarYRail.getBoundingClientRect().top; + i.event.bind(i.scrollbarY, 'mousedown', (e) => e.stopPropagation()); + i.event.bind(i.scrollbarYRail, 'mousedown', (e) => { + const positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top; const direction = positionTop > i.scrollbarYTop ? 1 : -1; i.element.scrollTop += direction * i.containerHeight; @@ -17,12 +16,10 @@ export default function(i) { e.stopPropagation(); }); - i.event.bind(i.scrollbarX, 'mousedown', e => e.stopPropagation()); - i.event.bind(i.scrollbarXRail, 'mousedown', e => { + i.event.bind(i.scrollbarX, 'mousedown', (e) => e.stopPropagation()); + i.event.bind(i.scrollbarXRail, 'mousedown', (e) => { const positionLeft = - e.pageX - - window.pageXOffset - - i.scrollbarXRail.getBoundingClientRect().left; + e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left; const direction = positionLeft > i.scrollbarXLeft ? 1 : -1; i.element.scrollLeft += direction * i.containerWidth; diff --git a/src/handlers/drag-thumb.js b/src/handlers/drag-thumb.js index 24c1542..0226183 100644 --- a/src/handlers/drag-thumb.js +++ b/src/handlers/drag-thumb.js @@ -1,24 +1,9 @@ -import * as CSS from '../lib/css'; -import * as DOM from '../lib/dom'; -import cls, { - addScrollingClass, - removeScrollingClass, -} from '../lib/class-names'; +import cls, { addScrollingClass, removeScrollingClass } from '../lib/class-names'; import updateGeometry from '../update-geometry'; -import { toInt } from '../lib/util'; -export default function(i) { - bindMouseScrollHandler(i, [ - 'containerWidth', - 'contentWidth', - 'pageX', - 'railXWidth', - 'scrollbarX', - 'scrollbarXWidth', - 'scrollLeft', - 'x', - 'scrollbarXRail', - ]); +let activeSlider = null; // Variable to track the currently active slider + +export default function setupScrollHandlers(i) { bindMouseScrollHandler(i, [ 'containerHeight', 'contentHeight', @@ -30,75 +15,96 @@ export default function(i) { 'y', 'scrollbarYRail', ]); + + bindMouseScrollHandler(i, [ + 'containerWidth', + 'contentWidth', + 'pageX', + 'railXWidth', + 'scrollbarX', + 'scrollbarXWidth', + 'scrollLeft', + 'x', + 'scrollbarXRail', + ]); } function bindMouseScrollHandler( i, [ - containerHeight, - contentHeight, - pageY, - railYHeight, - scrollbarY, - scrollbarYHeight, - scrollTop, - y, - scrollbarYRail, + containerDimension, + contentDimension, + pageAxis, + railDimension, + scrollbarAxis, + scrollbarDimension, + scrollAxis, + axis, + scrollbarRail, ] ) { const element = i.element; - - let startingScrollTop = null; - let startingMousePageY = null; + let startingScrollPosition = null; + let startingMousePagePosition = null; let scrollBy = null; - function mouseMoveHandler(e) { + function moveHandler(e) { if (e.touches && e.touches[0]) { - e[pageY] = e.touches[0].pageY; + e[pageAxis] = e.touches[0][`page${axis.toUpperCase()}`]; } - element[scrollTop] = - startingScrollTop + scrollBy * (e[pageY] - startingMousePageY); - addScrollingClass(i, y); - updateGeometry(i); - e.stopPropagation(); - if (e.type.startsWith('touch') && e.changedTouches.length > 1) { + // Only move if the active slider is the one we started with + if (activeSlider === scrollbarAxis) { + element[scrollAxis] = + startingScrollPosition + scrollBy * (e[pageAxis] - startingMousePagePosition); + addScrollingClass(i, axis); + updateGeometry(i); + + e.stopPropagation(); e.preventDefault(); } } - function mouseUpHandler() { - removeScrollingClass(i, y); - i[scrollbarYRail].classList.remove(cls.state.clicking); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); + function endHandler() { + removeScrollingClass(i, axis); + i[scrollbarRail].classList.remove(cls.state.clicking); + document.removeEventListener('mousemove', moveHandler); + document.removeEventListener('mouseup', endHandler); + document.removeEventListener('touchmove', moveHandler); + document.removeEventListener('touchend', endHandler); + activeSlider = null; // Reset active slider when interaction ends } - function bindMoves(e, touchMode) { - startingScrollTop = element[scrollTop]; - if (touchMode && e.touches) { - e[pageY] = e.touches[0].pageY; - } - startingMousePageY = e[pageY]; - scrollBy = - (i[contentHeight] - i[containerHeight]) / - (i[railYHeight] - i[scrollbarYHeight]); - if (!touchMode) { - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - e.preventDefault(); - } else { - i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler); - } + function bindMoves(e) { + if (activeSlider === null) { + // Only bind if no slider is currently active + activeSlider = scrollbarAxis; // Set current slider as active + + startingScrollPosition = element[scrollAxis]; + if (e.touches) { + e[pageAxis] = e.touches[0][`page${axis.toUpperCase()}`]; + } + startingMousePagePosition = e[pageAxis]; + scrollBy = + (i[contentDimension] - i[containerDimension]) / (i[railDimension] - i[scrollbarDimension]); - i[scrollbarYRail].classList.add(cls.state.clicking); + if (!e.touches) { + document.addEventListener('mousemove', moveHandler); + document.addEventListener('mouseup', endHandler); + } else { + document.addEventListener('touchmove', moveHandler, { passive: false }); + document.addEventListener('touchend', endHandler); + } + + i[scrollbarRail].classList.add(cls.state.clicking); + } e.stopPropagation(); + if (e.cancelable) { + e.preventDefault(); + } } - i.event.bind(i[scrollbarY], 'mousedown', e => { - bindMoves(e); - }); - i.event.bind(i[scrollbarY], 'touchstart', e => { - bindMoves(e, true); - }); + i[scrollbarAxis].addEventListener('mousedown', bindMoves); + i[scrollbarAxis].addEventListener('touchstart', bindMoves); } diff --git a/src/handlers/keyboard.js b/src/handlers/keyboard.js index 708a063..23eae58 100644 --- a/src/handlers/keyboard.js +++ b/src/handlers/keyboard.js @@ -1,8 +1,10 @@ +/* eslint-disable */ + import * as DOM from '../lib/dom'; import updateGeometry from '../update-geometry'; import { isEditable } from '../lib/util'; -export default function(i) { +export default function (i) { const element = i.element; const elementHovered = () => DOM.matches(element, ':hover'); @@ -38,11 +40,8 @@ export default function(i) { return true; } - i.event.bind(i.ownerDocument, 'keydown', e => { - if ( - (e.isDefaultPrevented && e.isDefaultPrevented()) || - e.defaultPrevented - ) { + i.event.bind(i.ownerDocument, 'keydown', (e) => { + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) { return; } diff --git a/src/handlers/mouse-wheel.js b/src/handlers/mouse-wheel.js index 840e269..e12e3a0 100644 --- a/src/handlers/mouse-wheel.js +++ b/src/handlers/mouse-wheel.js @@ -1,9 +1,11 @@ +/* eslint-disable */ + import * as CSS from '../lib/css'; import cls from '../lib/class-names'; import updateGeometry from '../update-geometry'; import { env } from '../lib/util'; -export default function(i) { +export default function (i) { const element = i.element; let shouldPrevent = false; @@ -11,11 +13,9 @@ export default function(i) { function shouldPreventDefault(deltaX, deltaY) { const roundedScrollTop = Math.floor(element.scrollTop); const isTop = element.scrollTop === 0; - const isBottom = - roundedScrollTop + element.offsetHeight === element.scrollHeight; + const isBottom = roundedScrollTop + element.offsetHeight === element.scrollHeight; const isLeft = element.scrollLeft === 0; - const isRight = - element.scrollLeft + element.offsetWidth === element.scrollWidth; + const isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth; let hitsBound; diff --git a/src/handlers/touch.js b/src/handlers/touch.js index 599d238..7c02e16 100644 --- a/src/handlers/touch.js +++ b/src/handlers/touch.js @@ -3,13 +3,20 @@ import cls from '../lib/class-names'; import * as CSS from '../lib/css'; import { env } from '../lib/util'; -export default function(i) { +export default function (i) { if (!env.supportsTouch && !env.supportsIePointer) { return; } const element = i.element; + const state = { + startOffset: {}, + startTime: 0, + speed: {}, + easingLoop: null, + }; + function shouldPrevent(deltaX, deltaY) { const scrollTop = Math.floor(element.scrollTop); const scrollLeft = element.scrollLeft; @@ -47,32 +54,25 @@ export default function(i) { updateGeometry(i); } - let startOffset = {}; - let startTime = 0; - let speed = {}; - let easingLoop = null; - function getTouch(e) { if (e.targetTouches) { return e.targetTouches[0]; - } else { - // Maybe IE pointer - return e; } + // Maybe IE pointer + return e; } function shouldHandle(e) { + if (e.target === i.scrollbarX || e.target === i.scrollbarY) { + return false; + } if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) { return false; } if (e.targetTouches && e.targetTouches.length === 1) { return true; } - if ( - e.pointerType && - e.pointerType !== 'mouse' && - e.pointerType !== e.MSPOINTER_TYPE_MOUSE - ) { + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) { return true; } return false; @@ -85,13 +85,13 @@ export default function(i) { const touch = getTouch(e); - startOffset.pageX = touch.pageX; - startOffset.pageY = touch.pageY; + state.startOffset.pageX = touch.pageX; + state.startOffset.pageY = touch.pageY; - startTime = new Date().getTime(); + state.startTime = new Date().getTime(); - if (easingLoop !== null) { - clearInterval(easingLoop); + if (state.easingLoop !== null) { + clearInterval(state.easingLoop); } } @@ -146,58 +146,57 @@ export default function(i) { const currentOffset = { pageX: touch.pageX, pageY: touch.pageY }; - const differenceX = currentOffset.pageX - startOffset.pageX; - const differenceY = currentOffset.pageY - startOffset.pageY; + const differenceX = currentOffset.pageX - state.startOffset.pageX; + const differenceY = currentOffset.pageY - state.startOffset.pageY; if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) { return; } applyTouchMove(differenceX, differenceY); - startOffset = currentOffset; + state.startOffset = currentOffset; const currentTime = new Date().getTime(); - const timeGap = currentTime - startTime; + const timeGap = currentTime - state.startTime; if (timeGap > 0) { - speed.x = differenceX / timeGap; - speed.y = differenceY / timeGap; - startTime = currentTime; + state.speed.x = differenceX / timeGap; + state.speed.y = differenceY / timeGap; + state.startTime = currentTime; } if (shouldPrevent(differenceX, differenceY)) { - e.preventDefault(); + // Prevent the default behavior if the event is cancelable + if (e.cancelable) { + e.preventDefault(); + } } } } + function touchEnd() { if (i.settings.swipeEasing) { - clearInterval(easingLoop); - easingLoop = setInterval(function() { + clearInterval(state.easingLoop); + state.easingLoop = setInterval(() => { if (i.isInitialized) { - clearInterval(easingLoop); - return; - } - - if (!speed.x && !speed.y) { - clearInterval(easingLoop); + clearInterval(state.easingLoop); return; } - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) { - clearInterval(easingLoop); + if (!state.speed.x && !state.speed.y) { + clearInterval(state.easingLoop); return; } - if (!i.element) { - clearInterval(easingLoop); + if (Math.abs(state.speed.x) < 0.01 && Math.abs(state.speed.y) < 0.01) { + clearInterval(state.easingLoop); return; } - applyTouchMove(speed.x * 30, speed.y * 30); + applyTouchMove(state.speed.x * 30, state.speed.y * 30); - speed.x *= 0.8; - speed.y *= 0.8; + state.speed.x *= 0.8; + state.speed.y *= 0.8; }, 10); } } diff --git a/src/index.js b/src/index.js index 451cd64..04cfd62 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,5 @@ +/* eslint-disable */ + import * as CSS from './lib/css'; import * as DOM from './lib/dom'; import cls from './lib/class-names'; @@ -98,12 +100,10 @@ export default class PerfectScrollbar { } else { this.isScrollbarXUsingBottom = true; } - this.railBorderXWidth = - toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); + this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth); // Set rail to display:block to calculate margins CSS.set(this.scrollbarXRail, { display: 'block' }); - this.railXMarginWidth = - toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); + this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight); CSS.set(this.scrollbarXRail, { display: '' }); this.railXWidth = null; this.railXRatio = null; @@ -127,11 +127,9 @@ export default class PerfectScrollbar { this.isScrollbarYUsingRight = true; } this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null; - this.railBorderYWidth = - toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); + this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth); CSS.set(this.scrollbarYRail, { display: 'block' }); - this.railYMarginHeight = - toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); + this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom); CSS.set(this.scrollbarYRail, { display: '' }); this.railYHeight = null; this.railYRatio = null; @@ -153,11 +151,11 @@ export default class PerfectScrollbar { this.isAlive = true; - this.settings.handlers.forEach(handlerName => handlers[handlerName](this)); + this.settings.handlers.forEach((handlerName) => handlers[handlerName](this)); this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only this.lastScrollLeft = element.scrollLeft; // for onScroll only - this.event.bind(this.element, 'scroll', e => this.onScroll(e)); + this.event.bind(this.element, 'scroll', (e) => this.onScroll(e)); updateGeometry(this); } @@ -201,11 +199,7 @@ export default class PerfectScrollbar { updateGeometry(this); processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop); - processScrollDiff( - this, - 'left', - this.element.scrollLeft - this.lastScrollLeft - ); + processScrollDiff(this, 'left', this.element.scrollLeft - this.lastScrollLeft); this.lastScrollTop = Math.floor(this.element.scrollTop); this.lastScrollLeft = this.element.scrollLeft; @@ -236,7 +230,7 @@ export default class PerfectScrollbar { removePsClasses() { this.element.className = this.element.className .split(' ') - .filter(name => !name.match(/^ps([-_].+|)$/)) + .filter((name) => !name.match(/^ps([-_].+|)$/)) .join(' '); } } diff --git a/src/process-scroll-diff.js b/src/process-scroll-diff.js index 77e11ac..4538464 100644 --- a/src/process-scroll-diff.js +++ b/src/process-scroll-diff.js @@ -3,39 +3,19 @@ import { setScrollingClassInstantly } from './lib/class-names'; function createEvent(name) { if (typeof window.CustomEvent === 'function') { return new CustomEvent(name); - } else { - const evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(name, false, false, undefined); - return evt; } + + const evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(name, false, false, undefined); + return evt; } -export default function( - i, - axis, - diff, - useScrollingClass = true, - forceFireReachEvent = false -) { +export default function (i, axis, diff, useScrollingClass = true, forceFireReachEvent = false) { let fields; if (axis === 'top') { - fields = [ - 'contentHeight', - 'containerHeight', - 'scrollTop', - 'y', - 'up', - 'down', - ]; + fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down']; } else if (axis === 'left') { - fields = [ - 'contentWidth', - 'containerWidth', - 'scrollLeft', - 'x', - 'left', - 'right', - ]; + fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right']; } else { throw new Error('A proper axis should be provided'); } diff --git a/src/update-geometry.js b/src/update-geometry.js index ae1f5a8..44581fe 100644 --- a/src/update-geometry.js +++ b/src/update-geometry.js @@ -3,29 +3,27 @@ import * as DOM from './lib/dom'; import cls from './lib/class-names'; import { toInt } from './lib/util'; -export default function(i) { +/* eslint-disable no-lonely-if */ + +export default function (i) { const element = i.element; const roundedScrollTop = Math.floor(element.scrollTop); const rect = element.getBoundingClientRect(); - i.containerWidth = Math.round(rect.width); - i.containerHeight = Math.round(rect.height); + i.containerWidth = Math.floor(rect.width); + i.containerHeight = Math.floor(rect.height); i.contentWidth = element.scrollWidth; i.contentHeight = element.scrollHeight; if (!element.contains(i.scrollbarXRail)) { // clean up and append - DOM.queryChildren(element, cls.element.rail('x')).forEach(el => - DOM.remove(el) - ); + DOM.queryChildren(element, cls.element.rail('x')).forEach((el) => DOM.remove(el)); element.appendChild(i.scrollbarXRail); } if (!element.contains(i.scrollbarYRail)) { // clean up and append - DOM.queryChildren(element, cls.element.rail('y')).forEach(el => - DOM.remove(el) - ); + DOM.queryChildren(element, cls.element.rail('y')).forEach((el) => DOM.remove(el)); element.appendChild(i.scrollbarYRail); } @@ -36,13 +34,9 @@ export default function(i) { i.scrollbarXActive = true; i.railXWidth = i.containerWidth - i.railXMarginWidth; i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize( - i, - toInt((i.railXWidth * i.containerWidth) / i.contentWidth) - ); + i.scrollbarXWidth = getThumbSize(i, toInt((i.railXWidth * i.containerWidth) / i.contentWidth)); i.scrollbarXLeft = toInt( - ((i.negativeScrollAdjustment + element.scrollLeft) * - (i.railXWidth - i.scrollbarXWidth)) / + ((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth)) / (i.contentWidth - i.containerWidth) ); } else { @@ -111,10 +105,7 @@ function updateCss(element, i) { if (i.isRtl) { xRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth - - i.contentWidth; + i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth; } else { xRailOffset.left = element.scrollLeft; }