Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@saleae/react-contexify

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saleae/react-contexify - npm Package Compare versions

Comparing version 4.1.5 to 4.1.6

.vscode/settings.json

4

dist/ReactContexify.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom"],t):"object"==typeof exports?exports.ReactContexify=t(require("react"),require("prop-types"),require("react-dom")):e.ReactContexify=t(e.react,e["prop-types"],e["react-dom"])}(window,function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styles={menu:"react-contexify",submenu:"react-contexify react-contexify__submenu",submenuArrow:"react-contexify__submenu-arrow",separator:"react-contexify__separator",item:"react-contexify__item",itemDisabled:"react-contexify__item--disabled",itemContent:"react-contexify__item__content",itemIcon:"react-contexify__item__icon",theme:"react-contexify__theme--",animationWillEnter:"react-contexify__will-enter--",animationWillLeave:"react-contexify__will-leave--",ignoreClick:"react-contexify__ignore_click"},t.theme={light:"light",dark:"dark"},t.animation={fade:"fade",flip:"flip",pop:"pop",zoom:"zoom"}},function(e,n){e.exports=t},function(e,t,n){var o;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom"],t):"object"==typeof exports?exports.ReactContexify=t(require("react"),require("prop-types"),require("react-dom")):e.ReactContexify=t(e.react,e["prop-types"],e["react-dom"])}(window,function(e,t,n){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.animation=t.theme=t.styles=void 0,t.styles={menu:"react-contexify",submenu:"react-contexify react-contexify__submenu",submenuArrow:"react-contexify__submenu-arrow",separator:"react-contexify__separator",item:"react-contexify__item",itemDisabled:"react-contexify__item--disabled",itemContent:"react-contexify__item__content",itemIcon:"react-contexify__item__icon",theme:"react-contexify__theme--",animationWillEnter:"react-contexify__will-enter--",animationWillLeave:"react-contexify__will-leave--",ignoreClick:"react-contexify__ignore_click"},t.theme={light:"light",dark:"dark"},t.animation={fade:"fade",flip:"flip",pop:"pop",zoom:"zoom"}},function(e,n){e.exports=t},function(e,t,n){var r;
/*!

@@ -12,3 +12,3 @@ Copyright (c) 2017 Jed Watson.

*/
!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var s=r.apply(null,o);s&&e.push(s)}else if("object"===i)for(var a in o)n.call(o,a)&&o[a]&&e.push(a)}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HIDE_ALL=0,t.DISPLAY_MENU=function(e){return"DISPLAY_"+e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={eventList:new Map,on:function(e,t){var n=this;return this.eventList.has(e)||this.eventList.set(e,new Set),this.eventList.get(e).add(t),function(){return n.eventList.get(e).delete(t)}},emit:function(e){for(var t=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return this.eventList.has(e)?(this.eventList.get(e).forEach(function(e){return e.call.apply(e,[t].concat(n))}),!0):(console.warn("<"+e+"> Event is not registered. Did you forgot to bind the event ?"),!1)}};t.eventManager=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.cloneItem=function(e,t){return o.Children.map(o.Children.toArray(e).filter(function(e){return Boolean(e)}),function(e){return o.cloneElement(e,t)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(8);t.Menu=o.Menu;var r=n(11);t.Item=r.Item;var i=n(12);t.Separator=i.Separator;var s=n(13);t.IconFont=s.IconFont;var a=n(14);t.Submenu=a.Submenu;var u=n(15);t.MenuProvider=u.MenuProvider;var l=n(16);t.contextMenu=l.contextMenu;var c=n(1);t.theme=c.theme,t.animation=c.animation},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(0)),l=a(n(2)),c=a(n(3)),d=n(6),f=n(9),p=n(4),h=n(1),v=n(5),y={ENTER:13,ESC:27,ARROW_UP:38,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39},m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={x:0,y:0,visible:!1,nativeEvent:{},propsFromTrigger:{},onShown:null,onHidden:null},t.menuRef=u.default.createRef(),t.unsub=[],t.bindWindowEvent=function(){window.addEventListener("resize",t.hide),window.addEventListener("contextmenu",t.hide),window.addEventListener("mousedown",t.hide),window.addEventListener("click",t.hide),window.addEventListener("scroll",t.hide),window.addEventListener("keydown",t.handleKeyboard)},t.unBindWindowEvent=function(){window.removeEventListener("resize",t.hide),window.removeEventListener("contextmenu",t.hide),window.removeEventListener("mousedown",t.hide),window.removeEventListener("click",t.hide),window.removeEventListener("scroll",t.hide),window.removeEventListener("keydown",t.handleKeyboard)},t.onMouseEnter=function(){return window.removeEventListener("mousedown",t.hide)},t.onMouseLeave=function(){return window.addEventListener("mousedown",t.hide)},t.hide=function(e){var n=e;(void 0===n||2!==n.button&&!0!==n.ctrlKey||"contextmenu"===n.type)&&(e&&"click"===e.type&&e.target.classList.contains(h.styles.ignoreClick)||(t.unBindWindowEvent(),t.setState({visible:!1})))},t.handleKeyboard=function(e){e.keyCode!==y.ENTER&&e.keyCode!==y.ESC||(t.unBindWindowEvent(),t.setState({visible:!1}))},t.show=function(e,n){e.stopPropagation(),v.eventManager.emit(p.HIDE_ALL);var o=t.getMousePosition(e),r=o.x,i=o.y;t.setState({visible:!0,x:r,y:i,nativeEvent:e,propsFromTrigger:n},t.setMenuPosition)},t}return r(t,e),t.prototype.componentDidMount=function(){this.unsub.push(v.eventManager.on(p.DISPLAY_MENU(this.props.id),this.show)),this.unsub.push(v.eventManager.on(p.HIDE_ALL,this.hide))},t.prototype.componentWillUnmount=function(){this.unsub.forEach(function(e){return e()}),this.unBindWindowEvent()},t.prototype.componentDidUpdate=function(e,t){this.state.visible!==t.visible&&(this.state.visible&&this.props.onShown?this.props.onShown():!this.state.visible&&this.props.onHidden&&this.props.onHidden())},t.prototype.setMenuPosition=function(){if(this.menuRef.current){var e=window.innerWidth,t=window.innerHeight,n=this.menuRef.current,o=n.offsetWidth,r=n.offsetHeight,i=this.state,s=i.x,a=i.y;s+o>e&&(s-=s+o-e),a+r>t&&(a-=a+r-t),this.setState({x:s,y:a},this.bindWindowEvent)}},t.prototype.getMousePosition=function(e){var t={x:e.clientX,y:e.clientY};return"touchend"===e.type&&(!t.x||!t.y)&&e.changedTouches&&e.changedTouches.length>0&&(t.x=e.changedTouches[0].clientX,t.y=e.changedTouches[0].clientY),(!t.x||t.x<0)&&(t.x=0),(!t.y||t.y<0)&&(t.y=0),t},t.prototype.render=function(){var e,t=this.props,n=t.theme,o=t.animation,r=t.style,s=t.className,a=t.children,l=this.state,p=l.visible,v=l.nativeEvent,y=l.propsFromTrigger,m=l.x,_=l.y,b=c.default(h.styles.menu,h.styles.ignoreClick,s,((e={})[h.styles.theme+n]=n,e[h.styles.animationWillEnter+o]=o,e)),g=i({},r,{left:m,top:_+1,opacity:1});return u.default.createElement(f.Portal,null,p&&u.default.createElement("div",{className:b,style:g,ref:this.menuRef,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},u.default.createElement("div",{className:h.styles.ignoreClick},d.cloneItem(a,{nativeEvent:v,propsFromTrigger:y}))))},t.propTypes={id:l.default.oneOfType([l.default.string,l.default.number]).isRequired,children:l.default.node.isRequired,theme:l.default.string,animation:l.default.string,className:l.default.string,style:l.default.object},t}(u.Component);t.Menu=m},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),s=n(10),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={canRender:!1},t.container={},t}return r(t,e),t.prototype.componentDidMount=function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.setState({canRender:!0})},t.prototype.componentWillUnmount=function(){document.body.removeChild(this.container)},t.prototype.render=function(){return this.state.canRender&&s.createPortal(this.props.children,this.container)},t}(i.PureComponent);t.Portal=a},function(e,t){e.exports=n},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(0)),l=a(n(2)),c=a(n(3)),d=n(1),f=function(){},p=function(e){function t(t){var n=e.call(this,t)||this;n.handleClick=function(e){n.stayOpenOnClick&&e.stopPropagation(),n.isDisabled||n.props.onClick({event:n.props.nativeEvent,props:i({},n.props.propsFromTrigger,n.props.data)})};var o=n.props,r=o.disabled,s=o.nativeEvent,a=o.propsFromTrigger,u=o.data,l=o.closeOnClick;return n.isDisabled="function"==typeof r?r({event:s,props:i({},a,u)}):r,n.stayOpenOnClick=n.isDisabled||!("function"==typeof l?l({event:s,props:i({},a,u)}):l),n}return r(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,o=t.style,r=t.children,i=c.default(d.styles.item,n,((e={})[""+d.styles.itemDisabled]=this.isDisabled,e));return u.default.createElement("div",{className:i,style:o,onClick:this.handleClick,role:"presentation"},u.default.createElement("div",{className:d.styles.itemContent},r))},t.propTypes={children:l.default.node.isRequired,data:l.default.object,disabled:l.default.oneOfType([l.default.func,l.default.bool]),onClick:l.default.func,nativeEvent:l.default.object,propsFromTrigger:l.default.object,className:l.default.string,style:l.default.object,closeOnClick:l.default.bool},t.defaultProps={disabled:!1,onClick:f,closeOnClick:!0},t}(u.Component);t.Item=p},function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=n(1);t.Separator=function(){return r.default.createElement("div",{className:i.styles.separator})}},function(e,t,n){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(2)),s=o(n(3)),a=n(1),u=function(e){var t=e.className,n=e.style,o=e.children;return r.default.createElement("i",{className:s.default(a.styles.itemIcon,t),style:n},o||"")};t.IconFont=u,u.propTypes={children:i.default.node,className:i.default.string,style:i.default.object}},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=s(n(0)),l=a(n(2)),c=a(n(3)),d=n(6),f=n(1),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={left:"100%",top:0,bottom:"initial"},t.setRef=function(e){t.menu=e},t}return r(t,e),t.prototype.componentDidMount=function(){var e=window.innerWidth,t=window.innerHeight,n=this.menu.getBoundingClientRect(),o={};n.right<e?(o.left="100%",o.right=void 0):(o.right="100%",o.left=void 0),n.bottom>t?(o.bottom=0,o.top="initial"):(o.bottom="initial",o.top=0),this.setState(o)},t.prototype.handleClick=function(e){e.stopPropagation()},t.prototype.render=function(){var e,t=this.props,n=t.arrow,o=t.disabled,r=t.className,s=t.style,a=t.label,l=t.nativeEvent,p=t.children,h=t.propsFromTrigger,v=c.default(f.styles.item,f.styles.ignoreClick,r,((e={})[""+f.styles.itemDisabled]="function"==typeof o?o({event:l,props:i({},h)}):o,e)),y=i({},s,this.state);return u.default.createElement("div",{className:v,role:"presentation"},u.default.createElement("div",{className:f.styles.itemContent,onClick:this.handleClick},a,u.default.createElement("span",{className:f.styles.submenuArrow},n)),u.default.createElement("div",{className:c.default(f.styles.submenu,f.styles.ignoreClick),ref:this.setRef,style:y},d.cloneItem(p,{propsFromTrigger:h,nativeEvent:l})))},t.propTypes={label:l.default.node.isRequired,children:l.default.node.isRequired,nativeEvent:l.default.object,arrow:l.default.node,disabled:l.default.oneOfType([l.default.func,l.default.bool]),className:l.default.string,style:l.default.object},t.defaultProps={arrow:"▶",disabled:!1,nativeEvent:{}},t}(u.Component);t.Submenu=p},function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},s=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),l=a(n(2)),c=n(4),d=n(5),f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.childrenRefs=[],t.handleEvent=function(e){e.preventDefault(),e.stopPropagation(),d.eventManager.emit(c.DISPLAY_MENU(t.props.id),e.nativeEvent,i({ref:1===t.childrenRefs.length?t.childrenRefs[0]:t.childrenRefs},t.props.data))},t.setChildRef=function(e){return null===e||t.childrenRefs.push(e)},t}return r(t,e),t.prototype.getChildren=function(){var e=this,t=this.props,n=(t.id,t.component,t.event,t.children),o=(t.className,t.style,t.storeRef),r=(t.data,s(t,["id","component","event","children","className","style","storeRef","data"]));return this.childrenRefs=[],u.Children.map(n,function(t){return u.isValidElement(t)?u.cloneElement(t,i({},r,o?{ref:e.setChildRef}:{})):t})},t.prototype.render=function(){var e,t=this.props,n=t.component,o=t.render,r=t.event,s=t.className,a=t.style,l=((e={})[r]=this.handleEvent,e.className=s,e.style=a,e);return"function"==typeof o?o(i({},l,{children:this.getChildren()})):u.createElement(n,l,this.getChildren())},t.propTypes={id:l.default.oneOfType([l.default.string,l.default.number]).isRequired,children:l.default.node.isRequired,component:l.default.oneOfType([l.default.node,l.default.func]),render:l.default.func,event:l.default.string,className:l.default.string,style:l.default.object,storeRef:l.default.bool,data:l.default.object},t.defaultProps={component:"div",event:"onContextMenu",storeRef:!0},t}(u.Component);t.MenuProvider=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),r=n(4),i={show:function(e){var t=e.id,n=e.event,i=e.props;o.eventManager.emit(r.DISPLAY_MENU(t),n.nativeEvent||n,i)},hideAll:function(){o.eventManager.emit(r.HIDE_ALL)}};t.contextMenu=i}])});
!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var s=o.apply(null,r);s&&e.push(s)}else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISPLAY_MENU=t.HIDE_ALL=void 0,t.HIDE_ALL=0,t.DISPLAY_MENU=function(e){return"DISPLAY_"+e}},function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.eventManager=void 0;var o={eventList:new Map,on:function(e,t){var n=this;return this.eventList.has(e)||this.eventList.set(e,new Set),this.eventList.get(e).add(t),function(){return n.eventList.get(e).delete(t)}},emit:function(e){for(var t=this,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];return this.eventList.has(e)?(this.eventList.get(e).forEach(function(e){return e.call.apply(e,r([t],n))}),!0):(console.warn("<"+e+"> Event is not registered. Did you forgot to bind the event ?"),!1)}};t.eventManager=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cloneItem=void 0;var r=n(0);t.cloneItem=function(e,t){return r.Children.map(r.Children.toArray(e).filter(function(e){return Boolean(e)}),function(e){return r.cloneElement(e,t)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);Object.defineProperty(t,"Menu",{enumerable:!0,get:function(){return r.Menu}});var o=n(11);Object.defineProperty(t,"Item",{enumerable:!0,get:function(){return o.Item}});var i=n(12);Object.defineProperty(t,"Separator",{enumerable:!0,get:function(){return i.Separator}});var s=n(13);Object.defineProperty(t,"IconFont",{enumerable:!0,get:function(){return s.IconFont}});var a=n(14);Object.defineProperty(t,"Submenu",{enumerable:!0,get:function(){return a.Submenu}});var u=n(15);Object.defineProperty(t,"MenuProvider",{enumerable:!0,get:function(){return u.MenuProvider}});var c=n(16);Object.defineProperty(t,"contextMenu",{enumerable:!0,get:function(){return c.contextMenu}});var l=n(1);Object.defineProperty(t,"theme",{enumerable:!0,get:function(){return l.theme}}),Object.defineProperty(t,"animation",{enumerable:!0,get:function(){return l.animation}})},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&s(t,e,n);return a(t,e),t},c=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Menu=void 0;var f=u(n(0)),d=l(n(2)),p=l(n(3)),h=n(6),v=n(9),y=n(4),m=n(1),_=n(5),b={ENTER:13,ESC:27,ARROW_UP:38,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39},g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={x:0,y:0,visible:!1,nativeEvent:{},propsFromTrigger:{},onShown:null,onHidden:null},t.menuRef=f.default.createRef(),t.unsub=[],t.bindWindowEvent=function(){window.addEventListener("resize",t.hide),window.addEventListener("contextmenu",t.hide),window.addEventListener("mousedown",t.hide),window.addEventListener("click",t.hide),window.addEventListener("scroll",t.hide),window.addEventListener("keydown",t.handleKeyboard)},t.unBindWindowEvent=function(){window.removeEventListener("resize",t.hide),window.removeEventListener("contextmenu",t.hide),window.removeEventListener("mousedown",t.hide),window.removeEventListener("click",t.hide),window.removeEventListener("scroll",t.hide),window.removeEventListener("keydown",t.handleKeyboard)},t.onMouseEnter=function(){return window.removeEventListener("mousedown",t.hide)},t.onMouseLeave=function(){return window.addEventListener("mousedown",t.hide)},t.hide=function(e){var n=e;(void 0===n||2!==n.button&&!0!==n.ctrlKey||"contextmenu"===n.type)&&(e&&"click"===e.type&&e.target.classList.contains(m.styles.ignoreClick)||(t.unBindWindowEvent(),t.setState({visible:!1})))},t.handleKeyboard=function(e){e.keyCode!==b.ENTER&&e.keyCode!==b.ESC||(t.unBindWindowEvent(),t.setState({visible:!1}))},t.show=function(e,n){e.stopPropagation(),_.eventManager.emit(y.HIDE_ALL);var r=t.getMousePosition(e),o=r.x,i=r.y;t.setState({visible:!0,x:o,y:i,nativeEvent:e,propsFromTrigger:n},t.setMenuPosition)},t}return o(t,e),t.prototype.componentDidMount=function(){this.unsub.push(_.eventManager.on(y.DISPLAY_MENU(this.props.id),this.show)),this.unsub.push(_.eventManager.on(y.HIDE_ALL,this.hide))},t.prototype.componentWillUnmount=function(){this.unsub.forEach(function(e){return e()}),this.unBindWindowEvent()},t.prototype.componentDidUpdate=function(e,t){this.state.visible!==t.visible&&(this.state.visible&&this.props.onShown?this.props.onShown():!this.state.visible&&this.props.onHidden&&this.props.onHidden())},t.prototype.setMenuPosition=function(){if(this.menuRef.current){var e=window.innerWidth,t=window.innerHeight,n=this.menuRef.current,r=n.offsetWidth,o=n.offsetHeight,i=this.state,s=i.x,a=i.y;s+r>e&&(s-=s+r-e),a+o>t&&(a-=a+o-t),this.setState({x:s,y:a},this.bindWindowEvent)}},t.prototype.getMousePosition=function(e){var t={x:e.clientX,y:e.clientY};return"touchend"===e.type&&(!t.x||!t.y)&&e.changedTouches&&e.changedTouches.length>0&&(t.x=e.changedTouches[0].clientX,t.y=e.changedTouches[0].clientY),(!t.x||t.x<0)&&(t.x=0),(!t.y||t.y<0)&&(t.y=0),t},t.prototype.render=function(){var e,t=this.props,n=t.theme,r=t.animation,o=t.style,s=t.className,a=t.children,u=t.menuWrapperProps,l=this.state,d=l.visible,y=l.nativeEvent,_=l.propsFromTrigger,b=l.x,g=l.y,O=u||{},w=O.className,j=c(O,["className"]),P=p.default(m.styles.menu,m.styles.ignoreClick,w,s,((e={})[m.styles.theme+n]=n,e[m.styles.animationWillEnter+r]=r,e)),E=i(i({},o),{left:b,top:g+1,opacity:1});return f.default.createElement(v.Portal,null,d&&f.default.createElement("div",i({className:P,style:E,ref:this.menuRef,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},j),f.default.createElement("div",{className:m.styles.ignoreClick},h.cloneItem(a,{nativeEvent:y,propsFromTrigger:_}))))},t.propTypes={id:d.default.oneOfType([d.default.string,d.default.number]).isRequired,children:d.default.node.isRequired,theme:d.default.string,animation:d.default.string,className:d.default.string,style:d.default.object,menuWrapperProps:d.default.object},t}(f.Component);t.Menu=g},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Portal=void 0;var i=n(0),s=n(10),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={canRender:!1},t.container={},t}return o(t,e),t.prototype.componentDidMount=function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.setState({canRender:!0})},t.prototype.componentWillUnmount=function(){document.body.removeChild(this.container)},t.prototype.render=function(){return this.state.canRender&&s.createPortal(this.props.children,this.container)},t}(i.PureComponent);t.Portal=a},function(e,t){e.exports=n},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&s(t,e,n);return a(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Item=void 0;var l=u(n(0)),f=c(n(2)),d=c(n(3)),p=n(1),h=function(){},v=function(e){function t(t){var n=e.call(this,t)||this;n.handleClick=function(e){n.stayOpenOnClick&&e.stopPropagation(),n.isDisabled||n.props.onClick({event:n.props.nativeEvent,props:i(i({},n.props.propsFromTrigger),n.props.data)})};var r=n.props,o=r.disabled,s=r.nativeEvent,a=r.propsFromTrigger,u=r.data,c=r.closeOnClick;return n.isDisabled="function"==typeof o?o({event:s,props:i(i({},a),u)}):o,n.stayOpenOnClick=n.isDisabled||!("function"==typeof c?c({event:s,props:i(i({},a),u)}):c),n}return o(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,r=t.style,o=t.children,i=d.default(p.styles.item,n,((e={})[""+p.styles.itemDisabled]=this.isDisabled,e));return l.default.createElement("div",{className:i,style:r,onClick:this.handleClick,role:"presentation"},l.default.createElement("div",{className:p.styles.itemContent},o))},t.propTypes={children:f.default.node.isRequired,data:f.default.object,disabled:f.default.oneOfType([f.default.func,f.default.bool]),onClick:f.default.func,nativeEvent:f.default.object,propsFromTrigger:f.default.object,className:f.default.string,style:f.default.object,closeOnClick:f.default.bool},t.defaultProps={disabled:!1,onClick:h,closeOnClick:!0},t}(l.Component);t.Item=v},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Separator=void 0;var o=r(n(0)),i=n(1);t.Separator=function(){return o.default.createElement("div",{className:i.styles.separator})}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IconFont=void 0;var o=r(n(0)),i=r(n(2)),s=r(n(3)),a=n(1),u=function(e){var t=e.className,n=e.style,r=e.children;return o.default.createElement("i",{className:s.default(a.styles.itemIcon,t),style:n},r||"")};t.IconFont=u,u.propTypes={children:i.default.node,className:i.default.string,style:i.default.object}},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),u=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&s(t,e,n);return a(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Submenu=void 0;var l=u(n(0)),f=c(n(2)),d=c(n(3)),p=n(6),h=n(1),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={left:"100%",top:0,bottom:"initial"},t.setRef=function(e){t.menu=e},t}return o(t,e),t.prototype.componentDidMount=function(){var e=window.innerWidth,t=window.innerHeight,n=this.menu.getBoundingClientRect(),r={};n.right<e?(r.left="100%",r.right=void 0):(r.right="100%",r.left=void 0),n.bottom>t?(r.bottom=0,r.top="initial"):(r.bottom="initial",r.top=0),this.setState(r)},t.prototype.handleClick=function(e){e.stopPropagation()},t.prototype.render=function(){var e,t=this.props,n=t.arrow,r=t.disabled,o=t.className,s=t.style,a=t.label,u=t.nativeEvent,c=t.children,f=t.propsFromTrigger,v=d.default(h.styles.item,h.styles.ignoreClick,o,((e={})[""+h.styles.itemDisabled]="function"==typeof r?r({event:u,props:i({},f)}):r,e)),y=i(i({},s),this.state);return l.default.createElement("div",{className:v,role:"presentation"},l.default.createElement("div",{className:h.styles.itemContent,onClick:this.handleClick},a,l.default.createElement("span",{className:h.styles.submenuArrow},n)),l.default.createElement("div",{className:d.default(h.styles.submenu,h.styles.ignoreClick),ref:this.setRef,style:y},p.cloneItem(c,{propsFromTrigger:f,nativeEvent:u})))},t.propTypes={label:f.default.node.isRequired,children:f.default.node.isRequired,nativeEvent:f.default.object,arrow:f.default.node,disabled:f.default.oneOfType([f.default.func,f.default.bool]),className:f.default.string,style:f.default.object},t.defaultProps={arrow:"▶",disabled:!1,nativeEvent:{}},t}(l.Component);t.Submenu=v},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},s=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MenuProvider=void 0;var u=n(0),c=a(n(2)),l=n(4),f=n(5),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.childrenRefs=[],t.handleEvent=function(e){e.preventDefault(),e.stopPropagation(),f.eventManager.emit(l.DISPLAY_MENU(t.props.id),e.nativeEvent,i({ref:1===t.childrenRefs.length?t.childrenRefs[0]:t.childrenRefs},t.props.data))},t.setChildRef=function(e){return null===e||t.childrenRefs.push(e)},t}return o(t,e),t.prototype.getChildren=function(){var e=this,t=this.props,n=(t.id,t.component,t.event,t.children),r=(t.className,t.style,t.storeRef),o=(t.data,s(t,["id","component","event","children","className","style","storeRef","data"]));return this.childrenRefs=[],u.Children.map(n,function(t){return u.isValidElement(t)?u.cloneElement(t,i(i({},o),r?{ref:e.setChildRef}:{})):t})},t.prototype.render=function(){var e,t=this.props,n=t.component,r=t.render,o=t.event,s=t.className,a=t.style,c=((e={})[o]=this.handleEvent,e.className=s,e.style=a,e);return"function"==typeof r?r(i(i({},c),{children:this.getChildren()})):u.createElement(n,c,this.getChildren())},t.propTypes={id:c.default.oneOfType([c.default.string,c.default.number]).isRequired,children:c.default.node.isRequired,component:c.default.oneOfType([c.default.node,c.default.func]),render:c.default.func,event:c.default.string,className:c.default.string,style:c.default.object,storeRef:c.default.bool,data:c.default.object},t.defaultProps={component:"div",event:"onContextMenu",storeRef:!0},t}(u.Component);t.MenuProvider=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contextMenu=void 0;var r=n(5),o=n(4),i={show:function(e){var t=e.id,n=e.event,i=e.props;r.eventManager.emit(o.DISPLAY_MENU(t),n.nativeEvent||n,i)},hideAll:function(){r.eventManager.emit(o.HIDE_ALL)}};t.contextMenu=i}])});
//# sourceMappingURL=ReactContexify.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneItem = void 0;
var react_1 = require("react");

