UNPKG

@progress/kendo-react-popup

Version:

React Popup positions a piece of content next to a specific anchor component. KendoReact Popup package

9 lines (8 loc) 1.37 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@progress/kendo-react-common"),w=(i,s,t)=>{i.style.transitionDuration="",s&&i.classList.remove(...s.split(" ")),t&&i.classList.remove(...t.split(" "))},y=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),p=(i,s,t,o,c,f)=>{if(t===0)return c();const r=e.classNames(e.uPopup.slide({direction:s,type:o,c:f})),a=e.classNames(e.uPopup.slideActive({direction:s,type:o,c:f})),u=n=>{n.target===i&&(i.removeEventListener("transitionend",u),w(i,r,a),o==="exit"?i.style.display="none":i.style.display="",c())};i.addEventListener("transitionend",u);const l=i.ownerDocument;if(!l)return;const d=l.defaultView;if(!d)return;const v=()=>{w(i,r,a),o==="enter"&&(i.style.display=""),r&&i.classList.add(...r.split(" ").filter(n=>n)),d.requestAnimationFrame(()=>{i.style.transitionDuration=t+"ms",i.classList.add(...a.split(" ").filter(n=>n))})};y?d.requestAnimationFrame(v):v()};exports.slide=p;