diff --git a/lib/amd/build/popper.min.js b/lib/amd/build/popper.min.js index 94e963eed74..780ebf570c0 100644 --- a/lib/amd/build/popper.min.js +++ b/lib/amd/build/popper.min.js @@ -1 +1 @@ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Popper=b()}(this,function(){"use strict";function a(a){var b=!1;return function(){b||(b=!0,window.Promise.resolve().then(function(){b=!1,a()}))}}function b(a){var b=!1;return function(){b||(b=!0,setTimeout(function(){b=!1,a()},ha))}}function c(a){var b={};return a&&"[object Function]"===b.toString.call(a)}function d(a,b){if(1!==a.nodeType)return[];var c=getComputedStyle(a,null);return b?c[b]:c}function e(a){return"HTML"===a.nodeName?a:a.parentNode||a.host}function f(a){if(!a)return document.body;switch(a.nodeName){case"HTML":case"BODY":return a.ownerDocument.body;case"#document":return a.body}var b=d(a),c=b.overflow,g=b.overflowX,h=b.overflowY;return/(auto|scroll)/.test(c+h+g)?a:f(e(a))}function g(a){var b=a&&a.offsetParent,c=b&&b.nodeName;return c&&"BODY"!==c&&"HTML"!==c?["TD","TABLE"].indexOf(b.nodeName)!==-1&&"static"===d(b,"position")?g(b):b:a?a.ownerDocument.documentElement:document.documentElement}function h(a){var b=a.nodeName;return"BODY"!==b&&("HTML"===b||g(a.firstElementChild)===a)}function i(a){return null!==a.parentNode?i(a.parentNode):a}function j(a,b){if(!(a&&a.nodeType&&b&&b.nodeType))return document.documentElement;var c=a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING,d=c?a:b,e=c?b:a,f=document.createRange();f.setStart(d,0),f.setEnd(e,0);var k=f.commonAncestorContainer;if(a!==k&&b!==k||d.contains(e))return h(k)?k:g(k);var l=i(a);return l.host?j(l.host,b):j(a,i(b).host)}function k(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",c="top"===b?"scrollTop":"scrollLeft",d=a.nodeName;if("BODY"===d||"HTML"===d){var e=a.ownerDocument.documentElement,f=a.ownerDocument.scrollingElement||e;return f[c]}return a[c]}function l(a,b){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=k(b,"top"),e=k(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 m(a,b){var c="x"===b?"Left":"Top",d="Left"===c?"Right":"Bottom";return parseFloat(a["border"+c+"Width"],10)+parseFloat(a["border"+d+"Width"],10)}function n(a,b,c,d){return Math.max(b["offset"+a],b["scroll"+a],c["client"+a],c["offset"+a],c["scroll"+a],ma()?c["offset"+a]+d["margin"+("Height"===a?"Top":"Left")]+d["margin"+("Height"===a?"Bottom":"Right")]:0)}function o(){var a=document.body,b=document.documentElement,c=ma()&&getComputedStyle(b);return{height:n("Height",a,b,c),width:n("Width",a,b,c)}}function p(a){return qa({},a,{right:a.left+a.width,bottom:a.top+a.height})}function q(a){var b={};if(ma())try{b=a.getBoundingClientRect();var c=k(a,"top"),e=k(a,"left");b.top+=c,b.left+=e,b.bottom+=c,b.right+=e}catch(f){}else b=a.getBoundingClientRect();var g={left:b.left,top:b.top,width:b.right-b.left,height:b.bottom-b.top},h="HTML"===a.nodeName?o():{},i=h.width||a.clientWidth||g.right-g.left,j=h.height||a.clientHeight||g.bottom-g.top,l=a.offsetWidth-i,n=a.offsetHeight-j;if(l||n){var q=d(a);l-=m(q,"x"),n-=m(q,"y"),g.width-=l,g.height-=n}return p(g)}function r(a,b){var c=ma(),e="HTML"===b.nodeName,g=q(a),h=q(b),i=f(a),j=d(b),k=parseFloat(j.borderTopWidth,10),m=parseFloat(j.borderLeftWidth,10),n=p({top:g.top-h.top-k,left:g.left-h.left-m,width:g.width,height:g.height});if(n.marginTop=0,n.marginLeft=0,!c&&e){var o=parseFloat(j.marginTop,10),r=parseFloat(j.marginLeft,10);n.top-=k-o,n.bottom-=k-o,n.left-=m-r,n.right-=m-r,n.marginTop=o,n.marginLeft=r}return(c?b.contains(i):b===i&&"BODY"!==i.nodeName)&&(n=l(n,b)),n}function s(a){var b=a.ownerDocument.documentElement,c=r(a,b),d=Math.max(b.clientWidth,window.innerWidth||0),e=Math.max(b.clientHeight,window.innerHeight||0),f=k(b),g=k(b,"left"),h={top:f-c.top+c.marginTop,left:g-c.left+c.marginLeft,width:d,height:e};return p(h)}function t(a){var b=a.nodeName;return"BODY"!==b&&"HTML"!==b&&("fixed"===d(a,"position")||t(e(a)))}function u(a,b,c,d){var g={top:0,left:0},h=j(a,b);if("viewport"===d)g=s(h);else{var i=void 0;"scrollParent"===d?(i=f(e(b)),"BODY"===i.nodeName&&(i=a.ownerDocument.documentElement)):i="window"===d?a.ownerDocument.documentElement:d;var k=r(i,h);if("HTML"!==i.nodeName||t(h))g=k;else{var l=o(),m=l.height,n=l.width;g.top+=k.top-k.marginTop,g.bottom=m+k.top,g.left+=k.left-k.marginLeft,g.right=n+k.left}}return g.left+=c,g.top+=c,g.right-=c,g.bottom-=c,g}function v(a){var b=a.width,c=a.height;return b*c}function w(a,b,c,d,e){var f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(a.indexOf("auto")===-1)return a;var g=u(c,d,f,e),h={top:{width:g.width,height:b.top-g.top},right:{width:g.right-b.right,height:g.height},bottom:{width:g.width,height:g.bottom-b.bottom},left:{width:b.left-g.left,height:g.height}},i=Object.keys(h).map(function(a){return qa({key:a},h[a],{area:v(h[a])})}).sort(function(a,b){return b.area-a.area}),j=i.filter(function(a){var b=a.width,d=a.height;return b>=c.clientWidth&&d>=c.clientHeight}),k=j.length>0?j[0].key:i[0].key,l=a.split("-")[1];return k+(l?"-"+l:"")}function x(a,b,c){var d=j(b,c);return r(c,d)}function y(a){var b=getComputedStyle(a),c=parseFloat(b.marginTop)+parseFloat(b.marginBottom),d=parseFloat(b.marginLeft)+parseFloat(b.marginRight),e={width:a.offsetWidth+d,height:a.offsetHeight+c};return e}function z(a){var b={left:"right",right:"left",bottom:"top",top:"bottom"};return a.replace(/left|right|bottom|top/g,function(a){return b[a]})}function A(a,b,c){c=c.split("-")[0];var d=y(a),e={width:d.width,height:d.height},f=["right","left"].indexOf(c)!==-1,g=f?"top":"left",h=f?"left":"top",i=f?"height":"width",j=f?"width":"height";return e[g]=b[g]+b[i]/2-d[i]/2,c===h?e[h]=b[h]-d[j]:e[h]=b[z(h)],e}function B(a,b){return Array.prototype.find?a.find(b):a.filter(b)[0]}function C(a,b,c){if(Array.prototype.findIndex)return a.findIndex(function(a){return a[b]===c});var d=B(a,function(a){return a[b]===c});return a.indexOf(d)}function D(a,b,d){var e=void 0===d?a:a.slice(0,C(a,"name",d));return e.forEach(function(a){a["function"]&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var d=a["function"]||a.fn;a.enabled&&c(d)&&(b.offsets.popper=p(b.offsets.popper),b.offsets.reference=p(b.offsets.reference),b=d(b,a))}),b}function E(){if(!this.state.isDestroyed){var a={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};a.offsets.reference=x(this.state,this.popper,this.reference),a.placement=w(this.options.placement,a.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),a.originalPlacement=a.placement,a.offsets.popper=A(this.popper,a.offsets.reference,a.placement),a.offsets.popper.position="absolute",a=D(this.modifiers,a),this.state.isCreated?this.options.onUpdate(a):(this.state.isCreated=!0,this.options.onCreate(a))}}function F(a,b){return a.some(function(a){var c=a.name,d=a.enabled;return d&&c===b})}function G(a){for(var b=[!1,"ms","Webkit","Moz","O"],c=a.charAt(0).toUpperCase()+a.slice(1),d=0;dh[o]&&(a.offsets.popper[m]+=i[m]+q-h[o]),a.offsets.popper=p(a.offsets.popper);var r=i[m]+i[k]/2-q/2,s=d(a.instance.popper),t=parseFloat(s["margin"+l],10),u=parseFloat(s["border"+l+"Width"],10),v=r-a.offsets.popper[m]-t-u;return v=Math.max(Math.min(h[k]-q,v),0),a.arrowElement=e,a.offsets.arrow=(c={},pa(c,m,Math.round(v)),pa(c,n,""),c),a}function W(a){return"end"===a?"start":"start"===a?"end":a}function X(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=sa.indexOf(a),d=sa.slice(c+1).concat(sa.slice(0,c));return b?d.reverse():d}function Y(a,b){if(F(a.instance.modifiers,"inner"))return a;if(a.flipped&&a.placement===a.originalPlacement)return a;var c=u(a.instance.popper,a.instance.reference,b.padding,b.boundariesElement),d=a.placement.split("-")[0],e=z(d),f=a.placement.split("-")[1]||"",g=[];switch(b.behavior){case ta.FLIP:g=[d,e];break;case ta.CLOCKWISE:g=X(d);break;case ta.COUNTERCLOCKWISE:g=X(d,!0);break;default:g=b.behavior}return g.forEach(function(h,i){if(d!==h||g.length===i+1)return a;d=a.placement.split("-")[0],e=z(d);var j=a.offsets.popper,k=a.offsets.reference,l=Math.floor,m="left"===d&&l(j.right)>l(k.left)||"right"===d&&l(j.left)l(k.top)||"bottom"===d&&l(j.top)l(c.right),p=l(j.top)l(c.bottom),r="left"===d&&n||"right"===d&&o||"top"===d&&p||"bottom"===d&&q,s=["top","bottom"].indexOf(d)!==-1,t=!!b.flipVariations&&(s&&"start"===f&&n||s&&"end"===f&&o||!s&&"start"===f&&p||!s&&"end"===f&&q);(m||r||t)&&(a.flipped=!0,(m||r)&&(d=g[i+1]),t&&(f=W(f)),a.placement=d+(f?"-"+f:""),a.offsets.popper=qa({},a.offsets.popper,A(a.instance.popper,a.offsets.reference,a.placement)),a=D(a.instance.modifiers,a,"flip"))}),a}function Z(a){var b=a.offsets,c=b.popper,d=b.reference,e=a.placement.split("-")[0],f=Math.floor,g=["top","bottom"].indexOf(e)!==-1,h=g?"right":"bottom",i=g?"left":"top",j=g?"width":"height";return c[h]f(d[h])&&(a.offsets.popper[i]=f(d[h])),a}function $(a,b,c,d){var e=a.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),f=+e[1],g=e[2];if(!f)return a;if(0===g.indexOf("%")){var h=void 0;switch(g){case"%p":h=c;break;case"%":case"%r":default:h=d}var i=p(h);return i[b]/100*f}if("vh"===g||"vw"===g){var j=void 0;return j="vh"===g?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),j/100*f}return f}function _(a,b,c,d){var e=[0,0],f=["right","left"].indexOf(d)!==-1,g=a.split(/(\+|\-)/).map(function(a){return a.trim()}),h=g.indexOf(B(g,function(a){return a.search(/,|\s/)!==-1}));g[h]&&g[h].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var i=/\s*,\s*|\s+/,j=h!==-1?[g.slice(0,h).concat([g[h].split(i)[0]]),[g[h].split(i)[1]].concat(g.slice(h+1))]:[g];return j=j.map(function(a,d){var e=(1===d?!f:f)?"height":"width",g=!1;return a.reduce(function(a,b){return""===a[a.length-1]&&["+","-"].indexOf(b)!==-1?(a[a.length-1]=b,g=!0,a):g?(a[a.length-1]+=b,g=!1,a):a.concat(b)},[]).map(function(a){return $(a,e,b,c)})}),j.forEach(function(a,b){a.forEach(function(c,d){O(c)&&(e[b]+=c*("-"===a[d-1]?-1:1))})}),e}function aa(a,b){var c=b.offset,d=a.placement,e=a.offsets,f=e.popper,g=e.reference,h=d.split("-")[0],i=void 0;return i=O(+c)?[+c,0]:_(c,f,g,h),"left"===h?(f.top+=i[0],f.left-=i[1]):"right"===h?(f.top+=i[0],f.left+=i[1]):"top"===h?(f.left+=i[0],f.top-=i[1]):"bottom"===h&&(f.left+=i[0],f.top+=i[1]),a.popper=f,a}function ba(a,b){var c=b.boundariesElement||g(a.instance.popper);a.instance.reference===c&&(c=g(c));var d=u(a.instance.popper,a.instance.reference,b.padding,c);b.boundaries=d;var e=b.priority,f=a.offsets.popper,h={primary:function(a){var c=f[a];return f[a]d[a]&&!b.escapeWithReference&&(e=Math.min(f[c],d[a]-("right"===a?f.width:f.height))),pa({},c,e)}};return e.forEach(function(a){var b=["left","top"].indexOf(a)!==-1?"primary":"secondary";f=qa({},f,h[b](a))}),a.offsets.popper=f,a}function ca(a){var b=a.placement,c=b.split("-")[0],d=b.split("-")[1];if(d){var e=a.offsets,f=e.reference,g=e.popper,h=["bottom","top"].indexOf(c)!==-1,i=h?"left":"top",j=h?"width":"height",k={start:pa({},i,f[i]),end:pa({},i,f[i]+f[j]-g[j])};a.offsets.popper=qa({},g,k[d])}return a}function da(a){if(!U(a.instance.modifiers,"hide","preventOverflow"))return a;var b=a.offsets.reference,c=B(a.instance.modifiers,function(a){return"preventOverflow"===a.name}).boundaries;if(b.bottomc.right||b.top>c.bottom||b.right=0){ha=1;break}var ja=fa&&window.Promise,ka=ja?a:b,la=void 0,ma=function(){return void 0===la&&(la=navigator.appVersion.indexOf("MSIE 10")!==-1),la},na=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},oa=function(){function a(a,b){for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:{};na(this,a),this.scheduleUpdate=function(){return requestAnimationFrame(e.update)},this.update=ka(this.update.bind(this)),this.options=qa({},a.Defaults,f),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=b&&b.jquery?b[0]:b,this.popper=d&&d.jquery?d[0]:d,this.options.modifiers={},Object.keys(qa({},a.Defaults.modifiers,f.modifiers)).forEach(function(b){e.options.modifiers[b]=qa({},a.Defaults.modifiers[b]||{},f.modifiers?f.modifiers[b]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return qa({name:a},e.options.modifiers[a])}).sort(function(a,b){return a.order-b.order}),this.modifiers.forEach(function(a){a.enabled&&c(a.onLoad)&&a.onLoad(e.reference,e.popper,e.options,a,e.state)}),this.update();var g=this.options.eventsEnabled;g&&this.enableEventListeners(),this.state.eventsEnabled=g}return oa(a,[{key:"update",value:function(){return E.call(this)}},{key:"destroy",value:function(){return H.call(this)}},{key:"enableEventListeners",value:function(){return L.call(this)}},{key:"disableEventListeners",value:function(){return N.call(this)}}]),a}();return wa.Utils=("undefined"!=typeof window?window:global).PopperUtils,wa.placements=ra,wa.Defaults=va,wa}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Popper=b()}(this,function(){"use strict";function a(a){var b=!1;return function(){b||(b=!0,Promise.resolve().then(function(){b=!1,a()}))}}function b(a){var b=!1;return function(){b||(b=!0,setTimeout(function(){b=!1,a()},ha))}}function c(a){var b={};return a&&"[object Function]"===b.toString.call(a)}function d(a,b){if(1!==a.nodeType)return[];var c=window.getComputedStyle(a,null);return b?c[b]:c}function e(a){return"HTML"===a.nodeName?a:a.parentNode||a.host}function f(a){if(!a)return window.document.body;switch(a.nodeName){case"HTML":case"BODY":return a.ownerDocument.body;case"#document":return a.body}var b=d(a),c=b.overflow,g=b.overflowX,h=b.overflowY;return/(auto|scroll)/.test(c+h+g)?a:f(e(a))}function g(a){var b=a&&a.offsetParent,c=b&&b.nodeName;return c&&"BODY"!==c&&"HTML"!==c?["TD","TABLE"].indexOf(b.nodeName)!==-1&&"static"===d(b,"position")?g(b):b:a?a.ownerDocument.documentElement:window.document.documentElement}function h(a){var b=a.nodeName;return"BODY"!==b&&("HTML"===b||g(a.firstElementChild)===a)}function i(a){return null!==a.parentNode?i(a.parentNode):a}function j(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,e=c?b:a,f=document.createRange();f.setStart(d,0),f.setEnd(e,0);var k=f.commonAncestorContainer;if(a!==k&&b!==k||d.contains(e))return h(k)?k:g(k);var l=i(a);return l.host?j(l.host,b):j(a,i(b).host)}function k(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",c="top"===b?"scrollTop":"scrollLeft",d=a.nodeName;if("BODY"===d||"HTML"===d){var e=a.ownerDocument.documentElement,f=a.ownerDocument.scrollingElement||e;return f[c]}return a[c]}function l(a,b){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],d=k(b,"top"),e=k(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 m(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 n(a,b,c,d){return Math.max(b["offset"+a],b["scroll"+a],c["client"+a],c["offset"+a],c["scroll"+a],ma()?c["offset"+a]+d["margin"+("Height"===a?"Top":"Left")]+d["margin"+("Height"===a?"Bottom":"Right")]:0)}function o(){var a=window.document.body,b=window.document.documentElement,c=ma()&&window.getComputedStyle(b);return{height:n("Height",a,b,c),width:n("Width",a,b,c)}}function p(a){return qa({},a,{right:a.left+a.width,bottom:a.top+a.height})}function q(a){var b={};if(ma())try{b=a.getBoundingClientRect();var c=k(a,"top"),e=k(a,"left");b.top+=c,b.left+=e,b.bottom+=c,b.right+=e}catch(f){}else b=a.getBoundingClientRect();var g={left:b.left,top:b.top,width:b.right-b.left,height:b.bottom-b.top},h="HTML"===a.nodeName?o():{},i=h.width||a.clientWidth||g.right-g.left,j=h.height||a.clientHeight||g.bottom-g.top,l=a.offsetWidth-i,n=a.offsetHeight-j;if(l||n){var q=d(a);l-=m(q,"x"),n-=m(q,"y"),g.width-=l,g.height-=n}return p(g)}function r(a,b){var c=ma(),e="HTML"===b.nodeName,g=q(a),h=q(b),i=f(a),j=d(b),k=+j.borderTopWidth.split("px")[0],m=+j.borderLeftWidth.split("px")[0],n=p({top:g.top-h.top-k,left:g.left-h.left-m,width:g.width,height:g.height});if(n.marginTop=0,n.marginLeft=0,!c&&e){var o=+j.marginTop.split("px")[0],r=+j.marginLeft.split("px")[0];n.top-=k-o,n.bottom-=k-o,n.left-=m-r,n.right-=m-r,n.marginTop=o,n.marginLeft=r}return(c?b.contains(i):b===i&&"BODY"!==i.nodeName)&&(n=l(n,b)),n}function s(a){var b=a.ownerDocument.documentElement,c=r(a,b),d=Math.max(b.clientWidth,window.innerWidth||0),e=Math.max(b.clientHeight,window.innerHeight||0),f=k(b),g=k(b,"left"),h={top:f-c.top+c.marginTop,left:g-c.left+c.marginLeft,width:d,height:e};return p(h)}function t(a){var b=a.nodeName;return"BODY"!==b&&"HTML"!==b&&("fixed"===d(a,"position")||t(e(a)))}function u(a,b,c,d){var g={top:0,left:0},h=j(a,b);if("viewport"===d)g=s(h);else{var i=void 0;"scrollParent"===d?(i=f(e(a)),"BODY"===i.nodeName&&(i=a.ownerDocument.documentElement)):i="window"===d?a.ownerDocument.documentElement:d;var k=r(i,h);if("HTML"!==i.nodeName||t(h))g=k;else{var l=o(),m=l.height,n=l.width;g.top+=k.top-k.marginTop,g.bottom=m+k.top,g.left+=k.left-k.marginLeft,g.right=n+k.left}}return g.left+=c,g.top+=c,g.right-=c,g.bottom-=c,g}function v(a){var b=a.width,c=a.height;return b*c}function w(a,b,c,d,e){var f=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(a.indexOf("auto")===-1)return a;var g=u(c,d,f,e),h={top:{width:g.width,height:b.top-g.top},right:{width:g.right-b.right,height:g.height},bottom:{width:g.width,height:g.bottom-b.bottom},left:{width:b.left-g.left,height:g.height}},i=Object.keys(h).map(function(a){return qa({key:a},h[a],{area:v(h[a])})}).sort(function(a,b){return b.area-a.area}),j=i.filter(function(a){var b=a.width,d=a.height;return b>=c.clientWidth&&d>=c.clientHeight}),k=j.length>0?j[0].key:i[0].key,l=a.split("-")[1];return k+(l?"-"+l:"")}function x(a,b,c){var d=j(b,c);return r(c,d)}function y(a){var b=window.getComputedStyle(a),c=parseFloat(b.marginTop)+parseFloat(b.marginBottom),d=parseFloat(b.marginLeft)+parseFloat(b.marginRight),e={width:a.offsetWidth+d,height:a.offsetHeight+c};return e}function z(a){var b={left:"right",right:"left",bottom:"top",top:"bottom"};return a.replace(/left|right|bottom|top/g,function(a){return b[a]})}function A(a,b,c){c=c.split("-")[0];var d=y(a),e={width:d.width,height:d.height},f=["right","left"].indexOf(c)!==-1,g=f?"top":"left",h=f?"left":"top",i=f?"height":"width",j=f?"width":"height";return e[g]=b[g]+b[i]/2-d[i]/2,c===h?e[h]=b[h]-d[j]:e[h]=b[z(h)],e}function B(a,b){return Array.prototype.find?a.find(b):a.filter(b)[0]}function C(a,b,c){if(Array.prototype.findIndex)return a.findIndex(function(a){return a[b]===c});var d=B(a,function(a){return a[b]===c});return a.indexOf(d)}function D(a,b,d){var e=void 0===d?a:a.slice(0,C(a,"name",d));return e.forEach(function(a){a["function"]&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var d=a["function"]||a.fn;a.enabled&&c(d)&&(b.offsets.popper=p(b.offsets.popper),b.offsets.reference=p(b.offsets.reference),b=d(b,a))}),b}function E(){if(!this.state.isDestroyed){var a={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};a.offsets.reference=x(this.state,this.popper,this.reference),a.placement=w(this.options.placement,a.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),a.originalPlacement=a.placement,a.offsets.popper=A(this.popper,a.offsets.reference,a.placement),a.offsets.popper.position="absolute",a=D(this.modifiers,a),this.state.isCreated?this.options.onUpdate(a):(this.state.isCreated=!0,this.options.onCreate(a))}}function F(a,b){return a.some(function(a){var c=a.name,d=a.enabled;return d&&c===b})}function G(a){for(var b=[!1,"ms","Webkit","Moz","O"],c=a.charAt(0).toUpperCase()+a.slice(1),d=0;dg[n]&&(a.offsets.popper[l]+=h[l]+o-g[n]);var q=h[l]+h[j]/2-o/2,r=d(a.instance.popper,"margin"+k).replace("px",""),s=q-p(a.offsets.popper)[l]-r;return s=Math.max(Math.min(g[j]-o,s),0),a.arrowElement=c,a.offsets.arrow={},a.offsets.arrow[l]=Math.round(s),a.offsets.arrow[m]="",a}function W(a){return"end"===a?"start":"start"===a?"end":a}function X(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=sa.indexOf(a),d=sa.slice(c+1).concat(sa.slice(0,c));return b?d.reverse():d}function Y(a,b){if(F(a.instance.modifiers,"inner"))return a;if(a.flipped&&a.placement===a.originalPlacement)return a;var c=u(a.instance.popper,a.instance.reference,b.padding,b.boundariesElement),d=a.placement.split("-")[0],e=z(d),f=a.placement.split("-")[1]||"",g=[];switch(b.behavior){case ta.FLIP:g=[d,e];break;case ta.CLOCKWISE:g=X(d);break;case ta.COUNTERCLOCKWISE:g=X(d,!0);break;default:g=b.behavior}return g.forEach(function(h,i){if(d!==h||g.length===i+1)return a;d=a.placement.split("-")[0],e=z(d);var j=a.offsets.popper,k=a.offsets.reference,l=Math.floor,m="left"===d&&l(j.right)>l(k.left)||"right"===d&&l(j.left)l(k.top)||"bottom"===d&&l(j.top)l(c.right),p=l(j.top)l(c.bottom),r="left"===d&&n||"right"===d&&o||"top"===d&&p||"bottom"===d&&q,s=["top","bottom"].indexOf(d)!==-1,t=!!b.flipVariations&&(s&&"start"===f&&n||s&&"end"===f&&o||!s&&"start"===f&&p||!s&&"end"===f&&q);(m||r||t)&&(a.flipped=!0,(m||r)&&(d=g[i+1]),t&&(f=W(f)),a.placement=d+(f?"-"+f:""),a.offsets.popper=qa({},a.offsets.popper,A(a.instance.popper,a.offsets.reference,a.placement)),a=D(a.instance.modifiers,a,"flip"))}),a}function Z(a){var b=a.offsets,c=b.popper,d=b.reference,e=a.placement.split("-")[0],f=Math.floor,g=["top","bottom"].indexOf(e)!==-1,h=g?"right":"bottom",i=g?"left":"top",j=g?"width":"height";return c[h]f(d[h])&&(a.offsets.popper[i]=f(d[h])),a}function $(a,b,c,d){var e=a.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),f=+e[1],g=e[2];if(!f)return a;if(0===g.indexOf("%")){var h=void 0;switch(g){case"%p":h=c;break;case"%":case"%r":default:h=d}var i=p(h);return i[b]/100*f}if("vh"===g||"vw"===g){var j=void 0;return j="vh"===g?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),j/100*f}return f}function _(a,b,c,d){var e=[0,0],f=["right","left"].indexOf(d)!==-1,g=a.split(/(\+|\-)/).map(function(a){return a.trim()}),h=g.indexOf(B(g,function(a){return a.search(/,|\s/)!==-1}));g[h]&&g[h].indexOf(",")===-1&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var i=/\s*,\s*|\s+/,j=h!==-1?[g.slice(0,h).concat([g[h].split(i)[0]]),[g[h].split(i)[1]].concat(g.slice(h+1))]:[g];return j=j.map(function(a,d){var e=(1===d?!f:f)?"height":"width",g=!1;return a.reduce(function(a,b){return""===a[a.length-1]&&["+","-"].indexOf(b)!==-1?(a[a.length-1]=b,g=!0,a):g?(a[a.length-1]+=b,g=!1,a):a.concat(b)},[]).map(function(a){return $(a,e,b,c)})}),j.forEach(function(a,b){a.forEach(function(c,d){O(c)&&(e[b]+=c*("-"===a[d-1]?-1:1))})}),e}function aa(a,b){var c=b.offset,d=a.placement,e=a.offsets,f=e.popper,g=e.reference,h=d.split("-")[0],i=void 0;return i=O(+c)?[+c,0]:_(c,f,g,h),"left"===h?(f.top+=i[0],f.left-=i[1]):"right"===h?(f.top+=i[0],f.left+=i[1]):"top"===h?(f.left+=i[0],f.top-=i[1]):"bottom"===h&&(f.left+=i[0],f.top+=i[1]),a.popper=f,a}function ba(a,b){var c=b.boundariesElement||g(a.instance.popper);a.instance.reference===c&&(c=g(c));var d=u(a.instance.popper,a.instance.reference,b.padding,c);b.boundaries=d;var e=b.priority,f=a.offsets.popper,h={primary:function(a){var c=f[a];return f[a]d[a]&&!b.escapeWithReference&&(e=Math.min(f[c],d[a]-("right"===a?f.width:f.height))),pa({},c,e)}};return e.forEach(function(a){var b=["left","top"].indexOf(a)!==-1?"primary":"secondary";f=qa({},f,h[b](a))}),a.offsets.popper=f,a}function ca(a){var b=a.placement,c=b.split("-")[0],d=b.split("-")[1];if(d){var e=a.offsets,f=e.reference,g=e.popper,h=["bottom","top"].indexOf(c)!==-1,i=h?"left":"top",j=h?"width":"height",k={start:pa({},i,f[i]),end:pa({},i,f[i]+f[j]-g[j])};a.offsets.popper=qa({},g,k[d])}return a}function da(a){if(!U(a.instance.modifiers,"hide","preventOverflow"))return a;var b=a.offsets.reference,c=B(a.instance.modifiers,function(a){return"preventOverflow"===a.name}).boundaries;if(b.bottomc.right||b.top>c.bottom||b.right=0){ha=1;break}var ja=fa&&window.Promise,ka=ja?a:b,la=void 0,ma=function(){return void 0===la&&(la=navigator.appVersion.indexOf("MSIE 10")!==-1),la},na=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},oa=function(){function a(a,b){for(var c=0;c2&&void 0!==arguments[2]?arguments[2]:{};na(this,a),this.scheduleUpdate=function(){return requestAnimationFrame(e.update)},this.update=ka(this.update.bind(this)),this.options=qa({},a.Defaults,f),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=b&&b.jquery?b[0]:b,this.popper=d&&d.jquery?d[0]:d,this.options.modifiers={},Object.keys(qa({},a.Defaults.modifiers,f.modifiers)).forEach(function(b){e.options.modifiers[b]=qa({},a.Defaults.modifiers[b]||{},f.modifiers?f.modifiers[b]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(a){return qa({name:a},e.options.modifiers[a])}).sort(function(a,b){return a.order-b.order}),this.modifiers.forEach(function(a){a.enabled&&c(a.onLoad)&&a.onLoad(e.reference,e.popper,e.options,a,e.state)}),this.update();var g=this.options.eventsEnabled;g&&this.enableEventListeners(),this.state.eventsEnabled=g}return oa(a,[{key:"update",value:function(){return E.call(this)}},{key:"destroy",value:function(){return H.call(this)}},{key:"enableEventListeners",value:function(){return L.call(this)}},{key:"disableEventListeners",value:function(){return N.call(this)}}]),a}();return wa.Utils=("undefined"!=typeof window?window:global).PopperUtils,wa.placements=ra,wa.Defaults=va,wa}); \ No newline at end of file diff --git a/lib/amd/src/popper.js b/lib/amd/src/popper.js index b46731f42a2..ecefee60c14 100644 --- a/lib/amd/src/popper.js +++ b/lib/amd/src/popper.js @@ -1,6 +1,6 @@ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.12.9 + * @version 1.12.6 * @license * Copyright (c) 2016 Federico Zivolo and contributors * @@ -22,21 +22,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - -/** - * Description of import/upgrade into Moodle: - * 1. Clone https://github.com/FezVrasta/popper.js into an unrelated directory - * 2. Copy /build/popper.js to lib/amd/src/ - * 3. Add back these instructions - */ - (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.Popper = factory()); + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.Popper = factory()); }(this, (function () { 'use strict'; -var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; +var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined'; var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; var timeoutDuration = 0; for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { @@ -53,7 +45,7 @@ function microtaskDebounce(fn) { return; } called = true; - window.Promise.resolve().then(function () { + Promise.resolve().then(function () { called = false; fn(); }); @@ -110,7 +102,7 @@ function getStyleComputedProperty(element, property) { return []; } // NOTE: 1 DOM access here - var css = getComputedStyle(element, null); + var css = window.getComputedStyle(element, null); return property ? css[property] : css; } @@ -138,7 +130,7 @@ function getParentNode(element) { function getScrollParent(element) { // Return body, `getScroll` will take care to get the correct `scrollTop` from it if (!element) { - return document.body; + return window.document.body; } switch (element.nodeName) { @@ -180,7 +172,7 @@ function getOffsetParent(element) { return element.ownerDocument.documentElement; } - return document.documentElement; + return window.document.documentElement; } // .offsetParent will return the closest TD or TABLE in case @@ -227,7 +219,7 @@ function getRoot(node) { function findCommonOffsetParent(element1, element2) { // This check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { - return document.documentElement; + return window.document.documentElement; } // Here we make sure to give as "start" the element that comes first in the DOM @@ -319,7 +311,7 @@ function getBordersSize(styles, axis) { var sideA = axis === 'x' ? 'Left' : 'Top'; var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; - return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); + return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0]; } /** @@ -342,9 +334,9 @@ function getSize(axis, body, html, computedStyle) { } function getWindowSizes() { - var body = document.body; - var html = document.documentElement; - var computedStyle = isIE10$1() && getComputedStyle(html); + var body = window.document.body; + var html = window.document.documentElement; + var computedStyle = isIE10$1() && window.getComputedStyle(html); return { height: getSize('Height', body, html, computedStyle), @@ -487,8 +479,8 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { var scrollParent = getScrollParent(children); var styles = getStyleComputedProperty(parent); - var borderTopWidth = parseFloat(styles.borderTopWidth, 10); - var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); + var borderTopWidth = +styles.borderTopWidth.split('px')[0]; + var borderLeftWidth = +styles.borderLeftWidth.split('px')[0]; var offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, @@ -504,8 +496,8 @@ function getOffsetRectRelativeToArbitraryNode(children, parent) { // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { - var marginTop = parseFloat(styles.marginTop, 10); - var marginLeft = parseFloat(styles.marginLeft, 10); + var marginTop = +styles.marginTop.split('px')[0]; + var marginLeft = +styles.marginLeft.split('px')[0]; offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; @@ -584,7 +576,7 @@ function getBoundaries(popper, reference, padding, boundariesElement) { // Handle other cases based on DOM element used as boundaries var boundariesNode = void 0; if (boundariesElement === 'scrollParent') { - boundariesNode = getScrollParent(getParentNode(reference)); + boundariesNode = getScrollParent(getParentNode(popper)); if (boundariesNode.nodeName === 'BODY') { boundariesNode = popper.ownerDocument.documentElement; } @@ -710,7 +702,7 @@ function getReferenceOffsets(state, popper, reference) { * @returns {Object} object containing width and height properties */ function getOuterSizes(element) { - var styles = getComputedStyle(element); + var styles = window.getComputedStyle(element); var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); var result = { @@ -927,7 +919,7 @@ function getSupportedPropertyName(property) { for (var i = 0; i < prefixes.length - 1; i++) { var prefix = prefixes[i]; var toCheck = prefix ? '' + prefix + upperProp : property; - if (typeof document.body.style[toCheck] !== 'undefined') { + if (typeof window.document.body.style[toCheck] !== 'undefined') { return toCheck; } } @@ -1046,7 +1038,7 @@ function removeEventListeners(reference, state) { */ function disableEventListeners() { if (this.state.eventsEnabled) { - cancelAnimationFrame(this.scheduleUpdate); + window.cancelAnimationFrame(this.scheduleUpdate); this.state = removeEventListeners(this.reference, this.state); } } @@ -1286,8 +1278,6 @@ function isModifierRequired(modifiers, requestingName, requestedName) { * @returns {Object} The data object, properly modified */ function arrow(data, options) { - var _data$offsets$arrow; - // arrow depends on keepTogether in order to work if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { return data; @@ -1339,23 +1329,22 @@ function arrow(data, options) { if (reference[side] + arrowElementSize > popper[opSide]) { data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; } - data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets // take popper margin in account because we don't have this info available - var css = getStyleComputedProperty(data.instance.popper); - var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); - var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); - var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; + var popperMarginSide = getStyleComputedProperty(data.instance.popper, 'margin' + sideCapitalized).replace('px', ''); + var sideValue = center - getClientRect(data.offsets.popper)[side] - popperMarginSide; // prevent arrowElement from being placed not contiguously to its popper sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); data.arrowElement = arrowElement; - data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); + data.offsets.arrow = {}; + data.offsets.arrow[side] = Math.round(sideValue); + data.offsets.arrow[altSide] = ''; // make sure to unset any eventual altSide value from the DOM node return data; } diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml index 6c3b3b46a6c..bd233869c43 100644 --- a/lib/thirdpartylibs.xml +++ b/lib/thirdpartylibs.xml @@ -307,7 +307,7 @@ amd/src/popper.js Popper.js MIT - v1.12.9 + v1.12.6