6 lines
9.7 KiB
JavaScript
6 lines
9.7 KiB
JavaScript
|
/*
|
||
|
Copyright (C) Federico Zivolo 2017
|
||
|
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
|
||
|
*/(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.PopperUtils=a.PopperUtils||{})})(this,function(a){'use strict';function b(a,b){if(1!==a.nodeType)return[];var c=window.getComputedStyle(a,null);return b?c[b]:c}function c(a){return'HTML'===a.nodeName?a:a.parentNode||a.host}function d(a){if(!a||-1!==['HTML','BODY','#document'].indexOf(a.nodeName))return window.document.body;var e=b(a),f=e.overflow,g=e.overflowX,h=e.overflowY;return /(auto|scroll)/.test(f+h+g)?a:d(c(a))}function e(a){var c=a&&a.offsetParent,d=c&&c.nodeName;return d&&'BODY'!==d&&'HTML'!==d?-1!==['TD','TABLE'].indexOf(c.nodeName)&&'static'===b(c,'position')?e(c):c:window.document.documentElement}function f(a){var b=a.nodeName;return'BODY'!==b&&('HTML'===b||e(a.firstElementChild)===a)}function g(a){return null===a.parentNode?a:g(a.parentNode)}function h(a,b){if(!a||!a.nodeType||!b||!b.nodeType)return window.document.documentElement;var c=a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING,d=c?a:b,i=c?b:a,j=document.createRange();j.setStart(d,0),j.setEnd(i,0);var k=j.commonAncestorContainer;if(a!==k&&b!==k||d.contains(i))return f(k)?k:e(k);var l=g(a);return l.host?h(l.host,b):h(a,g(b).host)}function j(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:'top',c='top'===b?'scrollTop':'scrollLeft',d=a.nodeName;if('BODY'===d||'HTML'===d){var e=window.document.documentElement,f=window.document.scrollingElement||e;return f[c]}return a[c]}function k(a,b){var c=2<arguments.length&&void 0!==arguments[2]&&arguments[2],d=j(b,'top'),e=j(b,'left'),f=c?-1:1;return a.top+=d*f,a.bottom+=d*f,a.left+=e*f,a.right+=e*f,a}function l(a,b){var c='x'===b?'Left':'Top',d='Left'==c?'Right':'Bottom';return+a['border'+c+'Width'].split('px')[0]+ +a['border'+d+'Width'].split('px')[0]}function m(a,b,c,d){return O(b['offset'+a],b['scroll'+a],c['client'+a],c['offset'+a],c['scroll'+a],Q()?c['offset'+a]+d['margin'+('Height'===a?'Top':'Left')]+d['margin'+('Height'===a?'Bottom':'Right')]:0)}function n(){var a=window.document.body,b=window.document.documentElement,c=Q()&&window.getComputedStyle(b);return{height:m('Height',a,b,c),width:m('Width',a,b,c)}}function o(a){return R({},a,{right:a.left+a.width,bottom:a.top+a.height})}function p(a){var c={};if(Q())try{c=a.getBoundingClientRect();var d=j(a,'top'),e=j(a,'left');c.top+=d,c.left+=e,c.bottom+=d,c.right+=e}catch(a){}else c=a.getBoundingClientRect();var f={left:c.left,top:c.top,width:c.right-c.left,height:c.bottom-c.top},g='HTML'===a.nodeName?n():{},h=g.width||a.clientWidth||f.right-f.left,i=g.height||a.clientHeight||f.bottom-f.top,k=a.offsetWidth-h,m=a.offsetHeight-i;if(k||m){var p=b(a);k-=l(p,'x'),m-=l(p,'y'),f.width-=k,f.height-=m}return o(f)}function q(a,c){var e=Q(),f='HTML'===c.nodeName,g=p(a),h=p(c),i=d(a),j=b(c),l=+j.borderTopWidth.split('px')[0],m=+j.borderLeftWidth.split('px')[0],n=o({top:g.top-h.top-l,left:g.left-h.left-m,width:g.width,height:g.height});if(n.marginTop=0,n.marginLeft=0,!e&&f){var q=+j.marginTop.split('px')[0],r=+j.marginLeft.split('px')[0];n.top-=l-q,n.bottom-=l-q,n.left-=m-r,n.right-=m-r,n.marginTop=q,n.marginLeft=r}return(e?c.contains(i):c===i&&'BODY'!==i.nodeName)&&(n=k(n,c)),n}function r(a){var b=window.document.documentElement,c=q(a,b),d=O(b.clientWidth,window.innerWidth||0),e=O(b.clientHeight,window.innerHeight||0),f=j(b),g=j(b,'left'),h={top:f-c.top+c.marginTop,left:g-c.left+c.marginLeft,width:d,height:e};return o(h)}function s(a){var d=a.nodeName;return'BODY'===d||'HTML'===d?!1:!('fixed'!==b(a,'position'))||s(c(a))}function t(a,b,e,f){var g={top:0,left:0},i=h(a,b);if('viewport'===f)g=r(i);else{var j;'scrollParent'===f?(j=d(c(a)),'BODY'===j.nodeName&&(j=window.document.documentElement)):'window'===f?j=window.document.documentElement:j=f;var k=q(j,i);if('HTML'===j.nodeName&&!s(i)){var l=n(),m=l.height,o=l.width;g.top+=k.top-k.marginTop,g.bottom=m+k.top,g.left+=k.left-k.marginLeft,g.right=o+k.left}else g=k}return g.left+=e,g.top+=e,g.right-=e,g.bottom-=e,g}function u(a){var b=a.width,c=a.height;return
|
||
|
//# sourceMappingURL=popper-utils.min.js.map
|