Files
aiot-platform-ui/apps/web-antd/dist/js/Text-BEJ9AcVR.js
lzh cb81829d4c
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 24s
chore: build and deploy web-antd
2026-01-14 14:15:09 +08:00

17 lines
21 KiB
JavaScript

import{cg as oe,ch as We,_ as f,ci as Se,n as Ue,m as Fe,h as Ee,bS as Ve,j as U,K as J,c as Ke,cj as Xe,y as we,ck as Q,cl as qe,cm as Oe,cn as Y,o as ie,bh as Ge,ax as Z,co as Je,cp as Qe,cq as fe,cr as ge}from"./bootstrap-CvQmCMXe.js";import{j as p,m as le,bt as Ye,b7 as Te,w as te,b9 as ne,v as $e,aa as X,aW as Ze,bF as et,I as me,R as tt,n as ye}from"../jse/index-index-CAIAj58w.js";var nt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"};function be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){ot(e,r,n[r])})}return e}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var re=function(t,n){var o=be({},t,n.attrs);return p(oe,be({},o,{icon:nt}),null)};re.displayName="EnterOutlined";re.inheritAttrs=!1;const it=(e,t,n,o)=>{const{sizeMarginHeadingVerticalEnd:r,fontWeightStrong:s}=o;return{marginBottom:r,color:n,fontWeight:s,fontSize:e,lineHeight:t}},lt=e=>{const t=[1,2,3,4,5],n={};return t.forEach(o=>{n[`
h${o}&,
div&-h${o},
div&-h${o} > textarea,
h${o}
`]=it(e[`fontSizeHeading${o}`],e[`lineHeightHeading${o}`],e.colorTextHeading,e)}),n},rt=e=>{const{componentCls:t}=e;return{"a&, a":f(f({},Se(e)),{textDecoration:e.linkDecoration,"&:active, &:hover":{textDecoration:e.linkHoverDecoration},[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}})}},at=()=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:We[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:600},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),ct=e=>{const{componentCls:t}=e,o=Ue(e).inputPaddingVertical+1;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:-e.paddingSM,marginTop:-o,marginBottom:`calc(1em - ${o}px)`},[`${t}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.marginXS+2,insetBlockEnd:e.marginXS,color:e.colorTextDescription,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},st=e=>({"&-copy-success":{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}}}),dt=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-single-line":{whiteSpace:"nowrap"},"&-ellipsis-single-line":{overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),ut=e=>{const{componentCls:t,sizeMarginHeadingVerticalStart:n}=e;return{[t]:f(f(f(f(f(f(f(f(f({color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccess},[`&${t}-warning`]:{color:e.colorWarning},[`&${t}-danger`]:{color:e.colorError,"a&:active, a&:focus":{color:e.colorErrorActive},"a&:hover":{color:e.colorErrorHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"}},lt(e)),{[`
& + h1${t},
& + h2${t},
& + h3${t},
& + h4${t},
& + h5${t}
`]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),at()),rt(e)),{[`
${t}-expand,
${t}-edit,
${t}-copy
`]:f(f({},Se(e)),{marginInlineStart:e.marginXXS})}),ct(e)),st(e)),dt()),{"&-rtl":{direction:"rtl"}})}},De=Fe("Typography",e=>[ut(e)],{sizeMarginHeadingVerticalStart:"1.2em",sizeMarginHeadingVerticalEnd:"0.5em"}),pt=()=>({prefixCls:String,value:String,maxlength:Number,autoSize:{type:[Boolean,Object]},onSave:Function,onCancel:Function,onEnd:Function,onChange:Function,originContent:String,direction:String,component:String}),ft=le({compatConfig:{MODE:3},name:"Editable",inheritAttrs:!1,props:pt(),setup(e,t){let{emit:n,slots:o,attrs:r}=t;const{prefixCls:s}=Ye(e),c=Te({current:e.value||"",lastKeyCode:void 0,inComposition:!1,cancelFlag:!1});te(()=>e.value,g=>{c.current=g});const l=ne();$e(()=>{var g;if(l.value){const d=(g=l.value)===null||g===void 0?void 0:g.resizableTextArea,b=d==null?void 0:d.textArea;b.focus();const{length:y}=b.value;b.setSelectionRange(y,y)}});function h(g){l.value=g}function C(g){let{target:{value:d}}=g;c.current=d.replace(/[\r\n]/g,""),n("change",c.current)}function m(){c.inComposition=!0}function T(){c.inComposition=!1}function B(g){const{keyCode:d}=g;d===J.ENTER&&g.preventDefault(),!c.inComposition&&(c.lastKeyCode=d)}function O(g){const{keyCode:d,ctrlKey:b,altKey:y,metaKey:E,shiftKey:H}=g;c.lastKeyCode===d&&!c.inComposition&&!b&&!y&&!E&&!H&&(d===J.ENTER?($(),n("end")):d===J.ESC&&(c.current=e.originContent,n("cancel")))}function N(){$()}function $(){n("save",c.current.trim())}const[M,P]=De(s);return()=>{const g=Ee({[`${s.value}`]:!0,[`${s.value}-edit-content`]:!0,[`${s.value}-rtl`]:e.direction==="rtl",[e.component?`${s.value}-${e.component}`:""]:!0},r.class,P.value);return M(p("div",U(U({},r),{},{class:g}),[p(Ve,{ref:h,maxlength:e.maxlength,value:c.current,onChange:C,onKeydown:B,onKeyup:O,onCompositionstart:m,onCompositionend:T,onBlur:N,rows:1,autoSize:e.autoSize===void 0||e.autoSize},null),o.enterIcon?o.enterIcon({className:`${e.prefixCls}-edit-content-confirm`}):p(re,{class:`${e.prefixCls}-edit-content-confirm`},null)]))}}}),gt=3,mt=8;let S;const ee={padding:0,margin:0,display:"inline",lineHeight:"inherit"};function Ie(e,t){e.setAttribute("aria-hidden","true");const n=window.getComputedStyle(t),o=Xe(n);e.setAttribute("style",o),e.style.position="fixed",e.style.left="0",e.style.height="auto",e.style.minHeight="auto",e.style.maxHeight="auto",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.borderTopWidth="0",e.style.borderBottomWidth="0",e.style.top="-999999px",e.style.zIndex="-1000",e.style.textOverflow="clip",e.style.whiteSpace="normal",e.style.webkitLineClamp="none"}function yt(e){const t=document.createElement("div");Ie(t,e),t.appendChild(document.createTextNode("text")),document.body.appendChild(t);const n=t.getBoundingClientRect().height;return document.body.removeChild(t),n}const bt=(e,t,n,o,r)=>{S||(S=document.createElement("div"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S));const{rows:s,suffix:c=""}=t,l=yt(e),h=Math.round(l*s*100)/100;Ie(S,e);const C=Ke({render(){return p("div",{style:ee},[p("span",{style:ee},[n,c]),p("span",{style:ee},[o])])}});C.mount(S);function m(){return Math.round(S.getBoundingClientRect().height*100)/100-.1<=h}if(m())return C.unmount(),{content:n,text:S.innerHTML,ellipsis:!1};const T=Array.prototype.slice.apply(S.childNodes[0].childNodes[0].cloneNode(!0).childNodes).filter(d=>{let{nodeType:b,data:y}=d;return b!==mt&&y!==""}),B=Array.prototype.slice.apply(S.childNodes[0].childNodes[1].cloneNode(!0).childNodes);C.unmount();const O=[];S.innerHTML="";const N=document.createElement("span");S.appendChild(N);const $=document.createTextNode(r+c);N.appendChild($),B.forEach(d=>{S.appendChild(d)});function M(d){N.insertBefore(d,$)}function P(d,b){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:b.length,H=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const R=Math.floor((y+E)/2),q=b.slice(0,R);if(d.textContent=q,y>=E-1)for(let _=E;_>=y;_-=1){const L=b.slice(0,_);if(d.textContent=L,m()||!L)return _===b.length?{finished:!1,vNode:b}:{finished:!0,vNode:L}}return m()?P(d,b,R,E,R):P(d,b,y,R,H)}function g(d){if(d.nodeType===gt){const y=d.textContent||"",E=document.createTextNode(y);return M(E),P(E,y)}return{finished:!1,vNode:null}}return T.some(d=>{const{finished:b,vNode:y}=g(d);return y&&O.push(y),b}),{content:O,text:S.innerHTML,ellipsis:!0}};var ht=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};const vt=()=>({prefixCls:String,direction:String,component:String}),xt=le({name:"ATypography",inheritAttrs:!1,props:vt(),setup(e,t){let{slots:n,attrs:o}=t;const{prefixCls:r,direction:s}=we("typography",e),[c,l]=De(r);return()=>{var h;const C=f(f({},e),o),{prefixCls:m,direction:T,component:B="article"}=C,O=ht(C,["prefixCls","direction","component"]);return c(p(B,U(U({},O),{},{class:Ee(r.value,{[`${r.value}-rtl`]:s.value==="rtl"},o.class,l.value)}),{default:()=>[(h=n.default)===null||h===void 0?void 0:h.call(n)]}))}}}),Ct=()=>{const e=document.getSelection();if(!e.rangeCount)return function(){};let t=document.activeElement;const n=[];for(let o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},he={"text/plain":"Text","text/html":"Url",default:"Text"},St="Copy to clipboard: #{key}, Enter";function Et(e){const t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function wt(e,t){let n,o,r,s,c,l=!1;t||(t={});const h=t.debug||!1;try{if(o=Ct(),r=document.createRange(),s=document.getSelection(),c=document.createElement("span"),c.textContent=e,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",function(m){if(m.stopPropagation(),t.format)if(m.preventDefault(),typeof m.clipboardData=="undefined"){h&&console.warn("unable to use e.clipboardData"),h&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();const T=he[t.format]||he.default;window.clipboardData.setData(T,e)}else m.clipboardData.clearData(),m.clipboardData.setData(t.format,e);t.onCopy&&(m.preventDefault(),t.onCopy(m.clipboardData))}),document.body.appendChild(c),r.selectNodeContents(c),s.addRange(r),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");l=!0}catch(C){h&&console.error("unable to copy using execCommand: ",C),h&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),l=!0}catch(m){h&&console.error("unable to copy using clipboardData: ",m),h&&console.error("falling back to prompt"),n=Et("message"in t?t.message:St),window.prompt(n,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(r):s.removeAllRanges()),c&&document.body.removeChild(c),o()}return l}var Ot={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"};function ve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){Tt(e,r,n[r])})}return e}function Tt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae=function(t,n){var o=ve({},t,n.attrs);return p(oe,ve({},o,{icon:Ot}),null)};ae.displayName="CopyOutlined";ae.inheritAttrs=!1;var $t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?Object(arguments[t]):{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){Dt(e,r,n[r])})}return e}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ce=function(t,n){var o=xe({},t,n.attrs);return p(oe,xe({},o,{icon:$t}),null)};ce.displayName="EditOutlined";ce.inheritAttrs=!1;var It=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};const Bt=Oe("webkitLineClamp"),Nt=Oe("textOverflow"),Ce="...",Be=()=>({editable:{type:[Boolean,Object],default:void 0},copyable:{type:[Boolean,Object],default:void 0},prefixCls:String,component:String,type:String,disabled:{type:Boolean,default:void 0},ellipsis:{type:[Boolean,Object],default:void 0},code:{type:Boolean,default:void 0},mark:{type:Boolean,default:void 0},underline:{type:Boolean,default:void 0},delete:{type:Boolean,default:void 0},strong:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},content:String,"onUpdate:content":Function}),Pt=le({compatConfig:{MODE:3},name:"TypographyBase",inheritAttrs:!1,props:Be(),setup(e,t){let{slots:n,attrs:o,emit:r}=t;const{prefixCls:s,direction:c}=we("typography",e),l=Te({copied:!1,ellipsisText:"",ellipsisContent:null,isEllipsis:!1,expanded:!1,clientRendered:!1,expandStr:"",copyStr:"",copiedStr:"",editStr:"",copyId:void 0,rafId:void 0,prevProps:void 0,originContent:""}),h=ne(),C=ne(),m=X(()=>{const i=e.ellipsis;return i?f({rows:1,expandable:!1},typeof i=="object"?i:null):{}});$e(()=>{l.clientRendered=!0,R()}),Ze(()=>{clearTimeout(l.copyId),Q.cancel(l.rafId)}),te([()=>m.value.rows,()=>e.content],()=>{ye(()=>{E()})},{flush:"post",deep:!0}),et(()=>{e.content===void 0&&(fe(!e.editable),fe(!e.ellipsis))});function T(){var i;return e.ellipsis||e.editable?e.content:(i=Y(h.value))===null||i===void 0?void 0:i.innerText}function B(i){const{onExpand:a}=m.value;l.expanded=!0,a==null||a(i)}function O(i){i.preventDefault(),l.originContent=e.content,y(!0)}function N(i){$(i),y(!1)}function $(i){const{onChange:a}=g.value;i!==e.content&&(r("update:content",i),a==null||a(i))}function M(){var i,a;(a=(i=g.value).onCancel)===null||a===void 0||a.call(i),y(!1)}function P(i){i.preventDefault(),i.stopPropagation();const{copyable:a}=e,u=f({},typeof a=="object"?a:null);u.text===void 0&&(u.text=T()),wt(u.text||""),l.copied=!0,ye(()=>{u.onCopy&&u.onCopy(i),l.copyId=setTimeout(()=>{l.copied=!1},3e3)})}const g=X(()=>{const i=e.editable;return i?f({},typeof i=="object"?i:null):{editing:!1}}),[d,b]=qe(!1,{value:X(()=>g.value.editing)});function y(i){const{onStart:a}=g.value;i&&a&&a(),b(i)}te(d,i=>{var a;i||(a=C.value)===null||a===void 0||a.focus()},{flush:"post"});function E(i){if(i){const{width:a,height:u}=i;if(!a||!u)return}Q.cancel(l.rafId),l.rafId=Q(()=>{R()})}const H=X(()=>{const{rows:i,expandable:a,suffix:u,onEllipsis:v,tooltip:x}=m.value;return u||x||e.editable||e.copyable||a||v?!1:i===1?Nt:Bt}),R=()=>{const{ellipsisText:i,isEllipsis:a}=l,{rows:u,suffix:v,onEllipsis:x}=m.value;if(!u||u<0||!Y(h.value)||l.expanded||e.content===void 0||H.value)return;const{content:D,text:z,ellipsis:j}=bt(Y(h.value),{rows:u,suffix:v},e.content,de(!0),Ce);(i!==z||l.isEllipsis!==j)&&(l.ellipsisText=z,l.ellipsisContent=D,l.isEllipsis=j,a!==j&&x&&x(j))};function q(i,a){let{mark:u,code:v,underline:x,delete:D,strong:z,keyboard:j}=i,W=a;function I(F,w){if(!F)return;const V=function(){return W}();W=p(w,null,{default:()=>[V]})}return I(z,"strong"),I(x,"u"),I(D,"del"),I(v,"code"),I(u,"mark"),I(j,"kbd"),W}function _(i){const{expandable:a,symbol:u}=m.value;if(!a||!i&&(l.expanded||!l.isEllipsis))return null;const v=(n.ellipsisSymbol?n.ellipsisSymbol():u)||l.expandStr;return p("a",{key:"expand",class:`${s.value}-expand`,onClick:B,"aria-label":l.expandStr},[v])}function L(){if(!e.editable)return;const{tooltip:i,triggerType:a=["icon"]}=e.editable,u=n.editableIcon?n.editableIcon():p(ce,{role:"button"},null),v=n.editableTooltip?n.editableTooltip():l.editStr,x=typeof v=="string"?v:"";return a.indexOf("icon")!==-1?p(Z,{key:"edit",title:i===!1?"":v},{default:()=>[p(ge,{ref:C,class:`${s.value}-edit`,onClick:O,"aria-label":x},{default:()=>[u]})]}):null}function Ne(){if(!e.copyable)return;const{tooltip:i}=e.copyable,a=l.copied?l.copiedStr:l.copyStr,u=n.copyableTooltip?n.copyableTooltip({copied:l.copied}):a,v=typeof u=="string"?u:"",x=l.copied?p(Qe,null,null):p(ae,null,null),D=n.copyableIcon?n.copyableIcon({copied:!!l.copied}):x;return p(Z,{key:"copy",title:i===!1?"":u},{default:()=>[p(ge,{class:[`${s.value}-copy`,{[`${s.value}-copy-success`]:l.copied}],onClick:P,"aria-label":v},{default:()=>[D]})]})}function Pe(){const{class:i,style:a}=o,{maxlength:u,autoSize:v,onEnd:x}=g.value;return p(ft,{class:i,style:a,prefixCls:s.value,value:e.content,originContent:l.originContent,maxlength:u,autoSize:v,onSave:N,onChange:$,onCancel:M,onEnd:x,direction:c.value,component:e.component},{enterIcon:n.editableEnterIcon})}function de(i){return[_(i),L(),Ne()].filter(a=>a)}return()=>{var i;const{triggerType:a=["icon"]}=g.value,u=e.ellipsis||e.editable?e.content!==void 0?e.content:(i=n.default)===null||i===void 0?void 0:i.call(n):n.default?n.default():e.content;return d.value?Pe():p(Je,{componentName:"Text",children:v=>{const x=f(f({},e),o),{type:D,disabled:z,content:j,class:W,style:I}=x,F=It(x,["type","disabled","content","class","style"]),{rows:w,suffix:V,tooltip:G}=m.value,{edit:Re,copy:je,copied:He,expand:_e}=v;l.editStr=Re,l.copyStr=je,l.copiedStr=He,l.expandStr=_e;const ze=ie(F,["prefixCls","editable","copyable","ellipsis","mark","code","delete","underline","strong","keyboard","onUpdate:content"]),K=H.value,Ae=w===1&&K,ue=w&&w>1&&K;let A=u,ke;if(w&&l.isEllipsis&&!l.expanded&&!K){const{title:pe}=F;let k=pe||"";!pe&&(typeof u=="string"||typeof u=="number")&&(k=String(u)),k=k==null?void 0:k.slice(String(l.ellipsisContent||"").length),A=p(me,null,[tt(l.ellipsisContent),p("span",{title:k,"aria-hidden":"true"},[Ce]),V])}else A=p(me,null,[u,V]);A=q(e,A);const Me=G&&w&&l.isEllipsis&&!l.expanded&&!K,Le=n.ellipsisTooltip?n.ellipsisTooltip():G;return p(Ge,{onResize:E,disabled:!w},{default:()=>[p(xt,U({ref:h,class:[{[`${s.value}-${D}`]:D,[`${s.value}-disabled`]:z,[`${s.value}-ellipsis`]:w,[`${s.value}-single-line`]:w===1&&!l.isEllipsis,[`${s.value}-ellipsis-single-line`]:Ae,[`${s.value}-ellipsis-multiple-line`]:ue},W],style:f(f({},I),{WebkitLineClamp:ue?w:void 0}),"aria-label":ke,direction:c.value,onClick:a.indexOf("text")!==-1?O:()=>{}},ze),{default:()=>[Me?p(Z,{title:G===!0?u:Le},{default:()=>[p("span",null,[A])]}):A,de()]})]})}},null)}}}),Rt=()=>f(f({},ie(Be(),["component"])),{ellipsis:{type:[Boolean,Object],default:void 0}}),se=(e,t)=>{let{slots:n,attrs:o}=t;const{ellipsis:r}=e,s=f(f(f({},e),{ellipsis:r&&typeof r=="object"?ie(r,["expandable","rows"]):r,component:"span"}),o);return p(Pt,s,n)};se.displayName="ATypographyText";se.inheritAttrs=!1;se.props=Rt();export{Pt as B,se as T,xt as a,Be as b};