@blueprintjs/popover2
Advanced tools
Comparing version 0.11.4 to 0.12.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-popper"),require("resize-observer-polyfill"),require("tslib")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","classnames","react","react-popper","resize-observer-polyfill","tslib"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-popper"),require("resize-observer-polyfill"),require("tslib")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Popover2=t(e.Blueprint.Core,e.classNames,e.React,e.ReactPopper,e.ResizeObserver,e.window))}(self,(function(e,t,n,r,o,s){return function(){"use strict";var i={840:function(e,t,n){n.r(t),n.d(t,{Classes:function(){return r},ContextMenu2:function(){return ue},ContextMenu2ChildrenProps:function(){return p.ContextMenu2ChildrenProps},ContextMenu2ContentProps:function(){return p.ContextMenu2ContentProps},ContextMenu2Props:function(){return p.ContextMenu2Props},ContextMenu2RenderProps:function(){return p.ContextMenu2RenderProps},Errors:function(){return o},IPopover2Props:function(){return a.IPopover2Props},IPopover2SharedProps:function(){return l.IPopover2SharedProps},IPopover2TargetProps:function(){return l.IPopover2TargetProps},ITooltip2Props:function(){return i.ITooltip2Props},Placement:function(){return u.Placement},PlacementOptions:function(){return de},Popover2:function(){return pe},Popover2InteractionKind:function(){return ae},Popover2Props:function(){return a.Popover2Props},Popover2SharedProps:function(){return l.Popover2SharedProps},Popover2TargetProps:function(){return l.Popover2TargetProps},PopperBoundary:function(){return u.Boundary},ResizeSensor2:function(){return ne},ResizeSensor2Props:function(){return s.ResizeSensor2Props},StrictModifierNames:function(){return l.StrictModifierNames},Tooltip2:function(){return ie},Tooltip2Props:function(){return i.Tooltip2Props}});var r={};n.r(r),n.d(r,{CONTEXT_MENU2:function(){return f},CONTEXT_MENU2_BACKDROP:function(){return O},CONTEXT_MENU2_POPOVER2:function(){return P},CONTEXT_MENU2_VIRTUAL_TARGET:function(){return v},POPOVER2:function(){return E},POPOVER2_ARROW:function(){return m},POPOVER2_BACKDROP:function(){return h},POPOVER2_CAPTURING_DISMISS:function(){return _},POPOVER2_CONTENT:function(){return T},POPOVER2_CONTENT_PLACEMENT:function(){return g},POPOVER2_CONTENT_SIZING:function(){return C},POPOVER2_DISMISS:function(){return R},POPOVER2_DISMISS_OVERRIDE:function(){return I},POPOVER2_OPEN:function(){return y},POPOVER2_TARGET:function(){return N},POPOVER2_TRANSITION_CONTAINER:function(){return b},TOOLTIP2:function(){return S},TOOLTIP2_INDICATOR:function(){return M}});var o={};n.r(o),n.d(o,{POPOVER2_HAS_BACKDROP_INTERACTION:function(){return L},POPOVER2_REQUIRES_TARGET:function(){return A},POPOVER2_WARN_DOUBLE_TARGET:function(){return w},POPOVER2_WARN_EMPTY_CONTENT:function(){return B},POPOVER2_WARN_HAS_BACKDROP_INLINE:function(){return V},POPOVER2_WARN_PLACEMENT_AND_POSITION_MUTEX:function(){return k},POPOVER2_WARN_TOO_MANY_CHILDREN:function(){return x},POPOVER2_WARN_UNCONTROLLED_ONINTERACTION:function(){return F}});var s={};n.r(s),n.d(s,{q:function(){return ne}});var i={};n.r(i),n.d(i,{u:function(){return ie}});var a={};n.r(a),n.d(a,{p:function(){return pe},k:function(){return ae}});var p={};n.r(p),n.d(p,{F:function(){return ue}});var l={};n.r(l);var u={};n.r(u);var c=n(669),d=c.Classes.getClassNamespace(),f=d+"-context-menu2",v=f+"-virtual-target",P=f+"-popover2",O=f+"-backdrop",E=d+"-popover2",m=E+"-arrow",h=E+"-backdrop",_=E+"-capturing-dismiss",T=E+"-content",g=E+"-placement",C=T+"-sizing",R=E+"-dismiss",I=R+"-override",y=E+"-open",N=E+"-target",b=E+"-transition-container",S=d+"-tooltip2",M=S+"-indicator",D="[Blueprint]",A=D+" <Popover2> requires renderTarget prop or a child element.",L=D+' <Popover2 hasBackdrop={true}> requires interactionKind="click".',x=D+" <Popover2> supports only one child which is rendered as its target; additional children are ignored.",w=D+" <Popover2> with children ignores renderTarget prop; use either prop or children.",B=D+" Disabling <Popover2> with empty/whitespace content...",V=D+" <Popover2 usePortal={false}> ignores hasBackdrop",k=D+" <Popover2> supports either placement or position prop, not both.",F=D+" <Popover2> onInteraction is ignored when uncontrolled.",K=n(770),U=n(957),H=n.n(U),G=n(888),q=n(72);function z(e){return e.split("-")[0]}function Y(e){return-1!==["left","right"].indexOf(e)}function j(e){switch(e){case"top":return"bottom";case"left":return"right";case"bottom":return"top";default:return"left"}}function X(e){switch(e.split("-")[1]){case"start":return"left";case"end":return"right";default:return"center"}}function W(e,t){var n=z(e);return void 0===t?Y(n)?j(n)+" "+X(n):X(n)+" "+j(n):Y(n)?j(n)+" "+(parseInt(t.top,10)+15)+"px":parseInt(t.left,10)+15+"px "+j(n)}function Q(e){if(null==e)return 0;switch(z(e)){case"top":return-90;case"left":return 180;case"bottom":return 90;default:return 0}}function Z(e){switch(z(e)){case"top":return{bottom:-11};case"left":return{right:-11};case"bottom":return{top:-11};default:return{left:-11}}}var J=function(e){var t=e.arrowProps,n=t.ref,r=t.style,o=e.placement;return G.createElement("div",{className:m,"data-popper-arrow":!0,ref:n,style:(0,K.__assign)((0,K.__assign)({},r),Z(o))},G.createElement("svg",{viewBox:"0 0 30 30",style:{transform:"rotate("+Q(o)+"deg)"}},G.createElement("path",{className:m+"-border",d:"M8.11 6.302c1.015-.936 1.887-2.922 1.887-4.297v26c0-1.378-.868-3.357-1.888-4.297L.925 17.09c-1.237-1.14-1.233-3.034 0-4.17L8.11 6.302z"}),G.createElement("path",{className:m+"-fill",d:"M8.787 7.036c1.22-1.125 2.21-3.376 2.21-5.03V0v30-2.005c0-1.654-.983-3.9-2.21-5.03l-7.183-6.616c-.81-.746-.802-1.96 0-2.7l7.183-6.614z"})))};function $(e){switch(e){case c.PopoverPosition.TOP_LEFT:return"top-start";case c.PopoverPosition.TOP:return"top";case c.PopoverPosition.TOP_RIGHT:return"top-end";case c.PopoverPosition.RIGHT_TOP:return"right-start";case c.PopoverPosition.RIGHT:return"right";case c.PopoverPosition.RIGHT_BOTTOM:return"right-end";case c.PopoverPosition.BOTTOM_RIGHT:return"bottom-end";case c.PopoverPosition.BOTTOM:return"bottom";case c.PopoverPosition.BOTTOM_LEFT:return"bottom-start";case c.PopoverPosition.LEFT_BOTTOM:return"left-end";case c.PopoverPosition.LEFT:return"left";case c.PopoverPosition.LEFT_TOP:return"left-start";case"auto":case"auto-start":case"auto-end":return e;default:return function(e){throw new Error("Unexpected position: "+e)}(e)}}J.displayName=c.DISPLAYNAME_PREFIX+".Popover2Arrow";var ee=n(1),te=n.n(ee),ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.targetRef=G.createRef(),t.prevElement=void 0,t.observer=new(te())((function(e){var n,r;return null===(r=(n=t.props).onResize)||void 0===r?void 0:r.call(n,e)})),t}return(0,K.__extends)(t,e),t.prototype.render=function(){var e=G.Children.only(this.props.children);return void 0!==this.props.targetRef?e:G.cloneElement(e,{ref:this.targetRef})},t.prototype.componentDidMount=function(){this.observeElement()},t.prototype.componentDidUpdate=function(e){this.observeElement(this.props.observeParents!==e.observeParents)},t.prototype.componentWillUnmount=function(){this.observer.disconnect()},t.prototype.observeElement=function(e){if(void 0===e&&(e=!1),this.targetRef.current instanceof Element){if((this.targetRef.current!==this.prevElement||e)&&(this.observer.disconnect(),this.prevElement=this.targetRef.current,this.observer.observe(this.targetRef.current),this.props.observeParents))for(var t=this.targetRef.current.parentElement;null!=t;)this.observer.observe(t),t=t.parentElement}else this.observer.disconnect()},t.displayName=c.DISPLAYNAME_PREFIX+".ResizeSensor2",t}(c.AbstractPureComponent2),re=G.createContext([{},function(){return null}]),oe=function(e,t){switch(t.type){case"FORCE_DISABLED_STATE":return{forceDisabled:!0};case"RESET_DISABLED_STATE":return{};default:return e}},se=function(e){var t=e.children,n=e.forceDisable,r=G.useReducer(oe,{}),o=r[0],s=r[1];return G.useEffect((function(){s(n?{type:"FORCE_DISABLED_STATE"}:{type:"RESET_DISABLED_STATE"})}),[n]),G.createElement(re.Provider,{value:[o,s]},"function"==typeof t?t(o):t)},ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.popover=null,t.renderPopover=function(e){var n,r,o=t.props,s=o.children,i=o.disabled,a=o.intent,p=o.popoverClassName,l=(0,K.__rest)(o,["children","disabled","intent","popoverClassName"]),u=H()(S,((n={})[c.Classes.MINIMAL]=t.props.minimal,n),c.Classes.intentClass(a),p);return G.createElement(pe,(0,K.__assign)({interactionKind:ae.HOVER_TARGET_ONLY,modifiers:{arrow:{enabled:!t.props.minimal},offset:{options:{offset:[0,11]}}}},l,{autoFocus:!1,canEscapeKeyClose:!1,disabled:null!==(r=e.forceDisabled)&&void 0!==r?r:i,enforceFocus:!1,lazy:!0,popoverClassName:u,portalContainer:t.props.portalContainer,ref:function(e){return t.popover=e}}),s)},t}return(0,K.__extends)(t,e),t.prototype.render=function(){var e=this;return G.createElement(re.Consumer,null,(function(t){var n=t[0];return G.createElement(se,(0,K.__assign)({},n),e.renderPopover)}))},t.prototype.reposition=function(){null!=this.popover&&this.popover.reposition()},t.displayName=c.DISPLAYNAME_PREFIX+".Tooltip2",t.defaultProps={hoverCloseDelay:0,hoverOpenDelay:100,minimal:!1,transitionDuration:100},t}(G.PureComponent),ae={CLICK:"click",CLICK_TARGET_ONLY:"click-target",HOVER:"hover",HOVER_TARGET_ONLY:"hover-target"},pe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hasDarkParent:!1,isOpen:t.getIsOpen(t.props)},t.popoverElement=null,t.targetElement=null,t.popoverRef=(0,c.refHandler)(t,"popoverElement",t.props.popoverRef),t.targetRef=function(e){return t.targetElement=e},t.isMouseInTargetOrPopover=!1,t.lostFocusOnSamePage=!0,t.isControlled=function(){return void 0!==t.props.isOpen},t.isArrowEnabled=function(){var e,n;return!t.props.minimal&&!1!==(null===(n=null===(e=t.props.modifiers)||void 0===e?void 0:e.arrow)||void 0===n?void 0:n.enabled)},t.isHoverInteractionKind=function(){return t.props.interactionKind===ae.HOVER||t.props.interactionKind===ae.HOVER_TARGET_ONLY},t.reposition=function(){var e;return null===(e=t.popperScheduleUpdate)||void 0===e?void 0:e.call(t)},t.renderTarget=function(e){var n,r,o,s=e.ref,i=t.props,a=i.children,p=i.className,l=i.fill,u=i.openOnTargetFocus,d=i.renderTarget,f=t.state.isOpen,v=t.isControlled(),P=t.isHoverInteractionKind(),O=t.props.targetTagName;l&&(O="div");var E,m=(0,c.mergeRefs)(s,t.targetRef),h=P?{onBlur:t.handleTargetBlur,onContextMenu:t.handleTargetContextMenu,onFocus:t.handleTargetFocus,onMouseEnter:t.handleMouseEnter,onMouseLeave:t.handleMouseLeave}:{onClick:t.handleTargetClick},_=u&&P?0:void 0,T=(0,K.__assign)({"aria-haspopup":"true",className:H()(p,N,(n={},n[y]=f,n[c.Classes.ACTIVE]=!v&&f&&!P,n)),ref:m},h);if(void 0!==d)E=d((0,K.__assign)((0,K.__assign)({},T),{isOpen:f,tabIndex:_}));else{var g=c.Utils.ensureElement(G.Children.toArray(a)[0]);if(void 0===g)return null;var C=((r={})[c.Classes.ACTIVE]=f&&!v&&!P,r[c.Classes.FILL]=l,r),R=G.cloneElement(g,{className:H()(g.props.className,C),disabled:!(!f||!c.Utils.isElementOfType(g,ie))||g.props.disabled,tabIndex:null!==(o=g.props.tabIndex)&&void 0!==o?o:_});E=G.createElement(O,T,R)}return G.createElement(ne,{targetRef:m,onResize:t.reposition},E)},t.renderPopover=function(e){var n,r=t.props,o=r.interactionKind,s=r.usePortal,i=t.state.isOpen,a=W(e.placement,t.isArrowEnabled()?e.arrowProps.style:void 0);t.popperScheduleUpdate=e.update;var p={onClick:t.handlePopoverClick};(o===ae.HOVER||!s&&o===ae.HOVER_TARGET_ONLY)&&(p.onMouseEnter=t.handleMouseEnter,p.onMouseLeave=t.handleMouseLeave);var l=z(e.placement),u=H()(E,((n={})[c.Classes.DARK]=t.props.inheritDarkTheme&&t.state.hasDarkParent,n[c.Classes.MINIMAL]=t.props.minimal,n[_]=t.props.captureDismiss,n),g+"-"+l,t.props.popoverClassName);return G.createElement(c.Overlay,{autoFocus:t.props.autoFocus,backdropClassName:h,backdropProps:t.props.backdropProps,canEscapeKeyClose:t.props.canEscapeKeyClose,canOutsideClickClose:t.props.interactionKind===ae.CLICK,enforceFocus:t.props.enforceFocus,hasBackdrop:t.props.hasBackdrop,isOpen:i,onClose:t.handleOverlayClose,onClosed:t.props.onClosed,onClosing:t.props.onClosing,onOpened:t.props.onOpened,onOpening:t.props.onOpening,transitionDuration:t.props.transitionDuration,transitionName:E,usePortal:t.props.usePortal,portalClassName:t.props.portalClassName,portalContainer:t.props.portalContainer},G.createElement("div",{className:b,ref:e.ref,style:e.style},G.createElement(ne,{onResize:t.reposition},G.createElement("div",(0,K.__assign)({className:u,style:{transformOrigin:a},ref:t.popoverRef},p),t.isArrowEnabled()&&G.createElement(J,{arrowProps:e.arrowProps,placement:e.placement}),G.createElement("div",{className:T},t.props.content)))))},t.handleTargetFocus=function(e){if(t.props.openOnTargetFocus&&t.isHoverInteractionKind()){if(null==e.relatedTarget&&!t.lostFocusOnSamePage)return;t.handleMouseEnter(e)}},t.handleTargetBlur=function(e){t.props.openOnTargetFocus&&t.isHoverInteractionKind()&&(null==e.relatedTarget||t.isElementInPopover(e.relatedTarget)||t.handleMouseLeave(e)),t.lostFocusOnSamePage=null!=e.relatedTarget},t.handleTargetContextMenu=function(e){e.defaultPrevented&&t.setOpenState(!1,e)},t.handleMouseEnter=function(e){t.isMouseInTargetOrPopover=!0,t.props.usePortal||!t.isElementInPopover(e.target)||t.props.interactionKind!==ae.HOVER_TARGET_ONLY||t.props.openOnTargetFocus?t.props.disabled||t.setOpenState(!0,e,t.props.hoverOpenDelay):t.handleMouseLeave(e)},t.handleMouseLeave=function(e){t.isMouseInTargetOrPopover=!1,t.setTimeout((function(){t.isMouseInTargetOrPopover||t.setOpenState(!1,e,t.props.hoverCloseDelay)}))},t.handlePopoverClick=function(e){var n,r,o,s,i=e.target,a=i.closest("."+E),p=i.closest("."+c.Classes.POPOVER),l=(null!=a?a:p)===t.getPopoverElement(),u=null!==(r=null!==(n=null==a?void 0:a.classList.contains(_))&&void 0!==n?n:null==p?void 0:p.classList.contains(c.Classes.POPOVER_CAPTURING_DISMISS))&&void 0!==r&&r,d=i.closest("."+R+", ."+I),f=i.closest("."+c.Classes.POPOVER_DISMISS+", ."+c.Classes.POPOVER_DISMISS_OVERRIDE),v=null!==(s=null!==(o=null==d?void 0:d.classList.contains(R))&&void 0!==o?o:null==f?void 0:f.classList.contains(c.Classes.POPOVER_DISMISS))&&void 0!==s&&s,P=null!=i.closest(":disabled, ."+c.Classes.DISABLED);!v||P||u&&!l||t.setOpenState(!1,e)},t.handleOverlayClose=function(e){if(null!==t.targetElement&&void 0!==e){var n=e.target;(!c.Utils.elementIsOrContains(t.targetElement,n)||e.nativeEvent instanceof KeyboardEvent)&&t.setOpenState(!1,e)}},t.handleTargetClick=function(e){t.props.disabled||t.isElementInPopover(e.target)||(null==t.props.isOpen?t.setState((function(e){return{isOpen:!e.isOpen}})):t.setOpenState(!t.props.isOpen,e))},t}return(0,K.__extends)(t,e),t.prototype.getPopoverElement=function(){var e;return null===(e=this.popoverElement)||void 0===e?void 0:e.querySelector("."+E)},t.prototype.getIsOpen=function(e){var t;return!e.disabled&&(null!==(t=e.isOpen)&&void 0!==t?t:e.defaultIsOpen)},t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.content,r=e.placement,o=e.position,s=void 0===o?"auto":o,i=e.positioningStrategy,a=this.state.isOpen;return null==n||"string"==typeof n&&""===n.trim()?(t||!1===a||c.Utils.isNodeEnv("production")||console.warn(B),this.renderTarget({ref:le})):G.createElement(q.Manager,null,G.createElement(q.Reference,null,this.renderTarget),G.createElement(q.Popper,{innerRef:this.popoverRef,placement:null!=r?r:$(s),strategy:i,modifiers:this.getPopperModifiers()},this.renderPopover))},t.prototype.componentDidMount=function(){this.updateDarkParent()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateDarkParent();var r=this.getIsOpen(this.props);null!=this.props.isOpen&&r!==this.state.isOpen?(this.setOpenState(r),this.setState({isOpen:r})):this.props.disabled&&this.state.isOpen&&null==this.props.isOpen&&this.setOpenState(!1)},t.prototype.validateProps=function(e){null==e.isOpen&&null!=e.onInteraction&&console.warn(F),e.hasBackdrop&&!e.usePortal&&console.warn(V),e.hasBackdrop&&e.interactionKind!==ae.CLICK&&console.warn(L),void 0!==e.placement&&void 0!==e.position&&console.warn(k);var t=G.Children.count(e.children),n=void 0!==e.renderTarget;0!==t||n||console.warn(A),t>1&&console.warn(x),t>0&&n&&console.warn(w)},t.prototype.getPopperModifiers=function(){var e,t,n,r,o=this.props.modifiers;return[(0,K.__assign)({enabled:this.isArrowEnabled(),name:"arrow"},null==o?void 0:o.arrow),(0,K.__assign)((0,K.__assign)({name:"computeStyles"},null==o?void 0:o.computeStyles),{options:(0,K.__assign)({adaptive:!0,gpuAcceleration:!1},null===(e=null==o?void 0:o.computeStyles)||void 0===e?void 0:e.options)}),(0,K.__assign)((0,K.__assign)({enabled:this.isArrowEnabled(),name:"offset"},null==o?void 0:o.offset),{options:(0,K.__assign)({offset:[0,15]},null===(t=null==o?void 0:o.offset)||void 0===t?void 0:t.options)}),(0,K.__assign)((0,K.__assign)({name:"flip"},null==o?void 0:o.flip),{options:(0,K.__assign)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(n=null==o?void 0:o.flip)||void 0===n?void 0:n.options)}),(0,K.__assign)((0,K.__assign)({name:"preventOverflow"},null==o?void 0:o.preventOverflow),{options:(0,K.__assign)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(r=null==o?void 0:o.preventOverflow)||void 0===r?void 0:r.options)})]},t.prototype.setOpenState=function(e,t,n){var r,o,s,i,a,p=this;null===(r=this.cancelOpenTimeout)||void 0===r||r.call(this),void 0!==n&&n>0?this.cancelOpenTimeout=this.setTimeout((function(){return p.setOpenState(e,t)}),n):(null==this.props.isOpen?this.setState({isOpen:e}):null===(s=(o=this.props).onInteraction)||void 0===s||s.call(o,e,t),e||null===(a=(i=this.props).onClose)||void 0===a||a.call(i,t))},t.prototype.updateDarkParent=function(){if(this.props.usePortal&&this.state.isOpen){var e=null!=this.targetElement&&null!=this.targetElement.closest("."+c.Classes.DARK);this.setState({hasDarkParent:e})}},t.prototype.isElementInPopover=function(e){var t,n;return null!==(n=null===(t=this.getPopoverElement())||void 0===t?void 0:t.contains(e))&&void 0!==n&&n},t.displayName=c.DISPLAYNAME_PREFIX+".Popover2",t.defaultProps={boundary:"clippingParents",captureDismiss:!1,defaultIsOpen:!1,disabled:!1,fill:!1,hasBackdrop:!1,hoverCloseDelay:300,hoverOpenDelay:150,inheritDarkTheme:!0,interactionKind:ae.CLICK,minimal:!1,openOnTargetFocus:!0,positioningStrategy:"absolute",renderTarget:void 0,targetTagName:"span",transitionDuration:300,usePortal:!0},t}(c.AbstractPureComponent2);function le(){}var ue=G.forwardRef((function(e,t){var n,r,o=e.className,s=e.children,i=e.content,a=e.disabled,p=void 0!==a&&a,l=e.onContextMenu,u=e.popoverProps,d=e.tagName,E=void 0===d?"div":d,m=(0,K.__rest)(e,["className","children","content","disabled","onContextMenu","popoverProps","tagName"]),h=G.useContext(re)[1],_=G.useState(void 0),T=_[0],g=_[1],C=G.useState(),R=C[0],I=C[1],y=G.useState(!1),N=y[0],b=y[1],S=G.useRef(null);G.useEffect((function(){b(!1),h({type:"RESET_DISABLED_STATE"})}),[p]);var M=G.useCallback((function(e){return e.preventDefault()}),[]),D=G.useCallback((function(e){e||(b(!1),I(void 0),h({type:"RESET_DISABLED_STATE"}))}),[]),A=G.useCallback((function(e){var t=e.ref;return G.createElement(c.Portal,null,G.createElement("div",{className:v,style:T,ref:t}))}),[T]),L=G.useMemo((function(){return c.Utils.isDarkTheme(S.current)}),[S,N]),x={isOpen:N,mouseEvent:R,targetOffset:T},w=p?void 0:c.Utils.isFunction(i)?i(x):i,B=void 0===w?void 0:G.createElement(pe,(0,K.__assign)({},u,{content:G.createElement("div",{onContextMenu:M},w),enforceFocus:!1,key:ce(T),hasBackdrop:!0,backdropProps:{className:O},isOpen:N,minimal:!0,onInteraction:D,popoverClassName:H()(P,null==u?void 0:u.popoverClassName,(n={},n[c.Classes.DARK]=L,n)),placement:"right-start",positioningStrategy:"fixed",rootBoundary:"viewport",renderTarget:A,transitionDuration:null!==(r=null==u?void 0:u.transitionDuration)&&void 0!==r?r:100})),V=G.useCallback((function(e){e.defaultPrevented||(!p&&(c.Utils.isFunction(s)||void 0!==B)&&(e.preventDefault(),e.persist(),I(e),g({left:e.clientX,top:e.clientY}),b(!0),h({type:"FORCE_DISABLED_STATE"})),null==l||l(e))}),[l,p]),k=H()(o,f),F=c.Utils.isFunction(s)?s({className:k,contentProps:x,onContextMenu:V,popover:B,ref:S}):G.createElement(G.Fragment,null,B,G.createElement(E,(0,K.__assign)({className:k,onContextMenu:V,ref:(0,c.mergeRefs)(S,t)},m),s));return G.createElement(se,{forceDisable:N},F)}));function ce(e){return void 0===e?"default":e.left+"x"+e.top}ue.displayName="Blueprint.ContextMenu2";var de=[].concat(["top","bottom","right","left"],["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[])},669:function(t){t.exports=e},957:function(e){e.exports=t},888:function(e){e.exports=n},72:function(e){e.exports=r},1:function(e){e.exports=o},770:function(e){e.exports=s}},a={};function p(e){if(a[e])return a[e].exports;var t=a[e]={exports:{}};return i[e](t,t.exports,p),t.exports}return p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p(840)}()})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-popper"),require("resize-observer-polyfill"),require("tslib")):"function"==typeof define&&define.amd?define(["@blueprintjs/core","classnames","react","react-popper","resize-observer-polyfill","tslib"],t):"object"==typeof exports?exports.Blueprint=t(require("@blueprintjs/core"),require("classnames"),require("react"),require("react-popper"),require("resize-observer-polyfill"),require("tslib")):(e.Blueprint=e.Blueprint||{},e.Blueprint.Popover2=t(e.Blueprint.Core,e.classNames,e.React,e.ReactPopper,e.ResizeObserver,e.window))}(self,(function(e,t,n,r,o,s){return function(){"use strict";var i={840:function(e,t,n){n.r(t),n.d(t,{Classes:function(){return r},ContextMenu2:function(){return ue},ContextMenu2ChildrenProps:function(){return p.ContextMenu2ChildrenProps},ContextMenu2ContentProps:function(){return p.ContextMenu2ContentProps},ContextMenu2Props:function(){return p.ContextMenu2Props},ContextMenu2RenderProps:function(){return p.ContextMenu2RenderProps},Errors:function(){return o},IPopover2Props:function(){return a.IPopover2Props},IPopover2SharedProps:function(){return l.IPopover2SharedProps},IPopover2TargetProps:function(){return l.IPopover2TargetProps},ITooltip2Props:function(){return i.ITooltip2Props},Placement:function(){return u.Placement},PlacementOptions:function(){return de},Popover2:function(){return pe},Popover2InteractionKind:function(){return ae},Popover2Props:function(){return a.Popover2Props},Popover2SharedProps:function(){return l.Popover2SharedProps},Popover2TargetProps:function(){return l.Popover2TargetProps},PopperBoundary:function(){return u.Boundary},ResizeSensor2:function(){return ne},ResizeSensor2Props:function(){return s.ResizeSensor2Props},StrictModifierNames:function(){return l.StrictModifierNames},Tooltip2:function(){return ie},Tooltip2Props:function(){return i.Tooltip2Props}});var r={};n.r(r),n.d(r,{CONTEXT_MENU2:function(){return f},CONTEXT_MENU2_BACKDROP:function(){return O},CONTEXT_MENU2_POPOVER2:function(){return P},CONTEXT_MENU2_VIRTUAL_TARGET:function(){return v},POPOVER2:function(){return E},POPOVER2_ARROW:function(){return m},POPOVER2_BACKDROP:function(){return h},POPOVER2_CAPTURING_DISMISS:function(){return T},POPOVER2_CONTENT:function(){return _},POPOVER2_CONTENT_PLACEMENT:function(){return g},POPOVER2_CONTENT_SIZING:function(){return C},POPOVER2_DISMISS:function(){return R},POPOVER2_DISMISS_OVERRIDE:function(){return I},POPOVER2_OPEN:function(){return y},POPOVER2_TARGET:function(){return b},POPOVER2_TRANSITION_CONTAINER:function(){return N},TOOLTIP2:function(){return S},TOOLTIP2_INDICATOR:function(){return D}});var o={};n.r(o),n.d(o,{POPOVER2_HAS_BACKDROP_INTERACTION:function(){return L},POPOVER2_REQUIRES_TARGET:function(){return A},POPOVER2_WARN_DOUBLE_TARGET:function(){return x},POPOVER2_WARN_EMPTY_CONTENT:function(){return k},POPOVER2_WARN_HAS_BACKDROP_INLINE:function(){return B},POPOVER2_WARN_PLACEMENT_AND_POSITION_MUTEX:function(){return V},POPOVER2_WARN_TOO_MANY_CHILDREN:function(){return w},POPOVER2_WARN_UNCONTROLLED_ONINTERACTION:function(){return F}});var s={};n.r(s),n.d(s,{q:function(){return ne}});var i={};n.r(i),n.d(i,{u:function(){return ie}});var a={};n.r(a),n.d(a,{p:function(){return pe},k:function(){return ae}});var p={};n.r(p),n.d(p,{F:function(){return ue}});var l={};n.r(l);var u={};n.r(u);var c=n(669),d=c.Classes.getClassNamespace(),f=d+"-context-menu2",v=f+"-virtual-target",P=f+"-popover2",O=f+"-backdrop",E=d+"-popover2",m=E+"-arrow",h=E+"-backdrop",T=E+"-capturing-dismiss",_=E+"-content",g=E+"-placement",C=_+"-sizing",R=E+"-dismiss",I=R+"-override",y=E+"-open",b=E+"-target",N=E+"-transition-container",S=d+"-tooltip2",D=S+"-indicator",M="[Blueprint]",A=M+" <Popover2> requires renderTarget prop or a child element.",L=M+' <Popover2 hasBackdrop={true}> requires interactionKind="click".',w=M+" <Popover2> supports only one child which is rendered as its target; additional children are ignored.",x=M+" <Popover2> with children ignores renderTarget prop; use either prop or children.",k=M+" Disabling <Popover2> with empty/whitespace content...",B=M+" <Popover2 usePortal={false}> ignores hasBackdrop",V=M+" <Popover2> supports either placement or position prop, not both.",F=M+" <Popover2> onInteraction is ignored when uncontrolled.",K=n(770),U=n(957),H=n.n(U),G=n(888),q=n(72);function z(e){return e.split("-")[0]}function Y(e){return-1!==["left","right"].indexOf(e)}function j(e){switch(e){case"top":return"bottom";case"left":return"right";case"bottom":return"top";default:return"left"}}function X(e){switch(e.split("-")[1]){case"start":return"left";case"end":return"right";default:return"center"}}function W(e,t){var n=z(e);return void 0===t?Y(n)?j(n)+" "+X(n):X(n)+" "+j(n):Y(n)?j(n)+" "+(parseInt(t.top,10)+15)+"px":parseInt(t.left,10)+15+"px "+j(n)}function Q(e){if(null==e)return 0;switch(z(e)){case"top":return-90;case"left":return 180;case"bottom":return 90;default:return 0}}function Z(e){switch(z(e)){case"top":return{bottom:-11};case"left":return{right:-11};case"bottom":return{top:-11};default:return{left:-11}}}var J=function(e){var t=e.arrowProps,n=t.ref,r=t.style,o=e.placement;return G.createElement("div",{className:m,"data-popper-arrow":!0,ref:n,style:(0,K.__assign)((0,K.__assign)({},r),Z(o))},G.createElement("svg",{viewBox:"0 0 30 30",style:{transform:"rotate("+Q(o)+"deg)"}},G.createElement("path",{className:m+"-border",d:"M8.11 6.302c1.015-.936 1.887-2.922 1.887-4.297v26c0-1.378-.868-3.357-1.888-4.297L.925 17.09c-1.237-1.14-1.233-3.034 0-4.17L8.11 6.302z"}),G.createElement("path",{className:m+"-fill",d:"M8.787 7.036c1.22-1.125 2.21-3.376 2.21-5.03V0v30-2.005c0-1.654-.983-3.9-2.21-5.03l-7.183-6.616c-.81-.746-.802-1.96 0-2.7l7.183-6.614z"})))};function $(e){switch(e){case c.PopoverPosition.TOP_LEFT:return"top-start";case c.PopoverPosition.TOP:return"top";case c.PopoverPosition.TOP_RIGHT:return"top-end";case c.PopoverPosition.RIGHT_TOP:return"right-start";case c.PopoverPosition.RIGHT:return"right";case c.PopoverPosition.RIGHT_BOTTOM:return"right-end";case c.PopoverPosition.BOTTOM_RIGHT:return"bottom-end";case c.PopoverPosition.BOTTOM:return"bottom";case c.PopoverPosition.BOTTOM_LEFT:return"bottom-start";case c.PopoverPosition.LEFT_BOTTOM:return"left-end";case c.PopoverPosition.LEFT:return"left";case c.PopoverPosition.LEFT_TOP:return"left-start";case"auto":case"auto-start":case"auto-end":return e;default:return function(e){throw new Error("Unexpected position: "+e)}(e)}}J.displayName=c.DISPLAYNAME_PREFIX+".Popover2Arrow";var ee=n(1),te=n.n(ee),ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.targetRef=G.createRef(),t.prevElement=void 0,t.observer=new(te())((function(e){var n,r;return null===(r=(n=t.props).onResize)||void 0===r?void 0:r.call(n,e)})),t}return(0,K.__extends)(t,e),t.prototype.render=function(){var e=G.Children.only(this.props.children);return void 0!==this.props.targetRef?e:G.cloneElement(e,{ref:this.targetRef})},t.prototype.componentDidMount=function(){this.observeElement()},t.prototype.componentDidUpdate=function(e){this.observeElement(this.props.observeParents!==e.observeParents)},t.prototype.componentWillUnmount=function(){this.observer.disconnect()},t.prototype.observeElement=function(e){if(void 0===e&&(e=!1),this.targetRef.current instanceof Element){if((this.targetRef.current!==this.prevElement||e)&&(this.observer.disconnect(),this.prevElement=this.targetRef.current,this.observer.observe(this.targetRef.current),this.props.observeParents))for(var t=this.targetRef.current.parentElement;null!=t;)this.observer.observe(t),t=t.parentElement}else this.observer.disconnect()},t.displayName=c.DISPLAYNAME_PREFIX+".ResizeSensor2",t}(c.AbstractPureComponent2),re=G.createContext([{},function(){return null}]),oe=function(e,t){switch(t.type){case"FORCE_DISABLED_STATE":return{forceDisabled:!0};case"RESET_DISABLED_STATE":return{};default:return e}},se=function(e){var t=e.children,n=e.forceDisable,r=G.useReducer(oe,{}),o=r[0],s=r[1];return G.useEffect((function(){s(n?{type:"FORCE_DISABLED_STATE"}:{type:"RESET_DISABLED_STATE"})}),[n]),G.createElement(re.Provider,{value:[o,s]},"function"==typeof t?t(o):t)},ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.popover=null,t.renderPopover=function(e){var n,r,o=t.props,s=o.children,i=o.disabled,a=o.intent,p=o.popoverClassName,l=(0,K.__rest)(o,["children","disabled","intent","popoverClassName"]),u=H()(S,((n={})[c.Classes.MINIMAL]=t.props.minimal,n),c.Classes.intentClass(a),p);return G.createElement(pe,(0,K.__assign)({interactionKind:ae.HOVER_TARGET_ONLY,modifiers:{arrow:{enabled:!t.props.minimal},offset:{options:{offset:[0,11]}}}},l,{autoFocus:!1,canEscapeKeyClose:!1,disabled:null!==(r=e.forceDisabled)&&void 0!==r?r:i,enforceFocus:!1,lazy:!0,popoverClassName:u,portalContainer:t.props.portalContainer,ref:function(e){return t.popover=e}}),s)},t}return(0,K.__extends)(t,e),t.prototype.render=function(){var e=this;return G.createElement(re.Consumer,null,(function(t){var n=t[0];return G.createElement(se,(0,K.__assign)({},n),e.renderPopover)}))},t.prototype.reposition=function(){null!=this.popover&&this.popover.reposition()},t.displayName=c.DISPLAYNAME_PREFIX+".Tooltip2",t.defaultProps={hoverCloseDelay:0,hoverOpenDelay:100,minimal:!1,transitionDuration:100},t}(G.PureComponent),ae={CLICK:"click",CLICK_TARGET_ONLY:"click-target",HOVER:"hover",HOVER_TARGET_ONLY:"hover-target"},pe=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hasDarkParent:!1,isOpen:t.getIsOpen(t.props)},t.popoverElement=null,t.targetElement=null,t.popoverRef=(0,c.refHandler)(t,"popoverElement",t.props.popoverRef),t.targetRef=function(e){return t.targetElement=e},t.isMouseInTargetOrPopover=!1,t.lostFocusOnSamePage=!0,t.isControlled=function(){return void 0!==t.props.isOpen},t.isArrowEnabled=function(){var e,n;return!t.props.minimal&&!1!==(null===(n=null===(e=t.props.modifiers)||void 0===e?void 0:e.arrow)||void 0===n?void 0:n.enabled)},t.isHoverInteractionKind=function(){return t.props.interactionKind===ae.HOVER||t.props.interactionKind===ae.HOVER_TARGET_ONLY},t.reposition=function(){var e;return null===(e=t.popperScheduleUpdate)||void 0===e?void 0:e.call(t)},t.renderTarget=function(e){var n,r,o,s=e.ref,i=t.props,a=i.children,p=i.className,l=i.fill,u=i.openOnTargetFocus,d=i.renderTarget,f=t.state.isOpen,v=t.isControlled(),P=t.isHoverInteractionKind(),O=t.props.targetTagName;l&&(O="div");var E,m=(0,c.mergeRefs)(s,t.targetRef),h=P?{onBlur:t.handleTargetBlur,onContextMenu:t.handleTargetContextMenu,onFocus:t.handleTargetFocus,onMouseEnter:t.handleMouseEnter,onMouseLeave:t.handleMouseLeave}:{onClick:t.handleTargetClick,onKeyDown:function(e){return c.Keys.isKeyboardClick(e.keyCode)&&t.handleTargetClick(e)}},T=u&&P?0:void 0,_=(0,K.__assign)({"aria-haspopup":"true",className:H()(p,b,(n={},n[y]=f,n[c.Classes.ACTIVE]=!v&&f&&!P,n)),ref:m},h);if(void 0!==d)E=d((0,K.__assign)((0,K.__assign)({},_),{isOpen:f,tabIndex:T}));else{var g=c.Utils.ensureElement(G.Children.toArray(a)[0]);if(void 0===g)return null;var C=((r={})[c.Classes.ACTIVE]=f&&!v&&!P,r[c.Classes.FILL]=l,r),R=G.cloneElement(g,{className:H()(g.props.className,C),disabled:!(!f||!c.Utils.isElementOfType(g,ie))||g.props.disabled,tabIndex:null!==(o=g.props.tabIndex)&&void 0!==o?o:T});E=G.createElement(O,_,R)}return G.createElement(ne,{targetRef:m,onResize:t.reposition},E)},t.renderPopover=function(e){var n,r=t.props,o=r.interactionKind,s=r.usePortal,i=t.state.isOpen,a=W(e.placement,t.isArrowEnabled()?e.arrowProps.style:void 0);t.popperScheduleUpdate=e.update;var p={onClick:t.handlePopoverClick,onKeyDown:function(e){return c.Keys.isKeyboardClick(e.keyCode)&&t.handlePopoverClick(e)}};(o===ae.HOVER||!s&&o===ae.HOVER_TARGET_ONLY)&&(p.onMouseEnter=t.handleMouseEnter,p.onMouseLeave=t.handleMouseLeave);var l=z(e.placement),u=H()(E,((n={})[c.Classes.DARK]=t.props.inheritDarkTheme&&t.state.hasDarkParent,n[c.Classes.MINIMAL]=t.props.minimal,n[T]=t.props.captureDismiss,n),g+"-"+l,t.props.popoverClassName);return G.createElement(c.Overlay,{autoFocus:t.props.autoFocus,backdropClassName:h,backdropProps:t.props.backdropProps,canEscapeKeyClose:t.props.canEscapeKeyClose,canOutsideClickClose:t.props.interactionKind===ae.CLICK,enforceFocus:t.props.enforceFocus,hasBackdrop:t.props.hasBackdrop,isOpen:i,onClose:t.handleOverlayClose,onClosed:t.props.onClosed,onClosing:t.props.onClosing,onOpened:t.props.onOpened,onOpening:t.props.onOpening,transitionDuration:t.props.transitionDuration,transitionName:E,usePortal:t.props.usePortal,portalClassName:t.props.portalClassName,portalContainer:t.props.portalContainer},G.createElement("div",{className:N,ref:e.ref,style:e.style},G.createElement(ne,{onResize:t.reposition},G.createElement("div",(0,K.__assign)({className:u,style:{transformOrigin:a},ref:t.popoverRef},p),t.isArrowEnabled()&&G.createElement(J,{arrowProps:e.arrowProps,placement:e.placement}),G.createElement("div",{className:_},t.props.content)))))},t.handleTargetFocus=function(e){if(t.props.openOnTargetFocus&&t.isHoverInteractionKind()){if(null==e.relatedTarget&&!t.lostFocusOnSamePage)return;t.handleMouseEnter(e)}},t.handleTargetBlur=function(e){t.props.openOnTargetFocus&&t.isHoverInteractionKind()&&(null==e.relatedTarget||t.isElementInPopover(e.relatedTarget)||t.handleMouseLeave(e)),t.lostFocusOnSamePage=null!=e.relatedTarget},t.handleTargetContextMenu=function(e){e.defaultPrevented&&t.setOpenState(!1,e)},t.handleMouseEnter=function(e){t.isMouseInTargetOrPopover=!0,t.props.usePortal||!t.isElementInPopover(e.target)||t.props.interactionKind!==ae.HOVER_TARGET_ONLY||t.props.openOnTargetFocus?t.props.disabled||t.setOpenState(!0,e,t.props.hoverOpenDelay):t.handleMouseLeave(e)},t.handleMouseLeave=function(e){t.isMouseInTargetOrPopover=!1,t.setTimeout((function(){t.isMouseInTargetOrPopover||t.setOpenState(!1,e,t.props.hoverCloseDelay)}))},t.handlePopoverClick=function(e){var n,r,o,s,i=e.target,a=i.closest("."+E),p=i.closest("."+c.Classes.POPOVER),l=(null!=a?a:p)===t.getPopoverElement(),u=null!==(r=null!==(n=null==a?void 0:a.classList.contains(T))&&void 0!==n?n:null==p?void 0:p.classList.contains(c.Classes.POPOVER_CAPTURING_DISMISS))&&void 0!==r&&r,d=i.closest("."+R+", ."+I),f=i.closest("."+c.Classes.POPOVER_DISMISS+", ."+c.Classes.POPOVER_DISMISS_OVERRIDE),v=null!==(s=null!==(o=null==d?void 0:d.classList.contains(R))&&void 0!==o?o:null==f?void 0:f.classList.contains(c.Classes.POPOVER_DISMISS))&&void 0!==s&&s,P=null!=i.closest(":disabled, ."+c.Classes.DISABLED);!v||P||u&&!l||t.setOpenState(!1,e)},t.handleOverlayClose=function(e){if(null!==t.targetElement&&void 0!==e){var n=e.target;(!c.Utils.elementIsOrContains(t.targetElement,n)||e.nativeEvent instanceof KeyboardEvent)&&t.setOpenState(!1,e)}},t.handleTargetClick=function(e){t.props.disabled||t.isElementInPopover(e.target)||(null==t.props.isOpen?t.setState((function(e){return{isOpen:!e.isOpen}})):t.setOpenState(!t.props.isOpen,e))},t}return(0,K.__extends)(t,e),t.prototype.getPopoverElement=function(){var e;return null===(e=this.popoverElement)||void 0===e?void 0:e.querySelector("."+E)},t.prototype.getIsOpen=function(e){var t;return!e.disabled&&(null!==(t=e.isOpen)&&void 0!==t?t:e.defaultIsOpen)},t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.content,r=e.placement,o=e.position,s=void 0===o?"auto":o,i=e.positioningStrategy,a=this.state.isOpen;return null==n||"string"==typeof n&&""===n.trim()?(t||!1===a||c.Utils.isNodeEnv("production")||console.warn(k),this.renderTarget({ref:le})):G.createElement(q.Manager,null,G.createElement(q.Reference,null,this.renderTarget),G.createElement(q.Popper,{innerRef:this.popoverRef,placement:null!=r?r:$(s),strategy:i,modifiers:this.getPopperModifiers()},this.renderPopover))},t.prototype.componentDidMount=function(){this.updateDarkParent()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateDarkParent();var r=this.getIsOpen(this.props);null!=this.props.isOpen&&r!==this.state.isOpen?(this.setOpenState(r),this.setState({isOpen:r})):this.props.disabled&&this.state.isOpen&&null==this.props.isOpen&&this.setOpenState(!1)},t.prototype.validateProps=function(e){null==e.isOpen&&null!=e.onInteraction&&console.warn(F),e.hasBackdrop&&!e.usePortal&&console.warn(B),e.hasBackdrop&&e.interactionKind!==ae.CLICK&&console.warn(L),void 0!==e.placement&&void 0!==e.position&&console.warn(V);var t=G.Children.count(e.children),n=void 0!==e.renderTarget;0!==t||n||console.warn(A),t>1&&console.warn(w),t>0&&n&&console.warn(x)},t.prototype.getPopperModifiers=function(){var e,t,n,r,o=this.props.modifiers;return[(0,K.__assign)({enabled:this.isArrowEnabled(),name:"arrow"},null==o?void 0:o.arrow),(0,K.__assign)((0,K.__assign)({name:"computeStyles"},null==o?void 0:o.computeStyles),{options:(0,K.__assign)({adaptive:!0,gpuAcceleration:!1},null===(e=null==o?void 0:o.computeStyles)||void 0===e?void 0:e.options)}),(0,K.__assign)((0,K.__assign)({enabled:this.isArrowEnabled(),name:"offset"},null==o?void 0:o.offset),{options:(0,K.__assign)({offset:[0,15]},null===(t=null==o?void 0:o.offset)||void 0===t?void 0:t.options)}),(0,K.__assign)((0,K.__assign)({name:"flip"},null==o?void 0:o.flip),{options:(0,K.__assign)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(n=null==o?void 0:o.flip)||void 0===n?void 0:n.options)}),(0,K.__assign)((0,K.__assign)({name:"preventOverflow"},null==o?void 0:o.preventOverflow),{options:(0,K.__assign)({boundary:this.props.boundary,rootBoundary:this.props.rootBoundary},null===(r=null==o?void 0:o.preventOverflow)||void 0===r?void 0:r.options)})]},t.prototype.setOpenState=function(e,t,n){var r,o,s,i,a,p=this;null===(r=this.cancelOpenTimeout)||void 0===r||r.call(this),void 0!==n&&n>0?this.cancelOpenTimeout=this.setTimeout((function(){return p.setOpenState(e,t)}),n):(null==this.props.isOpen?this.setState({isOpen:e}):null===(s=(o=this.props).onInteraction)||void 0===s||s.call(o,e,t),e||null===(a=(i=this.props).onClose)||void 0===a||a.call(i,t))},t.prototype.updateDarkParent=function(){if(this.props.usePortal&&this.state.isOpen){var e=null!=this.targetElement&&null!=this.targetElement.closest("."+c.Classes.DARK);this.setState({hasDarkParent:e})}},t.prototype.isElementInPopover=function(e){var t,n;return null!==(n=null===(t=this.getPopoverElement())||void 0===t?void 0:t.contains(e))&&void 0!==n&&n},t.displayName=c.DISPLAYNAME_PREFIX+".Popover2",t.defaultProps={boundary:"clippingParents",captureDismiss:!1,defaultIsOpen:!1,disabled:!1,fill:!1,hasBackdrop:!1,hoverCloseDelay:300,hoverOpenDelay:150,inheritDarkTheme:!0,interactionKind:ae.CLICK,minimal:!1,openOnTargetFocus:!0,positioningStrategy:"absolute",renderTarget:void 0,targetTagName:"span",transitionDuration:300,usePortal:!0},t}(c.AbstractPureComponent2);function le(){}var ue=G.forwardRef((function(e,t){var n,r,o=e.className,s=e.children,i=e.content,a=e.disabled,p=void 0!==a&&a,l=e.onContextMenu,u=e.popoverProps,d=e.tagName,E=void 0===d?"div":d,m=(0,K.__rest)(e,["className","children","content","disabled","onContextMenu","popoverProps","tagName"]),h=G.useContext(re)[1],T=G.useState(void 0),_=T[0],g=T[1],C=G.useState(),R=C[0],I=C[1],y=G.useState(!1),b=y[0],N=y[1],S=G.useRef(null);G.useEffect((function(){N(!1),h({type:"RESET_DISABLED_STATE"})}),[p]);var D=G.useCallback((function(e){return e.preventDefault()}),[]),M=G.useCallback((function(e){e||(N(!1),I(void 0),h({type:"RESET_DISABLED_STATE"}))}),[]),A=G.useCallback((function(e){var t=e.ref;return G.createElement(c.Portal,null,G.createElement("div",{className:v,style:_,ref:t}))}),[_]),L=G.useMemo((function(){return c.Utils.isDarkTheme(S.current)}),[S,b]),w={isOpen:b,mouseEvent:R,targetOffset:_},x=p?void 0:c.Utils.isFunction(i)?i(w):i,k=void 0===x?void 0:G.createElement(pe,(0,K.__assign)({},u,{content:G.createElement("div",{onContextMenu:D},x),enforceFocus:!1,key:ce(_),hasBackdrop:!0,backdropProps:{className:O},isOpen:b,minimal:!0,onInteraction:M,popoverClassName:H()(P,null==u?void 0:u.popoverClassName,(n={},n[c.Classes.DARK]=L,n)),placement:"right-start",positioningStrategy:"fixed",rootBoundary:"viewport",renderTarget:A,transitionDuration:null!==(r=null==u?void 0:u.transitionDuration)&&void 0!==r?r:100})),B=G.useCallback((function(e){e.defaultPrevented||(!p&&(c.Utils.isFunction(s)||void 0!==k)&&(e.preventDefault(),e.persist(),I(e),g({left:e.clientX,top:e.clientY}),N(!0),h({type:"FORCE_DISABLED_STATE"})),null==l||l(e))}),[l,p]),V=H()(o,f),F=c.Utils.isFunction(s)?s({className:V,contentProps:w,onContextMenu:B,popover:k,ref:S}):G.createElement(G.Fragment,null,k,G.createElement(E,(0,K.__assign)({className:V,onContextMenu:B,ref:(0,c.mergeRefs)(S,t)},m),s));return G.createElement(se,{forceDisable:b},F)}));function ce(e){return void 0===e?"default":e.left+"x"+e.top}ue.displayName="Blueprint.ContextMenu2";var de=[].concat(["top","bottom","right","left"],["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[])},669:function(t){t.exports=e},957:function(e){e.exports=t},888:function(e){e.exports=n},72:function(e){e.exports=r},1:function(e){e.exports=o},770:function(e){e.exports=s}},a={};function p(e){if(a[e])return a[e].exports;var t=a[e]={exports:{}};return i[e](t,t.exports,p),t.exports}return p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p(840)}()})); |
@@ -108,2 +108,7 @@ "use strict"; | ||
onClick: _this.handleTargetClick, | ||
// For keyboard accessibility, trigger the same behavior as a click event upon pressing ENTER/SPACE | ||
onKeyDown: function (event) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
return core_1.Keys.isKeyboardClick(event.keyCode) && _this.handleTargetClick(event); | ||
}, | ||
}; | ||
@@ -162,2 +167,5 @@ // Ensure target is focusable if relevant prop enabled | ||
onClick: _this.handlePopoverClick, | ||
// treat ENTER/SPACE keys the same as a click for accessibility | ||
// eslint-disable-next-line deprecation/deprecation | ||
onKeyDown: function (event) { return core_1.Keys.isKeyboardClick(event.keyCode) && _this.handlePopoverClick(event); }, | ||
}; | ||
@@ -164,0 +172,0 @@ if (interactionKind === exports.Popover2InteractionKind.HOVER || |
@@ -20,3 +20,3 @@ /* | ||
import { Manager, Popper, Reference } from "react-popper"; | ||
import { AbstractPureComponent2, Classes as CoreClasses, DISPLAYNAME_PREFIX, refHandler, mergeRefs, Overlay, Utils, } from "@blueprintjs/core"; | ||
import { AbstractPureComponent2, Classes as CoreClasses, DISPLAYNAME_PREFIX, Keys, refHandler, mergeRefs, Overlay, Utils, } from "@blueprintjs/core"; | ||
import * as Classes from "./classes"; | ||
@@ -106,2 +106,7 @@ import * as Errors from "./errors"; | ||
onClick: _this.handleTargetClick, | ||
// For keyboard accessibility, trigger the same behavior as a click event upon pressing ENTER/SPACE | ||
onKeyDown: function (event) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
return Keys.isKeyboardClick(event.keyCode) && _this.handleTargetClick(event); | ||
}, | ||
}; | ||
@@ -160,2 +165,5 @@ // Ensure target is focusable if relevant prop enabled | ||
onClick: _this.handlePopoverClick, | ||
// treat ENTER/SPACE keys the same as a click for accessibility | ||
// eslint-disable-next-line deprecation/deprecation | ||
onKeyDown: function (event) { return Keys.isKeyboardClick(event.keyCode) && _this.handlePopoverClick(event); }, | ||
}; | ||
@@ -162,0 +170,0 @@ if (interactionKind === Popover2InteractionKind.HOVER || |
@@ -19,3 +19,3 @@ /* | ||
import { Manager, Popper, Reference } from "react-popper"; | ||
import { AbstractPureComponent2, Classes as CoreClasses, DISPLAYNAME_PREFIX, refHandler, mergeRefs, Overlay, Utils, } from "@blueprintjs/core"; | ||
import { AbstractPureComponent2, Classes as CoreClasses, DISPLAYNAME_PREFIX, Keys, refHandler, mergeRefs, Overlay, Utils, } from "@blueprintjs/core"; | ||
import * as Classes from "./classes"; | ||
@@ -101,2 +101,6 @@ import * as Errors from "./errors"; | ||
onClick: this.handleTargetClick, | ||
// For keyboard accessibility, trigger the same behavior as a click event upon pressing ENTER/SPACE | ||
onKeyDown: (event) => | ||
// eslint-disable-next-line deprecation/deprecation | ||
Keys.isKeyboardClick(event.keyCode) && this.handleTargetClick(event), | ||
}; | ||
@@ -161,2 +165,5 @@ // Ensure target is focusable if relevant prop enabled | ||
onClick: this.handlePopoverClick, | ||
// treat ENTER/SPACE keys the same as a click for accessibility | ||
// eslint-disable-next-line deprecation/deprecation | ||
onKeyDown: event => Keys.isKeyboardClick(event.keyCode) && this.handlePopoverClick(event), | ||
}; | ||
@@ -163,0 +170,0 @@ if (interactionKind === Popover2InteractionKind.HOVER || |
{ | ||
"name": "@blueprintjs/popover2", | ||
"version": "0.11.4", | ||
"version": "0.12.0", | ||
"description": "Popover2 and dependent components", | ||
@@ -38,3 +38,3 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@blueprintjs/core": "^3.49.1", | ||
"@blueprintjs/core": "^3.50.0", | ||
"@popperjs/core": "^2.5.4", | ||
@@ -41,0 +41,0 @@ "classnames": "^2.2", |
@@ -232,6 +232,6 @@ @# Popover2 | ||
- `CLICK`: | ||
- **Opens when:** the target is clicked | ||
- **Opens when:** the target is clicked, or when Enter key is pressed while target is focused | ||
- **Closes when:** the user clicks anywhere outside of the popover (including the target) | ||
- `CLICK_TARGET_ONLY`: | ||
- **Opens when:** the target is clicked | ||
- **Opens when:** the target is clicked, or when Enter key is pressed while target is focused | ||
- **Closes when:** the target is clicked | ||
@@ -238,0 +238,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
521853
7115
Updated@blueprintjs/core@^3.50.0