@empathyco/x-components
Version:
Empathy X Components
77 lines (74 loc) • 2.69 kB
JavaScript
import _sfc_main from './base-modal.vue2.js';
import { withDirectives, openBlock, createElementBlock, createBlock, resolveDynamicComponent, withCtx, normalizeClass, renderSlot, createCommentVNode, vShow } from 'vue';
import './base-modal.vue3.js';
import _export_sfc from '../../_virtual/_plugin-vue_export-helper.js';
const _hoisted_1 = {
ref: "modalRef",
class: "x-modal",
"data-test": "modal"
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return withDirectives((openBlock(), createElementBlock(
"div",
_hoisted_1,
[
(openBlock(), createBlock(
resolveDynamicComponent(_ctx.animation),
{
onBeforeLeave: _cache[0] || (_cache[0] = ($event) => _ctx.isWaitingForLeave = true),
onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.isWaitingForLeave = false)
},
{
default: withCtx(() => [
_ctx.open ? (openBlock(), createElementBlock(
"div",
{
key: 0,
ref: "modalContentRef",
class: normalizeClass(["x-modal__content", _ctx.contentClass]),
"data-test": "modal-content",
role: "dialog",
"aria-label": "Base modal content"
},
[
renderSlot(_ctx.$slots, "default", {}, void 0, true)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true)
]),
_: 3
/* FORWARDED */
},
32
/* NEED_HYDRATION */
)),
(openBlock(), createBlock(resolveDynamicComponent(_ctx.overlayAnimation), null, {
default: withCtx(() => [
_ctx.open ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(["x-modal__overlay", _ctx.overlayClass]),
"data-test": "modal-overlay",
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.emitOverlayClicked && _ctx.emitOverlayClicked(...args)),
onKeydown: _cache[3] || (_cache[3] = (...args) => _ctx.emitOverlayClicked && _ctx.emitOverlayClicked(...args))
},
null,
34
/* CLASS, NEED_HYDRATION */
)) : createCommentVNode("v-if", true)
]),
_: 1
/* STABLE */
}))
],
512
/* NEED_PATCH */
)), [
[vShow, _ctx.isWaitingForLeave || _ctx.open]
]);
}
var BaseModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-61b0d59b"]]);
export { BaseModal as default };
//# sourceMappingURL=base-modal.vue.js.map