@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
36 lines (35 loc) • 890 B
JavaScript
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
v3.2.1 */
import { w as whenTransitionDone } from "./dom.js";
function isOpen(component) {
return component[component.openProp || "open"];
}
function onToggleOpenCloseComponent(component) {
requestAnimationFrame(() => {
if (!component.transitionEl) {
return;
}
whenTransitionDone(
component.transitionEl,
component.transitionProp,
() => {
if (isOpen(component)) {
component.onBeforeOpen();
} else {
component.onBeforeClose();
}
},
() => {
if (isOpen(component)) {
component.onOpen();
} else {
component.onClose();
}
}
);
});
}
export {
onToggleOpenCloseComponent as o
};