@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
71 lines (70 loc) • 2.39 kB
JavaScript
import { defineComponent as x, inject as k, ref as g, computed as E, onMounted as N, nextTick as w, openBlock as i, createBlock as p, Transition as C, unref as n, withCtx as D, withDirectives as S, createElementVNode as d, normalizeClass as u, normalizeStyle as b, renderSlot as h, createElementBlock as I, Fragment as P, createTextVNode as T, toDisplayString as $, vShow as z } from "vue";
import "../renderer/index.mjs";
import { classProp as B, useNameHelper as H, useZIndex as L } from "@vexip-ui/config";
import { noop as j } from "@vexip-ui/utils";
import { DELETE_HANDLER as A } from "./symbol.mjs";
import R from "../renderer/renderer.mjs";
const V = ["vxp-index"], J = /* @__PURE__ */ x({
name: "PopupItem",
__name: "popup-item",
props: {
state: {
type: Object,
default: () => ({})
},
transitionName: {
type: String,
default: null
},
innerClass: {
type: B,
default: null
}
},
emits: ["enter", "leave"],
setup(e, { emit: f }) {
const s = e, l = f, c = k(A, j), o = H("popup"), v = L(), a = g(), y = E(() => s.transitionName || o.ns("popup-top"));
return N(() => {
w(() => {
const r = s.state;
r && a.value && (r.height = a.value.offsetHeight);
});
}), (r, t) => (i(), p(C, {
appear: "",
name: y.value,
onAfterLeave: t[2] || (t[2] = (m) => n(c)(e.state.key))
}, {
default: D(() => [
S(d("div", {
ref_key: "wrapper",
ref: a,
class: u(n(o).be("item")),
style: b({ zIndex: n(v)() }),
"vxp-index": e.state.key,
onPointerenter: t[0] || (t[0] = (m) => l("enter")),
onPointerleave: t[1] || (t[1] = (m) => l("leave"))
}, [
d("div", {
class: u([n(o).be("item-inner"), e.innerClass])
}, [
h(r.$slots, "default", { item: e.state }, () => [
typeof e.state.renderer == "function" ? (i(), p(n(R), {
key: 0,
renderer: e.state.renderer
}, null, 8, ["renderer"])) : (i(), I(P, { key: 1 }, [
T($(e.state.content), 1)
], 64))
])
], 2)
], 46, V), [
[z, e.state.visible]
])
]),
_: 3
}, 8, ["name"]));
}
});
export {
J as default
};
//# sourceMappingURL=popup-item.vue2.mjs.map