"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("@ant-design/icons-vue"),c=require("@aplus-frontend/antdv");require("../../../config-provider/index.js");const f=require("../../../utils/copy.js"),d=require("../../style/ellipsis.js"),y=require("../../../config-provider/hooks/use-namespace.js"),h=require("../../../config-provider/hooks/use-locale.js"),v=e.defineComponent({name:"ApTableParagraphEllipsis",__name:"index",props:{copyable:{type:Boolean},content:{type:[Object,String,Number,Boolean,null,Array]},rawValue:{},ellipsis:{type:[Boolean,Object]}},setup(i){const t=i,{b:a}=y.useNamespace("ap-table-paragraph-ellipsis"),p=d.default("ap-table-paragraph-ellipsis"),{t:s}=h.useLocale(),l=e.ref(!1),o=e.computed(()=>t.ellipsis===!0?{rows:1,tooltip:t.content,htmlTitle:""}:typeof t.ellipsis=="object"?Object.assign({rows:1,tooltip:t.content,htmlTitle:""},t.ellipsis):{});function u(){const r=t.rawValue||"";f.copy(r)&&!l.value&&(l.value=!0,setTimeout(()=>{l.value=!1},2200))}return(r,m)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({class:[e.unref(a)(),e.unref(p)]},{...r.$attrs},{style:{"--ap-table-paragraph-ellipsis-rows":o.value?.rows}}),[e.createElementVNode("div",{class:e.normalizeClass([e.unref(a)("content")])},[e.createVNode(e.unref(c.Tooltip),null,e.createSlots({default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h("span",{title:o.value?.htmlTitle},[t.content]))))]),_:2},[o.value?.tooltip?{name:"title",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.h("div",[o.value.tooltip]))))]),key:"0"}:void 0]),1024)],2),t.copyable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(a)("copyable")]),onClick:u},[e.createVNode(e.unref(c.Tooltip),{title:l.value?e.unref(s)("ap.apTable.paragraphEllipsis.copySuccess"):e.unref(s)("ap.apTable.paragraphEllipsis.copy")},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createBlock(e.unref(n.CheckOutlined),{key:1})):(e.openBlock(),e.createBlock(e.unref(n.CopyOutlined),{key:0}))]),_:1},8,["title"])],2)):e.createCommentVNode("",!0)],16))}});exports.default=v;
