react-element-popper
Advanced tools
Comparing version 2.1.6 to 2.1.7
@@ -1,1 +0,1 @@ | ||
"use strict";module.exports=function({from:t=0,to:o=1,duration:s=400}={}){return t<0&&(t=0),o>1&&(o=1),function({popper:e,arrow:i}){e.style.opacity=t,i&&(i.style.opacity=t),setTimeout((()=>{e.style.transition=s+"ms",e.style.opacity=o,i&&(i.style.transition=s+"ms",i.style.opacity=o)}),18)}}; | ||
function t({from:t=0,to:o=1,duration:e=400}={}){return t<0&&(t=0),t>1&&(t=1),o>1&&(o=1),o<0&&(o=0),function({popper:i,arrow:s}){i.style.opacity=t,s&&(s.style.opacity=t),setTimeout((()=>{i.style.transition=e+"ms",i.style.opacity=o,s&&(s.style.transition=e+"ms",s.style.opacity=o)}),18)}}export{t as default}; |
@@ -1,1 +0,1 @@ | ||
"use strict";module.exports=function({from:t=0,duration:e=400}={}){return t>100&&(t=100),t<0&&(t=0),function({popper:i,data:p}){let o=i.children?.[0]?.children?.[0],[r]=p.position.split("-"),n=["left","right"].includes(r)?"width":"height";o&&(o.style[n]=p.popper[n]*t/100+"px",setTimeout((()=>{o.style.transition=e+"ms",o.style[n]=p.popper[n]+"px"}),18))}}; | ||
function t({from:t=0,duration:e=400}={}){return t>100&&(t=100),t<0&&(t=0),function({popper:i,data:p}){let n=i.children?.[0]?.children?.[0],[o]=p.position.split("-"),r=["left","right"].includes(o)?"width":"height";n&&(n.style[r]=p.popper[r]*t/100+"px",setTimeout((()=>{n.style.transition=e+"ms",n.style[r]=p.popper[r]+"px"}),18))}}export{t as default}; |
@@ -1,1 +0,1 @@ | ||
"use strict";module.exports=function({from:t=12,duration:o=400,transition:e}={}){return t<0&&(t=0),function({popper:r,arrow:n,data:{position:i,getTransform:p,popper:{top:f,left:s},arrow:{top:l,left:u}}}){let[a]=i.split("-"),m={top:0,left:0};function c(t){t.style.transition=e||o+"ms"}function d(t,o,e){t.style.transform=p(o,e)}["left","right"].includes(a)?m.left+="right"===a?t:-t:m.top+="bottom"===a?t:-t,d(r,s+m.left,f+m.top),n&&d(n,u+m.left,l+m.top),setTimeout((()=>{c(r),d(r,s,f),n&&(c(n),d(n,u,l))}),18)}}; | ||
function t({from:t=12,duration:o=400,transition:e}={}){return t<0&&(t=0),function({popper:r,arrow:n,data:{position:i,getTransform:f,popper:{top:p,left:l},arrow:{top:s,left:a}}}){let[u]=i.split("-"),m={top:0,left:0};function c(t){t.style.transition=e||o+"ms"}function d(t,o,e){t.style.transform=f(o,e)}["left","right"].includes(u)?m.left+="right"===u?t:-t:m.top+="bottom"===u?t:-t,d(r,l+m.left,p+m.top),n&&d(n,a+m.left,s+m.top),setTimeout((()=>{c(r),d(r,l,p),n&&(c(n),d(n,a,s))}),18)}}export{t as default}; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react-dom"),require("react")):"function"==typeof define&&define.amd?define(["react-dom","react"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).ElementPopper=e(t.ReactDOM,t.React)}(this,(function(t,e){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=r(e);function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){l=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function u(r,o){var a=r.element,l=r.popper,c=r.position,u=void 0===c?"bottom-center":c,s=r.containerStyle,d=r.containerClassName,p=void 0===d?"":d,h=r.arrow,m=r.arrowStyle,v=void 0===m?{}:m,b=r.arrowClassName,y=void 0===b?"":b,g=r.fixMainPosition,w=r.fixRelativePosition,O=r.offsetY,E=r.offsetX,P=r.animations,x=r.zIndex,j=void 0===x?0:x,M=r.popperShadow,T=r.onChange,S=r.active,C=void 0===S||S,N=r.portal,L=r.portalTarget,R="undefined"!=typeof window,A=R&&L instanceof HTMLElement,z=!0===h,I=l&&!0===C,X=e.useRef(),D=e.useRef(),H=e.useRef(),Y=e.useRef(),k=e.useMemo((function(){return{position:u,fixMainPosition:g,fixRelativePosition:w,offsetY:O,offsetX:E,defaultArrow:z,animations:P,zIndex:j,onChange:T}}),[u,g,w,O,E,z,P,T,j]),V=e.useCallback((function(){H.current&&(H.current.style.transition=""),D.current&&(D.current.parentNode.style.transition="")}),[]),W={element:i({display:"inline-block",height:"max-content"},s),arrow:i({visibility:"hidden",left:"0",top:"0",position:"absolute"},v),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:j}};R&&!Y.current&&(Y.current=document.createElement("div"),Y.current.data={portal:N,isValidPortalTarget:A}),e.useEffect((function(){if(N&&!A){var t=Y.current;return document.body.appendChild(t),function(){return document.body.removeChild(t)}}}),[N,A]),e.useEffect((function(){if(!I)return V(),D.current.parentNode.style.visibility="hidden",void(H.current&&(H.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(X.current)||(t&&V(),f(X,D,H,k,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[I,k,V]),e.useEffect((function(){var t={portal:N,isValidPortalTarget:A},e=Y.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(Y.current.data=t,X.current.refreshPosition())}),[N,A]);var q=n.default.createElement(n.default.Fragment,null,function(){if(!h||!I)return null;var t=n.default.createElement("div",{ref:H,style:W.arrow}),r=e.isValidElement(h)?{children:h}:{className:"ep-arrow ".concat(M?"ep-shadow":""," ").concat(y)};return e.cloneElement(t,r)}(),n.default.createElement("div",{className:M?"ep-popper-shadow":"",style:W.popper},n.default.createElement("div",{ref:D},l)));return n.default.createElement("div",{ref:function(t){t&&(t.removeTransition=V,t.refreshPosition=function(){return setTimeout((function(){return f(X,D,H,k,{})}),10)});if(X.current=t,o instanceof Function)return o(t);o&&(o.current=t)},className:p,style:W.element},a,N&&R?t.createPortal(q,A?L:Y.current):q)}function f(t,e,r,n,o){var a=n.position,c=n.fixMainPosition,u=n.fixRelativePosition,f=n.offsetY,h=void 0===f?0:f,m=n.offsetX,v=void 0===m?0:m,b=n.defaultArrow,y=n.animations,g=void 0===y?[]:y,w=n.zIndex,O=n.onChange;if(t.current&&e.current){var E,P,x,j,M=(P=void 0!==window.pageXOffset,x="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:x?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:x?document.documentElement.scrollTop:document.body.scrollTop}),T=M.scrollLeft,S=M.scrollTop,C=s(t.current,T,S),N=C.top,L=C.left,R=C.height,A=C.width,z=C.right,I=C.bottom,X=s(e.current,T,S),D=X.top,H=X.left,Y=X.height,k=X.width,V=document.documentElement,W=V.clientHeight,q=V.clientWidth,F=e.current.parentNode,J=function(t){if(!t)return[0,0];var e=l((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],n=void 0===r?0:r,o=e[2];return[n,void 0===o?0:o]}(F),B=l(J,2),U=B[0],$=B[1],G=function(t){var e=l(t.split("-"),2),r=e[0],n=void 0===r?"bottom":r,o=e[1],i=void 0===o?"center":o;"auto"===n&&(n="bottom");"auto"===i&&(i="center");var a="top"===n||"bottom"===n,c="left"===n||"right"===n;c&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[n,i,a,c]}(a),K=l(G,4),Q=K[0],Z=K[1],_=K[2],tt=K[3],et=Q,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},nt=A-k,ot=R-Y,it="left"===Z?0:"right"===Z?nt:nt/2,at=nt-it,lt="top"===Z?0:"bottom"===Z?ot:ot/2,ct=ot-lt,ut=L-H+U,ft=N-D+$,st=0,dt=0,pt=d(t.current),ht=[],mt=r.current,vt=s(mt,T,S)||{},bt=vt.height,yt=void 0===bt?0:bt,gt=vt.width,wt=void 0===gt?0:gt,Ot=ut,Et=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(_&&(ut+=it,ft+="top"===Q?-Y:R,b&&(yt=11,wt=20)),tt&&(ut+="left"===Q?-k:A,ft+=lt,b&&(yt=20,wt=11));pt;)ht.push(pt),jt(s(pt,T,S)),pt=d(pt.parentNode);if(jt({top:S,bottom:S+W,left:T,right:T+q,height:W,width:q}),_&&(ft+="bottom"===et?h:-h),tt&&(ut+="right"===et?v:-v),ut-=st,ft-=dt,E=Pt[et],mt)_&&((j=A<k)?Ot+=A/2:Ot=ut+k/2,Ot-=wt/2,"bottom"===et&&(Et=ft,ft+=yt),"top"===et&&(Et=(ft-=yt)+Y),st<0&&st-it<0&&(j?Ot+=(it-st)/2:A-it+st<k&&(Ot+=(A-it+st-k)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:A-st-at<k&&(Ot-=(A-st-at-k)/2))),tt&&((j=R<Y)?Et+=R/2:Et=ft+Y/2,Et-=yt/2,"left"===et&&(Ot=(ut-=wt)+k),"right"===et&&(Ot=ut,ut+=wt),dt<0&&dt-lt<0&&(j?Et+=(lt-dt)/2:R-lt+dt<Y&&(Et+=(R-lt+dt-Y)/2)),dt>0&&dt+ct>0&&(j?Et-=(dt+ct)/2:R-dt-ct<Y&&(Et-=(R-dt-ct-Y)/2))),mt.setAttribute("direction",E),mt.style.height=yt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,Et),mt.style.visibility="visible",mt.style.zIndex=w+1;F.style.transform=rt(ut,ft);var xt={popper:{top:ft,bottom:ft+Y,left:ut,right:ut+k,height:Y,width:k},element:{top:N,bottom:I,left:L,right:z,height:R,width:A},arrow:{top:Et,bottom:Et+yt,left:Ot,right:Ot+wt,height:yt,width:wt,direction:E},position:et+"-"+(0!==st?"auto":Z),scroll:{scrollLeft:T,scrollTop:S},scrollableParents:ht,event:o};o||g.forEach((function(t){t({popper:F,arrow:mt,data:i(i({},xt),{},{getTransform:rt,mirror:Pt})})})),F.style.visibility="visible","function"==typeof O&&O(xt)}function jt(t){var e=t.top,r=t.bottom,n=t.left,o=t.right,i=t.height,a=t.width;if(_){var l=Math.round(N-e+R/2),f=Math.round(i/2);c||(N-(Y+h+yt)<e&&l<=f&&"top"===et?(ft+=Y+R,et="bottom"):I+Y+h+yt>i+e&&l>=f&&"bottom"===et&&(ft-=Y+R,et="top")),u||(L+it<n&&(st=p(z-wt>n?L+it-n:-A+it+wt,st)),z-at>o&&(st=p(L+wt<o?z-at-o:A-at-wt,st)))}if(tt){var s=Math.round(L-n+A/2),d=Math.round(a/2);c||(L-(k+v+wt)<n&&s<d&&"left"===et?(ut+=A+k,et="right"):z+k+v+wt>o&&s>d&&"right"===et&&(ut-=A+k,et="left")),u||(N+lt<e&&(dt=p(I-yt>e?N+lt-e:-R+lt+yt,dt)),I-ct>r&&(dt=p(N+yt<r?I-ct-r:R-ct-yt,dt)))}}}function s(t,e,r){if(t){var n=t.getBoundingClientRect(),o=n.top,i=n.left,a=n.width,l=n.height,c=o+r,u=i+e;return{top:c,bottom:c+l,left:u,right:u+a,width:a,height:l}}}function d(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:d(t.parentNode)}}function p(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}return e.forwardRef(u)})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react-dom"),require("react")):"function"==typeof define&&define.amd?define(["react-dom","react"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).ElementPopper=e(t.ReactDOM,t.React)}(this,(function(t,e){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e);function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function u(r,n){var a=r.element,l=r.popper,c=r.position,u=void 0===c?"bottom-center":c,s=r.containerStyle,d=r.containerClassName,p=void 0===d?"":d,h=r.arrow,m=r.arrowStyle,v=void 0===m?{}:m,b=r.arrowClassName,y=void 0===b?"":b,g=r.fixMainPosition,w=r.fixRelativePosition,O=r.offsetY,E=r.offsetX,P=r.animations,x=r.zIndex,j=void 0===x?0:x,M=r.popperShadow,T=r.onChange,S=r.active,C=void 0===S||S,N=r.portal,L=r.portalTarget,R="undefined"!=typeof window,A=R&&L instanceof HTMLElement,z=!0===h,I=l&&!0===C,X=e.useRef(),D=e.useRef(),H=e.useRef(),Y=e.useRef(),k=e.useMemo((function(){return{position:u,fixMainPosition:g,fixRelativePosition:w,offsetY:O,offsetX:E,defaultArrow:z,animations:P,zIndex:j,onChange:T}}),[u,g,w,O,E,z,P,T,j]),V=e.useCallback((function(){H.current&&(H.current.style.transition=""),D.current&&(D.current.parentNode.style.transition="")}),[]),W={element:i({display:"inline-block",height:"max-content"},s),arrow:i({visibility:"hidden",left:"0",top:"0",position:"absolute"},v),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:j}};R&&!Y.current&&(Y.current=document.createElement("div"),Y.current.data={portal:N,isValidPortalTarget:A}),e.useEffect((function(){if(N&&!A){var t=Y.current;return document.body.appendChild(t),function(){document.body.contains(t)&&document.body.removeChild(t)}}}),[N,A]),e.useEffect((function(){if(!I)return V(),D.current.parentNode.style.visibility="hidden",void(H.current&&(H.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(X.current)||(t&&V(),f(X,D,H,k,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[I,k,V]),e.useEffect((function(){var t={portal:N,isValidPortalTarget:A},e=Y.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(Y.current.data=t,X.current.refreshPosition())}),[N,A]);var q=o.default.createElement(o.default.Fragment,null,function(){if(!h||!I)return null;var t=o.default.createElement("div",{ref:H,style:W.arrow}),r=e.isValidElement(h)?{children:h}:{className:"ep-arrow ".concat(M?"ep-shadow":""," ").concat(y)};return e.cloneElement(t,r)}(),o.default.createElement("div",{className:M?"ep-popper-shadow":"",style:W.popper},o.default.createElement("div",{ref:D},l)));return o.default.createElement("div",{ref:function(t){t&&(t.removeTransition=V,t.refreshPosition=function(){return setTimeout((function(){return f(X,D,H,k,{})}),10)});if(X.current=t,n instanceof Function)return n(t);n&&(n.current=t)},className:p,style:W.element},a,N&&R?t.createPortal(q,A?L:Y.current):q)}function f(t,e,r,o,n){var a=o.position,c=o.fixMainPosition,u=o.fixRelativePosition,f=o.offsetY,h=void 0===f?0:f,m=o.offsetX,v=void 0===m?0:m,b=o.defaultArrow,y=o.animations,g=void 0===y?[]:y,w=o.zIndex,O=o.onChange;if(t.current&&e.current){var E,P,x,j,M=(P=void 0!==window.pageXOffset,x="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:x?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:x?document.documentElement.scrollTop:document.body.scrollTop}),T=M.scrollLeft,S=M.scrollTop,C=s(t.current,T,S),N=C.top,L=C.left,R=C.height,A=C.width,z=C.right,I=C.bottom,X=s(e.current,T,S),D=X.top,H=X.left,Y=X.height,k=X.width,V=document.documentElement,W=V.clientHeight,q=V.clientWidth,F=e.current.parentNode,J=function(t){if(!t)return[0,0];var e=l((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],o=void 0===r?0:r,n=e[2];return[o,void 0===n?0:n]}(F),B=l(J,2),U=B[0],$=B[1],G=function(t){var e=l(t.split("-"),2),r=e[0],o=void 0===r?"bottom":r,n=e[1],i=void 0===n?"center":n;"auto"===o&&(o="bottom");"auto"===i&&(i="center");var a="top"===o||"bottom"===o,c="left"===o||"right"===o;c&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[o,i,a,c]}(a),K=l(G,4),Q=K[0],Z=K[1],_=K[2],tt=K[3],et=Q,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},ot=A-k,nt=R-Y,it="left"===Z?0:"right"===Z?ot:ot/2,at=ot-it,lt="top"===Z?0:"bottom"===Z?nt:nt/2,ct=nt-lt,ut=L-H+U,ft=N-D+$,st=0,dt=0,pt=d(t.current),ht=[],mt=r.current,vt=s(mt,T,S)||{},bt=vt.height,yt=void 0===bt?0:bt,gt=vt.width,wt=void 0===gt?0:gt,Ot=ut,Et=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(_&&(ut+=it,ft+="top"===Q?-Y:R,b&&(yt=11,wt=20)),tt&&(ut+="left"===Q?-k:A,ft+=lt,b&&(yt=20,wt=11));pt;)ht.push(pt),jt(s(pt,T,S)),pt=d(pt.parentNode);if(jt({top:S,bottom:S+W,left:T,right:T+q,height:W,width:q}),_&&(ft+="bottom"===et?h:-h),tt&&(ut+="right"===et?v:-v),ut-=st,ft-=dt,E=Pt[et],mt)_&&((j=A<k)?Ot+=A/2:Ot=ut+k/2,Ot-=wt/2,"bottom"===et&&(Et=ft,ft+=yt),"top"===et&&(Et=(ft-=yt)+Y),st<0&&st-it<0&&(j?Ot+=(it-st)/2:A-it+st<k&&(Ot+=(A-it+st-k)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:A-st-at<k&&(Ot-=(A-st-at-k)/2))),tt&&((j=R<Y)?Et+=R/2:Et=ft+Y/2,Et-=yt/2,"left"===et&&(Ot=(ut-=wt)+k),"right"===et&&(Ot=ut,ut+=wt),dt<0&&dt-lt<0&&(j?Et+=(lt-dt)/2:R-lt+dt<Y&&(Et+=(R-lt+dt-Y)/2)),dt>0&&dt+ct>0&&(j?Et-=(dt+ct)/2:R-dt-ct<Y&&(Et-=(R-dt-ct-Y)/2))),mt.setAttribute("direction",E),mt.style.height=yt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,Et),mt.style.visibility="visible",mt.style.zIndex=w+1;F.style.transform=rt(ut,ft);var xt={popper:{top:ft,bottom:ft+Y,left:ut,right:ut+k,height:Y,width:k},element:{top:N,bottom:I,left:L,right:z,height:R,width:A},arrow:{top:Et,bottom:Et+yt,left:Ot,right:Ot+wt,height:yt,width:wt,direction:E},position:et+"-"+(0!==st?"auto":Z),scroll:{scrollLeft:T,scrollTop:S},scrollableParents:ht,event:n};n||g.forEach((function(t){t({popper:F,arrow:mt,data:i(i({},xt),{},{getTransform:rt,mirror:Pt})})})),F.style.visibility="visible","function"==typeof O&&O(xt)}function jt(t){var e=t.top,r=t.bottom,o=t.left,n=t.right,i=t.height,a=t.width;if(_){var l=Math.round(N-e+R/2),f=Math.round(i/2);c||(N-(Y+h+yt)<e&&l<=f&&"top"===et?(ft+=Y+R,et="bottom"):I+Y+h+yt>i+e&&l>=f&&"bottom"===et&&(ft-=Y+R,et="top")),u||(L+it<o&&(st=p(z-wt>o?L+it-o:-A+it+wt,st)),z-at>n&&(st=p(L+wt<n?z-at-n:A-at-wt,st)))}if(tt){var s=Math.round(L-o+A/2),d=Math.round(a/2);c||(L-(k+v+wt)<o&&s<d&&"left"===et?(ut+=A+k,et="right"):z+k+v+wt>n&&s>d&&"right"===et&&(ut-=A+k,et="left")),u||(N+lt<e&&(dt=p(I-yt>e?N+lt-e:-R+lt+yt,dt)),I-ct>r&&(dt=p(N+yt<r?I-ct-r:R-ct-yt,dt)))}}}function s(t,e,r){if(t){var o=t.getBoundingClientRect(),n=o.top,i=o.left,a=o.width,l=o.height,c=n+r,u=i+e;return{top:c,bottom:c+l,left:u,right:u+a,width:a,height:l}}}function d(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:d(t.parentNode)}}function p(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}return e.forwardRef(u)})); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react-dom"),e=require("react");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e);function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function c(r,n){var a=r.element,l=r.popper,u=r.position,c=void 0===u?"bottom-center":u,f=r.containerStyle,d=r.containerClassName,p=void 0===d?"":d,h=r.arrow,m=r.arrowStyle,v=void 0===m?{}:m,b=r.arrowClassName,y=void 0===b?"":b,g=r.fixMainPosition,w=r.fixRelativePosition,O=r.offsetY,E=r.offsetX,P=r.animations,x=r.zIndex,j=void 0===x?0:x,M=r.popperShadow,S=r.onChange,C=r.active,N=void 0===C||C,T=r.portal,L=r.portalTarget,A="undefined"!=typeof window,R=A&&L instanceof HTMLElement,z=!0===h,I=l&&!0===N,X=e.useRef(),H=e.useRef(),Y=e.useRef(),D=e.useRef(),k=e.useMemo((function(){return{position:c,fixMainPosition:g,fixRelativePosition:w,offsetY:O,offsetX:E,defaultArrow:z,animations:P,zIndex:j,onChange:S}}),[c,g,w,O,E,z,P,S,j]),V=e.useCallback((function(){Y.current&&(Y.current.style.transition=""),H.current&&(H.current.parentNode.style.transition="")}),[]),W={element:i({display:"inline-block",height:"max-content"},f),arrow:i({visibility:"hidden",left:"0",top:"0",position:"absolute"},v),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:j}};A&&!D.current&&(D.current=document.createElement("div"),D.current.data={portal:T,isValidPortalTarget:R}),e.useEffect((function(){if(T&&!R){var t=D.current;return document.body.appendChild(t),function(){return document.body.removeChild(t)}}}),[T,R]),e.useEffect((function(){if(!I)return V(),H.current.parentNode.style.visibility="hidden",void(Y.current&&(Y.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(X.current)||(t&&V(),s(X,H,Y,k,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[I,k,V]),e.useEffect((function(){var t={portal:T,isValidPortalTarget:R},e=D.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(D.current.data=t,X.current.refreshPosition())}),[T,R]);var q=o.default.createElement(o.default.Fragment,null,function(){if(!h||!I)return null;var t=o.default.createElement("div",{ref:Y,style:W.arrow}),r=e.isValidElement(h)?{children:h}:{className:"ep-arrow ".concat(M?"ep-shadow":""," ").concat(y)};return e.cloneElement(t,r)}(),o.default.createElement("div",{className:M?"ep-popper-shadow":"",style:W.popper},o.default.createElement("div",{ref:H},l)));return o.default.createElement("div",{ref:function(t){t&&(t.removeTransition=V,t.refreshPosition=function(){return setTimeout((function(){return s(X,H,Y,k,{})}),10)});if(X.current=t,n instanceof Function)return n(t);n&&(n.current=t)},className:p,style:W.element},a,T&&A?t.createPortal(q,R?L:D.current):q)}var f=e.forwardRef(c);function s(t,e,r,o,n){var a=o.position,u=o.fixMainPosition,c=o.fixRelativePosition,f=o.offsetY,s=void 0===f?0:f,m=o.offsetX,v=void 0===m?0:m,b=o.defaultArrow,y=o.animations,g=void 0===y?[]:y,w=o.zIndex,O=o.onChange;if(t.current&&e.current){var E,P,x,j,M=(P=void 0!==window.pageXOffset,x="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:x?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:x?document.documentElement.scrollTop:document.body.scrollTop}),S=M.scrollLeft,C=M.scrollTop,N=d(t.current,S,C),T=N.top,L=N.left,A=N.height,R=N.width,z=N.right,I=N.bottom,X=d(e.current,S,C),H=X.top,Y=X.left,D=X.height,k=X.width,V=document.documentElement,W=V.clientHeight,q=V.clientWidth,F=e.current.parentNode,J=function(t){if(!t)return[0,0];var e=l((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],o=void 0===r?0:r,n=e[2];return[o,void 0===n?0:n]}(F),_=l(J,2),B=_[0],U=_[1],$=function(t){var e=l(t.split("-"),2),r=e[0],o=void 0===r?"bottom":r,n=e[1],i=void 0===n?"center":n;"auto"===o&&(o="bottom");"auto"===i&&(i="center");var a="top"===o||"bottom"===o,u="left"===o||"right"===o;u&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[o,i,a,u]}(a),G=l($,4),K=G[0],Q=G[1],Z=G[2],tt=G[3],et=K,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},ot=R-k,nt=A-D,it="left"===Q?0:"right"===Q?ot:ot/2,at=ot-it,lt="top"===Q?0:"bottom"===Q?nt:nt/2,ut=nt-lt,ct=L-Y+B,ft=T-H+U,st=0,dt=0,pt=p(t.current),ht=[],mt=r.current,vt=d(mt,S,C)||{},bt=vt.height,yt=void 0===bt?0:bt,gt=vt.width,wt=void 0===gt?0:gt,Ot=ct,Et=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(Z&&(ct+=it,ft+="top"===K?-D:A,b&&(yt=11,wt=20)),tt&&(ct+="left"===K?-k:R,ft+=lt,b&&(yt=20,wt=11));pt;)ht.push(pt),jt(d(pt,S,C)),pt=p(pt.parentNode);if(jt({top:C,bottom:C+W,left:S,right:S+q,height:W,width:q}),Z&&(ft+="bottom"===et?s:-s),tt&&(ct+="right"===et?v:-v),ct-=st,ft-=dt,E=Pt[et],mt)Z&&((j=R<k)?Ot+=R/2:Ot=ct+k/2,Ot-=wt/2,"bottom"===et&&(Et=ft,ft+=yt),"top"===et&&(Et=(ft-=yt)+D),st<0&&st-it<0&&(j?Ot+=(it-st)/2:R-it+st<k&&(Ot+=(R-it+st-k)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:R-st-at<k&&(Ot-=(R-st-at-k)/2))),tt&&((j=A<D)?Et+=A/2:Et=ft+D/2,Et-=yt/2,"left"===et&&(Ot=(ct-=wt)+k),"right"===et&&(Ot=ct,ct+=wt),dt<0&&dt-lt<0&&(j?Et+=(lt-dt)/2:A-lt+dt<D&&(Et+=(A-lt+dt-D)/2)),dt>0&&dt+ut>0&&(j?Et-=(dt+ut)/2:A-dt-ut<D&&(Et-=(A-dt-ut-D)/2))),mt.setAttribute("direction",E),mt.style.height=yt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,Et),mt.style.visibility="visible",mt.style.zIndex=w+1;F.style.transform=rt(ct,ft);var xt={popper:{top:ft,bottom:ft+D,left:ct,right:ct+k,height:D,width:k},element:{top:T,bottom:I,left:L,right:z,height:A,width:R},arrow:{top:Et,bottom:Et+yt,left:Ot,right:Ot+wt,height:yt,width:wt,direction:E},position:et+"-"+(0!==st?"auto":Q),scroll:{scrollLeft:S,scrollTop:C},scrollableParents:ht,event:n};n||g.forEach((function(t){t({popper:F,arrow:mt,data:i(i({},xt),{},{getTransform:rt,mirror:Pt})})})),F.style.visibility="visible","function"==typeof O&&O(xt)}function jt(t){var e=t.top,r=t.bottom,o=t.left,n=t.right,i=t.height,a=t.width;if(Z){var l=Math.round(T-e+A/2),f=Math.round(i/2);u||(T-(D+s+yt)<e&&l<=f&&"top"===et?(ft+=D+A,et="bottom"):I+D+s+yt>i+e&&l>=f&&"bottom"===et&&(ft-=D+A,et="top")),c||(L+it<o&&(st=h(z-wt>o?L+it-o:-R+it+wt,st)),z-at>n&&(st=h(L+wt<n?z-at-n:R-at-wt,st)))}if(tt){var d=Math.round(L-o+R/2),p=Math.round(a/2);u||(L-(k+v+wt)<o&&d<p&&"left"===et?(ct+=R+k,et="right"):z+k+v+wt>n&&d>p&&"right"===et&&(ct-=R+k,et="left")),c||(T+lt<e&&(dt=h(I-yt>e?T+lt-e:-A+lt+yt,dt)),I-ut>r&&(dt=h(T+yt<r?I-ut-r:A-ut-yt,dt)))}}}function d(t,e,r){if(t){var o=t.getBoundingClientRect(),n=o.top,i=o.left,a=o.width,l=o.height,u=n+r,c=i+e;return{top:u,bottom:u+l,left:c,right:c+a,width:a,height:l}}}function p(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:p(t.parentNode)}}function h(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}exports.default=f; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react-dom"),e=require("react");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e);function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function u(r,n){var a=r.element,l=r.popper,c=r.position,u=void 0===c?"bottom-center":c,f=r.containerStyle,d=r.containerClassName,p=void 0===d?"":d,h=r.arrow,m=r.arrowStyle,v=void 0===m?{}:m,b=r.arrowClassName,y=void 0===b?"":b,g=r.fixMainPosition,w=r.fixRelativePosition,O=r.offsetY,E=r.offsetX,P=r.animations,x=r.zIndex,j=void 0===x?0:x,M=r.popperShadow,S=r.onChange,C=r.active,N=void 0===C||C,T=r.portal,L=r.portalTarget,A="undefined"!=typeof window,R=A&&L instanceof HTMLElement,z=!0===h,I=l&&!0===N,X=e.useRef(),H=e.useRef(),Y=e.useRef(),D=e.useRef(),k=e.useMemo((function(){return{position:u,fixMainPosition:g,fixRelativePosition:w,offsetY:O,offsetX:E,defaultArrow:z,animations:P,zIndex:j,onChange:S}}),[u,g,w,O,E,z,P,S,j]),V=e.useCallback((function(){Y.current&&(Y.current.style.transition=""),H.current&&(H.current.parentNode.style.transition="")}),[]),W={element:i({display:"inline-block",height:"max-content"},f),arrow:i({visibility:"hidden",left:"0",top:"0",position:"absolute"},v),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:j}};A&&!D.current&&(D.current=document.createElement("div"),D.current.data={portal:T,isValidPortalTarget:R}),e.useEffect((function(){if(T&&!R){var t=D.current;return document.body.appendChild(t),function(){document.body.contains(t)&&document.body.removeChild(t)}}}),[T,R]),e.useEffect((function(){if(!I)return V(),H.current.parentNode.style.visibility="hidden",void(Y.current&&(Y.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(X.current)||(t&&V(),s(X,H,Y,k,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[I,k,V]),e.useEffect((function(){var t={portal:T,isValidPortalTarget:R},e=D.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(D.current.data=t,X.current.refreshPosition())}),[T,R]);var q=o.default.createElement(o.default.Fragment,null,function(){if(!h||!I)return null;var t=o.default.createElement("div",{ref:Y,style:W.arrow}),r=e.isValidElement(h)?{children:h}:{className:"ep-arrow ".concat(M?"ep-shadow":""," ").concat(y)};return e.cloneElement(t,r)}(),o.default.createElement("div",{className:M?"ep-popper-shadow":"",style:W.popper},o.default.createElement("div",{ref:H},l)));return o.default.createElement("div",{ref:function(t){t&&(t.removeTransition=V,t.refreshPosition=function(){return setTimeout((function(){return s(X,H,Y,k,{})}),10)});if(X.current=t,n instanceof Function)return n(t);n&&(n.current=t)},className:p,style:W.element},a,T&&A?t.createPortal(q,R?L:D.current):q)}var f=e.forwardRef(u);function s(t,e,r,o,n){var a=o.position,c=o.fixMainPosition,u=o.fixRelativePosition,f=o.offsetY,s=void 0===f?0:f,m=o.offsetX,v=void 0===m?0:m,b=o.defaultArrow,y=o.animations,g=void 0===y?[]:y,w=o.zIndex,O=o.onChange;if(t.current&&e.current){var E,P,x,j,M=(P=void 0!==window.pageXOffset,x="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:x?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:x?document.documentElement.scrollTop:document.body.scrollTop}),S=M.scrollLeft,C=M.scrollTop,N=d(t.current,S,C),T=N.top,L=N.left,A=N.height,R=N.width,z=N.right,I=N.bottom,X=d(e.current,S,C),H=X.top,Y=X.left,D=X.height,k=X.width,V=document.documentElement,W=V.clientHeight,q=V.clientWidth,F=e.current.parentNode,J=function(t){if(!t)return[0,0];var e=l((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],o=void 0===r?0:r,n=e[2];return[o,void 0===n?0:n]}(F),_=l(J,2),B=_[0],U=_[1],$=function(t){var e=l(t.split("-"),2),r=e[0],o=void 0===r?"bottom":r,n=e[1],i=void 0===n?"center":n;"auto"===o&&(o="bottom");"auto"===i&&(i="center");var a="top"===o||"bottom"===o,c="left"===o||"right"===o;c&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[o,i,a,c]}(a),G=l($,4),K=G[0],Q=G[1],Z=G[2],tt=G[3],et=K,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},ot=R-k,nt=A-D,it="left"===Q?0:"right"===Q?ot:ot/2,at=ot-it,lt="top"===Q?0:"bottom"===Q?nt:nt/2,ct=nt-lt,ut=L-Y+B,ft=T-H+U,st=0,dt=0,pt=p(t.current),ht=[],mt=r.current,vt=d(mt,S,C)||{},bt=vt.height,yt=void 0===bt?0:bt,gt=vt.width,wt=void 0===gt?0:gt,Ot=ut,Et=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(Z&&(ut+=it,ft+="top"===K?-D:A,b&&(yt=11,wt=20)),tt&&(ut+="left"===K?-k:R,ft+=lt,b&&(yt=20,wt=11));pt;)ht.push(pt),jt(d(pt,S,C)),pt=p(pt.parentNode);if(jt({top:C,bottom:C+W,left:S,right:S+q,height:W,width:q}),Z&&(ft+="bottom"===et?s:-s),tt&&(ut+="right"===et?v:-v),ut-=st,ft-=dt,E=Pt[et],mt)Z&&((j=R<k)?Ot+=R/2:Ot=ut+k/2,Ot-=wt/2,"bottom"===et&&(Et=ft,ft+=yt),"top"===et&&(Et=(ft-=yt)+D),st<0&&st-it<0&&(j?Ot+=(it-st)/2:R-it+st<k&&(Ot+=(R-it+st-k)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:R-st-at<k&&(Ot-=(R-st-at-k)/2))),tt&&((j=A<D)?Et+=A/2:Et=ft+D/2,Et-=yt/2,"left"===et&&(Ot=(ut-=wt)+k),"right"===et&&(Ot=ut,ut+=wt),dt<0&&dt-lt<0&&(j?Et+=(lt-dt)/2:A-lt+dt<D&&(Et+=(A-lt+dt-D)/2)),dt>0&&dt+ct>0&&(j?Et-=(dt+ct)/2:A-dt-ct<D&&(Et-=(A-dt-ct-D)/2))),mt.setAttribute("direction",E),mt.style.height=yt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,Et),mt.style.visibility="visible",mt.style.zIndex=w+1;F.style.transform=rt(ut,ft);var xt={popper:{top:ft,bottom:ft+D,left:ut,right:ut+k,height:D,width:k},element:{top:T,bottom:I,left:L,right:z,height:A,width:R},arrow:{top:Et,bottom:Et+yt,left:Ot,right:Ot+wt,height:yt,width:wt,direction:E},position:et+"-"+(0!==st?"auto":Q),scroll:{scrollLeft:S,scrollTop:C},scrollableParents:ht,event:n};n||g.forEach((function(t){t({popper:F,arrow:mt,data:i(i({},xt),{},{getTransform:rt,mirror:Pt})})})),F.style.visibility="visible","function"==typeof O&&O(xt)}function jt(t){var e=t.top,r=t.bottom,o=t.left,n=t.right,i=t.height,a=t.width;if(Z){var l=Math.round(T-e+A/2),f=Math.round(i/2);c||(T-(D+s+yt)<e&&l<=f&&"top"===et?(ft+=D+A,et="bottom"):I+D+s+yt>i+e&&l>=f&&"bottom"===et&&(ft-=D+A,et="top")),u||(L+it<o&&(st=h(z-wt>o?L+it-o:-R+it+wt,st)),z-at>n&&(st=h(L+wt<n?z-at-n:R-at-wt,st)))}if(tt){var d=Math.round(L-o+R/2),p=Math.round(a/2);c||(L-(k+v+wt)<o&&d<p&&"left"===et?(ut+=R+k,et="right"):z+k+v+wt>n&&d>p&&"right"===et&&(ut-=R+k,et="left")),u||(T+lt<e&&(dt=h(I-yt>e?T+lt-e:-A+lt+yt,dt)),I-ct>r&&(dt=h(T+yt<r?I-ct-r:A-ct-yt,dt)))}}}function d(t,e,r){if(t){var o=t.getBoundingClientRect(),n=o.top,i=o.left,a=o.width,l=o.height,c=n+r,u=i+e;return{top:c,bottom:c+l,left:u,right:u+a,width:a,height:l}}}function p(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:p(t.parentNode)}}function h(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}exports.default=f; |
@@ -1,1 +0,1 @@ | ||
import{createPortal as t}from"react-dom";import e,{forwardRef as r,useRef as o,useMemo as n,useCallback as i,useEffect as a,cloneElement as l,isValidElement as c}from"react";function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function h(r,u){var s=r.element,d=r.popper,p=r.position,h=void 0===p?"bottom-center":p,m=r.containerStyle,b=r.containerClassName,g=void 0===b?"":b,y=r.arrow,w=r.arrowStyle,O=void 0===w?{}:w,x=r.arrowClassName,P=void 0===x?"":x,E=r.fixMainPosition,j=r.fixRelativePosition,M=r.offsetY,S=r.offsetX,N=r.animations,T=r.zIndex,C=void 0===T?0:T,L=r.popperShadow,A=r.onChange,z=r.active,I=void 0===z||z,X=r.portal,H=r.portalTarget,Y="undefined"!=typeof window,D=Y&&H instanceof HTMLElement,R=!0===y,W=d&&!0===I,k=o(),F=o(),J=o(),V=o(),B=n((function(){return{position:h,fixMainPosition:E,fixRelativePosition:j,offsetY:M,offsetX:S,defaultArrow:R,animations:N,zIndex:C,onChange:A}}),[h,E,j,M,S,R,N,A,C]),U=i((function(){J.current&&(J.current.style.transition=""),F.current&&(F.current.parentNode.style.transition="")}),[]),$={element:f({display:"inline-block",height:"max-content"},m),arrow:f({visibility:"hidden",left:"0",top:"0",position:"absolute"},O),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:C}};Y&&!V.current&&(V.current=document.createElement("div"),V.current.data={portal:X,isValidPortalTarget:D}),a((function(){if(X&&!D){var t=V.current;return document.body.appendChild(t),function(){return document.body.removeChild(t)}}}),[X,D]),a((function(){if(!W)return U(),F.current.parentNode.style.visibility="hidden",void(J.current&&(J.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(k.current)||(t&&U(),v(k,F,J,B,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[W,B,U]),a((function(){var t={portal:X,isValidPortalTarget:D},e=V.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(V.current.data=t,k.current.refreshPosition())}),[X,D]);var q=e.createElement(e.Fragment,null,function(){if(!y||!W)return null;var t=e.createElement("div",{ref:J,style:$.arrow}),r=c(y)?{children:y}:{className:"ep-arrow ".concat(L?"ep-shadow":""," ").concat(P)};return l(t,r)}(),e.createElement("div",{className:L?"ep-popper-shadow":"",style:$.popper},e.createElement("div",{ref:F},d)));return e.createElement("div",{ref:function(t){t&&(t.removeTransition=U,t.refreshPosition=function(){return setTimeout((function(){return v(k,F,J,B,{})}),10)});if(k.current=t,u instanceof Function)return u(t);u&&(u.current=t)},className:g,style:$.element},s,X&&Y?t(q,D?H:V.current):q)}var m=r(h);function v(t,e,r,o,n){var i=o.position,a=o.fixMainPosition,l=o.fixRelativePosition,c=o.offsetY,u=void 0===c?0:c,s=o.offsetX,p=void 0===s?0:s,h=o.defaultArrow,m=o.animations,v=void 0===m?[]:m,w=o.zIndex,O=o.onChange;if(t.current&&e.current){var x,P,E,j,M=(P=void 0!==window.pageXOffset,E="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:E?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:E?document.documentElement.scrollTop:document.body.scrollTop}),S=M.scrollLeft,N=M.scrollTop,T=b(t.current,S,N),C=T.top,L=T.left,A=T.height,z=T.width,I=T.right,X=T.bottom,H=b(e.current,S,N),Y=H.top,D=H.left,R=H.height,W=H.width,k=document.documentElement,F=k.clientHeight,J=k.clientWidth,V=e.current.parentNode,B=function(t){if(!t)return[0,0];var e=d((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],o=void 0===r?0:r,n=e[2];return[o,void 0===n?0:n]}(V),U=d(B,2),$=U[0],q=U[1],G=function(t){var e=d(t.split("-"),2),r=e[0],o=void 0===r?"bottom":r,n=e[1],i=void 0===n?"center":n;"auto"===o&&(o="bottom");"auto"===i&&(i="center");var a="top"===o||"bottom"===o,l="left"===o||"right"===o;l&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[o,i,a,l]}(i),K=d(G,4),Q=K[0],Z=K[1],_=K[2],tt=K[3],et=Q,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},ot=z-W,nt=A-R,it="left"===Z?0:"right"===Z?ot:ot/2,at=ot-it,lt="top"===Z?0:"bottom"===Z?nt:nt/2,ct=nt-lt,ut=L-D+$,ft=C-Y+q,st=0,dt=0,pt=g(t.current),ht=[],mt=r.current,vt=b(mt,S,N)||{},bt=vt.height,gt=void 0===bt?0:bt,yt=vt.width,wt=void 0===yt?0:yt,Ot=ut,xt=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(_&&(ut+=it,ft+="top"===Q?-R:A,h&&(gt=11,wt=20)),tt&&(ut+="left"===Q?-W:z,ft+=lt,h&&(gt=20,wt=11));pt;)ht.push(pt),jt(b(pt,S,N)),pt=g(pt.parentNode);if(jt({top:N,bottom:N+F,left:S,right:S+J,height:F,width:J}),_&&(ft+="bottom"===et?u:-u),tt&&(ut+="right"===et?p:-p),ut-=st,ft-=dt,x=Pt[et],mt)_&&((j=z<W)?Ot+=z/2:Ot=ut+W/2,Ot-=wt/2,"bottom"===et&&(xt=ft,ft+=gt),"top"===et&&(xt=(ft-=gt)+R),st<0&&st-it<0&&(j?Ot+=(it-st)/2:z-it+st<W&&(Ot+=(z-it+st-W)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:z-st-at<W&&(Ot-=(z-st-at-W)/2))),tt&&((j=A<R)?xt+=A/2:xt=ft+R/2,xt-=gt/2,"left"===et&&(Ot=(ut-=wt)+W),"right"===et&&(Ot=ut,ut+=wt),dt<0&&dt-lt<0&&(j?xt+=(lt-dt)/2:A-lt+dt<R&&(xt+=(A-lt+dt-R)/2)),dt>0&&dt+ct>0&&(j?xt-=(dt+ct)/2:A-dt-ct<R&&(xt-=(A-dt-ct-R)/2))),mt.setAttribute("direction",x),mt.style.height=gt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,xt),mt.style.visibility="visible",mt.style.zIndex=w+1;V.style.transform=rt(ut,ft);var Et={popper:{top:ft,bottom:ft+R,left:ut,right:ut+W,height:R,width:W},element:{top:C,bottom:X,left:L,right:I,height:A,width:z},arrow:{top:xt,bottom:xt+gt,left:Ot,right:Ot+wt,height:gt,width:wt,direction:x},position:et+"-"+(0!==st?"auto":Z),scroll:{scrollLeft:S,scrollTop:N},scrollableParents:ht,event:n};n||v.forEach((function(t){t({popper:V,arrow:mt,data:f(f({},Et),{},{getTransform:rt,mirror:Pt})})})),V.style.visibility="visible","function"==typeof O&&O(Et)}function jt(t){var e=t.top,r=t.bottom,o=t.left,n=t.right,i=t.height,c=t.width;if(_){var f=Math.round(C-e+A/2),s=Math.round(i/2);a||(C-(R+u+gt)<e&&f<=s&&"top"===et?(ft+=R+A,et="bottom"):X+R+u+gt>i+e&&f>=s&&"bottom"===et&&(ft-=R+A,et="top")),l||(L+it<o&&(st=y(I-wt>o?L+it-o:-z+it+wt,st)),I-at>n&&(st=y(L+wt<n?I-at-n:z-at-wt,st)))}if(tt){var d=Math.round(L-o+z/2),h=Math.round(c/2);a||(L-(W+p+wt)<o&&d<h&&"left"===et?(ut+=z+W,et="right"):I+W+p+wt>n&&d>h&&"right"===et&&(ut-=z+W,et="left")),l||(C+lt<e&&(dt=y(X-gt>e?C+lt-e:-A+lt+gt,dt)),X-ct>r&&(dt=y(C+gt<r?X-ct-r:A-ct-gt,dt)))}}}function b(t,e,r){if(t){var o=t.getBoundingClientRect(),n=o.top,i=o.left,a=o.width,l=o.height,c=n+r,u=i+e;return{top:c,bottom:c+l,left:u,right:u+a,width:a,height:l}}}function g(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:g(t.parentNode)}}function y(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}export{m as default}; | ||
import{createPortal as t}from"react-dom";import e,{forwardRef as r,useRef as o,useMemo as n,useCallback as i,useEffect as a,cloneElement as l,isValidElement as c}from"react";function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var o,n,i=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(o=r.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(t){l=!0,n=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw n}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function h(r,u){var s=r.element,d=r.popper,p=r.position,h=void 0===p?"bottom-center":p,m=r.containerStyle,b=r.containerClassName,g=void 0===b?"":b,y=r.arrow,w=r.arrowStyle,O=void 0===w?{}:w,x=r.arrowClassName,P=void 0===x?"":x,E=r.fixMainPosition,j=r.fixRelativePosition,M=r.offsetY,S=r.offsetX,N=r.animations,T=r.zIndex,C=void 0===T?0:T,L=r.popperShadow,A=r.onChange,z=r.active,I=void 0===z||z,X=r.portal,H=r.portalTarget,Y="undefined"!=typeof window,D=Y&&H instanceof HTMLElement,R=!0===y,W=d&&!0===I,k=o(),F=o(),J=o(),V=o(),B=n((function(){return{position:h,fixMainPosition:E,fixRelativePosition:j,offsetY:M,offsetX:S,defaultArrow:R,animations:N,zIndex:C,onChange:A}}),[h,E,j,M,S,R,N,A,C]),U=i((function(){J.current&&(J.current.style.transition=""),F.current&&(F.current.parentNode.style.transition="")}),[]),$={element:f({display:"inline-block",height:"max-content"},m),arrow:f({visibility:"hidden",left:"0",top:"0",position:"absolute"},O),popper:{position:"absolute",left:"0",top:"0",willChange:"transform",visibility:"hidden",zIndex:C}};Y&&!V.current&&(V.current=document.createElement("div"),V.current.data={portal:X,isValidPortalTarget:D}),a((function(){if(X&&!D){var t=V.current;return document.body.appendChild(t),function(){document.body.contains(t)&&document.body.removeChild(t)}}}),[X,D]),a((function(){if(!W)return U(),F.current.parentNode.style.visibility="hidden",void(J.current&&(J.current.style.visibility="hidden"));function t(t){t&&"resize"!==t.type&&!t.target.contains(k.current)||(t&&U(),v(k,F,J,B,t))}return t(),document.addEventListener("scroll",t,!0),window.addEventListener("resize",t),function(){document.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t)}}),[W,B,U]),a((function(){var t={portal:X,isValidPortalTarget:D},e=V.current.data;JSON.stringify(t)!==JSON.stringify(e)&&(V.current.data=t,k.current.refreshPosition())}),[X,D]);var q=e.createElement(e.Fragment,null,function(){if(!y||!W)return null;var t=e.createElement("div",{ref:J,style:$.arrow}),r=c(y)?{children:y}:{className:"ep-arrow ".concat(L?"ep-shadow":""," ").concat(P)};return l(t,r)}(),e.createElement("div",{className:L?"ep-popper-shadow":"",style:$.popper},e.createElement("div",{ref:F},d)));return e.createElement("div",{ref:function(t){t&&(t.removeTransition=U,t.refreshPosition=function(){return setTimeout((function(){return v(k,F,J,B,{})}),10)});if(k.current=t,u instanceof Function)return u(t);u&&(u.current=t)},className:g,style:$.element},s,X&&Y?t(q,D?H:V.current):q)}var m=r(h);function v(t,e,r,o,n){var i=o.position,a=o.fixMainPosition,l=o.fixRelativePosition,c=o.offsetY,u=void 0===c?0:c,s=o.offsetX,p=void 0===s?0:s,h=o.defaultArrow,m=o.animations,v=void 0===m?[]:m,w=o.zIndex,O=o.onChange;if(t.current&&e.current){var x,P,E,j,M=(P=void 0!==window.pageXOffset,E="CSS1Compat"===(document.compatMode||""),{scrollLeft:P?window.pageXOffset:E?document.documentElement.scrollLeft:document.body.scrollLeft,scrollTop:P?window.pageYOffset:E?document.documentElement.scrollTop:document.body.scrollTop}),S=M.scrollLeft,N=M.scrollTop,T=b(t.current,S,N),C=T.top,L=T.left,A=T.height,z=T.width,I=T.right,X=T.bottom,H=b(e.current,S,N),Y=H.top,D=H.left,R=H.height,W=H.width,k=document.documentElement,F=k.clientHeight,J=k.clientWidth,V=e.current.parentNode,B=function(t){if(!t)return[0,0];var e=d((t.style.transform.match(/translate\((.*?)px,\s(.*?)px\)/)||[]).map((function(t){return Number(t)})),3),r=e[1],o=void 0===r?0:r,n=e[2];return[o,void 0===n?0:n]}(V),U=d(B,2),$=U[0],q=U[1],G=function(t){var e=d(t.split("-"),2),r=e[0],o=void 0===r?"bottom":r,n=e[1],i=void 0===n?"center":n;"auto"===o&&(o="bottom");"auto"===i&&(i="center");var a="top"===o||"bottom"===o,l="left"===o||"right"===o;l&&("start"===i&&(i="top"),"end"===i&&(i="bottom"));a&&("start"===i&&(i="left"),"end"===i&&(i="right"));return[o,i,a,l]}(i),K=d(G,4),Q=K[0],Z=K[1],_=K[2],tt=K[3],et=Q,rt=function(t,e){return"translate(".concat(t,"px, ").concat(e,"px)")},ot=z-W,nt=A-R,it="left"===Z?0:"right"===Z?ot:ot/2,at=ot-it,lt="top"===Z?0:"bottom"===Z?nt:nt/2,ct=nt-lt,ut=L-D+$,ft=C-Y+q,st=0,dt=0,pt=g(t.current),ht=[],mt=r.current,vt=b(mt,S,N)||{},bt=vt.height,gt=void 0===bt?0:bt,yt=vt.width,wt=void 0===yt?0:yt,Ot=ut,xt=ft,Pt={top:"bottom",bottom:"top",left:"right",right:"left"};for(_&&(ut+=it,ft+="top"===Q?-R:A,h&&(gt=11,wt=20)),tt&&(ut+="left"===Q?-W:z,ft+=lt,h&&(gt=20,wt=11));pt;)ht.push(pt),jt(b(pt,S,N)),pt=g(pt.parentNode);if(jt({top:N,bottom:N+F,left:S,right:S+J,height:F,width:J}),_&&(ft+="bottom"===et?u:-u),tt&&(ut+="right"===et?p:-p),ut-=st,ft-=dt,x=Pt[et],mt)_&&((j=z<W)?Ot+=z/2:Ot=ut+W/2,Ot-=wt/2,"bottom"===et&&(xt=ft,ft+=gt),"top"===et&&(xt=(ft-=gt)+R),st<0&&st-it<0&&(j?Ot+=(it-st)/2:z-it+st<W&&(Ot+=(z-it+st-W)/2)),st>0&&st+at>0&&(j?Ot-=(st+at)/2:z-st-at<W&&(Ot-=(z-st-at-W)/2))),tt&&((j=A<R)?xt+=A/2:xt=ft+R/2,xt-=gt/2,"left"===et&&(Ot=(ut-=wt)+W),"right"===et&&(Ot=ut,ut+=wt),dt<0&&dt-lt<0&&(j?xt+=(lt-dt)/2:A-lt+dt<R&&(xt+=(A-lt+dt-R)/2)),dt>0&&dt+ct>0&&(j?xt-=(dt+ct)/2:A-dt-ct<R&&(xt-=(A-dt-ct-R)/2))),mt.setAttribute("direction",x),mt.style.height=gt+"px",mt.style.width=wt+"px",mt.style.transform=rt(Ot,xt),mt.style.visibility="visible",mt.style.zIndex=w+1;V.style.transform=rt(ut,ft);var Et={popper:{top:ft,bottom:ft+R,left:ut,right:ut+W,height:R,width:W},element:{top:C,bottom:X,left:L,right:I,height:A,width:z},arrow:{top:xt,bottom:xt+gt,left:Ot,right:Ot+wt,height:gt,width:wt,direction:x},position:et+"-"+(0!==st?"auto":Z),scroll:{scrollLeft:S,scrollTop:N},scrollableParents:ht,event:n};n||v.forEach((function(t){t({popper:V,arrow:mt,data:f(f({},Et),{},{getTransform:rt,mirror:Pt})})})),V.style.visibility="visible","function"==typeof O&&O(Et)}function jt(t){var e=t.top,r=t.bottom,o=t.left,n=t.right,i=t.height,c=t.width;if(_){var f=Math.round(C-e+A/2),s=Math.round(i/2);a||(C-(R+u+gt)<e&&f<=s&&"top"===et?(ft+=R+A,et="bottom"):X+R+u+gt>i+e&&f>=s&&"bottom"===et&&(ft-=R+A,et="top")),l||(L+it<o&&(st=y(I-wt>o?L+it-o:-z+it+wt,st)),I-at>n&&(st=y(L+wt<n?I-at-n:z-at-wt,st)))}if(tt){var d=Math.round(L-o+z/2),h=Math.round(c/2);a||(L-(W+p+wt)<o&&d<h&&"left"===et?(ut+=z+W,et="right"):I+W+p+wt>n&&d>h&&"right"===et&&(ut-=z+W,et="left")),l||(C+lt<e&&(dt=y(X-gt>e?C+lt-e:-A+lt+gt,dt)),X-ct>r&&(dt=y(C+gt<r?X-ct-r:A-ct-gt,dt)))}}}function b(t,e,r){if(t){var o=t.getBoundingClientRect(),n=o.top,i=o.left,a=o.width,l=o.height,c=n+r,u=i+e;return{top:c,bottom:c+l,left:u,right:u+a,width:a,height:l}}}function g(t){if(t&&"HTML"!==t.tagName){var e=window.getComputedStyle(t),r=function(t){return["auto","scroll"].includes(t)};return t.clientHeight<t.scrollHeight&&r(e.overflowX)||t.clientWidth<t.scrollWidth&&r(e.overflowY)?t:g(t.parentNode)}}function y(t,e){return Math.round(Math.abs(t))>Math.round(Math.abs(e))?t:e}export{m as default}; |
@@ -0,0 +0,0 @@ declare module "react-element-popper" { |
{ | ||
"name": "react-element-popper", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"description": "A small React component to create a variety of elements that require Popper, such as dropdowns, modals, multiselects, and more.", | ||
@@ -5,0 +5,0 @@ "main": "./build/index.min.js", |
@@ -0,0 +0,0 @@ # ElementPopper |
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
292
39481