UNPKG

@wetspace/pro-components

Version:
98 lines (97 loc) 3.19 kB
import { defineComponent as E, shallowRef as h, watch as y, openBlock as s, createBlock as a, unref as o, normalizeClass as D, withCtx as n, createVNode as t, createTextVNode as r, createElementVNode as u, withModifiers as d, toDisplayString as _, withDirectives as f, vShow as B, createCommentVNode as R } from "vue"; import { Close as N } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.4.2_/node_modules/@element-plus/icons-vue/dist/index.mjs"; import { TextEllipsis as V } from "../../ellipsis/index.mjs"; import { useNamespace as O, ElLoading as H, ElDropdown as I, ElDropdownMenu as L, ElDropdownItem as g, ElButton as M, ElIcon as S } from "element-plus"; const q = /* @__PURE__ */ E({ __name: "paneitem", props: { close: { type: Function }, label: {}, isHome: { type: Boolean }, isOpenDropdown: { type: Boolean }, loading: { type: Boolean } }, emits: ["handRightClick", "click"], setup(k, { emit: C }) { const w = O("pro-page-labels-item"), p = C, b = H.directive, l = k, v = () => { p("handRightClick"); }, x = () => { p("click"); }, i = h(); return y(() => l.isOpenDropdown, (m) => { var e, c; m ? (e = i.value) == null || e.handleOpen() : (c = i.value) == null || c.handleClose(); }), (m, e) => (s(), a(o(I), { ref_key: "dropdownRef", ref: i, trigger: "contextmenu", class: D(o(w).b()) }, { dropdown: n(() => [ t(o(L), null, { default: n(() => [ t(o(g), { onClick: e[1] || (e[1] = () => l.close("other")) }, { default: n(() => e[3] || (e[3] = [ r(" 关闭其他 ") ])), _: 1 }), t(o(g), { onClick: e[2] || (e[2] = () => l.close("all")) }, { default: n(() => e[4] || (e[4] = [ r(" 关闭所有 ") ])), _: 1 }) ]), _: 1 }) ]), default: n(() => [ u("div", { class: "item-lablebox", onContextmenu: d(v, ["prevent"]), onClick: d(x, ["stop"]) }, [ u("div", null, [ t(o(V), null, { default: n(() => [ r(_(l.label), 1) ]), _: 1 }) ]), l.isHome ? R("", !0) : (s(), a(o(M), { key: 0, link: "", onClick: e[0] || (e[0] = d(() => l.close("one"), ["stop"])) }, { default: n(() => [ f((s(), a(o(S), { "element-loading-background": "transparent", "element-loading-custom-class": "item-lablebox__loading" }, { default: n(() => [ f(t(o(N), null, null, 512), [ [B, !l.loading] ]) ]), _: 1 })), [ [o(b), l.loading] ]) ]), _: 1 })) ], 32) ]), _: 1 }, 8, ["class"])); } }); export { q as default };