17 lines
20 KiB
Java
17 lines
20 KiB
Java
|
|
import{cq as We,hP as Fe,a as c,h7 as Ke,l as Ue,k as Te,bR as Ve,h as U,aI as ie,hQ as Xe,f as Ee,dF as le,hG as qe,go as re,c8 as M,fK as Ge,T as ae,gY as Qe,f7 as Ye,hR as we,dq as ye,hS as Je}from"./index-X7Y8jykP.js";import{T as be}from"./transButton-B2CWzlQO.js";import{f,e as ue,a7 as Ze,b as Oe,h as ce,o as Ie,r as de,af as et,x as tt,w as nt,c as te,F as he,t as ot,n as ve}from"./vue-vendor-DNhG1Cve.js";import{o as Ne}from"./operationUnit-vCu2co3e.js";import{C as it}from"./CopyOutlined-Dpp8TC22.js";import{E as lt}from"./EditOutlined-drlR34lz.js";var rt={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 xe(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?Object(arguments[t]):{},n=Object.keys(o);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(o).filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable}))),n.forEach(function(i){at(e,i,o[i])})}return e}function at(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var pe=function(t,o){var n=xe({},t,o.attrs);return f(We,xe({},n,{icon:rt}),null)};pe.displayName="EnterOutlined";pe.inheritAttrs=!1;const st=(e,t,o,n)=>{const{sizeMarginHeadingVerticalEnd:i,fontWeightStrong:d}=n;return{marginBottom:i,color:o,fontWeight:d,fontSize:e,lineHeight:t}},ct=e=>{const t=[1,2,3,4,5],o={};return t.forEach(n=>{o[`
|
||
|
|
h${n}&,
|
||
|
|
div&-h${n},
|
||
|
|
div&-h${n} > textarea,
|
||
|
|
h${n}
|
||
|
|
`]=st(e[`fontSizeHeading${n}`],e[`lineHeightHeading${n}`],e.colorTextHeading,e)}),o},dt=e=>{const{componentCls:t}=e;return{"a&, a":c(c({},Ne(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"}}})}},ut=()=>({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:Fe[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}}),pt=e=>{const{componentCls:t}=e,n=Ke(e).inputPaddingVertical+1;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:-e.paddingSM,marginTop:-n,marginBottom:`calc(1em - ${n}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"}}}},ft=e=>({"&-copy-success":{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}}}),mt=()=>({"\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"}}),gt=e=>{const{componentCls:t,sizeMarginHeadingVerticalStart:o}=e;return{[t]:c(c(c(c(c(c(c(c(c({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"}},ct(e)),{[`
|
||
|
|
& + h1${t},
|
||
|
|
& + h2${t},
|
||
|
|
& + h3${t},
|
||
|
|
& + h4${t},
|
||
|
|
& + h5${t}
|
||
|
|
`]:{marginTop:o},"\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:o}}}),ut()),dt(e)),{[`
|
||
|
|
${t}-expand,
|
||
|
|
${t}-edit,
|
||
|
|
${t}-copy
|
||
|
|
`]:c(c({},Ne(e)),{marginInlineStart:e.marginXXS})}),pt(e)),ft(e)),mt()),{"&-rtl":{direction:"rtl"}})}},Pe=Ue("Typography",e=>[gt(e)],{sizeMarginHeadingVerticalStart:"1.2em",sizeMarginHeadingVerticalEnd:"0.5em"}),yt=()=>({prefixCls:String,value:String,maxlength:Number,autoSize:{type:[Boolean,Object]},onSave:Function,onCancel:Function,onEnd:Function,onChange:Function,originContent:String,direction:String,component:String}),bt=ue({compatConfig:{MODE:3},name:"Editable",inheritAttrs:!1,props:yt(),setup(e,t){let{emit:o,slots:n,attrs:i}=t;const{prefixCls:d}=Ze(e),a=Oe({current:e.value||"",lastKeyCode:void 0,inComposition:!1,cancelFlag:!1});ce(()=>e.value,m=>{a.current=m});const l=de();Ie(()=>{var m;if(l.value){const u=(m=l.value)===null||m===void 0?void 0:m.resizableTextArea,h=u==null?void 0:u.textArea;h.focus();const{length:b}=h.value;h.setSelectionRange(b,b)}});function g(m){l.value=m}function S(m){let{target:{value:u}}=m;a.current=u.replace(/[\r\n]/g,""),o("change",a.current)}function y(){a.inComposition=!0}function I(){a.inComposition=!1}function D(m){const{keyCode:u}=m;u===ie.ENTER&&m.preventDefault(),!a.inComposition&&(a.lastKeyCode=u)}function O(m){const{keyCode:u,ctrlKey:h,altKey:b,metaKey:E,shiftKey:A}=m;a.lastKeyCode===u&&!a.inComposition&&!h&&!b&&!E&&!A&&(u===ie.ENTER?(N(),o("end")):u===ie.ESC&&(a.current=e.originContent,o("cancel")))}function k(){N()}function N(){o("save",a.current.trim())}const[W,B]=Pe(d);return()=>{const m=Te({[`${d.value}`]:!0,[`${d.value}-edit-content`]:!0,[`${d.value}-rtl`]:e.direction==="rtl",[e.component?`${d.value}-${e.component}`:""]:!0},i.class,B.value);return W(f("div",U(U({},i),{},{class:m}),[f(Ve,{ref:g,maxlength:e.maxlength,value:a.current,onChange:S,onKeydown:D,onKeyup:O,onCompositionstart:y,onCompositionend:I,onBlur:k,rows:1,autoSize:e.autoSize===void 0||e.autoSize},null),n.enterIcon?n.enterIcon({className:`${e.prefixCls}-edit-content-confirm`}):f(pe,{class:`${e.prefixCls}-edit-content-confirm`},null)]))}}}),ht=3,vt=8;let C;const se={padding:0,margin:0,display:"inline",lineHeight:"inherit"};function $e(e,t){e.setAttribute("aria-hidden","true");const o=window.getComputedStyle(t),n=Xe(o);e.setAttribute("style",n),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 xt(e){const t=document.createElement("div");$e(t,e),t.appendChild(document.createTextNode("text")),document.body.appendChild(t);const o=t.getBoundingClientRect().height;return document.body.removeChild(t),o}const Ct=((e,t,o,n,i)=>{C||(C=document.createElement("div"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C));const{rows:d,suffix:a=""}=t,l=xt(e),g=Math.round(l*d*100)/100;$e(C,e);const S=et({render(){return f("div",{style:se},[f("span",{style:se},[o,a]),f("span",{style:se},[n])])}});S.mount(C);function y(){return Math.round(C.getBoundingClientRect().height*100)/100-.1<=g}if(y())return S.unmount(),{content:o,text:C.innerHTML,ellipsis:!1};const I=Array.prototype.slice.apply(C.childNodes[0].childNodes[0].cloneNode(!0).childNodes).filter(u=>{let{nodeType:h,data:b}=u;return h!==vt&&b!==""}),D=Array.prototype.slice.apply(C.childNodes[0].childNodes[1].cloneNode(!0).childNodes);S.unmount();const O=[];C.innerHTML="";const k=document.createElement("span");C.appendChild(k);const N=document.createTextNode(i+a);k.appendChild(N),D.forEach(u=>{C.appendChild(u)});function W(u){k.insertBefore(u,N)}function B(u,h){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,E=arguments.length>3&&arguments[3]!==void 0?arguments[3]:h.length,A=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const _=Math.floor((b+E)/2),ne=h.slice(0,_);if(u.textContent=ne,b>=E-1)for(let j=E;j>=b;j-=1){const F=h.slice(0,j);if(u.textContent=F,y()||!F)return j===h.length?{finished:!1,vNode:h}:{finished:!0,vNode:F}}return y()
|