@@ -4,0 +5,0 @@ function cloneItem(children, props) {

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.IconFont = void 0;
var react_1 = __importDefault(require("react"));

@@ -8,0 +9,0 @@ var prop_types_1 = __importDefault(require("prop-types"));

@@ -48,5 +48,5 @@ import React, { Component, ReactNode } from 'react';

constructor(props: ItemProps);
handleClick: (e: React.MouseEvent<Element>) => void;
handleClick: (e: React.MouseEvent) => void;
render(): JSX.Element;
}
export { Item };

@@ -26,7 +26,19 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;

@@ -38,2 +50,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.Item = void 0;
var react_1 = __importStar(require("react"));

@@ -55,3 +68,3 @@ var prop_types_1 = __importDefault(require("prop-types"));

event: _this.props.nativeEvent,
props: __assign({}, _this.props.propsFromTrigger, _this.props.data)
props: __assign(__assign({}, _this.props.propsFromTrigger), _this.props.data)
});

@@ -65,3 +78,3 @@ }

event: nativeEvent,
props: __assign({}, propsFromTrigger, data)
props: __assign(__assign({}, propsFromTrigger), data)
})

@@ -74,3 +87,3 @@ : disabled;

event: nativeEvent,
props: __assign({}, propsFromTrigger, data)
props: __assign(__assign({}, propsFromTrigger), data)
})

