徐总多门店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
116 KiB

{"version":3,"file":"happy-scroll.min.js","sources":["../src/util.js","../node_modules/batch-processor/src/batch-processor.js","../node_modules/element-resize-detector/src/state-handler.js","../node_modules/element-resize-detector/src/element-resize-detector.js","../src/strip.vue","../node_modules/element-resize-detector/src/collection-utils.js","../node_modules/element-resize-detector/src/element-utils.js","../node_modules/element-resize-detector/src/listener-handler.js","../node_modules/element-resize-detector/src/id-generator.js","../node_modules/element-resize-detector/src/id-handler.js","../node_modules/element-resize-detector/src/reporter.js","../node_modules/element-resize-detector/src/browser-detector.js","../node_modules/batch-processor/src/utils.js","../node_modules/element-resize-detector/src/detection-strategy/object.js","../node_modules/element-resize-detector/src/detection-strategy/scroll.js","../src/scroll.vue","../src/index.js"],"sourcesContent":["\n/**\n * 绑定事件\n *\n * @export\n * @param {any} dom\n * @param {any} eventType\n * @param {any} callback\n */\nexport function on (dom, eventType, callback) {\n if (document.addEventListener) {\n dom.addEventListener(eventType, callback)\n } else {\n dom.attachEvent('on' + eventType, callback)\n }\n}\n\n/**\n* 解绑事件\n*\n* @export\n* @param {any} dom\n* @param {any} eventType\n* @param {any} callback\n*/\nexport function off (dom, eventType, callback) {\n if (document.addEventListener) {\n dom.removeEventListener(eventType, callback)\n } else {\n dom.detachEvent('on' + eventType, callback)\n }\n}\n\n/**\n * 节流函数生成器\n * 对于调用频繁的地方,可保障在设置时间内只执行1次。\n * 使用方法:\n *\n * const currentThrottle = generateThrottle() //生成一个节流函数\n * currentThrottle(Data.now()) //如果超过了阈值则返回true,否则返回false\n *\n * @param throttleTime 设置此生成器的阈值\n */\nexport const generateThrottle = function (throttleTime) {\n let time = Date.now()\n return function (now) {\n // 如果没有设置节流时间, 使用默认配置的时间 14毫秒\n if (now - time > (throttleTime || 14)) {\n time = now\n return true\n }\n }\n}\n\n/**\n * 防反跳。func函数在最后一次调用时刻的wait毫秒之后执行!\n * @param func 执行函数\n * @param wait 时间间隔\n * @param immediate 为true,debounce会在wai 时间间隔的开始调用这个函数\n * @returns {Function}\n */\nexport const debounce = function (func, wait, immediate) {\n var timeout, args, context, timestamp, result\n\n var later = function () {\n var last = new Date().getTime() - timestamp // timestamp会实时更新\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last)\n } else {\n timeout = null\n if (!immediate) {\n result = func.apply(context, args)\n if (!timeout) context = args = null\n }\n }\n }\n\n return function () {\n context = this\n args = arguments\n timestamp = new Date().getTime()\n var callNow = immediate && !timeout\n\n if (!timeout) {\n timeout = setTimeout(later, wait)\n }\n if (callNow) {\n result = func.apply(context, args)\n context = args = null\n }\n return result\n }\n}\n","\"use strict\";\n\nvar utils = require(\"./utils\");\n\nmodule.exports = function batchProcessorMaker(options) {\n options = options || {};\n var reporter = options.reporter;\n var asyncProcess = utils.getOption(options, \"async\", true);\n var autoProcess = utils.getOption(options, \"auto\", true);\n\n if(autoProcess && !asyncProcess) {\n reporter && reporter.warn(\"Invalid options combination. auto=true and async=false is invalid. Setting async=true.\");\n asyncProcess = true;\n }\n\n var batch = Batch();\n var asyncFrameHandler;\n var isProcessing = false;\n\n function addFunction(level, fn) {\n if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {\n // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.\n // This needs to be done before, since we're checking the size of the batch to be 0.\n processBatchAsync();\n }\n\n batch.add(level, fn);\n }\n\n function processBatch() {\n // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.\n // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).\n isProcessing = true;\n while (batch.size()) {\n var processingBatch = batch;\n batch = Batch();\n processingBatch.process();\n }\n isProcessing = false;\n }\n\n function forceProcessBatch(localAsyncProcess) {\n if (isProcessing) {\n return;\n }\n\n if(localAsyncProcess === undefined) {\n localAsyncProcess = asyncProcess;\n }\n\n if(asyncFrameHandler) {\n cancelFrame(asyncFrameHandler);\n asyncFrameHandler = null;\n }\n\n if(localAsyncProcess) {\n processBatchAsync();\n } else {\n processBatch();\n }\n }\n\n function processBatchAsync() {\n asyncFrameHandler = requestFrame(processBatch);\n }\n\n function clearBatch() {\n batch = {};\n batchSize = 0;\n topLevel = 0;\n bottomLevel = 0;\n }\n\n function cancelFrame(listener) {\n // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;\n var cancel = clearTimeout;\n return cancel(listener);\n }\n\n function requestFrame(callback) {\n // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };\n var raf = function(fn) { return setTimeout(fn, 0); };\n return raf(callback);\n }\n\n return {\n add: addFunction,\n force: forceProcessBatch\n };\n};\n\nfunction Batch() {\n var batch = {};\n var size = 0;\n var topLevel = 0;\n var bottomLevel = 0;\n\n function add(level, fn) {\n if(!fn) {\n fn = level;\n level = 0;\n }\n\n if(level > topLevel) {\n topLevel = level;\n } else if(level < bottomLevel) {\n bottomLevel = level;\n }\n\n if(!batch[level]) {\n batch[level] = [];\n }\n\n batch[level].push(fn);\n size++;\n }\n\n function process() {\n for(var level = bottomLevel; level <= topLevel; level++) {\n var fns = batch[level];\n\n for(var i = 0; i < fns.length; i++) {\n var fn = fns[i];\n fn();\n }\n }\n }\n\n function getSize() {\n return size;\n }\n\n return {\n add: add,\n process: process,\n size: getSize\n };\n}\n","\"use strict\";\n\nvar prop = \"_erd\";\n\nfunction initState(element) {\n element[prop] = {};\n return getState(element);\n}\n\nfunction getState(element) {\n return element[prop];\n}\n\nfunction cleanState(element) {\n delete element[prop];\n}\n\nmodule.exports = {\n initState: initState,\n getState: getState,\n cleanState: cleanState\n};\n","\"use strict\";\n\nvar forEach = require(\"./collection-utils\").forEach;\nvar elementUtilsMaker = require(\"./element-utils\");\nvar listenerHandlerMaker = require(\"./listener-handler\");\nvar idGeneratorMaker = require(\"./id-generator\");\nvar idHandlerMaker = require(\"./id-handler\");\nvar reporterMaker = require(\"./reporter\");\nvar browserDetector = require(\"./browser-detector\");\nvar batchProcessorMaker = require(\"batch-processor\");\nvar stateHandler = require(\"./state-handler\");\n\n//Detection strategies.\nvar objectStrategyMaker = require(\"./detection-strategy/object.js\");\nvar scrollStrategyMaker = require(\"./detection-strategy/scroll.js\");\n\nfunction isCollection(obj) {\n return Array.isArray(obj) || obj.length !== undefined;\n}\n\nfunction toArray(collection) {\n if (!Array.isArray(collection)) {\n var array = [];\n forEach(collection, function (obj) {\n array.push(obj);\n });\n return array;\n } else {\n return collection;\n }\n}\n\nfunction isElement(obj) {\n return obj && obj.nodeType === 1;\n}\n\n/**\n * @typedef idHandler\n * @type {object}\n * @property {function} get Gets the resize detector id of the element.\n * @property {function} set Generate and sets the resize detector id of the element.\n */\n\n/**\n * @typedef Options\n * @type {object}\n * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.\n Default is true. If true, the listener is guaranteed to be called when it has been added.\n If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).\n * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.\n If not provided, a default id handler will be used.\n * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.\n If not provided, a default id handler will be used.\n If set to false, then nothing will be reported.\n * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.\n */\n\n/**\n * Creates an element resize detector instance.\n * @public\n * @param {Options?} options Optional global options object that will decide how this instance will work.\n */\nmodule.exports = function(options) {\n options = options || {};\n\n //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var idHandler;\n\n if (options.idHandler) {\n // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler\n // so that readonly flag always is true when it's used here. This may be removed next major version bump.\n idHandler = {\n get: function (element) { return options.idHandler.get(element, true); },\n set: options.idHandler.set\n };\n } else {\n var idGenerator = idGeneratorMaker();\n var defaultIdHandler = idHandlerMaker({\n idGenerator: idGenerator,\n stateHandler: stateHandler\n });\n idHandler = defaultIdHandler;\n }\n\n //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var reporter = options.reporter;\n\n if(!reporter) {\n //If options.reporter is false, then the reporter should be quiet.\n var quiet = reporter === false;\n reporter = reporterMaker(quiet);\n }\n\n //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.\n var batchProcessor = getOption(options, \"batchProcessor\", batchProcessorMaker({ reporter: reporter }));\n\n //Options to be used as default for the listenTo function.\n var globalOptions = {};\n globalOptions.callOnAdd = !!getOption(options, \"callOnAdd\", true);\n globalOptions.debug = !!getOption(options, \"debug\", false);\n\n var eventListenerHandler = listenerHandlerMaker(idHandler);\n var elementUtils = elementUtilsMaker({\n stateHandler: stateHandler\n });\n\n //The detection strategy to be used.\n var detectionStrategy;\n var desiredStrategy = getOption(options, \"strategy\", \"object\");\n var strategyOptions = {\n reporter: reporter,\n batchProcessor: batchProcessor,\n stateHandler: stateHandler,\n idHandler: idHandler\n };\n\n if(desiredStrategy === \"scroll\") {\n if (browserDetector.isLegacyOpera()) {\n reporter.warn(\"Scroll strategy is not supported on legacy Opera. Changing to object strategy.\");\n desiredStrategy = \"object\";\n } else if (browserDetector.isIE(9)) {\n reporter.warn(\"Scroll strategy is not supported on IE9. Changing to object strategy.\");\n desiredStrategy = \"object\";\n }\n }\n\n if(desiredStrategy === \"scroll\") {\n detectionStrategy = scrollStrategyMaker(strategyOptions);\n } else if(desiredStrategy === \"object\") {\n detectionStrategy = objectStrategyMaker(strategyOptions);\n } else {\n throw new Error(\"Invalid strategy name: \" + desiredStrategy);\n }\n\n //Calls can be made to listenTo with elements that are still being installed.\n //Also, same elements can occur in the elements list in the listenTo function.\n //With this map, the ready callbacks can be synchronized between the calls\n //so that the ready callback can always be called when an element is ready - even if\n //it wasn't installed from the function itself.\n var onReadyCallbacks = {};\n\n /**\n * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.\n * @public\n * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.\n * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.\n * @param {function} listener The callback to be executed for each resize event for each element.\n */\n function listenTo(options, elements, listener) {\n function onResizeCallback(element) {\n var listeners = eventListenerHandler.get(element);\n forEach(listeners, function callListenerProxy(listener) {\n listener(element);\n });\n }\n\n function addListener(callOnAdd, element, listener) {\n eventListenerHandler.add(element, listener);\n\n if(callOnAdd) {\n listener(element);\n }\n }\n\n //Options object may be omitted.\n if(!listener) {\n listener = elements;\n elements = options;\n options = {};\n }\n\n if(!elements) {\n throw new Error(\"At least one element required.\");\n }\n\n if(!listener) {\n throw new Error(\"Listener required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n var elementsReady = 0;\n\n var callOnAdd = getOption(options, \"callOnAdd\", globalOptions.callOnAdd);\n var onReadyCallback = getOption(options, \"onReady\", function noop() {});\n var debug = getOption(options, \"debug\", globalOptions.debug);\n\n forEach(elements, function attachListenerToElement(element) {\n if (!stateHandler.getState(element)) {\n stateHandler.initState(element);\n idHandler.set(element);\n }\n\n var id = idHandler.get(element);\n\n debug && reporter.log(\"Attaching listener to element\", id, element);\n\n if(!elementUtils.isDetectable(element)) {\n debug && reporter.log(id, \"Not detectable.\");\n if(elementUtils.isBusy(element)) {\n debug && reporter.log(id, \"System busy making it detectable\");\n\n //The element is being prepared to be detectable. Do not make it detectable.\n //Just add the listener, because the element will soon be detectable.\n addListener(callOnAdd, element, listener);\n onReadyCallbacks[id] = onReadyCallbacks[id] || [];\n onReadyCallbacks[id].push(function onReady() {\n elementsReady++;\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n return;\n }\n\n debug && reporter.log(id, \"Making detectable...\");\n //The element is not prepared to be detectable, so do prepare it and add a listener to it.\n elementUtils.markBusy(element, true);\n return detectionStrategy.makeDetectable({ debug: debug }, element, function onElementDetectable(element) {\n debug && reporter.log(id, \"onElementDetectable\");\n\n if (stateHandler.getState(element)) {\n elementUtils.markAsDetectable(element);\n elementUtils.markBusy(element, false);\n detectionStrategy.addListener(element, onResizeCallback);\n addListener(callOnAdd, element, listener);\n\n // Since the element size might have changed since the call to \"listenTo\", we need to check for this change,\n // so that a resize event may be emitted.\n // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.\n // Also, check the state existance before since the element may have been uninstalled in the installation process.\n var state = stateHandler.getState(element);\n if (state && state.startSize) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n if (state.startSize.width !== width || state.startSize.height !== height) {\n onResizeCallback(element);\n }\n }\n\n if(onReadyCallbacks[id]) {\n forEach(onReadyCallbacks[id], function(callback) {\n callback();\n });\n }\n } else {\n // The element has been unisntalled before being detectable.\n debug && reporter.log(id, \"Element uninstalled before being detectable.\");\n }\n\n delete onReadyCallbacks[id];\n\n elementsReady++;\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n });\n }\n\n debug && reporter.log(id, \"Already detecable, adding listener.\");\n\n //The element has been prepared to be detectable and is ready to be listened to.\n addListener(callOnAdd, element, listener);\n elementsReady++;\n });\n\n if(elementsReady === elements.length) {\n onReadyCallback();\n }\n }\n\n function uninstall(elements) {\n if(!elements) {\n return reporter.error(\"At least one element is required.\");\n }\n\n if (isElement(elements)) {\n // A single element has been passed in.\n elements = [elements];\n } else if (isCollection(elements)) {\n // Convert collection to array for plugins.\n // TODO: May want to check so that all the elements in the collection are valid elements.\n elements = toArray(elements);\n } else {\n return reporter.error(\"Invalid arguments. Must be a DOM element or a collection of DOM elements.\");\n }\n\n forEach(elements, function (element) {\n eventListenerHandler.removeAllListeners(element);\n detectionStrategy.uninstall(element);\n stateHandler.cleanState(element);\n });\n }\n\n return {\n listenTo: listenTo,\n removeListener: eventListenerHandler.removeListener,\n removeAllListeners: eventListenerHandler.removeAllListeners,\n uninstall: uninstall\n };\n};\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","<template>\n <div ref=\"stripContainer\"\n class=\"happy-scroll-strip\"\n :style=\"[initLocation]\"\n :class=\"[horizontal ? 'happy-scroll-strip--horizontal' : 'happy-scroll-strip--vertical']\"\n @wheel.capture.stop=\"handlerWheel\">\n\n <div ref=\"strip\"\n class=\"happy-scroll-bar\"\n :style=\"[translate, {[config.sizeAttr]: length + 'px'}, initSize, {background: color}, {opacity: isOpacity}]\"\n @mousedown.stop=\"handlerMouseDown\">\n </div>\n </div>\n</template>\n<script>\nimport { on, off, generateThrottle } from './util'\nexport default {\n name: 'happy-scroll-strip',\n props: {\n // 是否作为横向\n horizontal: Boolean,\n // 使竖向滚动条在居左\n left: Boolean,\n // 使横向滚动条居右\n top: Boolean,\n move: {\n type: Number,\n default: 0\n },\n // 滚动条的宽(对于横向时为高度)\n size: {\n type: [Number, String],\n default: 4\n },\n // 竖向的 滚动条的最小长度,当滚动条长度随元素比例缩小到一定程度时不再缩小。\n minLengthV: {\n type: Number,\n default: 40\n },\n // 横向的 滚动条的最小长度,当滚动条长度随元素比例缩小到一定程度时不再缩小。\n minLengthH: {\n type: Number,\n default: 40\n },\n // 滚动条的背景色\n color: {\n type: String,\n default: 'rgba(51,51,51,0.2)'\n },\n // 鼠标移动的节流函数时间, 表示该时间内鼠标移动的回调保障在该时间内只执行一次\n throttle: {\n type: Number,\n default: 14 // 默认14毫秒\n }\n },\n data () {\n return {\n config: {},\n // 标记鼠标按下后开始移动的状态. 鼠标按下为true 抬起为 false\n startMove: false,\n // 为document绑定事件, 此状态值为了避免重复绑定\n binded: false,\n // 滚动条的宽或者高\n length: 0,\n // 滚动条空白区域 与 (用户内容元素的高度 - 视图区域的高度) 的比例\n percentage: 0,\n // 滚动条最大的偏移量。这个值等于滚动条容器 减去 滚动条 的空白区域\n maxOffset: 0,\n // 记录当前的偏移量,用于触发 滚动到头部和尾部的事件\n currentOffset: 0,\n // 鼠标移动的节流函数\n moveThrottle: generateThrottle(this.throttle)\n }\n },\n watch: {\n currentOffset (newVal) {\n if (newVal === 0) {\n // 触发事件\n this.emitLocationEvent('start', 0)\n } else if (newVal === this.maxOffset) {\n this.emitLocationEvent('end', newVal / this.percentage)\n }\n }\n },\n computed: {\n // 初始化滚动条的大小 (横向时为高度,竖向时为宽度)\n initSize () {\n return {\n [this.horizontal ? 'height' : 'width']: this.size + 'px'\n }\n },\n // 当 percentage 大于等于 1 时,说明不需要显示滚动条\n isOpacity () {\n return this.percentage < 1 ? 1 : 0\n },\n /**\n * 变化滚动条的位置,scroll主体内容,滚动时,滚动条跟着联动\n */\n translate () {\n let offset = this.move * this.percentage\n\n if (!this.$refs.stripContainer) return\n\n if (offset < 0) {\n offset = 0\n }\n if (offset > this.maxOffset) {\n offset = this.maxOffset\n }\n this.currentOffset = offset\n return {\n transform: `${this.config.translate}(${offset}px)`\n }\n },\n // 初始化滚动条位置\n initLocation () {\n if (this.horizontal) {\n return this.top ? { top: 0, bottom: 'auto' } : ''\n }\n return this.left ? { left: 0, right: 'auto' } : ''\n }\n },\n methods: {\n // 触发滚动条滚动到顶部或底部的事件\n emitLocationEvent (type, outsideOffset) {\n const direction = this.horizontal ? 'horizontal' : 'vertical'\n this.$emit(`${direction}-${type}`, outsideOffset)\n },\n /**\n * scrollSize 如果是竖向滚动条,则为 用户内容元素的 scrollHeight, 横向的则作为 用户内容元素的 scrollWidth\n * clientSize 可视区域的 clientHeight clientWidth. 横竖的原理同scrollSize\n */\n computeStrip (scrollSize, clientSize) {\n // const container = this.$refs.stripContainer // 滚动条的容器\n const currentSize = this.$refs.stripContainer[this.config.client]\n /**\n * 滚动条长度。\n *\n * clientSize / scrollSize 是表示视图范围与用户内容元素的比例\n * 用此比例来决定 滚动条的长度 滚动条容器 * 比例 = 滚动条长度\n * 但是当用户内容元素无限大的时候,可能会导致滚动条无限小,所以会设置最小长度\n */\n this.length = currentSize * (clientSize / scrollSize)\n let minLength = this.horizontal ? this.minLengthH : this.minLengthV\n if (minLength < 1) {\n // 按百分比处理\n minLength = currentSize * minLength\n }\n // 判断是否滚动条长度是否已经小于了设置的最小长度\n this.length = this.length < minLength ? minLength : this.length\n // 滚动条容器 - 滚动条长度 = 剩余的空间\n const space = this.maxOffset = currentSize - this.length\n /**\n * 这里计算一个比例\n * 已高度举例子:\n * 使用 剩余空间 除以 (用户内容元素的高度 - 视图区域的高度)\n * 可以把 视图区域的高度 比作 滚动条的长度 用户内容元素的高度 比作 滚动条容器的高度\n * 所以使用两者剩余空间的比例,来计算 当滚动条滑动1px的时候 用户内容元素应该滑动多少 px,当用户内容元素移动时 来计算 滚动条应该移动多少px\n */\n this.percentage = space / (scrollSize - clientSize)\n },\n bindEvents () {\n // 已绑定过了 不再重复绑定\n if (this.binded) return\n on(document, 'mouseup', this.handlerMouseUp)\n on(document, 'mousemove', this.handlerMove)\n this.binded = true\n },\n // 鼠标按下事件\n handlerMouseDown (event) {\n // 只有鼠标左键可以拖动\n if (event.button !== 0) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n event.stopImmediatePropagation()\n\n // 标记开始拖拽滚动条\n this.startMove = true\n // 记录鼠标起始的位置\n this.axis = event[this.config.clientAxis]\n\n // 给document绑定 mouseup与mousemove\n this.bindEvents()\n\n return false\n },\n handlerMouseUp () {\n // 鼠标抬起, 结束拖拽状态\n this.startMove = false\n },\n handlerMove (event) {\n // 如果不是在鼠标按下的状态 || 节流控制,在指定时间内只执行一次\n if (!this.startMove || !this.moveThrottle(Date.now())) return\n\n event.preventDefault()\n event.stopPropagation()\n event.stopImmediatePropagation()\n\n const parentRect = this.$refs.stripContainer.getBoundingClientRect()\n const rect = this.$refs.strip.getBoundingClientRect()\n // 相对于滚动条容器的offset\n const contrastParentOffset = rect[this.config.direction] - parentRect[this.config.direction]\n /**\n * offset = 鼠标移动的偏移量 + 滚动条当前的偏移量\n * offset为滚动条需要移动到的位置\n * event[this.config.clientAxis] - this.axis = 鼠标移动后与移动前的偏移量\n */\n const offset = event[this.config.clientAxis] - this.axis + contrastParentOffset\n // 更新鼠标偏移量的值\n this.axis = event[this.config.clientAxis]\n\n this.changeOffset(offset)\n },\n // 鼠标滚轮滚动事件\n handlerWheel (event) {\n const parentRect = this.$refs.stripContainer.getBoundingClientRect()\n const rect = this.$refs.strip.getBoundingClientRect()\n // 滚动条相对于容器的offset\n const contrastParentOffset = rect[this.config.direction] - parentRect[this.config.direction]\n // 滚动条最终要设置的偏移量 event[this.config.wheelDelta] => 获取鼠标滚轮的滚动值\n const offset = contrastParentOffset + event[this.config.wheelDelta]\n\n this.changeOffset(offset, event)\n },\n changeOffset (offset, event) {\n // 防止滚动条越界\n if (offset < 0) {\n offset = 0\n }\n\n // 防止滚动条越界\n if (offset > this.maxOffset) {\n offset = this.maxOffset\n }\n\n if (event && offset > 0 && offset < this.maxOffset) {\n event.preventDefault()\n event.stopImmediatePropagation()\n }\n this.currentOffset = offset\n // 偏移\n this.$refs.strip.style.transform = `${this.config.translate}(${offset}px)`\n\n // 告诉scroll.vue 滚动条移动的偏移量\n this.$emit('change', offset / this.percentage)\n }\n },\n created () {\n const configs = {\n // 水平的属性配置\n h: {\n sizeAttr: 'width',\n client: 'clientWidth',\n clientAxis: 'clientX',\n translate: 'translateX',\n direction: 'left',\n wheelDelta: 'deltaX'\n },\n // 垂直的属性配置\n v: {\n sizeAttr: 'height', // 滚动条的高度\n client: 'clientHeight', // 滚动条容器的可视高度\n clientAxis: 'clientY', // 拖动滚动条时,鼠标移动的Y轴坐标值\n translate: 'translateY', // 上下移动滚动条的位置\n direction: 'top', // 滚动条容器的top值, 会与 clientY 发生计算\n wheelDelta: 'deltaY' // 在滚动条容器中滚动 鼠标滚轮 时, 滚动量的值\n }\n }\n\n // 根据方向初始化对应的属性配置\n this.config = this.horizontal ? configs['h'] : configs['v']\n },\n destroyed () {\n off(document, 'mouseup', this.handlerClickUp)\n off(document, 'mousemove', this.handlerMove)\n }\n}\n</script>\n","\"use strict\";\n\nvar utils = module.exports = {};\n\n/**\n * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.\n * @public\n * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.\n * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.\n * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.\n */\nutils.forEach = function(collection, callback) {\n for(var i = 0; i < collection.length; i++) {\n var result = callback(collection[i]);\n if(result) {\n return result;\n }\n }\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var getState = options.stateHandler.getState;\n\n /**\n * Tells if the element has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is detectable or not.\n */\n function isDetectable(element) {\n var state = getState(element);\n return state && !!state.isDetectable;\n }\n\n /**\n * Marks the element that it has been made detectable and ready to be listened for resize events.\n * @public\n * @param {element} The element to mark.\n */\n function markAsDetectable(element) {\n getState(element).isDetectable = true;\n }\n\n /**\n * Tells if the element is busy or not.\n * @public\n * @param {element} The element to check.\n * @returns {boolean} True or false depending on if the element is busy or not.\n */\n function isBusy(element) {\n return !!getState(element).busy;\n }\n\n /**\n * Marks the object is busy and should not be made detectable.\n * @public\n * @param {element} element The element to mark.\n * @param {boolean} busy If the element is busy or not.\n */\n function markBusy(element, busy) {\n getState(element).busy = !!busy;\n }\n\n return {\n isDetectable: isDetectable,\n markAsDetectable: markAsDetectable,\n isBusy: isBusy,\n markBusy: markBusy\n };\n};\n","\"use strict\";\n\nmodule.exports = function(idHandler) {\n var eventListeners = {};\n\n /**\n * Gets all listeners for the given element.\n * @public\n * @param {element} element The element to get all listeners for.\n * @returns All listeners for the given element.\n */\n function getListeners(element) {\n var id = idHandler.get(element);\n\n if (id === undefined) {\n return [];\n }\n\n return eventListeners[id] || [];\n }\n\n /**\n * Stores the given listener for the given element. Will not actually add the listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The callback that the element has added.\n */\n function addListener(element, listener) {\n var id = idHandler.get(element);\n\n if(!eventListeners[id]) {\n eventListeners[id] = [];\n }\n\n eventListeners[id].push(listener);\n }\n\n function removeListener(element, listener) {\n var listeners = getListeners(element);\n for (var i = 0, len = listeners.length; i < len; ++i) {\n if (listeners[i] === listener) {\n listeners.splice(i, 1);\n break;\n }\n }\n }\n\n function removeAllListeners(element) {\n var listeners = getListeners(element);\n if (!listeners) { return; }\n listeners.length = 0;\n }\n\n return {\n get: getListeners,\n add: addListener,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners\n };\n};\n","\"use strict\";\n\nmodule.exports = function() {\n var idCount = 1;\n\n /**\n * Generates a new unique id in the context.\n * @public\n * @returns {number} A unique id in the context.\n */\n function generate() {\n return idCount++;\n }\n\n return {\n generate: generate\n };\n};\n","\"use strict\";\n\nmodule.exports = function(options) {\n var idGenerator = options.idGenerator;\n var getState = options.stateHandler.getState;\n\n /**\n * Gets the resize detector id of the element.\n * @public\n * @param {element} element The target element to get the id of.\n * @returns {string|number|null} The id of the element. Null if it has no id.\n */\n function getId(element) {\n var state = getState(element);\n\n if (state && state.id !== undefined) {\n return state.id;\n }\n\n return null;\n }\n\n /**\n * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.\n * @public\n * @param {element} element The target element to set the id of.\n * @returns {string|number|null} The id of the element.\n */\n function setId(element) {\n var state = getState(element);\n\n if (!state) {\n throw new Error(\"setId required the element to have a resize detection state.\");\n }\n\n var id = idGenerator.generate();\n\n state.id = id;\n\n return id;\n }\n\n return {\n get: getId,\n set: setId\n };\n};\n","\"use strict\";\n\n/* global console: false */\n\n/**\n * Reporter that handles the reporting of logs, warnings and errors.\n * @public\n * @param {boolean} quiet Tells if the reporter should be quiet or not.\n */\nmodule.exports = function(quiet) {\n function noop() {\n //Does nothing.\n }\n\n var reporter = {\n log: noop,\n warn: noop,\n error: noop\n };\n\n if(!quiet && window.console) {\n var attachFunction = function(reporter, name) {\n //The proxy is needed to be able to call the method with the console context,\n //since we cannot use bind.\n reporter[name] = function reporterProxy() {\n var f = console[name];\n if (f.apply) { //IE9 does not support console.log.apply :)\n f.apply(console, arguments);\n } else {\n for (var i = 0; i < arguments.length; i++) {\n f(arguments[i]);\n }\n }\n };\n };\n\n attachFunction(reporter, \"log\");\n attachFunction(reporter, \"warn\");\n attachFunction(reporter, \"error\");\n }\n\n return reporter;\n};","\"use strict\";\n\nvar detector = module.exports = {};\n\ndetector.isIE = function(version) {\n function isAnyIeVersion() {\n var agent = navigator.userAgent.toLowerCase();\n return agent.indexOf(\"msie\") !== -1 || agent.indexOf(\"trident\") !== -1 || agent.indexOf(\" edge/\") !== -1;\n }\n\n if(!isAnyIeVersion()) {\n return false;\n }\n\n if(!version) {\n return true;\n }\n\n //Shamelessly stolen from https://gist.github.com/padolsey/527683\n var ieVersion = (function(){\n var undef,\n v = 3,\n div = document.createElement(\"div\"),\n all = div.getElementsByTagName(\"i\");\n\n do {\n div.innerHTML = \"<!--[if gt IE \" + (++v) + \"]><i></i><![endif]-->\";\n }\n while (all[0]);\n\n return v > 4 ? v : undef;\n }());\n\n return version === ieVersion;\n};\n\ndetector.isLegacyOpera = function() {\n return !!window.opera;\n};\n","\"use strict\";\n\nvar utils = module.exports = {};\n\nutils.getOption = getOption;\n\nfunction getOption(options, name, defaultValue) {\n var value = options[name];\n\n if((value === undefined || value === null) && defaultValue !== undefined) {\n return defaultValue;\n }\n\n return value;\n}\n","/**\n * Resize detection strategy that injects objects to elements in order to detect resize events.\n * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/\n */\n\n\"use strict\";\n\nvar browserDetector = require(\"../browser-detector\");\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n\n if(!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n if(!getObject(element)) {\n throw new Error(\"Element is not detectable by this strategy.\");\n }\n\n function listenerProxy() {\n listener(element);\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support object, but supports the resize event directly on elements.\n getState(element).object = {\n proxy: listenerProxy\n };\n element.attachEvent(\"onresize\", listenerProxy);\n } else {\n var object = getObject(element);\n object.contentDocument.defaultView.addEventListener(\"resize\", listenerProxy);\n }\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n var debug = options.debug;\n\n function injectObject(element, callback) {\n var OBJECT_STYLE = \"display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; padding: 0; margin: 0; opacity: 0; z-index: -1000; pointer-events: none;\";\n\n //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.\n\n // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.\n var positionCheckPerformed = false;\n\n // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.\n // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.\n var style = window.getComputedStyle(element);\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n getState(element).startSize = {\n width: width,\n height: height\n };\n\n function mutateDom() {\n function alterPositionStyles() {\n if(style.position === \"static\") {\n element.style.position = \"relative\";\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style[property] = 0;\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function onObjectLoad() {\n // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.\n if (!positionCheckPerformed) {\n alterPositionStyles();\n }\n\n /*jshint validthis: true */\n\n function getDocument(element, callback) {\n //Opera 12 seem to call the object.onload before the actual document has been created.\n //So if it is not present, poll it with an timeout until it is present.\n //TODO: Could maybe be handled better with object.onreadystatechange or similar.\n if(!element.contentDocument) {\n setTimeout(function checkForObjectDocument() {\n getDocument(element, callback);\n }, 100);\n\n return;\n }\n\n callback(element.contentDocument);\n }\n\n //Mutating the object element here seems to fire another load event.\n //Mutating the inner document of the object element is fine though.\n var objectElement = this;\n\n //Create the style element to be added to the object.\n getDocument(objectElement, function onObjectDocumentReady(objectDocument) {\n //Notify that the element is ready to be listened to.\n callback(element);\n });\n }\n\n // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.\n // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.\n if (style.position !== \"\") {\n alterPositionStyles(style);\n positionCheckPerformed = true;\n }\n\n //Add an object element as a child to the target element that will be listened to for resize events.\n var object = document.createElement(\"object\");\n object.style.cssText = OBJECT_STYLE;\n object.tabIndex = -1;\n object.type = \"text/html\";\n object.onload = onObjectLoad;\n\n //Safari: This must occur before adding the object to the DOM.\n //IE: Does not like that this happens before, even if it is also added after.\n if(!browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n\n element.appendChild(object);\n getState(element).object = object;\n\n //IE: This must occur after adding the object to the DOM.\n if(browserDetector.isIE()) {\n object.data = \"about:blank\";\n }\n }\n\n if(batchProcessor) {\n batchProcessor.add(mutateDom);\n } else {\n mutateDom();\n }\n }\n\n if(browserDetector.isIE(8)) {\n //IE 8 does not support objects properly. Luckily they do support the resize event.\n //So do not inject the object and notify that the element is already ready to be listened to.\n //The event handler for the resize event is attached in the utils.addListener instead.\n callback(element);\n } else {\n injectObject(element, callback);\n }\n }\n\n /**\n * Returns the child object of the target element.\n * @private\n * @param {element} element The target element.\n * @returns The object element of the target.\n */\n function getObject(element) {\n return getState(element).object;\n }\n\n function uninstall(element) {\n if(browserDetector.isIE(8)) {\n element.detachEvent(\"onresize\", getState(element).object.proxy);\n } else {\n element.removeChild(getObject(element));\n }\n delete getState(element).object;\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall\n };\n};\n","/**\n * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.\n * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js\n */\n\n\"use strict\";\n\nvar forEach = require(\"../collection-utils\").forEach;\n\nmodule.exports = function(options) {\n options = options || {};\n var reporter = options.reporter;\n var batchProcessor = options.batchProcessor;\n var getState = options.stateHandler.getState;\n var hasState = options.stateHandler.hasState;\n var idHandler = options.idHandler;\n\n if (!batchProcessor) {\n throw new Error(\"Missing required dependency: batchProcessor\");\n }\n\n if (!reporter) {\n throw new Error(\"Missing required dependency: reporter.\");\n }\n\n //TODO: Could this perhaps be done at installation time?\n var scrollbarSizes = getScrollbarSizes();\n\n // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.\n // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).\n var styleId = \"erd_scroll_detection_scrollbar_style\";\n var detectionContainerClass = \"erd_scroll_detection_container\";\n injectScrollStyle(styleId, detectionContainerClass);\n\n function getScrollbarSizes() {\n var width = 500;\n var height = 500;\n\n var child = document.createElement(\"div\");\n child.style.cssText = \"position: absolute; width: \" + width*2 + \"px; height: \" + height*2 + \"px; visibility: hidden; margin: 0; padding: 0;\";\n\n var container = document.createElement(\"div\");\n container.style.cssText = \"position: absolute; width: \" + width + \"px; height: \" + height + \"px; overflow: scroll; visibility: none; top: \" + -width*3 + \"px; left: \" + -height*3 + \"px; visibility: hidden; margin: 0; padding: 0;\";\n\n container.appendChild(child);\n\n document.body.insertBefore(container, document.body.firstChild);\n\n var widthSize = width - container.clientWidth;\n var heightSize = height - container.clientHeight;\n\n document.body.removeChild(container);\n\n return {\n width: widthSize,\n height: heightSize\n };\n }\n\n function injectScrollStyle(styleId, containerClass) {\n function injectStyle(style, method) {\n method = method || function (element) {\n document.head.appendChild(element);\n };\n\n var styleElement = document.createElement(\"style\");\n styleElement.innerHTML = style;\n styleElement.id = styleId;\n method(styleElement);\n return styleElement;\n }\n\n if (!document.getElementById(styleId)) {\n var containerAnimationClass = containerClass + \"_animation\";\n var containerAnimationActiveClass = containerClass + \"_animation_active\";\n var style = \"/* Created by the element-resize-detector library. */\\n\";\n style += \".\" + containerClass + \" > div::-webkit-scrollbar { display: none; }\\n\\n\";\n style += \".\" + containerAnimationActiveClass + \" { -webkit-animation-duration: 0.1s; animation-duration: 0.1s; -webkit-animation-name: \" + containerAnimationClass + \"; animation-name: \" + containerAnimationClass + \"; }\\n\";\n style += \"@-webkit-keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\\n\";\n style += \"@keyframes \" + containerAnimationClass + \" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\";\n injectStyle(style);\n }\n }\n\n function addAnimationClass(element) {\n element.className += \" \" + detectionContainerClass + \"_animation_active\";\n }\n\n function addEvent(el, name, cb) {\n if (el.addEventListener) {\n el.addEventListener(name, cb);\n } else if(el.attachEvent) {\n el.attachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to add event listeners.\");\n }\n }\n\n function removeEvent(el, name, cb) {\n if (el.removeEventListener) {\n el.removeEventListener(name, cb);\n } else if(el.detachEvent) {\n el.detachEvent(\"on\" + name, cb);\n } else {\n return reporter.error(\"[scroll] Don't know how to remove event listeners.\");\n }\n }\n\n function getExpandElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[0];\n }\n\n function getShrinkElement(element) {\n return getState(element).container.childNodes[0].childNodes[0].childNodes[1];\n }\n\n /**\n * Adds a resize event listener to the element.\n * @public\n * @param {element} element The element that should have the listener added.\n * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.\n */\n function addListener(element, listener) {\n var listeners = getState(element).listeners;\n\n if (!listeners.push) {\n throw new Error(\"Cannot add listener to an element that is not detectable.\");\n }\n\n getState(element).listeners.push(listener);\n }\n\n /**\n * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.\n * @private\n * @param {object} options Optional options object.\n * @param {element} element The element to make detectable\n * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.\n */\n function makeDetectable(options, element, callback) {\n if (!callback) {\n callback = element;\n element = options;\n options = null;\n }\n\n options = options || {};\n\n function debug() {\n if (options.debug) {\n var args = Array.prototype.slice.call(arguments);\n args.unshift(idHandler.get(element), \"Scroll: \");\n if (reporter.log.apply) {\n reporter.log.apply(null, args);\n } else {\n for (var i = 0; i < args.length; i++) {\n reporter.log(args[i]);\n }\n }\n }\n }\n\n function isDetached(element) {\n function isInDocument(element) {\n return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);\n }\n\n if (!isInDocument(element)) {\n return true;\n }\n\n // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520\n if (getComputedStyle(element) === null) {\n return true;\n }\n\n return false;\n }\n\n function isUnrendered(element) {\n // Check the absolute positioned container since the top level container is display: inline.\n var container = getState(element).container.childNodes[0];\n var style = getComputedStyle(container);\n return !style.width || style.width.indexOf(\"px\") === -1; //Can only compute pixel value when rendered.\n }\n\n function getStyle() {\n // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,\n // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).\n var elementStyle = getComputedStyle(element);\n var style = {};\n style.position = elementStyle.position;\n style.width = element.offsetWidth;\n style.height = element.offsetHeight;\n style.top = elementStyle.top;\n style.right = elementStyle.right;\n style.bottom = elementStyle.bottom;\n style.left = elementStyle.left;\n style.widthCSS = elementStyle.width;\n style.heightCSS = elementStyle.height;\n return style;\n }\n\n function storeStartSize() {\n var style = getStyle();\n getState(element).startSize = {\n width: style.width,\n height: style.height\n };\n debug(\"Element start size\", getState(element).startSize);\n }\n\n function initListeners() {\n getState(element).listeners = [];\n }\n\n function storeStyle() {\n debug(\"storeStyle invoked.\");\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getStyle();\n getState(element).style = style;\n }\n\n function storeCurrentSize(element, width, height) {\n getState(element).lastWidth = width;\n getState(element).lastHeight = height;\n }\n\n function getExpandChildElement(element) {\n return getExpandElement(element).childNodes[0];\n }\n\n function getWidthOffset() {\n return 2 * scrollbarSizes.width + 1;\n }\n\n function getHeightOffset() {\n return 2 * scrollbarSizes.height + 1;\n }\n\n function getExpandWidth(width) {\n return width + 10 + getWidthOffset();\n }\n\n function getExpandHeight(height) {\n return height + 10 + getHeightOffset();\n }\n\n function getShrinkWidth(width) {\n return width * 2 + getWidthOffset();\n }\n\n function getShrinkHeight(height) {\n return height * 2 + getHeightOffset();\n }\n\n function positionScrollbars(element, width, height) {\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n var shrinkWidth = getShrinkWidth(width);\n var shrinkHeight = getShrinkHeight(height);\n expand.scrollLeft = expandWidth;\n expand.scrollTop = expandHeight;\n shrink.scrollLeft = shrinkWidth;\n shrink.scrollTop = shrinkHeight;\n }\n\n function injectContainerElement() {\n var container = getState(element).container;\n\n if (!container) {\n container = document.createElement(\"div\");\n container.className = detectionContainerClass;\n container.style.cssText = \"visibility: hidden; display: inline; width: 0px; height: 0px; z-index: -1; overflow: hidden; margin: 0; padding: 0;\";\n getState(element).container = container;\n addAnimationClass(container);\n element.appendChild(container);\n\n var onAnimationStart = function () {\n getState(element).onRendered && getState(element).onRendered();\n };\n\n addEvent(container, \"animationstart\", onAnimationStart);\n\n // Store the event handler here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onAnimationStart = onAnimationStart;\n }\n\n return container;\n }\n\n function injectScrollElements() {\n function alterPositionStyles() {\n var style = getState(element).style;\n\n if(style.position === \"static\") {\n element.style.position = \"relative\";\n\n var removeRelativeStyles = function(reporter, element, style, property) {\n function getNumericalValue(value) {\n return value.replace(/[^-\\d\\.]/g, \"\");\n }\n\n var value = style[property];\n\n if(value !== \"auto\" && getNumericalValue(value) !== \"0\") {\n reporter.warn(\"An element that is positioned static has style.\" + property + \"=\" + value + \" which is ignored due to the static positioning. The element will need to be positioned relative, so the style.\" + property + \" will be set to 0. Element: \", element);\n element.style[property] = 0;\n }\n };\n\n //Check so that there are no accidental styles that will make the element styled differently now that is is relative.\n //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).\n removeRelativeStyles(reporter, element, style, \"top\");\n removeRelativeStyles(reporter, element, style, \"right\");\n removeRelativeStyles(reporter, element, style, \"bottom\");\n removeRelativeStyles(reporter, element, style, \"left\");\n }\n }\n\n function getLeftTopBottomRightCssText(left, top, bottom, right) {\n left = (!left ? \"0\" : (left + \"px\"));\n top = (!top ? \"0\" : (top + \"px\"));\n bottom = (!bottom ? \"0\" : (bottom + \"px\"));\n right = (!right ? \"0\" : (right + \"px\"));\n\n return \"left: \" + left + \"; top: \" + top + \"; right: \" + right + \"; bottom: \" + bottom + \";\";\n }\n\n debug(\"Injecting elements\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n alterPositionStyles();\n\n var rootContainer = getState(element).container;\n\n if (!rootContainer) {\n rootContainer = injectContainerElement();\n }\n\n // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),\n // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than\n // the targeted element.\n // When the bug is resolved, \"containerContainer\" may be removed.\n\n // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).\n // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.\n\n var scrollbarWidth = scrollbarSizes.width;\n var scrollbarHeight = scrollbarSizes.height;\n var containerContainerStyle = \"position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; width: 100%; height: 100%; left: 0px; top: 0px;\";\n var containerStyle = \"position: absolute; flex: none; overflow: hidden; z-index: -1; visibility: hidden; \" + getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth);\n var expandStyle = \"position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;\";\n var shrinkStyle = \"position: absolute; flex: none; overflow: scroll; z-index: -1; visibility: hidden; width: 100%; height: 100%;\";\n var expandChildStyle = \"position: absolute; left: 0; top: 0;\";\n var shrinkChildStyle = \"position: absolute; width: 200%; height: 200%;\";\n\n var containerContainer = document.createElement(\"div\");\n var container = document.createElement(\"div\");\n var expand = document.createElement(\"div\");\n var expandChild = document.createElement(\"div\");\n var shrink = document.createElement(\"div\");\n var shrinkChild = document.createElement(\"div\");\n\n // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56\n // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.\n containerContainer.dir = \"ltr\";\n\n containerContainer.style.cssText = containerContainerStyle;\n containerContainer.className = detectionContainerClass;\n container.className = detectionContainerClass;\n container.style.cssText = containerStyle;\n expand.style.cssText = expandStyle;\n expandChild.style.cssText = expandChildStyle;\n shrink.style.cssText = shrinkStyle;\n shrinkChild.style.cssText = shrinkChildStyle;\n\n expand.appendChild(expandChild);\n shrink.appendChild(shrinkChild);\n container.appendChild(expand);\n container.appendChild(shrink);\n containerContainer.appendChild(container);\n rootContainer.appendChild(containerContainer);\n\n function onExpandScroll() {\n getState(element).onExpand && getState(element).onExpand();\n }\n\n function onShrinkScroll() {\n getState(element).onShrink && getState(element).onShrink();\n }\n\n addEvent(expand, \"scroll\", onExpandScroll);\n addEvent(shrink, \"scroll\", onShrinkScroll);\n\n // Store the event handlers here so that they may be removed when uninstall is called.\n // See uninstall function for an explanation why it is needed.\n getState(element).onExpandScroll = onExpandScroll;\n getState(element).onShrinkScroll = onShrinkScroll;\n }\n\n function registerListenersAndPositionElements() {\n function updateChildSizes(element, width, height) {\n var expandChild = getExpandChildElement(element);\n var expandWidth = getExpandWidth(width);\n var expandHeight = getExpandHeight(height);\n expandChild.style.width = expandWidth + \"px\";\n expandChild.style.height = expandHeight + \"px\";\n }\n\n function updateDetectorElements(done) {\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n debug(\"Storing current size\", width, height);\n\n // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.\n // Otherwise the if-check in handleScroll is useless.\n storeCurrentSize(element, width, height);\n\n // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.\n // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.\n\n batchProcessor.add(0, function performUpdateChildSizes() {\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n if (options.debug) {\n var w = element.offsetWidth;\n var h = element.offsetHeight;\n\n if (w !== width || h !== height) {\n reporter.warn(idHandler.get(element), \"Scroll: Size changed before updating detector elements.\");\n }\n }\n\n updateChildSizes(element, width, height);\n });\n\n batchProcessor.add(1, function updateScrollbars() {\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n positionScrollbars(element, width, height);\n });\n\n if (done) {\n batchProcessor.add(2, function () {\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n if (!areElementsInjected()) {\n debug(\"Aborting because element container has not been initialized\");\n return;\n }\n\n done();\n });\n }\n }\n\n function areElementsInjected() {\n return !!getState(element).container;\n }\n\n function notifyListenersIfNeeded() {\n function isFirstNotify() {\n return getState(element).lastNotifiedWidth === undefined;\n }\n\n debug(\"notifyListenersIfNeeded invoked\");\n\n var state = getState(element);\n\n // Don't notify the if the current size is the start size, and this is the first notification.\n if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {\n return debug(\"Not notifying: Size is the same as the start size, and there has been no notification yet.\");\n }\n\n // Don't notify if the size already has been notified.\n if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {\n return debug(\"Not notifying: Size already notified\");\n }\n\n\n debug(\"Current size not notified, notifying...\");\n state.lastNotifiedWidth = state.lastWidth;\n state.lastNotifiedHeight = state.lastHeight;\n forEach(getState(element).listeners, function (listener) {\n listener(element);\n });\n }\n\n function handleRender() {\n debug(\"startanimation triggered.\");\n\n if (isUnrendered(element)) {\n debug(\"Ignoring since element is still unrendered...\");\n return;\n }\n\n debug(\"Element rendered.\");\n var expand = getExpandElement(element);\n var shrink = getShrinkElement(element);\n if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {\n debug(\"Scrollbars out of sync. Updating detector elements...\");\n updateDetectorElements(notifyListenersIfNeeded);\n }\n }\n\n function handleScroll() {\n debug(\"Scroll detected.\");\n\n if (isUnrendered(element)) {\n // Element is still unrendered. Skip this scroll event.\n debug(\"Scroll event fired while unrendered. Ignoring...\");\n return;\n }\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (width !== element.lastWidth || height !== element.lastHeight) {\n debug(\"Element size changed.\");\n updateDetectorElements(notifyListenersIfNeeded);\n } else {\n debug(\"Element size has not changed (\" + width + \"x\" + height + \").\");\n }\n }\n\n debug(\"registerListenersAndPositionElements invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n getState(element).onRendered = handleRender;\n getState(element).onExpand = handleScroll;\n getState(element).onShrink = handleScroll;\n\n var style = getState(element).style;\n updateChildSizes(element, style.width, style.height);\n }\n\n function finalizeDomMutation() {\n debug(\"finalizeDomMutation invoked.\");\n\n if (!getState(element)) {\n debug(\"Aborting because element has been uninstalled\");\n return;\n }\n\n var style = getState(element).style;\n storeCurrentSize(element, style.width, style.height);\n positionScrollbars(element, style.width, style.height);\n }\n\n function ready() {\n callback(element);\n }\n\n function install() {\n debug(\"Installing...\");\n initListeners();\n storeStartSize();\n\n batchProcessor.add(0, storeStyle);\n batchProcessor.add(1, injectScrollElements);\n batchProcessor.add(2, registerListenersAndPositionElements);\n batchProcessor.add(3, finalizeDomMutation);\n batchProcessor.add(4, ready);\n }\n\n debug(\"Making detectable...\");\n\n if (isDetached(element)) {\n debug(\"Element is detached\");\n\n injectContainerElement();\n\n debug(\"Waiting until element is attached...\");\n\n getState(element).onRendered = function () {\n debug(\"Element is now attached\");\n install();\n };\n } else {\n install();\n }\n }\n\n function uninstall(element) {\n var state = getState(element);\n\n if (!state) {\n // Uninstall has been called on a non-erd element.\n return;\n }\n\n // Uninstall may have been called in the following scenarios:\n // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).\n // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).\n // (3) After the installation process (here, state.busy = false and all the stuff has been injected).\n // So to be on the safe side, let's check for each thing before removing.\n\n // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.\n state.onExpandScroll && removeEvent(getExpandElement(element), \"scroll\", state.onExpandScroll);\n state.onShrinkScroll && removeEvent(getShrinkElement(element), \"scroll\", state.onShrinkScroll);\n state.onAnimationStart && removeEvent(state.container, \"animationstart\", state.onAnimationStart);\n\n state.container && element.removeChild(state.container);\n }\n\n return {\n makeDetectable: makeDetectable,\n addListener: addListener,\n uninstall: uninstall\n };\n};\n","<template>\n <!-- 此元素负责覆盖原生的滚动条 -->\n <div class=\"happy-scroll\" ref=\"happy-scroll\">\n <!-- 出现滚动条的元素 -->\n <div class=\"happy-scroll-container\" ref=\"container\" :style=\"[initSize]\" @scroll.stop=\"onScroll\">\n <!-- 视图元素 此元素 >= 内容元素的宽高 -->\n <div class=\"happy-scroll-content\"\n ref=\"content\"\n :style=\"[contentBorderStyle]\">\n <!-- 用户的内容元素 -->\n <slot></slot>\n </div>\n </div>\n <!-- 竖向垂直滚动条 -->\n <happy-scroll-strip\n ref=\"stripY\"\n v-if=\"!hideVertical\"\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n :throttle=\"throttle\"\n :move=\"moveY\"\n @change=\"slideYChange\">\n </happy-scroll-strip>\n <!-- 横向水平滚动条 -->\n <happy-scroll-strip\n ref=\"stripX\"\n v-if=\"!hideHorizontal\"\n horizontal\n v-bind=\"$attrs\"\n v-on=\"$listeners\"\n :throttle=\"throttle\"\n :move=\"moveX\"\n @change=\"slideXChange\">\n </happy-scroll-strip>\n </div>\n</template>\n<script>\nimport Vue$ from 'vue'\nimport { generateThrottle, debounce } from './util'\nimport HappyScrollStrip from './strip.vue'\n// @FIXME 需要一个更优的解决方案\nimport ElementResizeDetectorMaker from 'element-resize-detector'\nimport './scroll.css'\nlet Vue = Vue$\nif (typeof window !== 'undefined' && window.Vue) {\n Vue = window.Vue\n}\nexport default {\n name: 'happy-scroll',\n inheritAttrs: false,\n components: {\n HappyScrollStrip\n },\n props: {\n // 设置竖向滚动条的位置\n scrollTop: {\n type: [Number, String],\n default: 0\n },\n // 设置横向滚动条的位置\n scrollLeft: {\n type: [Number, String],\n default: 0\n },\n // 是否隐藏竖向滚动条\n hideVertical: Boolean,\n // 是否隐藏横向滚动条\n hideHorizontal: Boolean,\n // 鼠标移动的节流函数时间, 表示该时间内鼠标移动的回调保障在该时间内只执行一次\n throttle: {\n type: Number,\n default: 14 // 默认14毫秒\n },\n // 是否开启监控视图大小发生变化\n resize: Boolean,\n // (当resize=true时生效)当视图宽高变小时(内容减少) 滚动条移动到 -> start(竖向时表示最上边,横向时表示最左边)、end、默认保持不变\n smallerMoveH: {\n type: String,\n default: ''\n },\n smallerMoveV: {\n type: String,\n default: ''\n },\n // (当resize=true时生效)当视图宽高变大时(内容增多)\n biggerMoveH: {\n type: String,\n default: ''\n },\n biggerMoveV: {\n type: String,\n default: ''\n }\n },\n data () {\n return {\n // 视图元素的容器的宽高,在mounted之后会计算该属性\n initSize: {\n },\n // 横向的\n moveX: +this.scrollLeft, // slot dom元素滚动的位置\n // 竖向的\n moveY: +this.scrollTop,\n // 监听scroll事件的节流函数\n scrollThrottle: generateThrottle(this.throttle),\n // 浏览器滚动条所占空间的大小, 默认为15px\n browserHSize: 0,\n browserVSize: 0,\n // 滚动条的模式,表示占用宽度还是悬浮在元素上(macOS系统可以设置滚动条悬浮在元素上,不会占用元素的空间)\n isScrollNotUseSpace: undefined\n }\n },\n watch: {\n // 监听(鼠标滑轮或者触摸板滑动) 滑动到指定位置\n scrollTop (newVal) {\n this.$refs.container.scrollTop = this.moveY = +newVal\n },\n scrollLeft (newVal) {\n this.$refs.container.scrollLeft = this.moveX = +newVal\n },\n // 监听动态开启或关闭对应的滚动条\n hideVertical (newVal) {\n if (!newVal) {\n // 如果将禁用修改为启用,等子组件渲染后 再计算比例\n this.$nextTick(this.computeStripY)\n }\n },\n hideHorizontal (newVal) {\n if (!newVal) {\n // 如果将禁用修改为启用,等子组件渲染后 再计算比例\n this.$nextTick(this.computeStripX)\n }\n }\n },\n computed: {\n // content 元素的border样式\n contentBorderStyle () {\n if (this.isScrollNotUseSpace === undefined) {\n return {}\n }\n\n return {\n 'border-right': `${20 - this.browserHSize}px solid transparent`,\n 'border-bottom': `${20 - this.browserVSize}px solid transparent`\n }\n }\n },\n methods: {\n // 模拟的滚动条位置发生了变动,修改 dom 对应的位置\n slideYChange (newVal) {\n this.$refs.container.scrollTop = newVal\n // this.$refs.container.scrollTop 会在渲染之后被自动调整,所以这里重新取值\n this.$emit('update:scrollTop', this.$refs.container.scrollTop)\n },\n slideXChange (newVal) {\n this.$refs.container.scrollLeft = newVal\n this.$emit('update:scrollLeft', this.$refs.container.scrollLeft)\n },\n // 监听dom元素的滚动事件,通知strip,将bar移动到对应位置\n onScroll (e) {\n // 节流\n if (!this.scrollThrottle(Date.now())) return false\n this.moveY = e.target.scrollTop\n this.moveX = e.target.scrollLeft\n this.updateSyncScroll()\n },\n // 初始化,获取浏览器滚动条的大小\n initBrowserSize () {\n if (this.isScrollNotUseSpace === undefined) {\n return\n }\n\n if (this.isScrollNotUseSpace === true) {\n this.browserHSize = 0\n this.browserVSize = 0\n } else {\n // 获取当前浏览器滚动条的宽高\n this.browserHSize = (this.$refs.container.offsetWidth - this.$refs.container.clientWidth)\n // 横向滚动的高度\n this.browserVSize = (this.$refs.container.offsetHeight - this.$refs.container.clientHeight)\n }\n },\n // 计算横向滚动条宽度度与元素宽度百分比\n computeStripX () {\n if (this.hideHorizontal) {\n // 没有开启横向滚动条\n return\n }\n const clientEle = this.$refs['happy-scroll']\n const slotEle = this.$slots.default[0]['elm']\n this.$refs.stripX.computeStrip(slotEle.scrollWidth, clientEle.clientWidth)\n },\n // 计算横向滚动条高度与元素高度百分比\n computeStripY () {\n if (this.hideVertical) {\n // 没有开启竖向滚动条\n return\n }\n const clientEle = this.$refs['happy-scroll']\n const slotEle = this.$slots.default[0]['elm']\n // 竖向滚动条高度与元素高度百分比\n this.$refs.stripY.computeStrip(slotEle.scrollHeight, clientEle.clientHeight)\n },\n // slot视图大小变化时的监听\n resizeListener () {\n // 没开启监听reszie方法\n if (!this.resize) return\n\n // 监听slot视图元素resize\n let elementResizeDetector = ElementResizeDetectorMaker({\n strategy: 'scroll',\n callOnAdd: false\n })\n\n // 记录视图上次宽高的变化\n const ele = this.$slots.default[0]['elm']\n let lastHeight = ele.clientHeight\n let lastWidth = ele.clientWidth\n elementResizeDetector.listenTo(ele, (element) => {\n // 初始化百分比\n this.computeStripX()\n this.computeStripY()\n this.initBrowserSize()\n // 获取竖向滚动条变小或者变大的移动策略\n let moveTo\n if (element.clientHeight < lastHeight) {\n // 高度变小\n moveTo = this.smallerMoveH.toLocaleLowerCase()\n }\n if (element.clientHeight > lastHeight) {\n // 高度变大\n moveTo = this.biggerMoveH.toLocaleLowerCase()\n }\n\n if (moveTo === 'start') {\n // 竖向滚动条移动到顶部\n this.moveY = 0\n this.slideYChange(this.moveY)\n }\n if (moveTo === 'end') {\n // 竖向滚动条移动到底部\n this.moveY = element.clientHeight\n this.slideYChange(this.moveY)\n }\n\n // 记录此次的高度,用于下次变化后的比较\n lastHeight = element.clientHeight\n\n // 获取横向向滚动条变小或者变大的移动策略\n moveTo = ''\n if (element.clientWidth < lastWidth) {\n // 宽度变小\n moveTo = this.smallerMoveV.toLocaleLowerCase()\n }\n if (element.clientWidth > lastWidth) {\n // 宽度变大\n moveTo = this.biggerMoveV.toLocaleLowerCase()\n }\n if (moveTo === 'start') {\n // 横向滚动条移动到最左边\n this.moveX = 0\n this.slideXChange(this.moveX)\n }\n if (moveTo === 'end') {\n // 竖向滚动条移动到最右边\n this.moveX = element.clientWidth\n this.slideXChange(this.moveX)\n }\n\n // 记录此次的宽度,用于下次变化后的比较\n lastWidth = element.clientWidth\n })\n },\n // 设置滚动条元素的宽度\n setContainerSize () {\n // 根据最外层div,初始化内部容器的宽高,包含滚动条的宽高\n this.initSize = {\n width: this.$refs['happy-scroll'].clientWidth + 20 + 'px',\n height: this.$refs['happy-scroll'].clientHeight + 20 + 'px'\n }\n },\n // 判断浏览器滚动条的模式\n checkScrollMode () {\n // eslint-disable-next-line\n if (Vue._happyJS._isScrollNotUseSpace !== undefined) {\n // 如果不是undefined,说明已经判断过了\n return\n }\n\n const ele = this.$slots.default[0]['elm']\n const container = this.$refs.container\n // 如果视图元素的实际高度(宽度)大于可视高度(宽度),则可以肯定会出现滚动条了,否则还没有出现,不做判断\n if (ele.offsetHeight > container.clientHeight || ele.offsetWidth > container.clientWidth) {\n // 可以肯定出现滚动条了,可以判断滚动条的模式\n if (container.offsetWidth > container.clientWidth || container.offsetHeight > container.clientHeight) {\n // 滚动条一直存在的模式\n // eslint-disable-next-line\n Vue._happyJS._isScrollNotUseSpace = false\n } else {\n // eslint-disable-next-line\n Vue._happyJS._isScrollNotUseSpace = true\n }\n // eslint-disable-next-line\n this.isScrollNotUseSpace = Vue._happyJS._isScrollNotUseSpace\n }\n }\n },\n beforeCreate () {\n // eslint-disable-next-line\n const happyJS = Vue._happyJS = Vue._happyJS || {}\n /**\n * 判断当前浏览器滚动条存在的方式\n * true. 滚动时滚动条才会出现,悬浮在元素之上,不占用宽度(默认为此模式,但可以通过css隐藏滚动条,也属于不占用空间的模式,不过Firefox除外)\n * false. 系统滚动条始终存在,所以会占用宽度 (占用视图宽度的模式,windows下默认为此方式)\n */\n this.isScrollNotUseSpace = happyJS._isScrollNotUseSpace\n },\n created () {\n // @FIXME 更新滚动事件,因为需要使用 this.throttle 变量,所以声明在 created 中\n this.updateSyncScroll = debounce(function () {\n this.$emit('update:scrollTop', this.moveY)\n this.$emit('update:scrollLeft', this.moveX)\n }, this.throttle)\n },\n mounted () {\n // 计算最外层宽高,设置滚动条元素的宽高\n this.setContainerSize()\n this.$nextTick(() => {\n // 使滚动条进行计算比例\n this.computeStripX()\n this.computeStripY()\n // 判断当前浏览器滚动条的模式,依据slot元素高度,如果高度大于视图高度,则出现滚动条了,此时再判断滚动条的模式\n this.checkScrollMode()\n // 获取当前浏览器滚动条的宽高\n this.initBrowserSize()\n\n this.$nextTick(() => {\n // 因为 initBrowserSize 会有增加 20px border 的操作,所以需要等待这20px渲染完成后再进行操作\n // 将视图dom移动到设定的位置\n this.scrollTop && (this.$refs.container.scrollTop = +this.scrollTop)\n this.scrollLeft && (this.$refs.container.scrollLeft = +this.scrollLeft)\n })\n })\n\n // 监听slot视图变化, 方法内部会判断是否设置了开启监听resize\n this.resizeListener()\n\n // 监听滚动条宽度变化,有滚动条 -> 无滚动条, 在mounted中监听是为了确保$refs可调用\n this.$watch('browserHSize', this.setContainerSize)\n this.$watch('browserVSize', this.setContainerSize)\n }\n}\n</script>\n","import HappyScroll from './scroll.vue'\nimport { version } from '../package.json'\n\n// 如果vue是全局变量,使用自动全局安装。\nif (typeof window !== 'undefined' && window.Vue) {\n // eslint-disable-next-line\n Vue.component('happy-scroll', HappyScroll)\n}\n\nexport default {\n install (Vue) {\n Vue.component('happy-scroll', HappyScroll)\n },\n version\n}\n\nexport {\n HappyScroll,\n version\n}\n"],"names":["on","dom","eventType","callback","document","addEventListener","attachEvent","off","removeEventListener","detachEvent","Batch","batch","size","topLevel","bottomLevel","add","level","fn","push","process","fns","i","length","getState","element","prop","isCollection","obj","Array","isArray","undefined","toArray","collection","array","forEach","isElement","nodeType","getOption","options","name","defaultValue","value","generateThrottle","throttleTime","time","Date","now","debounce","func","wait","immediate","timeout","args","context","timestamp","result","later","last","getTime","setTimeout","apply","this","arguments","callNow","render","Boolean","Number","String","throttle","newVal","emitLocationEvent","maxOffset","percentage","horizontal","offset","move","$refs","stripContainer","currentOffset","config","translate","top","bottom","left","right","type","outsideOffset","direction","$emit","scrollSize","clientSize","currentSize","client","minLength","minLengthH","minLengthV","space","binded","handlerMouseUp","handlerMove","event","button","preventDefault","stopPropagation","stopImmediatePropagation","startMove","axis","clientAxis","bindEvents","moveThrottle","parentRect","getBoundingClientRect","contrastParentOffset","strip","changeOffset","wheelDelta","style","transform","configs","handlerClickUp","module","stateHandler","isDetectable","state","markAsDetectable","isBusy","busy","markBusy","idHandler","getListeners","id","get","eventListeners","listener","removeListener","listeners","len","splice","removeAllListeners","idCount","generate","idGenerator","set","Error","quiet","noop","reporter","log","warn","error","window","console","attachFunction","f","detector","isIE","version","agent","navigator","userAgent","toLowerCase","indexOf","isAnyIeVersion","v","div","createElement","all","getElementsByTagName","innerHTML","undef","isLegacyOpera","opera","processBatch","isProcessing","processingBatch","processBatchAsync","asyncFrameHandler","requestFrame","cancelFrame","clearTimeout","raf","asyncProcess","utils","autoProcess","force","localAsyncProcess","initState","cleanState","getObject","object","batchProcessor","makeDetectable","browserDetector","mutateDom","alterPositionStyles","position","removeRelativeStyles","property","replace","getNumericalValue","positionCheckPerformed","cssText","OBJECT_STYLE","tabIndex","onload","getDocument","contentDocument","objectDocument","data","appendChild","getComputedStyle","width","offsetWidth","height","offsetHeight","startSize","injectObject","addListener","listenerProxy","proxy","defaultView","uninstall","removeChild","require$$0","addAnimationClass","className","detectionContainerClass","addEvent","el","cb","removeEvent","getExpandElement","container","childNodes","getShrinkElement","scrollbarSizes","child","body","insertBefore","firstChild","widthSize","clientWidth","heightSize","clientHeight","getScrollbarSizes","styleId","containerClass","getElementById","containerAnimationClass","method","head","styleElement","injectStyle","injectScrollStyle","debug","prototype","slice","call","unshift","isUnrendered","getStyle","elementStyle","widthCSS","heightCSS","storeStartSize","initListeners","storeStyle","storeCurrentSize","lastWidth","lastHeight","getExpandChildElement","getWidthOffset","getHeightOffset","getExpandWidth","getExpandHeight","getShrinkWidth","getShrinkHeight","positionScrollbars","expand","shrink","expandWidth","expandHeight","shrinkWidth","shrinkHeight","scrollLeft","scrollTop","injectContainerElement","onAnimationStart","onRendered","injectScrollElements","onExpandScroll","onExpand","onShrinkScroll","onShrink","rootContainer","scrollbarWidth","scrollbarHeight","containerStyle","getLeftTopBottomRightCssText","containerContainer","expandChild","shrinkChild","dir","registerListenersAndPositionElements","updateChildSizes","updateDetectorElements","done","areElementsInjected","w","h","notifyListenersIfNeeded","lastNotifiedWidth","lastNotifiedHeight","handleScroll","finalizeDomMutation","ready","install","ownerDocument","contains","isInDocument","isDetached","idGeneratorMaker","defaultIdHandler","idHandlerMaker","reporterMaker","batchProcessorMaker","globalOptions","callOnAdd","detectionStrategy","eventListenerHandler","listenerHandlerMaker","elementUtils","elementUtilsMaker","desiredStrategy","strategyOptions","scrollStrategyMaker","objectStrategyMaker","onReadyCallbacks","listenTo","elements","onResizeCallback","elementsReady","onReadyCallback","Vue","Vue$","moveY","moveX","$nextTick","computeStripY","computeStripX","isScrollNotUseSpace","browserHSize","browserVSize","e","scrollThrottle","target","updateSyncScroll","hideHorizontal","clientEle","slotEle","$slots","default","stripX","computeStrip","scrollWidth","hideVertical","stripY","scrollHeight","resize","elementResizeDetector","ElementResizeDetectorMaker","ele","initBrowserSize","moveTo","_this","smallerMoveH","toLocaleLowerCase","biggerMoveH","slideYChange","smallerMoveV","biggerMoveV","slideXChange","initSize","_happyJS","_isScrollNotUseSpace","happyJS","setContainerSize","checkScrollMode","_this2","resizeListener","$watch","component","HappyScroll"],"mappings":"gOASA,SAAgBA,EAAIC,EAAKC,EAAWC,GAC9BC,SAASC,mBACPA,iBAAiBH,EAAWC,KAE5BG,YAAY,KAAOJ,EAAWC,GAYtC,SAAgBI,EAAKN,EAAKC,EAAWC,GAC/BC,SAASC,mBACPG,oBAAoBN,EAAWC,KAE/BM,YAAY,KAAOP,EAAWC,0LC8DtC,SAASO,IACL,IAAIC,KACAC,EAAc,EACdC,EAAc,EACdC,EAAc,EAqClB,OACIC,IApCJ,SAAaC,EAAOC,GACZA,IACAA,EAAKD,EACLA,EAAQ,GAGTA,EAAQH,EACPA,EAAWG,EACLA,EAAQF,IACdA,EAAcE,GAGdL,EAAMK,KACNL,EAAMK,OAGVL,EAAMK,GAAOE,KAAKD,GAClBL,KAoBAO,QAjBJ,WACI,IAAI,IAAIH,EAAQF,EAAaE,GAASH,EAAUG,IAG5C,IAAI,IAFAI,EAAMT,EAAMK,GAERK,EAA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