UNPKG

reactjs-popup-47

Version:

React Popup Component - Modals,Tooltips and Menus —  All in one

1 lines 26.5 kB
{"version":3,"file":"reactjs-popup.min.js","sources":["../src/Utils.js","../src/index.css.js","../src/index.js"],"sourcesContent":["/* Algo to calculate position\n 1. center position for popup content : the center of the trigger will be the center of the content content\n so the popup content position will be like this :\n top => the y of the center for the trigger element : trigger.top + trigger.height/2\n left => the x of the center for the trigger element : trigger.left + trigger.width/2\n\n 2. translate position according to the first position attribute passed in the function argument\n for example :\n position = 'left top'\n we need to handle the first argument in the position: 'left' => that's mean we need to translate the popup content according to the X axis by - content.width/2\n\n 3.translate position according to the first position attribute passed in the function argument\n for example :\n position = 'left top'\n the second argument 'top' => translate popup content by + content.height*4/5\n\n 4. check if calculated position is going out of bounds of wrapper box or not. If yes repeat 1-3 for next position enum. By default wrapper box is window element\n*/\n\nfunction getCoordinatesForPosition(\n triggerBounding,\n ContentBounding,\n position,\n arrow,\n {offsetX, offsetY},\n) {\n const margin = arrow ? 8 : 0;\n const args = position.split(' ');\n // the step N 1 : center the popup content => ok\n const CenterTop = triggerBounding.top + triggerBounding.height / 2;\n const CenterLeft = triggerBounding.left + triggerBounding.width / 2;\n const {height, width} = ContentBounding;\n let top = CenterTop - height / 2;\n let left = CenterLeft - width / 2;\n let transform = '';\n let arrowTop = '0%';\n let arrowLeft = '0%';\n // the step N 2 : => ok\n switch (args[0]) {\n case 'top':\n top -= height / 2 + triggerBounding.height / 2 + margin;\n transform = `rotate(45deg)`;\n arrowTop = '100%';\n arrowLeft = '50%';\n break;\n case 'bottom':\n top += height / 2 + triggerBounding.height / 2 + margin;\n transform = `rotate(225deg)`;\n arrowLeft = '50%';\n break;\n case 'left':\n left -= width / 2 + triggerBounding.width / 2 + margin;\n transform = ` rotate(-45deg)`;\n arrowLeft = '100%';\n arrowTop = '50%';\n break;\n case 'right':\n left += width / 2 + triggerBounding.width / 2 + margin;\n transform = `rotate(135deg)`;\n arrowTop = '50%';\n break;\n default:\n }\n switch (args[1]) {\n case 'top':\n top = triggerBounding.top;\n arrowTop = `${triggerBounding.height / 2}px`;\n break;\n case 'bottom':\n top = triggerBounding.top - height + triggerBounding.height;\n arrowTop = `${height - triggerBounding.height / 2}px`;\n break;\n case 'left':\n left = triggerBounding.left;\n arrowLeft = `${triggerBounding.width / 2}px`;\n break;\n case 'right':\n left = triggerBounding.left - width + triggerBounding.width;\n arrowLeft = `${width - triggerBounding.width / 2}px`;\n break;\n default:\n }\n\n top = args[0] === 'top' ? top - offsetY : top + offsetY;\n left = args[0] === 'left' ? left - offsetX : left + offsetX;\n\n return {top, left, transform, arrowLeft, arrowTop};\n}\n\nexport default function calculatePosition(\n triggerBounding,\n ContentBounding,\n positions,\n arrow,\n {offsetX, offsetY},\n wrapperBox,\n) {\n let bestCoords;\n let i = 0;\n while (i < positions.length) {\n bestCoords = getCoordinatesForPosition(\n triggerBounding,\n ContentBounding,\n positions[i],\n arrow,\n {offsetX, offsetY},\n );\n\n const contentBox = {\n top: bestCoords.top,\n left: bestCoords.left,\n width: ContentBounding.width,\n height: ContentBounding.height,\n };\n\n if (\n contentBox.top <= wrapperBox.top ||\n contentBox.left <= wrapperBox.left ||\n contentBox.top + contentBox.height >=\n wrapperBox.top + wrapperBox.height ||\n contentBox.left + contentBox.width >= wrapperBox.left + wrapperBox.width\n ) {\n i++;\n } else {\n break;\n }\n }\n\n return bestCoords;\n}\n","export default {\n popupContent: {\n tooltip: {\n position: 'absolute',\n zIndex: '2',\n width: '200px',\n background: `rgb(255, 255, 255)`,\n border: `1px solid rgb(187, 187, 187)`,\n boxShadow: `rgba(0, 0, 0, 0.2) 0px 1px 3px`,\n padding: '5px',\n },\n modal: {\n position: 'relative',\n background: `rgb(255, 255, 255)`,\n width: '50%',\n margin: 'auto',\n border: `1px solid rgb(187, 187, 187)`,\n padding: '5px',\n },\n },\n popupArrow: {\n height: '10px',\n width: '10px',\n position: 'absolute',\n background: 'rgb(255, 255, 255)',\n transform: 'rotate(45deg)',\n margin: '-5px',\n zIndex: '-1',\n boxShadow: 'rgba(0, 0, 0, 0.2) 1px 1px 1px',\n },\n overlay: {\n tooltip: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n },\n modal: {\n position: 'fixed',\n top: '0',\n bottom: '0',\n left: '0',\n right: '0',\n background: `rgba(0, 0, 0,0.5)`,\n display: 'flex',\n zIndex: '999',\n },\n },\n};\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport calculatePosition from \"./Utils\";\nimport styles from \"./index.css.js\";\n\nconst POSITION_TYPES = [\n \"top left\",\n \"top center\",\n \"top right\",\n \"right top\",\n \"right center\",\n \"right bottom\",\n \"bottom left\",\n \"bottom center\",\n \"bottom right\",\n \"left top\",\n \"left center\",\n \"left bottom\",\n \"center center\"\n];\n\nexport default class Popup extends React.PureComponent {\n static defaultProps = {\n trigger: null,\n onOpen: () => {},\n onClose: () => {},\n defaultOpen: false,\n open: false,\n disabled: false,\n closeOnDocumentClick: true,\n repositionOnResize: true,\n closeOnEscape: true,\n on: [\"click\"],\n contentStyle: {},\n arrowStyle: {},\n overlayStyle: {},\n className: \"\",\n position: \"bottom center\",\n modal: false,\n lockScroll: false,\n arrow: true,\n offsetX: 0,\n offsetY: 0,\n popupRootID: \"popupRoot\",\n mouseEnterDelay: 100,\n mouseLeaveDelay: 100,\n keepTooltipInside: false\n };\n\n constructor(props) {\n super(props);\n this.setTriggerRef = r => (this.TriggerEl = r);\n this.setContentRef = r => (this.ContentEl = r);\n this.setArrowRef = r => (this.ArrowEl = r);\n this.setHelperRef = r => (this.HelperEl = r);\n this.timeOut = 0;\n const { open, modal, defaultOpen, trigger } = props;\n this.state = {\n isOpen: open || defaultOpen,\n modal: modal ? true : !trigger\n // we create this modal state because the popup can't be a tooltip if the trigger prop doesn't exist\n };\n }\n\n componentDidMount() {\n const { closeOnEscape, defaultOpen, repositionOnResize } = this.props;\n if (defaultOpen) this.setPosition();\n if (closeOnEscape) {\n /* eslint-disable-next-line no-undef */\n window.addEventListener(\"keyup\", this.onEscape);\n }\n if (repositionOnResize) {\n /* eslint-disable-next-line no-undef */\n window.addEventListener(\"resize\", this.repositionOnResize);\n }\n }\n\n componentDidUpdate(prevProps) {\n const { open, disabled } = this.props;\n const { isOpen } = this.state;\n if (prevProps.open !== open) {\n if (open) this.openPopup();\n else this.closePopup(undefined, true);\n }\n if (prevProps.disabled !== disabled && disabled && isOpen) {\n this.closePopup();\n }\n }\n\n componentWillUnmount() {\n // kill any function to execute if the component is unmounted\n clearTimeout(this.timeOut);\n\n const { closeOnEscape, repositionOnResize } = this.props;\n // remove events listeners\n if (closeOnEscape) {\n /* eslint-disable-next-line no-undef */\n window.removeEventListener(\"keyup\", this.onEscape);\n }\n if (repositionOnResize) {\n /* eslint-disable-next-line no-undef */\n window.removeEventListener(\"resize\", this.repositionOnResize);\n }\n this.resetScroll();\n }\n\n repositionOnResize = () => {\n this.setPosition();\n };\n\n onEscape = e => {\n if (e.key === \"Escape\") this.closePopup();\n };\n\n lockScroll = () => {\n const { lockScroll } = this.props;\n const { modal } = this.state;\n if (modal && lockScroll)\n /* eslint-disable-next-line no-undef */\n document.getElementsByTagName(\"body\")[0].style.overflow = \"hidden\";\n };\n\n resetScroll = () => {\n const { lockScroll } = this.props;\n const { modal } = this.state;\n if (modal && lockScroll)\n /* eslint-disable-next-line no-undef */\n document.getElementsByTagName(\"body\")[0].style.overflow = \"auto\";\n };\n\n togglePopup = e => {\n // https://reactjs.org/docs/events.html#event-pooling\n e.persist();\n if (this.state.isOpen) this.closePopup(e);\n else this.openPopup(e);\n };\n\n openPopup = e => {\n const { disabled, onOpen } = this.props;\n const { isOpen } = this.state;\n if (isOpen || disabled) return;\n onOpen(e);\n this.setState({ isOpen: true }, () => {\n this.setPosition();\n this.lockScroll();\n });\n };\n\n closePopup = e => {\n const { onClose } = this.props;\n const { isOpen } = this.state;\n if (!isOpen) return;\n onClose(e);\n this.setState({ isOpen: false }, () => {\n this.resetScroll();\n });\n };\n\n onMouseEnter = () => {\n clearTimeout(this.timeOut);\n const { mouseEnterDelay } = this.props;\n this.timeOut = setTimeout(() => this.openPopup(), mouseEnterDelay);\n };\n\n onMouseLeave = () => {\n clearTimeout(this.timeOut);\n const { mouseLeaveDelay } = this.props;\n this.timeOut = setTimeout(() => this.closePopup(), mouseLeaveDelay);\n };\n\n getTooltipBoundary = () => {\n const { keepTooltipInside } = this.props;\n let boundingBox = {\n top: 0,\n left: 0,\n /* eslint-disable-next-line no-undef */\n width: window.innerWidth,\n /* eslint-disable-next-line no-undef */\n height: window.innerHeight\n };\n if (typeof keepTooltipInside === \"string\") {\n /* eslint-disable-next-line no-undef */\n const selector = document.querySelector(keepTooltipInside);\n if (process.env.NODE_ENV !== \"production\") {\n if (selector === null)\n throw new Error(\n `${keepTooltipInside} selector is not exist : keepTooltipInside must be a valid html selector 'class' or 'Id' or a boolean value`\n );\n }\n boundingBox = selector.getBoundingClientRect();\n }\n return boundingBox;\n };\n\n setPosition = () => {\n const { modal, isOpen } = this.state;\n if (modal || !isOpen) return;\n const {\n arrow,\n position,\n offsetX,\n offsetY,\n keepTooltipInside,\n arrowStyle,\n className\n } = this.props;\n const helper = this.HelperEl.getBoundingClientRect();\n const trigger = this.TriggerEl.getBoundingClientRect();\n const content = this.ContentEl.getBoundingClientRect();\n const boundingBox = this.getTooltipBoundary();\n let positions = Array.isArray(position) ? position : [position];\n\n // keepTooltipInside would be activated if the keepTooltipInside exist or the position is Array\n if (keepTooltipInside || Array.isArray(position))\n positions = [...positions, ...POSITION_TYPES];\n\n const cords = calculatePosition(\n trigger,\n content,\n positions,\n arrow,\n {\n offsetX,\n offsetY\n },\n boundingBox\n );\n this.ContentEl.style.top = `${cords.top - helper.top}px`;\n this.ContentEl.style.left = `${cords.left - helper.left}px`;\n if (arrow) {\n this.ArrowEl.style.transform = cords.transform;\n this.ArrowEl.style[\"-ms-transform\"] = cords.transform;\n this.ArrowEl.style[\"-webkit-transform\"] = cords.transform;\n this.ArrowEl.style.top = arrowStyle.top || cords.arrowTop;\n this.ArrowEl.style.left = arrowStyle.left || cords.arrowLeft;\n this.ArrowEl.classList.add(`popup-arrow`);\n if (className !== \"\") {\n this.ArrowEl.classList.add(`${className}-arrow`);\n }\n }\n if (\n /* eslint-disable-next-line no-undef */\n window\n .getComputedStyle(this.TriggerEl, null)\n .getPropertyValue(\"position\") === \"static\" ||\n /* eslint-disable-next-line no-undef */\n window\n .getComputedStyle(this.TriggerEl, null)\n .getPropertyValue(\"position\") === \"\"\n )\n this.TriggerEl.style.position = \"relative\";\n };\n\n addWarperAction = () => {\n const { contentStyle, className, on } = this.props;\n const { modal } = this.state;\n const popupContentStyle = modal\n ? styles.popupContent.modal\n : styles.popupContent.tooltip;\n\n const childrenElementProps = {\n className: `popup-content ${\n className !== \"\" ? `${className}-content` : \"\"\n }`,\n style: Object.assign({}, popupContentStyle, contentStyle),\n ref: this.setContentRef,\n onClick: e => {\n e.stopPropagation();\n }\n };\n if (!modal && on.indexOf(\"hover\") >= 0) {\n childrenElementProps.onMouseEnter = this.onMouseEnter;\n childrenElementProps.onMouseLeave = this.onMouseLeave;\n }\n return childrenElementProps;\n };\n\n renderTrigger = () => {\n const triggerProps = { key: \"T\", ref: this.setTriggerRef };\n const { on, trigger } = this.props;\n const { isOpen } = this.state;\n const onAsArray = Array.isArray(on) ? on : [on];\n for (let i = 0, len = onAsArray.length; i < len; i++) {\n switch (onAsArray[i]) {\n case \"click\":\n triggerProps.onClick = this.togglePopup;\n break;\n case \"hover\":\n triggerProps.onMouseEnter = this.onMouseEnter;\n triggerProps.onMouseLeave = this.onMouseLeave;\n break;\n case \"focus\":\n triggerProps.onFocus = this.onMouseEnter;\n break;\n default:\n }\n }\n\n if (typeof trigger === \"function\")\n return !!trigger && React.cloneElement(trigger(isOpen), triggerProps);\n\n return !!trigger && React.cloneElement(trigger, triggerProps);\n };\n\n renderContent = () => {\n const { arrow, arrowStyle, children } = this.props;\n const { modal, isOpen } = this.state;\n return (\n <div {...this.addWarperAction()} key=\"C\">\n {arrow &&\n !modal && (\n <div\n ref={this.setArrowRef}\n style={Object.assign({}, styles.popupArrow, arrowStyle)}\n />\n )}\n {typeof children === \"function\"\n ? children(this.closePopup, isOpen)\n : children}\n </div>\n );\n };\n\n render() {\n const {\n overlayStyle,\n closeOnDocumentClick,\n className,\n on,\n trigger\n } = this.props;\n const { modal, isOpen } = this.state;\n const overlay = isOpen && !(on.indexOf(\"hover\") >= 0);\n const ovStyle = modal ? styles.overlay.modal : styles.overlay.tooltip;\n const portalContent = [\n isOpen && (\n <div\n key=\"H\"\n style={{ position: \"absolute\", top: \"0px\", left: \"0px\" }}\n ref={this.setHelperRef}\n />\n ),\n overlay && (\n <div\n key=\"O\"\n className={`popup-overlay ${\n className !== \"\" ? `${className}-overlay` : \"\"\n }`}\n style={Object.assign({}, ovStyle, overlayStyle)}\n onClick={closeOnDocumentClick ? this.closePopup : undefined}\n >\n {modal && this.renderContent()}\n </div>\n ),\n isOpen && !modal && this.renderContent()\n ];\n\n const portalRoot = document.getElementById(this.props.popupRootID);\n const portal = portalRoot\n ? [\n ReactDOM.createPortal(\n portalContent,\n document.getElementById(this.props.popupRootID)\n )\n ]\n : portalContent;\n\n return [this.renderTrigger(), ...portal];\n }\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n const PropTypes = require(\"prop-types\");\n const TRIGGER_TYPES = [\"hover\", \"click\", \"focus\"];\n\n Popup.propTypes = {\n arrowStyle: PropTypes.object,\n contentStyle: PropTypes.object,\n overlayStyle: PropTypes.object,\n className: PropTypes.string,\n modal: PropTypes.bool,\n arrow: PropTypes.bool,\n closeOnDocumentClick: PropTypes.bool,\n repositionOnResize: PropTypes.bool,\n disabled: PropTypes.bool,\n closeOnEscape: PropTypes.bool,\n lockScroll: PropTypes.bool,\n offsetX: PropTypes.number,\n offsetY: PropTypes.number,\n mouseEnterDelay: PropTypes.number,\n mouseLeaveDelay: PropTypes.number,\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n open: PropTypes.bool,\n defaultOpen: PropTypes.bool,\n trigger: PropTypes.oneOfType([PropTypes.func, PropTypes.element]), // for uncontrolled component we don't need the trigger Element\n on: PropTypes.oneOfType([\n PropTypes.oneOf(TRIGGER_TYPES),\n PropTypes.arrayOf(PropTypes.oneOf(TRIGGER_TYPES))\n ]),\n children: PropTypes.oneOfType([\n PropTypes.func,\n PropTypes.element,\n PropTypes.string\n ]).isRequired,\n position: PropTypes.oneOfType([\n PropTypes.oneOf(POSITION_TYPES),\n PropTypes.arrayOf(PropTypes.oneOf(POSITION_TYPES))\n ]),\n keepTooltipInside: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n popupRootID: PropTypes.string\n };\n}\n"],"names":["getCoordinatesForPosition","triggerBounding","ContentBounding","position","arrow","offsetX","offsetY","margin","args","split","CenterTop","top","height","CenterLeft","left","width","transform","arrowTop","arrowLeft","popupContent","tooltip","zIndex","background","border","boxShadow","padding","modal","popupArrow","overlay","bottom","right","display","POSITION_TYPES","Popup","props","setPosition","e","key","_this","closePopup","lockScroll","state","document","getElementsByTagName","style","overflow","persist","isOpen","openPopup","disabled","onOpen","setState","onClose","resetScroll","clearTimeout","timeOut","mouseEnterDelay","setTimeout","mouseLeaveDelay","keepTooltipInside","boundingBox","window","innerWidth","innerHeight","querySelector","getBoundingClientRect","arrowStyle","className","helper","HelperEl","trigger","TriggerEl","content","ContentEl","getTooltipBoundary","positions","Array","isArray","cords","wrapperBox","bestCoords","i","length","contentBox","calculatePosition","ArrowEl","classList","add","getComputedStyle","getPropertyValue","contentStyle","on","popupContentStyle","styles","childrenElementProps","Object","assign","ref","setContentRef","onClick","stopPropagation","indexOf","onMouseEnter","onMouseLeave","triggerProps","setTriggerRef","onAsArray","len","togglePopup","onFocus","React","cloneElement","children","addWarperAction","setArrowRef","r","setHelperRef","open","defaultOpen","PureComponent","this","closeOnEscape","repositionOnResize","addEventListener","onEscape","prevProps","undefined","removeEventListener","overlayStyle","closeOnDocumentClick","ovStyle","portalContent","renderContent","portal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