UNPKG

el-plus-powerful-table

Version:

## [DOCS](https://peng-xiao-shuai.github.io/vite-vue-admin-docs/zh-CN/component_directive/component/powerful-table-doc.html)

84 lines (83 loc) 2.33 kB
import { defineComponent as u, ref as f, createVNode as o, withDirectives as x, vShow as p } from "vue"; import { ElIcon as w } from "element-plus"; import { ArrowUp as v, ArrowDown as s } from "@element-plus/icons-vue"; import { powerfulTableComponentProp as b, useREmit as k } from "../../powerful-table/src/powerful-table-data.mjs"; import { t as a } from "../../locale/lang.mjs"; import { LangKey as r } from "../../locale/packages.mjs"; const l = /* @__PURE__ */ u({ name: "PTText", props: { ...b, prop: { type: Object, default: () => ({}) }, listLength: { type: Number, default: 0 } }, emits: ["component-emit"], setup(e, { emit: d }) { const t = e.prop.data, { REmit: c, event: m } = k(d, "text", { row: e.row, index: e.index, props: e.prop }), n = f(Array.from({ length: e.listLength }).fill(!1)); return () => o("div", { class: { content: n.value[e.index || 0] } }, [o("div", { onClick: (i) => { i.stopPropagation(), c("click", { row: e.row, index: e.index, prop: e.prop.prop, evt: i }), m("click", i); }, style: t && t.develop ? { display: "-webkit-box", overflow: "hidden", "-webkit-box-orient": "vertical", "word-break": "break-all", "-webkit-line-clamp": n.value[e.index || 0] ? 99999 : t && t.line || 3 } : {} }, [t && typeof t.formatting == "function" ? t.formatting({ row: e.row, index: e.index, props: e.prop }) : e.row[e.prop.prop]]), x(o("div", { class: "develop", onClick: (i) => { i.stopPropagation(), n.value[e.index || 0] = !n.value[e.index || 0]; } }, [o("span", { style: { position: n.value[e.index || 0] ? "absolute" : "static", display: "flex", "justify-content": "center", "align-items": "center" } }, [n.value[e.index || 0] ? a(r.PackUp) : a(r.ReadFullText), o(w, null, { default: () => [n.value[e.index || 0] ? o(v, null, null) : o(s, null, null)] })])]), [[p, t && t.develop]])]); } }); l.install = (e) => { e.component(l.name, l); }; const A = l; export { A as PTText, l as default }; //# sourceMappingURL=text.mjs.map