@progress/kendo-react-layout
Version:
React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package
9 lines (8 loc) • 1.55 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),s=require("@progress/kendo-react-common"),d=require("@progress/kendo-react-popup"),b=require("../menu/components/Menu.js");function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=g(f),i=e=>{const t=c.useRef(null),[n,u]=c.useState(e.show),l=s.useId(e.id),{animate:r=v.animate}=e;return c.useEffect(()=>{u(e.show),e.show&&setTimeout(()=>{const a=t.current&&t.current.element,o=a&&a.querySelector(".k-menu-item"),m=s.getActiveElement(o&&o.ownerDocument);o&&o!==m&&o.focus()})},[e.show]),c.createElement(d.Popup,{show:n,offset:e.offset,popupClass:"k-menu-popup k-overflow-visible",animate:r},c.createElement(b.Menu,{id:l,vertical:!0,...e,ref:t,className:s.classNames("k-context-menu",e.className),onClose:e.onClose,role:"menu"},e.children))},v={animate:{openDuration:300,closeDuration:300}};i.displayName="KendoReactContextMenu";exports.ContextMenu=i;