UNPKG

@extclp/vexip-ui

Version:

A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good

71 lines (70 loc) 2.39 kB
import { defineComponent as x, inject as k, ref as g, computed as E, onMounted as N, nextTick as w, createBlock as p, openBlock as i, Transition as C, unref as n, withCtx as D, withDirectives as S, createElementVNode as d, normalizeStyle as b, normalizeClass as u, renderSlot as h, createElementBlock as I, Fragment as P, createTextVNode as T, toDisplayString as $, vShow as z } from "vue"; import "../renderer/index.mjs"; import { useNameHelper as B, useZIndex as H, classProp 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: L, default: null } }, emits: ["enter", "leave"], setup(e, { emit: f }) { const s = e, l = f, c = k(A, j), o = B("popup"), v = H(), 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