@@ -77,0 +90,0 @@ : closeOnClick);

@@ -33,2 +33,6 @@ import React, { Component, ReactNode } from 'react';

onHidden?: () => void;
/**
* menu wrapper props
*/
menuWrapperProps?: Omit<React.HTMLAttributes<HTMLDivElement>, 'onMouseEnter' | 'onMouseLeave' | 'style'>;
}

@@ -50,2 +54,3 @@ interface MenuState {

style: PropTypes.Requireable<object>;
menuWrapperProps: PropTypes.Requireable<object>;
};

@@ -52,0 +57,0 @@ state: {

@@ -26,9 +26,32 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -38,2 +61,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

Object.defineProperty(exports, "__esModule", { value: true });
exports.Menu = void 0;
/* global: window */

@@ -183,10 +207,11 @@ var react_1 = __importStar(require("react"));

var _a;
var _b = this.props, theme = _b.theme, animation = _b.animation, style = _b.style, className = _b.className, children = _b.children;
var _b = this.props, theme = _b.theme, animation = _b.animation, style = _b.style, className = _b.className, children = _b.children, menuWrapperProps = _b.menuWrapperProps;
var _c = this.state, visible = _c.visible, nativeEvent = _c.nativeEvent, propsFromTrigger = _c.propsFromTrigger, x = _c.x, y = _c.y;
var cssClasses = classnames_1.default(styles_1.styles.menu, styles_1.styles.ignoreClick, className, (_a = {},
var _d = menuWrapperProps || {}, wrapperClassName = _d.className, menuWrapperRestProps = __rest(_d, ["className"]);
var cssClasses = classnames_1.default(styles_1.styles.menu, styles_1.styles.ignoreClick, wrapperClassName, className, (_a = {},
_a[styles_1.styles.theme + theme] = theme,
_a[styles_1.styles.animationWillEnter + animation] = animation,
_a));
var menuStyle = __assign({}, style, { left: x, top: y + 1, opacity: 1 });
return (react_1.default.createElement(Portal_1.Portal, null, visible && (react_1.default.createElement("div", { className: cssClasses, style: menuStyle, ref: this.menuRef, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave },
var menuStyle = __assign(__assign({}, style), { left: x, top: y + 1, opacity: 1 });
return (react_1.default.createElement(Portal_1.Portal, null, visible && (react_1.default.createElement("div", __assign({ className: cssClasses, style: menuStyle, ref: this.menuRef, onMouseEnter: this.onMouseEnter, onMouseLeave: this.onMouseLeave }, menuWrapperRestProps),
react_1.default.createElement("div", { className: styles_1.styles.ignoreClick }, cloneItem_1.cloneItem(children, {

@@ -203,3 +228,4 @@ nativeEvent: nativeEvent,

className: prop_types_1.default.string,
style: prop_types_1.default.object
style: prop_types_1.default.object,
menuWrapperProps: prop_types_1.default.object
};

@@ -206,0 +232,0 @@ return Menu;

@@ -54,3 +54,3 @@ import { Component, ReactNode, SyntheticEvent } from 'react';

childrenRefs: HTMLElement[];
handleEvent: (e: SyntheticEvent<Element>) => void;
handleEvent: (e: SyntheticEvent) => void;
setChildRef: (ref: HTMLElement) => number | true;

@@ -57,0 +57,0 @@ getChildren(): import("react").ReactChild[];

@@ -31,4 +31,6 @@ "use strict";

if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;

@@ -40,2 +42,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.MenuProvider = void 0;
var react_1 = require("react");

@@ -70,3 +73,3 @@ var prop_types_1 = __importDefault(require("prop-types"));

return react_1.isValidElement(child)
? react_1.cloneElement(child, __assign({}, rest, (storeRef ? { ref: _this.setChildRef } : {})))
? react_1.cloneElement(child, __assign(__assign({}, rest), (storeRef ? { ref: _this.setChildRef } : {})))
: child;

@@ -84,3 +87,3 @@ });

if (typeof render === 'function') {
return render(__assign({}, attributes, { children: this.getChildren() }));
return render(__assign(__assign({}, attributes), { children: this.getChildren() }));
}

@@ -87,0 +90,0 @@ return react_1.createElement(component, attributes, this.getChildren());

@@ -16,2 +16,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Portal = void 0;
var react_1 = require("react");

@@ -18,0 +19,0 @@ var react_dom_1 = require("react-dom");

@@ -6,2 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Separator = void 0;
var react_1 = __importDefault(require("react"));

@@ -8,0 +9,0 @@ var styles_1 = require("../utils/styles");

@@ -26,7 +26,19 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;

@@ -38,2 +50,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.Submenu = void 0;
var react_1 = __importStar(require("react"));

@@ -94,3 +107,3 @@ var prop_types_1 = __importDefault(require("prop-types"));

_a));
var submenuStyle = __assign({}, style, this.state);
var submenuStyle = __assign(__assign({}, style), this.state);
return (react_1.default.createElement("div", { className: cssClasses, role: "presentation" },

@@ -97,0 +110,0 @@ react_1.default.createElement("div", { className: styles_1.styles.itemContent, onClick: this.handleClick },

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Menu_1 = require("./components/Menu");
exports.Menu = Menu_1.Menu;
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return Menu_1.Menu; } });
var Item_1 = require("./components/Item");
exports.Item = Item_1.Item;
Object.defineProperty(exports, "Item", { enumerable: true, get: function () { return Item_1.Item; } });
var Separator_1 = require("./components/Separator");
exports.Separator = Separator_1.Separator;
Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return Separator_1.Separator; } });
var IconFont_1 = require("./components/IconFont");
exports.IconFont = IconFont_1.IconFont;
Object.defineProperty(exports, "IconFont", { enumerable: true, get: function () { return IconFont_1.IconFont; } });
var Submenu_1 = require("./components/Submenu");
exports.Submenu = Submenu_1.Submenu;
Object.defineProperty(exports, "Submenu", { enumerable: true, get: function () { return Submenu_1.Submenu; } });
var MenuProvider_1 = require("./components/MenuProvider");
exports.MenuProvider = MenuProvider_1.MenuProvider;
Object.defineProperty(exports, "MenuProvider", { enumerable: true, get: function () { return MenuProvider_1.MenuProvider; } });
var contextMenu_1 = require("./utils/contextMenu");
exports.contextMenu = contextMenu_1.contextMenu;
Object.defineProperty(exports, "contextMenu", { enumerable: true, get: function () { return contextMenu_1.contextMenu; } });
var styles_1 = require("./utils/styles");
exports.theme = styles_1.theme;
exports.animation = styles_1.animation;
Object.defineProperty(exports, "theme", { enumerable: true, get: function () { return styles_1.theme; } });
Object.defineProperty(exports, "animation", { enumerable: true, get: function () { return styles_1.animation; } });
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DISPLAY_MENU = exports.HIDE_ALL = void 0;
exports.HIDE_ALL = 0;
exports.DISPLAY_MENU = function (id) { return "DISPLAY_" + id; };
//# sourceMappingURL=actions.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contextMenu = void 0;
var eventManager_1 = require("./eventManager");

@@ -4,0 +5,0 @@ var actions_1 = require("./actions");

"use strict";
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.eventManager = void 0;
var eventManager = {

@@ -21,3 +29,3 @@ eventList: new Map(),

}
this.eventList.get(event).forEach(function (cb) { return cb.call.apply(cb, [_this].concat(args)); });
this.eventList.get(event).forEach(function (cb) { return cb.call.apply(cb, __spreadArrays([_this], args)); });
return true;

@@ -24,0 +32,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.animation = exports.theme = exports.styles = void 0;
/*

@@ -4,0 +5,0 @@ * css classes mapping

{
"name": "@saleae/react-contexify",
"version": "4.1.5",
"version": "4.1.6",
"main": "lib/index.js",

@@ -73,3 +73,3 @@ "typings": "./lib/index.d.ts",

"ts-loader": "^5.2.1",
"typescript": "^3.1.1",
"typescript": "^3.9.7",
"webpack": "^4.17.1",

@@ -87,2 +87,2 @@ "webpack-cli": "^3.1.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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc