{"version":3,"sources":["webpack:///./node_modules/dom-scroll-into-view/lib/index.js","webpack:///./node_modules/dom-scroll-into-view/lib/dom-scroll-into-view.js","webpack:///./node_modules/dom-scroll-into-view/lib/util.js"],"names":["module","exports","util","elem","container","config","nodeType","getWindow","allowHorizontalScroll","onlyScrollIfNeeded","alignWithTop","alignWithLeft","offsetTop","offsetLeft","offsetBottom","offsetRight","undefined","isWin","isWindow","elemOffset","offset","eh","outerHeight","ew","outerWidth","containerOffset","ch","cw","containerScroll","diffTop","diffBottom","win","winScroll","ww","wh","height","width","left","scrollLeft","top","scrollTop","clientHeight","clientWidth","parseFloat","css","_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","_typeof","Symbol","iterator","obj","constructor","getScroll","w","ret","method","d","document","documentElement","body","getScrollLeft","getScrollTop","getOffset","el","pos","box","x","y","doc","ownerDocument","docElem","getBoundingClientRect","clientLeft","clientTop","getClientPosition","defaultView","parentWindow","_RE_NUM_NO_PX","RegExp","RE_POS","getComputedStyleX","each","arr","fn","isBorderBoxFn","window","getComputedStyle","name","computedStyle_","val","computedStyle","getPropertyValue","test","style","rsLeft","pixelLeft","BOX_MODELS","swap","options","callback","old","getPBMWidth","props","which","value","prop","j","cssProp","domUtils","getWH","extra","viewportWidth","viewportHeight","docWidth","docHeight","borderBoxValue","offsetWidth","offsetHeight","isBorderBox","cssBoxValue","Number","borderBoxValueOrIsBorderBox","padding","slice","refWin","Math","max","documentElementProp","compatMode","cssShow","position","visibility","display","getWHIgnoreDisplay","args","apply","v","first","charAt","toUpperCase","includeMargin","node","current","setOffset","clone","overflow","scrollTo"],"mappings":"2FAEAA,EAAOC,QAAU,EAAQ,M,iCCAzB,IAAIC,EAAO,EAAQ,KA8HnBF,EAAOC,QA5HP,SAAwBE,EAAMC,EAAWC,GACvCA,EAASA,GAAU,GAEQ,IAAvBD,EAAUE,WACZF,EAAYF,EAAKK,UAAUH,IAG7B,IAAII,EAAwBH,EAAOG,sBAC/BC,EAAqBJ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EAAM6D,GAUNyF,CAAUhF,EAAIyC,IAMlBhG,SAAUA,EACVyE,KAAMA,EACN/C,IAAKA,EACL8G,MAAO,SAAe9F,GACpB,IAAII,EAAM,GACV,IAAK,IAAIf,KAAKW,EACRA,EAAIL,eAAeN,KACrBe,EAAIf,GAAKW,EAAIX,IAIjB,GADeW,EAAI+F,SAEjB,IAAK,IAAI1G,KAAKW,EACRA,EAAIL,eAAeN,KACrBe,EAAI2F,SAAS1G,GAAKW,EAAI+F,SAAS1G,IAIrC,OAAOe,GAET1B,WAAY,SAAoByB,EAAGmF,GACjC,GAAIhI,EAAS6C,GAAI,CACf,QAAU/C,IAANkI,EACF,OAAO5E,EAAcP,GAEvBgC,OAAO6D,SAASV,EAAG3E,EAAaR,QAC3B,CACL,QAAU/C,IAANkI,EACF,OAAOnF,EAAEzB,WAEXyB,EAAEzB,WAAa4G,IAGnB1G,UAAW,SAAmBuB,EAAGmF,GAC/B,GAAIhI,EAAS6C,GAAI,CACf,QAAU/C,IAANkI,EACF,OAAO3E,EAAaR,GAEtBgC,OAAO6D,SAAStF,EAAcP,GAAImF,OAC7B,CACL,QAAUlI,IAANkI,EACF,OAAOnF,EAAEvB,UAEXuB,EAAEvB,UAAY0G,IAIlBzB,cAAe,EACfC,eAAgB,GACfJ","file":"npm.dom-scroll-into-view.c920b4ddeb9b68365139.js","sourcesContent":["'use strict';\n\nmodule.exports = require('./dom-scroll-into-view');","'use strict';\n\nvar util = require('./util');\n\nfunction scrollIntoView(elem, container, config) {\n config = config || {};\n // document 归一化到 window\n if (container.nodeType === 9) {\n container = util.getWindow(container);\n }\n\n var allowHorizontalScroll = config.allowHorizontalScroll;\n var onlyScrollIfNeeded = config.onlyScrollIfNeeded;\n var alignWithTop = config.alignWithTop;\n var alignWithLeft = config.alignWithLeft;\n var offsetTop = config.offsetTop || 0;\n var offsetLeft = config.offsetLeft || 0;\n var offsetBottom = config.offsetBottom || 0;\n var offsetRight = config.offsetRight || 0;\n\n allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll;\n\n var isWin = util.isWindow(container);\n var elemOffset = util.offset(elem);\n var eh = util.outerHeight(elem);\n var ew = util.outerWidth(elem);\n var containerOffset = undefined;\n var ch = undefined;\n var cw = undefined;\n var containerScroll = undefined;\n var diffTop = undefined;\n var diffBottom = undefined;\n var win = undefined;\n var winScroll = undefined;\n var ww = undefined;\n var wh = undefined;\n\n if (isWin) {\n win = container;\n wh = util.height(win);\n ww = util.width(win);\n winScroll = {\n left: util.scrollLeft(win),\n top: util.scrollTop(win)\n };\n // elem 相对 container 可视视窗的距离\n diffTop = {\n left: elemOffset.left - winScroll.left - offsetLeft,\n top: elemOffset.top - winScroll.top - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight,\n top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom\n };\n containerScroll = winScroll;\n } else {\n containerOffset = util.offset(container);\n ch = container.clientHeight;\n cw = container.clientWidth;\n containerScroll = {\n left: container.scrollLeft,\n top: container.scrollTop\n };\n // elem 相对 container 可视视窗的距离\n // 注意边框, offset 是边框到根节点\n diffTop = {\n left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft,\n top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop\n };\n diffBottom = {\n left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight,\n top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom\n };\n }\n\n if (diffTop.top < 0 || diffBottom.top > 0) {\n // 强制向上\n if (alignWithTop === true) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else if (alignWithTop === false) {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n } else {\n // 自动调整\n if (diffTop.top < 0) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithTop = alignWithTop === undefined ? true : !!alignWithTop;\n if (alignWithTop) {\n util.scrollTop(container, containerScroll.top + diffTop.top);\n } else {\n util.scrollTop(container, containerScroll.top + diffBottom.top);\n }\n }\n }\n\n if (allowHorizontalScroll) {\n if (diffTop.left < 0 || diffBottom.left > 0) {\n // 强制向上\n if (alignWithLeft === true) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else if (alignWithLeft === false) {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n } else {\n // 自动调整\n if (diffTop.left < 0) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n } else {\n if (!onlyScrollIfNeeded) {\n alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft;\n if (alignWithLeft) {\n util.scrollLeft(container, containerScroll.left + diffTop.left);\n } else {\n util.scrollLeft(container, containerScroll.left + diffBottom.left);\n }\n }\n }\n }\n}\n\nmodule.exports = scrollIntoView;","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\nvar RE_NUM = /[\\-+]?(?:\\d*\\.|)\\d+(?:[eE][\\-+]?\\d+|)/.source;\n\nfunction getClientPosition(elem) {\n var box = undefined;\n var x = undefined;\n var y = undefined;\n var doc = elem.ownerDocument;\n var body = doc.body;\n var docElem = doc && doc.documentElement;\n // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式\n box = elem.getBoundingClientRect();\n\n // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop\n // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确\n // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin\n\n x = box.left;\n y = box.top;\n\n // In IE, most of the time, 2 extra pixels are added to the top and left\n // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and\n // IE6 standards mode, this border can be overridden by setting the\n // document element's border to zero -- thus, we cannot rely on the\n // offset always being 2 pixels.\n\n // In quirks mode, the offset can be determined by querying the body's\n // clientLeft/clientTop, but in standards mode, it is found by querying\n // the document element's clientLeft/clientTop. Since we already called\n // getClientBoundingRect we have already forced a reflow, so it is not\n // too expensive just to query them all.\n\n // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的\n // 窗口边框标准是设 documentElement ,quirks 时设置 body\n // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去\n // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置\n // 标准 ie 下 docElem.clientTop 就是 border-top\n // ie7 html 即窗口边框改变不了。永远为 2\n // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0\n\n x -= docElem.clientLeft || body.clientLeft || 0;\n y -= docElem.clientTop || body.clientTop || 0;\n\n return {\n left: x,\n top: y\n };\n}\n\nfunction getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}\n\nfunction getScrollLeft(w) {\n return getScroll(w);\n}\n\nfunction getScrollTop(w) {\n return getScroll(w, true);\n}\n\nfunction getOffset(el) {\n var pos = getClientPosition(el);\n var doc = el.ownerDocument;\n var w = doc.defaultView || doc.parentWindow;\n pos.left += getScrollLeft(w);\n pos.top += getScrollTop(w);\n return pos;\n}\nfunction _getComputedStyle(elem, name, computedStyle_) {\n var val = '';\n var d = elem.ownerDocument;\n var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null);\n\n // https://github.com/kissyteam/kissy/issues/61\n if (computedStyle) {\n val = computedStyle.getPropertyValue(name) || computedStyle[name];\n }\n\n return val;\n}\n\nvar _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i');\nvar RE_POS = /^(top|right|bottom|left)$/;\nvar CURRENT_STYLE = 'currentStyle';\nvar RUNTIME_STYLE = 'runtimeStyle';\nvar LEFT = 'left';\nvar PX = 'px';\n\nfunction _getComputedStyleIE(elem, name) {\n // currentStyle maybe null\n // http://msdn.microsoft.com/en-us/library/ms535231.aspx\n var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name];\n\n // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值\n // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19\n // 在 ie 下不对,需要直接用 offset 方式\n // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了\n\n // From the awesome hack by Dean Edwards\n // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291\n // If we're not dealing with a regular pixel number\n // but a number that has a weird ending, we need to convert it to pixels\n // exclude left right for relativity\n if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) {\n // Remember the original values\n var style = elem.style;\n var left = style[LEFT];\n var rsLeft = elem[RUNTIME_STYLE][LEFT];\n\n // prevent flashing of content\n elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT];\n\n // Put in the new values to get a computed value out\n style[LEFT] = name === 'fontSize' ? '1em' : ret || 0;\n ret = style.pixelLeft + PX;\n\n // Revert the changed values\n style[LEFT] = left;\n\n elem[RUNTIME_STYLE][LEFT] = rsLeft;\n }\n return ret === '' ? 'auto' : ret;\n}\n\nvar getComputedStyleX = undefined;\nif (typeof window !== 'undefined') {\n getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE;\n}\n\nfunction each(arr, fn) {\n for (var i = 0; i < arr.length; i++) {\n fn(arr[i]);\n }\n}\n\nfunction isBorderBoxFn(elem) {\n return getComputedStyleX(elem, 'boxSizing') === 'border-box';\n}\n\nvar BOX_MODELS = ['margin', 'border', 'padding'];\nvar CONTENT_INDEX = -1;\nvar PADDING_INDEX = 2;\nvar BORDER_INDEX = 1;\nvar MARGIN_INDEX = 0;\n\nfunction swap(elem, options, callback) {\n var old = {};\n var style = elem.style;\n var name = undefined;\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n old[name] = style[name];\n style[name] = options[name];\n }\n }\n\n callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n if (options.hasOwnProperty(name)) {\n style[name] = old[name];\n }\n }\n}\n\nfunction getPBMWidth(elem, props, which) {\n var value = 0;\n var prop = undefined;\n var j = undefined;\n var i = undefined;\n for (j = 0; j < props.length; j++) {\n prop = props[j];\n if (prop) {\n for (i = 0; i < which.length; i++) {\n var cssProp = undefined;\n if (prop === 'border') {\n cssProp = prop + which[i] + 'Width';\n } else {\n cssProp = prop + which[i];\n }\n value += parseFloat(getComputedStyleX(elem, cssProp)) || 0;\n }\n }\n }\n return value;\n}\n\n/**\n * A crude way of determining if an object is a window\n * @member util\n */\nfunction isWindow(obj) {\n // must use == for ie8\n /* eslint eqeqeq:0 */\n return obj != null && obj == obj.window;\n}\n\nvar domUtils = {};\n\neach(['Width', 'Height'], function (name) {\n domUtils['doc' + name] = function (refWin) {\n var d = refWin.document;\n return Math.max(\n // firefox chrome documentElement.scrollHeight< body.scrollHeight\n // ie standard mode : documentElement.scrollHeight> body.scrollHeight\n d.documentElement['scroll' + name],\n // quirks : documentElement.scrollHeight 最大等于可视窗口多一点?\n d.body['scroll' + name], domUtils['viewport' + name](d));\n };\n\n domUtils['viewport' + name] = function (win) {\n // pc browser includes scrollbar in window.innerWidth\n var prop = 'client' + name;\n var doc = win.document;\n var body = doc.body;\n var documentElement = doc.documentElement;\n var documentElementProp = documentElement[prop];\n // 标准模式取 documentElement\n // backcompat 取 body\n return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp;\n };\n});\n\n/*\n 得到元素的大小信息\n @param elem\n @param name\n @param {String} [extra] 'padding' : (css width) + padding\n 'border' : (css width) + padding + border\n 'margin' : (css width) + padding + border + margin\n */\nfunction getWH(elem, name, extra) {\n if (isWindow(elem)) {\n return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem);\n } else if (elem.nodeType === 9) {\n return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem);\n }\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight;\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem, computedStyle);\n var cssBoxValue = 0;\n if (borderBoxValue == null || borderBoxValue <= 0) {\n borderBoxValue = undefined;\n // Fall back to computed then un computed css if necessary\n cssBoxValue = getComputedStyleX(elem, name);\n if (cssBoxValue == null || Number(cssBoxValue) < 0) {\n cssBoxValue = elem.style[name] || 0;\n }\n // Normalize '', auto, and prepare for extra\n cssBoxValue = parseFloat(cssBoxValue) || 0;\n }\n if (extra === undefined) {\n extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX;\n }\n var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox;\n var val = borderBoxValue || cssBoxValue;\n if (extra === CONTENT_INDEX) {\n if (borderBoxValueOrIsBorderBox) {\n return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle);\n }\n return cssBoxValue;\n }\n if (borderBoxValueOrIsBorderBox) {\n var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle);\n return val + (extra === BORDER_INDEX ? 0 : padding);\n }\n return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle);\n}\n\nvar cssShow = {\n position: 'absolute',\n visibility: 'hidden',\n display: 'block'\n};\n\n// fix #119 : https://github.com/kissyteam/kissy/issues/119\nfunction getWHIgnoreDisplay(elem) {\n var val = undefined;\n var args = arguments;\n // in case elem is window\n // elem.offsetWidth === undefined\n if (elem.offsetWidth !== 0) {\n val = getWH.apply(undefined, args);\n } else {\n swap(elem, cssShow, function () {\n val = getWH.apply(undefined, args);\n });\n }\n return val;\n}\n\nfunction css(el, name, v) {\n var value = v;\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n for (var i in name) {\n if (name.hasOwnProperty(i)) {\n css(el, i, name[i]);\n }\n }\n return undefined;\n }\n if (typeof value !== 'undefined') {\n if (typeof value === 'number') {\n value += 'px';\n }\n el.style[name] = value;\n return undefined;\n }\n return getComputedStyleX(el, name);\n}\n\neach(['width', 'height'], function (name) {\n var first = name.charAt(0).toUpperCase() + name.slice(1);\n domUtils['outer' + first] = function (el, includeMargin) {\n return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX);\n };\n var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom'];\n\n domUtils[name] = function (elem, val) {\n if (val !== undefined) {\n if (elem) {\n var computedStyle = getComputedStyleX(elem);\n var isBorderBox = isBorderBoxFn(elem);\n if (isBorderBox) {\n val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle);\n }\n return css(elem, name, val);\n }\n return undefined;\n }\n return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX);\n };\n});\n\n// 设置 elem 相对 elem.ownerDocument 的坐标\nfunction setOffset(elem, offset) {\n // set position first, in-case top/left are set even on static elem\n if (css(elem, 'position') === 'static') {\n elem.style.position = 'relative';\n }\n\n var old = getOffset(elem);\n var ret = {};\n var current = undefined;\n var key = undefined;\n\n for (key in offset) {\n if (offset.hasOwnProperty(key)) {\n current = parseFloat(css(elem, key)) || 0;\n ret[key] = current + offset[key] - old[key];\n }\n }\n css(elem, ret);\n}\n\nmodule.exports = _extends({\n getWindow: function getWindow(node) {\n var doc = node.ownerDocument || node;\n return doc.defaultView || doc.parentWindow;\n },\n offset: function offset(el, value) {\n if (typeof value !== 'undefined') {\n setOffset(el, value);\n } else {\n return getOffset(el);\n }\n },\n\n isWindow: isWindow,\n each: each,\n css: css,\n clone: function clone(obj) {\n var ret = {};\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret[i] = obj[i];\n }\n }\n var overflow = obj.overflow;\n if (overflow) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n ret.overflow[i] = obj.overflow[i];\n }\n }\n }\n return ret;\n },\n scrollLeft: function scrollLeft(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollLeft(w);\n }\n window.scrollTo(v, getScrollTop(w));\n } else {\n if (v === undefined) {\n return w.scrollLeft;\n }\n w.scrollLeft = v;\n }\n },\n scrollTop: function scrollTop(w, v) {\n if (isWindow(w)) {\n if (v === undefined) {\n return getScrollTop(w);\n }\n window.scrollTo(getScrollLeft(w), v);\n } else {\n if (v === undefined) {\n return w.scrollTop;\n }\n w.scrollTop = v;\n }\n },\n\n viewportWidth: 0,\n viewportHeight: 0\n}, domUtils);"],"sourceRoot":""}