compute-scroll-into-view
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -1,2 +0,2 @@ | ||
function t(t){return"object"==typeof t&&null!=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}module.exports=function(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,c=i.skipOverflowHiddenElements,a="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=[],m=e;t(m)&&a(m);){if((m=m.parentElement)===f){s.push(m);break}null!=m&&m===document.body&&n(m)&&!n(document.documentElement)||null!=m&&n(m,c)&&s.push(m)}for(var p=o.visualViewport?o.visualViewport.width:innerWidth,g=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,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E: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&&M<=g&&E<=p&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-p/2:"end"===u?I-p:r(w,w+p,p,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}C.push({el:k,top:F,left:G})}return C}; | ||
function t(t){return"object"==typeof t&&null!=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 i=getComputedStyle(t,null);return e(i.overflowY,n)||e(i.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 i(t,e,n,i,r,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-i:l>e&&d<n||o<t&&d>n?l-e+r:0}module.exports=function(e,r){var o=window,l=r.scrollMode,d=r.block,f=r.inline,h=r.boundary,u=r.skipOverflowHiddenElements,s="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,a=[],g=e;t(g)&&s(g);){if((g=g.parentElement)===c){a.push(g);break}null!=g&&g===document.body&&n(g)&&!n(document.documentElement)||null!=g&&n(g,u)&&a.push(g)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,p=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),H=W.height,b=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+H/2,I="center"===f?V+b/2:"end"===f?E:V,C=[],T=0;T<a.length;T++){var k=a[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&&M<=p&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0,N="offsetWidth"in k?0===k.offsetWidth?0:O/k.offsetWidth:0,P="offsetHeight"in k?0===k.offsetHeight?0:D/k.offsetHeight:0;if(c===k)F="start"===d?x:"end"===d?x-p:"nearest"===d?i(v,v+p,p,q,A,v+x,v+x+H,H):x-p/2,G="start"===f?I:"center"===f?I-m/2:"end"===f?I-m:i(w,w+m,m,j,z,w+I,w+I+b,b),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?i(R,Y,D,q,A+K,x,x+H,H):x-(R+D/2)+K/2,G="start"===f?I-L-j:"center"===f?I-(L+O/2)+J/2:"end"===f?I-X+z+J:i(L,X,O,j,z+J,I,I+b,b);var Q=k.scrollLeft,U=k.scrollTop;x+=U-(F=Math.max(0,Math.min(U+F/P,k.scrollHeight-D/P+K))),I+=Q-(G=Math.max(0,Math.min(Q+G/N,k.scrollWidth-O/N+J)))}C.push({el:k,top:F,left:G})}return C}; | ||
//# sourceMappingURL=index.js.map |
115
package.json
{ | ||
"name": "compute-scroll-into-view", | ||
"version": "1.0.18", | ||
"description": "The engine that powers scroll-into-view-if-needed", | ||
"license": "MIT", | ||
"author": "Cody Olsen", | ||
"homepage": "https://scroll-into-view-if-needed.netlify.com", | ||
"keywords": [ | ||
"if-needed", | ||
"scroll", | ||
"scroll-into-view", | ||
"scroll-into-view-if-needed", | ||
"scrollIntoView", | ||
"scrollIntoViewIfNeeded", | ||
"scrollMode", | ||
"typescript" | ||
], | ||
"homepage": "https://scroll-into-view.dev", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/stipsan/compute-scroll-into-view.git" | ||
"url": "git+https://github.com/scroll-into-view/compute-scroll-into-view.git" | ||
}, | ||
"version": "1.0.17", | ||
"main": "dist/index.js", | ||
"module": "dist/index.module.js", | ||
"license": "MIT", | ||
"author": "Cody Olsen", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"types": "./typings/index.d.ts", | ||
"source": "./src/index.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "dist/index.cjs", | ||
"umd:main": "umd/compute-scroll-into-view.min.js", | ||
"module": "dist/index.mjs", | ||
"source": "src/index.ts", | ||
"typings": "typings/index.d.ts", | ||
"files": [ | ||
@@ -25,46 +49,6 @@ "dist", | ||
"build:umd": "microbundle -f umd -o umd", | ||
"dev": "concurrently 'npm run typecheck -- --watch' 'npm run build:dist -- --watch' 'npm run build:umd -- --watch'", | ||
"prepublishOnly": "unset npm_config_cafile && npm run build", | ||
"prepublishOnly": "npm run build", | ||
"test": "jest -c integration/jest.config.js", | ||
"typecheck": "tsc --noEmit" | ||
}, | ||
"sideEffects": false, | ||
"typings": "typings/index.d.ts", | ||
"devDependencies": { | ||
"concurrently": "5.3.0", | ||
"husky": "5.1.0", | ||
"jest": "26.6.3", | ||
"jest-junit": "12.0.0", | ||
"jest-puppeteer": "4.4.0", | ||
"lint-staged": "10.5.4", | ||
"microbundle": "^0.13.0", | ||
"prettier": "2.2.1", | ||
"prettier-package-json": "2.1.3", | ||
"puppeteer": "5.5.0", | ||
"rimraf": "3.0.2", | ||
"serve": "11.3.2", | ||
"typescript": "4.1.5" | ||
}, | ||
"keywords": [ | ||
"if-needed", | ||
"scroll", | ||
"scroll-into-view", | ||
"scroll-into-view-if-needed", | ||
"scrollIntoView", | ||
"scrollIntoViewIfNeeded", | ||
"scrollMode", | ||
"typescript" | ||
], | ||
"browserify": { | ||
"transform": [ | ||
"loose-envify" | ||
] | ||
}, | ||
"bundlesize": [ | ||
{ | ||
"path": "./umd/compute-scroll-into-view.min.js", | ||
"maxSize": "3 kB", | ||
"compression": "none" | ||
} | ||
], | ||
"husky": { | ||
@@ -76,5 +60,9 @@ "hooks": { | ||
"lint-staged": { | ||
"*.{js,ts,tsx,json,md}": "prettier --write", | ||
"**/package.json": "prettier-package-json --write" | ||
"*.{js,ts,tsx,json,md}": "prettier --write" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"loose-envify" | ||
] | ||
}, | ||
"prettier": { | ||
@@ -85,9 +73,24 @@ "semi": false, | ||
}, | ||
"release": { | ||
"prepare": [ | ||
"@semantic-release/npm" | ||
] | ||
"devDependencies": { | ||
"@sanity/semantic-release-preset": "^2.0.2", | ||
"husky": "^8.0.1", | ||
"jest": "^26.6.3", | ||
"jest-junit": "^12.2.0", | ||
"jest-puppeteer": "^4.4.0", | ||
"lint-staged": "^13.0.3", | ||
"microbundle": "^0.15.1", | ||
"prettier": "^2.8.0", | ||
"prettier-plugin-packagejson": "^2.3.0", | ||
"puppeteer": "^5.5.0", | ||
"rimraf": "^3.0.2", | ||
"serve": "^11.3.2", | ||
"typescript": "^4.9.3" | ||
}, | ||
"source": "src/index.ts", | ||
"umd:main": "umd/compute-scroll-into-view.min.js" | ||
"bundlesize": [ | ||
{ | ||
"path": "./umd/compute-scroll-into-view.min.js", | ||
"maxSize": "3 kB", | ||
"compression": "none" | ||
} | ||
] | ||
} |
@@ -1,2 +0,1 @@ | ||
[![CircleCI Status](https://img.shields.io/circleci/project/github/stipsan/compute-scroll-into-view.svg?style=flat-square)](https://circleci.com/gh/stipsan/compute-scroll-into-view) | ||
[![npm stat](https://img.shields.io/npm/dm/compute-scroll-into-view.svg?style=flat-square)](https://npm-stat.com/charts.html?package=compute-scroll-into-view) | ||
@@ -11,3 +10,3 @@ [![npm version](https://img.shields.io/npm/v/compute-scroll-into-view.svg?style=flat-square)](https://www.npmjs.com/package/compute-scroll-into-view) | ||
Lower level API that is used by the [ponyfill](https://ponyfill.com) [scroll-into-view-if-needed](https://github.com/stipsan/scroll-into-view-if-needed) to compute where (if needed) elements should scroll based on [options defined in the spec](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) and the [`scrollMode: "if-needed"` draft spec proposal](https://github.com/w3c/csswg-drafts/pull/1805). | ||
Lower level API that is used by the [ponyfill](https://ponyfill.com) [scroll-into-view-if-needed](https://github.com/scroll-into-view/scroll-into-view-if-needed) to compute where (if needed) elements should scroll based on [options defined in the spec](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) and the [`scrollMode: "if-needed"` draft spec proposal](https://github.com/w3c/csswg-drafts/pull/1805). | ||
Use this if you want the smallest possible bundlesize and is ok with implementing the actual scrolling yourself. | ||
@@ -20,3 +19,3 @@ | ||
```bash | ||
yarn add compute-scroll-into-view | ||
npm i compute-scroll-into-view | ||
``` | ||
@@ -73,3 +72,3 @@ | ||
#### [block](https://scroll-into-view-if-needed.netlify.com/#scroll-alignment) | ||
#### [block](https://scroll-into-view.dev/#scroll-alignment) | ||
@@ -81,3 +80,3 @@ Type: `'start' | 'center' | 'end' | 'nearest'`<br> Default: `'center'` | ||
#### [inline](https://scroll-into-view-if-needed.netlify.com/#scroll-alignment) | ||
#### [inline](https://scroll-into-view.dev/#scroll-alignment) | ||
@@ -88,3 +87,3 @@ Type: `'start' | 'center' | 'end' | 'nearest'`<br> Default: `'nearest'` | ||
#### [scrollMode](https://scroll-into-view-if-needed.netlify.com/#scrolling-if-needed) | ||
#### [scrollMode](https://scroll-into-view.dev/#scrolling-if-needed) | ||
@@ -98,3 +97,3 @@ Type: `'always' | 'if-needed'`<br> Default: `'always'` | ||
#### [boundary](https://scroll-into-view-if-needed.netlify.com/#limit-propagation) | ||
#### [boundary](https://scroll-into-view.dev/#limit-propagation) | ||
@@ -113,3 +112,3 @@ Type: `Element | Function` | ||
const actions = computeScrollIntoView(target, { | ||
boundary: parent => { | ||
boundary: (parent) => { | ||
// By default `overflow: hidden` elements are allowed, only `overflow: visible | clip` is skipped as | ||
@@ -130,3 +129,3 @@ // this is required by the CSSOM spec | ||
By default the [spec](https://drafts.csswg.org/cssom-view/#scrolling-box) states that `overflow: hidden` elements should be scrollable because it has [been used to allow programatic scrolling](https://drafts.csswg.org/css-overflow-3/#valdef-overflow-hidden). This behavior can sometimes lead to [scrolling issues](https://github.com/stipsan/scroll-into-view-if-needed/pull/225#issue-186419520) when you have a node that is a child of an `overflow: hidden` node. | ||
By default the [spec](https://drafts.csswg.org/cssom-view/#scrolling-box) states that `overflow: hidden` elements should be scrollable because it has [been used to allow programatic scrolling](https://drafts.csswg.org/css-overflow-3/#valdef-overflow-hidden). This behavior can sometimes lead to [scrolling issues](https://github.com/scroll-into-view/scroll-into-view-if-needed/pull/225#issue-186419520) when you have a node that is a child of an `overflow: hidden` node. | ||
@@ -133,0 +132,0 @@ This package follows the convention [adopted by Firefox](https://hg.mozilla.org/integration/fx-team/rev/c48c3ec05012#l7.18) of setting a boolean option to _not_ scroll all nodes with `overflow: hidden` set. |
@@ -1,4 +0,4 @@ | ||
declare type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest'; | ||
declare type ScrollMode = 'always' | 'if-needed'; | ||
declare type SkipOverflowHiddenElements = boolean; | ||
type ScrollLogicalPosition = 'start' | 'center' | 'end' | 'nearest'; | ||
type ScrollMode = 'always' | 'if-needed'; | ||
type SkipOverflowHiddenElements = boolean; | ||
interface Options { | ||
@@ -11,4 +11,4 @@ block?: ScrollLogicalPosition; | ||
} | ||
declare type CustomScrollBoundaryCallback = (parent: Element) => boolean; | ||
declare type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null; | ||
type CustomScrollBoundaryCallback = (parent: Element) => boolean; | ||
type CustomScrollBoundary = Element | CustomScrollBoundaryCallback | null; | ||
interface CustomScrollAction { | ||
@@ -15,0 +15,0 @@ el: Element; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).computeScrollIntoView=t()}(this,function(){function e(e){return"object"==typeof e&&null!=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 i=getComputedStyle(e,null);return t(i.overflowY,n)||t(i.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 i(e,t,n,i,r,o,l,d){return o<e&&l>t||o>e&&l<t?0:o<=e&&d<=n||l>=t&&d>=n?o-e-i:l>t&&d<n||o<e&&d>n?l-t+r:0}return function(t,r){var o=window,l=r.scrollMode,d=r.block,u=r.inline,f=r.boundary,c=r.skipOverflowHiddenElements,h="function"==typeof f?f:function(e){return e!==f};if(!e(t))throw new TypeError("Invalid target");for(var a=document.scrollingElement||document.documentElement,s=[],p=t;e(p)&&h(p);){if((p=p.parentElement)===a){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,c)&&s.push(p)}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,b=t.getBoundingClientRect(),y=b.height,W=b.width,H=b.top,E=b.right,M=b.bottom,V=b.left,x="start"===d||"nearest"===d?H:"end"===d?M:H+y/2,I="center"===u?V+W/2:"end"===u?E:V,T=[],C=0;C<s.length;C++){var k=s[C],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,S=B.right,X=B.bottom,Y=B.left;if("if-needed"===l&&H>=0&&V>=0&&M<=g&&E<=m&&H>=R&&M<=X&&V>=Y&&E<=S)return T;var j=getComputedStyle(k),L=parseInt(j.borderLeftWidth,10),q=parseInt(j.borderTopWidth,10),z=parseInt(j.borderRightWidth,10),A=parseInt(j.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-L-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(a===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?i(v,v+g,g,q,A,v+x,v+x+y,y):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:i(w,w+m,m,L,z,w+I,w+I+W,W),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===d?x-R-q:"end"===d?x-X+A+K:"nearest"===d?i(R,X,D,q,A+K,x,x+y,y):x-(R+D/2)+K/2,G="start"===u?I-Y-L:"center"===u?I-(Y+O/2)+J/2:"end"===u?I-S+z+J:i(Y,S,O,L,z+J,I,I+W,W);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)))}T.push({el:k,top:F,left:G})}return T}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e||self).computeScrollIntoView=t()}(this,function(){function e(e){return"object"==typeof e&&null!=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 i=getComputedStyle(e,null);return t(i.overflowY,n)||t(i.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 i(e,t,n,i,o,r,l,f){return r<e&&l>t||r>e&&l<t?0:r<=e&&f<=n||l>=t&&f>=n?r-e-i:l>t&&f<n||r<e&&f>n?l-t+o:0}return function(t,o){var r=window,l=o.scrollMode,f=o.block,d=o.inline,u=o.boundary,h=o.skipOverflowHiddenElements,s="function"==typeof u?u:function(e){return e!==u};if(!e(t))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,a=[],p=t;e(p)&&s(p);){if((p=p.parentElement)===c){a.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,h)&&a.push(p)}for(var g=r.visualViewport?r.visualViewport.width:innerWidth,m=r.visualViewport?r.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=t.getBoundingClientRect(),b=W.height,y=W.width,H=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===f||"nearest"===f?H:"end"===f?M:H+b/2,I="center"===d?V+y/2:"end"===d?E:V,T=[],C=0;C<a.length;C++){var k=a[C],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,S=B.right,X=B.bottom,Y=B.left;if("if-needed"===l&&H>=0&&V>=0&&M<=m&&E<=g&&H>=R&&M<=X&&V>=Y&&E<=S)return T;var j=getComputedStyle(k),L=parseInt(j.borderLeftWidth,10),q=parseInt(j.borderTopWidth,10),z=parseInt(j.borderRightWidth,10),A=parseInt(j.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-L-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0,N="offsetWidth"in k?0===k.offsetWidth?0:O/k.offsetWidth:0,P="offsetHeight"in k?0===k.offsetHeight?0:D/k.offsetHeight:0;if(c===k)F="start"===f?x:"end"===f?x-m:"nearest"===f?i(v,v+m,m,q,A,v+x,v+x+b,b):x-m/2,G="start"===d?I:"center"===d?I-g/2:"end"===d?I-g:i(w,w+g,g,L,z,w+I,w+I+y,y),F=Math.max(0,F+v),G=Math.max(0,G+w);else{F="start"===f?x-R-q:"end"===f?x-X+A+K:"nearest"===f?i(R,X,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===d?I-Y-L:"center"===d?I-(Y+O/2)+J/2:"end"===d?I-S+z+J:i(Y,S,O,L,z+J,I,I+y,y);var Q=k.scrollLeft,U=k.scrollTop;x+=U-(F=Math.max(0,Math.min(U+F/P,k.scrollHeight-D/P+K))),I+=Q-(G=Math.max(0,Math.min(Q+G/N,k.scrollWidth-O/N+J)))}T.push({el:k,top:F,left:G})}return T}}); | ||
//# sourceMappingURL=compute-scroll-into-view.min.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
90520
55
0
134