@progress/kendo-react-popup
Version:
React Popup positions a piece of content next to a specific anchor component. KendoReact Popup package
34 lines (33 loc) • 1.5 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
*-------------------------------------------------------------------------------------------
*/
import { classNames as w, uPopup as v } from "@progress/kendo-react-common";
const p = (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), x = (i, s, t, r, d, f) => {
if (t === 0)
return d();
const o = w(v.slide({ direction: s, type: r, c: f })), a = w(v.slideActive({ direction: s, type: r, c: f })), c = (n) => {
n.target === i && (i.removeEventListener("transitionend", c), p(i, o, a), r === "exit" ? i.style.display = "none" : i.style.display = "", d());
};
i.addEventListener("transitionend", c);
const u = i.ownerDocument;
if (!u)
return;
const e = u.defaultView;
if (!e)
return;
const l = () => {
p(i, o, a), r === "enter" && (i.style.display = ""), o && i.classList.add(...o.split(" ").filter((n) => n)), e.requestAnimationFrame(() => {
i.style.transitionDuration = t + "ms", i.classList.add(...a.split(" ").filter((n) => n));
});
};
y ? e.requestAnimationFrame(l) : l();
};
export {
x as slide
};