scroll-into-view-if-needed
Advanced tools
Comparing version 2.2.25 to 2.2.26
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "2.2.25", | ||
"version": "2.2.26", | ||
"main": "index.js", | ||
@@ -38,25 +38,25 @@ "module": "es/index.js", | ||
"dependencies": { | ||
"compute-scroll-into-view": "^1.0.14" | ||
"compute-scroll-into-view": "^1.0.16" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "7.8.4", | ||
"@babel/core": "7.9.6", | ||
"@babel/plugin-external-helpers": "7.8.3", | ||
"@babel/preset-env": "7.9.6", | ||
"@babel/preset-typescript": "7.9.0", | ||
"@babel/cli": "7.10.5", | ||
"@babel/core": "7.11.4", | ||
"@babel/plugin-external-helpers": "7.10.4", | ||
"@babel/preset-env": "7.11.0", | ||
"@babel/preset-typescript": "7.10.4", | ||
"babel-eslint": "10.1.0", | ||
"babel-plugin-add-module-exports": "1.0.2", | ||
"babel-plugin-dev-expression": "0.2.2", | ||
"concurrently": "5.2.0", | ||
"concurrently": "5.3.0", | ||
"eslint": "4.19.1", | ||
"eslint-config-prettier": "4.0.0", | ||
"eslint-plugin-import": "2.20.2", | ||
"eslint-plugin-react": "7.20.0", | ||
"flowgen": "1.10.0", | ||
"eslint-plugin-import": "2.22.0", | ||
"eslint-plugin-react": "7.20.6", | ||
"flowgen": "1.11.0", | ||
"husky": "4.2.5", | ||
"lint-staged": "10.2.6", | ||
"prettier": "1.19.1", | ||
"lint-staged": "10.2.13", | ||
"prettier": "2.1.1", | ||
"prettier-package-json": "2.1.3", | ||
"rimraf": "3.0.2", | ||
"rollup": "1.29.0", | ||
"rollup": "2.26.8", | ||
"rollup-plugin-babel": "4.4.0", | ||
@@ -66,7 +66,7 @@ "rollup-plugin-commonjs": "10.1.0", | ||
"rollup-plugin-replace": "2.2.0", | ||
"rollup-plugin-terser": "5.3.0", | ||
"semantic-release": "16.0.2", | ||
"rollup-plugin-terser": "6.1.0", | ||
"semantic-release": "17.1.1", | ||
"tslint": "5.20.1", | ||
"tslint-config-prettier": "1.18.0", | ||
"typescript": "3.9.3" | ||
"typescript": "3.9.7" | ||
}, | ||
@@ -73,0 +73,0 @@ "keywords": [ |
@@ -389,5 +389,6 @@ [![CircleCI Status](https://img.shields.io/circleci/project/github/stipsan/scroll-into-view-if-needed.svg?style=flat-square)](https://circleci.com/gh/stipsan/scroll-into-view-if-needed) | ||
- [compute-scroll-into-view](http://npmjs.com/package/compute-scroll-into-view) - the engine used by this library. | ||
- [smooth-scroll-into-view-if-needed](http://npmjs.com/package/smooth-scroll-into-view-if-needed) – ponyfills smooth scrolling. | ||
- [compute-scroll-into-view](https://www.npmjs.com/package/compute-scroll-into-view) - the engine used by this library. | ||
- [smooth-scroll-into-view-if-needed](https://www.npmjs.com/package/smooth-scroll-into-view-if-needed) – ponyfills smooth scrolling. | ||
- [react-scroll-into-view-if-needed](https://www.npmjs.com/package/react-scroll-into-view-if-needed) – A thin wrapper to scroll your component into view. | ||
- [scroll-polyfill](https://www.npmjs.com/package/scroll-polyfill) – polyfills smooth scrolling. | ||
- [Don't be shy, add yours!](https://github.com/stipsan/scroll-into-view-if-needed/edit/master/README.md) | ||
@@ -394,0 +395,0 @@ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.scrollIntoView = factory()); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.scrollIntoView = factory()); | ||
}(this, (function () { 'use strict'; | ||
function isElement(el) { | ||
return el != null && typeof el === 'object' && el.nodeType === 1; | ||
} | ||
function t(t){return null!=t&&"object"==typeof t&&1===t.nodeType}function e(t,e){return (!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return !!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return !1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentNode)===f){s.push(p);break}p===document.body&&n(p)&&!n(document.documentElement)||n(p,a)&&s.push(p);}for(var g=o.visualViewport?o.visualViewport.width:innerWidth,m=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,M=W.right,E=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?E:y+b/2,I="center"===u?V+H/2:"end"===u?M:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&E<=m&&M<=g&&y>=R&&E<=Y&&V>=L&&M<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),N=parseInt(S.borderTopWidth,10),q=parseInt(S.borderRightWidth,10),z=parseInt(S.borderBottomWidth,10),A=0,F=0,G="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-q:0,J="offsetHeight"in k?k.offsetHeight-k.clientHeight-N-z:0;if(f===k)A="start"===d?x:"end"===d?x-m:"nearest"===d?r(v,v+m,m,N,z,v+x,v+x+b,b):x-m/2,F="start"===u?I:"center"===u?I-g/2:"end"===u?I-g:r(w,w+g,g,j,q,w+I,w+I+H,H),A=Math.max(0,A+v),F=Math.max(0,F+w);else {A="start"===d?x-R-N:"end"===d?x-Y+z+J:"nearest"===d?r(R,Y,D,N,z+J,x,x+b,b):x-(R+D/2)+J/2,F="start"===u?I-L-j:"center"===u?I-(L+O/2)+G/2:"end"===u?I-X+q+G:r(L,X,O,j,q+G,I,I+H,H);var K=k.scrollLeft,P=k.scrollTop;x+=P-(A=Math.max(0,Math.min(P+A,k.scrollHeight-D+J))),I+=K-(F=Math.max(0,Math.min(K+F,k.scrollWidth-O+G)));}C.push({el:k,top:A,left:F});}return C} | ||
function canOverflow(overflow, skipOverflowHiddenElements) { | ||
if (skipOverflowHiddenElements && overflow === 'hidden') { | ||
return false; | ||
} | ||
return overflow !== 'visible' && overflow !== 'clip'; | ||
} | ||
function getFrameElement(el) { | ||
if (!el.ownerDocument || !el.ownerDocument.defaultView) { | ||
return null; | ||
} | ||
try { | ||
return el.ownerDocument.defaultView.frameElement; | ||
} catch (e) { | ||
return null; | ||
} | ||
} | ||
function isHiddenByFrame(el) { | ||
var frame = getFrameElement(el); | ||
if (!frame) { | ||
return false; | ||
} | ||
return frame.clientHeight < el.scrollHeight || frame.clientWidth < el.scrollWidth; | ||
} | ||
function isScrollable(el, skipOverflowHiddenElements) { | ||
if (el.clientHeight < el.scrollHeight || el.clientWidth < el.scrollWidth) { | ||
var style = getComputedStyle(el, null); | ||
return canOverflow(style.overflowY, skipOverflowHiddenElements) || canOverflow(style.overflowX, skipOverflowHiddenElements) || isHiddenByFrame(el); | ||
} | ||
return false; | ||
} | ||
function alignNearest(scrollingEdgeStart, scrollingEdgeEnd, scrollingSize, scrollingBorderStart, scrollingBorderEnd, elementEdgeStart, elementEdgeEnd, elementSize) { | ||
if (elementEdgeStart < scrollingEdgeStart && elementEdgeEnd > scrollingEdgeEnd || elementEdgeStart > scrollingEdgeStart && elementEdgeEnd < scrollingEdgeEnd) { | ||
return 0; | ||
} | ||
if (elementEdgeStart <= scrollingEdgeStart && elementSize <= scrollingSize || elementEdgeEnd >= scrollingEdgeEnd && elementSize >= scrollingSize) { | ||
return elementEdgeStart - scrollingEdgeStart - scrollingBorderStart; | ||
} | ||
if (elementEdgeEnd > scrollingEdgeEnd && elementSize < scrollingSize || elementEdgeStart < scrollingEdgeStart && elementSize > scrollingSize) { | ||
return elementEdgeEnd - scrollingEdgeEnd + scrollingBorderEnd; | ||
} | ||
return 0; | ||
} | ||
var compute = (function (target, options) { | ||
var scrollMode = options.scrollMode, | ||
block = options.block, | ||
inline = options.inline, | ||
boundary = options.boundary, | ||
skipOverflowHiddenElements = options.skipOverflowHiddenElements; | ||
var checkBoundary = typeof boundary === 'function' ? boundary : function (node) { | ||
return node !== boundary; | ||
}; | ||
if (!isElement(target)) { | ||
throw new TypeError('Invalid target'); | ||
} | ||
var scrollingElement = document.scrollingElement || document.documentElement; | ||
var frames = []; | ||
var cursor = target; | ||
while (isElement(cursor) && checkBoundary(cursor)) { | ||
cursor = cursor.parentNode; | ||
if (cursor === scrollingElement) { | ||
frames.push(cursor); | ||
break; | ||
} | ||
if (cursor === document.body && isScrollable(cursor) && !isScrollable(document.documentElement)) { | ||
continue; | ||
} | ||
if (isScrollable(cursor, skipOverflowHiddenElements)) { | ||
frames.push(cursor); | ||
} | ||
} | ||
var viewportWidth = window.visualViewport ? visualViewport.width : innerWidth; | ||
var viewportHeight = window.visualViewport ? visualViewport.height : innerHeight; | ||
var viewportX = window.scrollX || pageXOffset; | ||
var viewportY = window.scrollY || pageYOffset; | ||
var _target$getBoundingCl = target.getBoundingClientRect(), | ||
targetHeight = _target$getBoundingCl.height, | ||
targetWidth = _target$getBoundingCl.width, | ||
targetTop = _target$getBoundingCl.top, | ||
targetRight = _target$getBoundingCl.right, | ||
targetBottom = _target$getBoundingCl.bottom, | ||
targetLeft = _target$getBoundingCl.left; | ||
var targetBlock = block === 'start' || block === 'nearest' ? targetTop : block === 'end' ? targetBottom : targetTop + targetHeight / 2; | ||
var targetInline = inline === 'center' ? targetLeft + targetWidth / 2 : inline === 'end' ? targetRight : targetLeft; | ||
var computations = []; | ||
for (var index = 0; index < frames.length; index++) { | ||
var frame = frames[index]; | ||
var _frame$getBoundingCli = frame.getBoundingClientRect(), | ||
height = _frame$getBoundingCli.height, | ||
width = _frame$getBoundingCli.width, | ||
top = _frame$getBoundingCli.top, | ||
right = _frame$getBoundingCli.right, | ||
bottom = _frame$getBoundingCli.bottom, | ||
left = _frame$getBoundingCli.left; | ||
if (scrollMode === 'if-needed' && targetTop >= 0 && targetLeft >= 0 && targetBottom <= viewportHeight && targetRight <= viewportWidth && targetTop >= top && targetBottom <= bottom && targetLeft >= left && targetRight <= right) { | ||
return computations; | ||
} | ||
var frameStyle = getComputedStyle(frame); | ||
var borderLeft = parseInt(frameStyle.borderLeftWidth, 10); | ||
var borderTop = parseInt(frameStyle.borderTopWidth, 10); | ||
var borderRight = parseInt(frameStyle.borderRightWidth, 10); | ||
var borderBottom = parseInt(frameStyle.borderBottomWidth, 10); | ||
var blockScroll = 0; | ||
var inlineScroll = 0; | ||
var scrollbarWidth = 'offsetWidth' in frame ? frame.offsetWidth - frame.clientWidth - borderLeft - borderRight : 0; | ||
var scrollbarHeight = 'offsetHeight' in frame ? frame.offsetHeight - frame.clientHeight - borderTop - borderBottom : 0; | ||
if (scrollingElement === frame) { | ||
if (block === 'start') { | ||
blockScroll = targetBlock; | ||
} else if (block === 'end') { | ||
blockScroll = targetBlock - viewportHeight; | ||
} else if (block === 'nearest') { | ||
blockScroll = alignNearest(viewportY, viewportY + viewportHeight, viewportHeight, borderTop, borderBottom, viewportY + targetBlock, viewportY + targetBlock + targetHeight, targetHeight); | ||
} else { | ||
blockScroll = targetBlock - viewportHeight / 2; | ||
} | ||
if (inline === 'start') { | ||
inlineScroll = targetInline; | ||
} else if (inline === 'center') { | ||
inlineScroll = targetInline - viewportWidth / 2; | ||
} else if (inline === 'end') { | ||
inlineScroll = targetInline - viewportWidth; | ||
} else { | ||
inlineScroll = alignNearest(viewportX, viewportX + viewportWidth, viewportWidth, borderLeft, borderRight, viewportX + targetInline, viewportX + targetInline + targetWidth, targetWidth); | ||
} | ||
blockScroll = Math.max(0, blockScroll + viewportY); | ||
inlineScroll = Math.max(0, inlineScroll + viewportX); | ||
} else { | ||
if (block === 'start') { | ||
blockScroll = targetBlock - top - borderTop; | ||
} else if (block === 'end') { | ||
blockScroll = targetBlock - bottom + borderBottom + scrollbarHeight; | ||
} else if (block === 'nearest') { | ||
blockScroll = alignNearest(top, bottom, height, borderTop, borderBottom + scrollbarHeight, targetBlock, targetBlock + targetHeight, targetHeight); | ||
} else { | ||
blockScroll = targetBlock - (top + height / 2) + scrollbarHeight / 2; | ||
} | ||
if (inline === 'start') { | ||
inlineScroll = targetInline - left - borderLeft; | ||
} else if (inline === 'center') { | ||
inlineScroll = targetInline - (left + width / 2) + scrollbarWidth / 2; | ||
} else if (inline === 'end') { | ||
inlineScroll = targetInline - right + borderRight + scrollbarWidth; | ||
} else { | ||
inlineScroll = alignNearest(left, right, width, borderLeft, borderRight + scrollbarWidth, targetInline, targetInline + targetWidth, targetWidth); | ||
} | ||
var scrollLeft = frame.scrollLeft, | ||
scrollTop = frame.scrollTop; | ||
blockScroll = Math.max(0, Math.min(scrollTop + blockScroll, frame.scrollHeight - height + scrollbarHeight)); | ||
inlineScroll = Math.max(0, Math.min(scrollLeft + inlineScroll, frame.scrollWidth - width + scrollbarWidth)); | ||
targetBlock += scrollTop - blockScroll; | ||
targetInline += scrollLeft - inlineScroll; | ||
} | ||
computations.push({ | ||
el: frame, | ||
top: blockScroll, | ||
left: inlineScroll | ||
}); | ||
} | ||
return computations; | ||
}); | ||
function isOptionsObject(options) { | ||
@@ -206,0 +10,0 @@ return options === Object(options) && Object.keys(options).length !== 0; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).scrollIntoView=t()}(this,(function(){"use strict";function e(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function t(e,t){return(!t||"hidden"!==e)&&("visible"!==e&&"clip"!==e)}function n(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return t(r.overflowY,n)||t(r.overflowX,n)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function r(e,t,n,r,o,i,l,c){return i<e&&l>t||i>e&&l<t?0:i<=e&&c<=n||l>=t&&c>=n?i-e-r:l>t&&c<n||i<e&&c>n?l-t+o:0}var o=function(t,o){var i=o.scrollMode,l=o.block,c=o.inline,u=o.boundary,d=o.skipOverflowHiddenElements,f="function"==typeof u?u:function(e){return e!==u};if(!e(t))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,s=[],h=t;e(h)&&f(h);){if((h=h.parentNode)===a){s.push(h);break}h===document.body&&n(h)&&!n(document.documentElement)||n(h,d)&&s.push(h)}for(var p=window.visualViewport?visualViewport.width:innerWidth,m=window.visualViewport?visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,g=window.scrollY||pageYOffset,w=t.getBoundingClientRect(),b=w.height,y=w.width,W=w.top,H=w.right,E=w.bottom,M=w.left,V="start"===l||"nearest"===l?W:"end"===l?E:W+b/2,k="center"===c?M+y/2:"end"===c?H:M,x=[],I=0;I<s.length;I++){var O=s[I],T=O.getBoundingClientRect(),j=T.height,B=T.width,C=T.top,D=T.right,L=T.bottom,R=T.left;if("if-needed"===i&&W>=0&&M>=0&&E<=m&&H<=p&&W>=C&&E<=L&&M>=R&&H<=D)return x;var X=getComputedStyle(O),Y=parseInt(X.borderLeftWidth,10),S=parseInt(X.borderTopWidth,10),N=parseInt(X.borderRightWidth,10),q=parseInt(X.borderBottomWidth,10),z=0,A=0,F="offsetWidth"in O?O.offsetWidth-O.clientWidth-Y-N:0,G="offsetHeight"in O?O.offsetHeight-O.clientHeight-S-q:0;if(a===O)z="start"===l?V:"end"===l?V-m:"nearest"===l?r(g,g+m,m,S,q,g+V,g+V+b,b):V-m/2,A="start"===c?k:"center"===c?k-p/2:"end"===c?k-p:r(v,v+p,p,Y,N,v+k,v+k+y,y),z=Math.max(0,z+g),A=Math.max(0,A+v);else{z="start"===l?V-C-S:"end"===l?V-L+q+G:"nearest"===l?r(C,L,j,S,q+G,V,V+b,b):V-(C+j/2)+G/2,A="start"===c?k-R-Y:"center"===c?k-(R+B/2)+F/2:"end"===c?k-D+N+F:r(R,D,B,Y,N+F,k,k+y,y);var J=O.scrollLeft,K=O.scrollTop;V+=K-(z=Math.max(0,Math.min(K+z,O.scrollHeight-j+G))),k+=J-(A=Math.max(0,Math.min(J+A,O.scrollWidth-B+F)))}x.push({el:O,top:z,left:A})}return x};function i(e){return e===Object(e)&&0!==Object.keys(e).length}return function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(i(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:o(e,t));if(!n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:i(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,o=e.top,i=e.left;r.scroll&&n?r.scroll({top:o,left:i,behavior:t}):(r.scrollTop=o,r.scrollLeft=i)}))}(o(e,r),r.behavior)}}})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).scrollIntoView=t()}(this,(function(){"use strict";function e(e){return null!=e&&"object"==typeof e&&1===e.nodeType}function t(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function n(e,n){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var o=getComputedStyle(e,null);return t(o.overflowY,n)||t(o.overflowX,n)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function o(e,t,n,o,r,i,l,c){return i<e&&l>t||i>e&&l<t?0:i<=e&&c<=n||l>=t&&c>=n?i-e-o:l>t&&c<n||i<e&&c>n?l-t+r:0}function r(t,r){var i=window,l=r.scrollMode,c=r.block,u=r.inline,f=r.boundary,d=r.skipOverflowHiddenElements,a="function"==typeof f?f:function(e){return e!==f};if(!e(t))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,h=[],p=t;e(p)&&a(p);){if((p=p.parentNode)===s){h.push(p);break}p===document.body&&n(p)&&!n(document.documentElement)||n(p,d)&&h.push(p)}for(var m=i.visualViewport?i.visualViewport.width:innerWidth,g=i.visualViewport?i.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,w=window.scrollY||pageYOffset,b=t.getBoundingClientRect(),y=b.height,W=b.width,H=b.top,E=b.right,M=b.bottom,T=b.left,V="start"===c||"nearest"===c?H:"end"===c?M:H+y/2,k="center"===u?T+W/2:"end"===u?E:T,x=[],I=0;I<h.length;I++){var O=h[I],j=O.getBoundingClientRect(),B=j.height,C=j.width,D=j.top,L=j.right,R=j.bottom,X=j.left;if("if-needed"===l&&H>=0&&T>=0&&M<=g&&E<=m&&H>=D&&M<=R&&T>=X&&E<=L)return x;var Y=getComputedStyle(O),S=parseInt(Y.borderLeftWidth,10),N=parseInt(Y.borderTopWidth,10),q=parseInt(Y.borderRightWidth,10),z=parseInt(Y.borderBottomWidth,10),A=0,F=0,G="offsetWidth"in O?O.offsetWidth-O.clientWidth-S-q:0,J="offsetHeight"in O?O.offsetHeight-O.clientHeight-N-z:0;if(s===O)A="start"===c?V:"end"===c?V-g:"nearest"===c?o(w,w+g,g,N,z,w+V,w+V+y,y):V-g/2,F="start"===u?k:"center"===u?k-m/2:"end"===u?k-m:o(v,v+m,m,S,q,v+k,v+k+W,W),A=Math.max(0,A+w),F=Math.max(0,F+v);else{A="start"===c?V-D-N:"end"===c?V-R+z+J:"nearest"===c?o(D,R,B,N,z+J,V,V+y,y):V-(D+B/2)+J/2,F="start"===u?k-X-S:"center"===u?k-(X+C/2)+G/2:"end"===u?k-L+q+G:o(X,L,C,S,q+G,k,k+W,W);var K=O.scrollLeft,P=O.scrollTop;V+=P-(A=Math.max(0,Math.min(P+A,O.scrollHeight-B+J))),k+=K-(F=Math.max(0,Math.min(K+F,O.scrollWidth-C+G)))}x.push({el:O,top:A,left:F})}return x}function i(e){return e===Object(e)&&0!==Object.keys(e).length}return function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(i(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:r(e,t));if(!n){var o=function(e){return!1===e?{block:"end",inline:"nearest"}:i(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var o=e.el,r=e.top,i=e.left;o.scroll&&n?o.scroll({top:r,left:i,behavior:t}):(o.scrollTop=r,o.scrollLeft=i)}))}(r(e,o),o.behavior)}}})); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
417
39539
220