2023-10-30 02:12:29 +00:00
|
|
|
import{u as r,g as C4,o as tf,r as A,a as ks,s as $t,w as zn,b as de,c as Qe,d as Ze,n as xe,e as $,i as et,f as kt,h as it,j as $4,k as nf,l as _,m as S,p as k,q as k4,t as an,v as S4,N as Nt,x as yt,y as Lt,F as Ve,C as Hu,z as Tt,A as Te,B as dn,D as M4,E as Pu,G as ct,H as U,I as ue,J as x,K as ze,L as lt,M as Jt,O as te,P as G,Q as je,R as ot,S as J,T as gt,U as be,V as W,W as ht,X as qt,Y as zt,Z as nl,_ as bt,$ as Gt,a0 as ma,a1 as of,a2 as ga,a3 as He,a4 as E4,a5 as af,a6 as Ql,a7 as x4,a8 as dt,a9 as vt,aa as yo,ab as xl,ac as Un,ad as ia,ae as as,af as lf,ag as Ae,ah as Ue,ai as T4,aj as Ei,ak as Bu,al as z4,am as Ru,an as _l,ao as O4,ap as il,aq as Qs,ar as Tl,as as hd,at as N4,au as A4,av as I4,aw as Fa}from"./vue-02cc547d.js";const V4='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',L4=e=>getComputedStyle(e).position==="fixed"?!1:e.offsetParent!==null,md=e=>Array.from(e.querySelectorAll(V4)).filter(t=>H4(t)&&L4(t)),H4=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Ar=function(e,t,...n){let o;t.includes("mouse")||t.includes("click")?o="MouseEvents":t.includes("key")?o="KeyboardEvent":o="HTMLEvents";const a=document.createEvent(o);return a.initEvent(t,...n),e.dispatchEvent(a),e},rf=e=>!e.getAttribute("aria-owns"),sf=(e,t,n)=>{const{parentNode:o}=e;if(!o)return null;const a=o.querySelectorAll(n),l=Array.prototype.indexOf.call(a,e);return a[l+t]||null},Ir=e=>{e&&(e.focus(),!rf(e)&&e.click())},At=(e,t,{checkForDefaultPrevented:n=!0}={})=>a=>{const l=e==null?void 0:e(a);if(n===!1||!l)return t==null?void 0:t(a)},gd=e=>t=>t.pointerType==="mouse"?e(t):void 0;var P4=Object.defineProperty,B4=Object.defineProperties,R4=Object.getOwnPropertyDescriptors,_d=Object.getOwnPropertySymbols,D4=Object.prototype.hasOwnProperty,F4=Object.prototype.propertyIsEnumerable,yd=(e,t,n)=>t in e?P4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K4=(e,t)=>{for(var n in t||(t={}))D4.call(t,n)&&yd(e,n,t[n]);if(_d)for(var n of _d(t))F4.call(t,n)&&yd(e,n,t[n]);return e},W4=(e,t)=>B4(e,R4(t));function bd(e,t){var n;const o=$t();return zn(()=>{o.value=e()},W4(K4({},t),{flush:(n=t==null?void 0:t.flush)!=null?n:"sync"})),ks(o)}var wd;const ft=typeof window<"u",j4=e=>typeof e<"u",q4=e=>typeof e=="function",U4=e=>typeof e=="string",Ka=()=>{},uf=ft&&((wd=window==null?void 0:window.navigator)==null?void 0:wd.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Po(e){return typeof e=="function"?e():r(e)}function cf(e,t){function n(...o){return new Promise((a,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(a).catch(l)})}return n}function Y4(e,t={}){let n,o,a=Ka;const l=i=>{clearTimeout(i),a(),a=Ka};return i=>{const u=Po(e),c=Po(t.maxWait);return n&&l(n),u<=0||c!==void 0&&c<=0?(o&&(l(o),o=null),Promise.resolve(i())):new Promise((f,d)=>{a=t.rejectOnCancel?d:f,c&&!o&&(o=setTimeout(()=>{n&&l(n),o=null,f(i())},c)),n=setTimeout(()=>{o&&l(o),o=null,f(i())},u)})}}function G4(e,t=!0,n=!0,o=!1){let a=0,l,s=!0,i=Ka,u;const c=()=>{l&&(clearTimeout(l),l=void 0,i(),i=Ka)};return d=>{const p=Po(e),h=Date.now()-a,m=()=>u=d();return c(),p<=0?(a=Date.now(),m()):(h>p&&(n||!s)?(a=Date.now(),m()):t&&(u=new Promise((v,y)=>{i=o?y:v,l=setTimeout(()=>{a=Date.now(),s=!0,v(m()),c()},Math.max(0,p-h))})),!n&&!l&&(l=setTimeout(()=>s=!0,p)),s=!1,u)}}function X4(e){return e}function er(e){return C4()?(tf(e),!0):!1}function Z4(e,t=200,n={}){return cf(Y4(t,n),e)}function J4(e,t=200,n={}){const o=A(e.value),a=Z4(()=>{o.value=e.value},t,n);return de(e,()=>a()),o}function df(e,t=200,n=!1,o=!0,a=!1){return cf(G4(t,n,o,a),e)}function Du(e,t=!0){Qe()?Ze(e):t?e():xe(e)}function ua(e,t,n={}){const{immediate:o=!0}=n,a=A(!1);let l=null;function s(){l&&(clearTimeout(l),l=null)
|
2023-10-17 06:44:04 +00:00
|
|
|
(?:
|
|
|
|
|
(?:`+o+":){7}(?:"+o+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
|
|
|
(?:`+o+":){6}(?:"+n+"|:"+o+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
|
|
|
(?:`+o+":){5}(?::"+n+"|(?::"+o+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
|
|
|
(?:`+o+":){4}(?:(?::"+o+"){0,1}:"+n+"|(?::"+o+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
|
|
|
(?:`+o+":){3}(?:(?::"+o+"){0,2}:"+n+"|(?::"+o+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
|
|
|
(?:`+o+":){2}(?:(?::"+o+"){0,3}:"+n+"|(?::"+o+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
|
|
|
(?:`+o+":){1}(?:(?::"+o+"){0,4}:"+n+"|(?::"+o+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
|
|
|
(?::(?:(?::`+o+"){0,5}:"+n+"|(?::"+o+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
|
|
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
2023-10-18 06:10:06 +00:00
|
|
|
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),l=new RegExp("(?:^"+n+"$)|(?:^"+a+"$)"),s=new RegExp("^"+n+"$"),i=new RegExp("^"+a+"$"),u=function(C){return C&&C.exact?l:new RegExp("(?:"+t(C)+n+t(C)+")|(?:"+t(C)+a+t(C)+")","g")};u.v4=function(w){return w&&w.exact?s:new RegExp(""+t(w)+n+t(w),"g")},u.v6=function(w){return w&&w.exact?i:new RegExp(""+t(w)+a+t(w),"g")};var c="(?:(?:[a-z]+:)?//)",f="(?:\\S+(?::\\S*)?@)?",d=u.v4().source,p=u.v6().source,h="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",m="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",v="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",g='(?:[/?#][^\\s"]*)?',b="(?:"+c+"|www\\.)"+f+"(?:localhost|"+d+"|"+p+"|"+h+m+v+")"+y+g;return wr=new RegExp("(?:^"+b+"$)","i"),wr},A0={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},ml={integer:function(t){return ml.number(t)&&parseInt(t,10)===t},float:function(t){return ml.number(t)&&!ml.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!ml.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(A0.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(yQ())},hex:function(t){return typeof t=="string"&&!!t.match(A0.hex)}},bQ=function(t,n,o,a,l){if(t.required&&n===void 0){dp(t,n,o,a,l);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],i=t.type;s.indexOf(i)>-1?ml[i](n)||a.push(Tn(l.messages.types[i],t.fullField,t.type)):i&&typeof n!==t.type&&a.push(Tn(l.messages.types[i],t.fullField,t.type))},wQ=function(t,n,o,a,l){var s=typeof t.len=="number",i=typeof t.min=="number",u=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=n,d=null,p=typeof n=="number",h=typeof n=="string",m=Array.isArray(n);if(p?d="number":h?d="string":m&&(d="array"),!d)return!1;m&&(f=n.length),h&&(f=n.replace(c,"_").length),s?f!==t.len&&a.push(Tn(l.messages[d].len,t.fullField,t.len)):i&&!u&&f<t.min?a.push(Tn(l.messages[d].min,t.fullField,t.min)):u&&!i&&f>t.max?a.push(Tn(l.messages[d].max,t.fullField,t.max)):i&&u&&(f<t.min||f>t.max)&&a.push(Tn(l.messages[d].range,t.fullField,t.min,t.max))},ka="enum",CQ=function(t,n,o,a,l){t[ka]=Array.isArray(t[ka])?t[ka]:[],t[ka].indexOf(n)===-1&&a.push(Tn(l.messages[ka],t.fullField,t[ka].join(", ")))},$Q=function(t,n,o,a,l){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||a.push(Tn(l.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var s=new RegExp(t.pattern);s.test(n)||a.push(Tn(l.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},Ct={required:dp,whitespace:_Q,type:bQ,range:wQ,enum:CQ,pattern:$Q},kQ=function(t,n,o,a,l){var s=[],i=t.required||!t.required&&a.hasOwnProperty(t.field);if(i){if(Xt(n,"string")&&!t.required)return o();Ct.required(t,n,a,s,l,"string"),Xt(n,"string")||(Ct.type(t,n,a,s,l),Ct.range(t,n,a,s,l),Ct.pattern(t,n,a,s,l),t.whitespace===!0&&Ct.whitespace(t,n,a,s,l))}o(s)},SQ=function(t,n,o,a,l){var s=[],i=t.required||!t.required&&a.hasOwnProperty(t.field);if(i){if(Xt(n)&&!t.required)return o();Ct.required(t,n,a,s,l),n!==void 0&&Ct.type(t,n,a,s,l)}o(s)},MQ=function(t,n,o,a,l){var s=[],i=t.required||!t.required&&a.hasOwnProperty(t.field);if(i){if(n===""&&(n=void 0),Xt(n)&&!t.required)return o();Ct.required(t,n,a,s,l),n!==void 0&&(Ct.type(t,n,a,s,l),Ct.range(t,n,a,s,l))}o(s)},EQ=function(t,n,o,a,l){var s=[],i=t.required||!t.required&&a.hasOwnProperty(t.field);if(i){if(Xt(n)&&!t.requir
|
2023-10-17 06:44:04 +00:00
|
|
|
height:0 !important;
|
|
|
|
|
visibility:hidden !important;
|
|
|
|
|
${pf()?"":"overflow:hidden !important;"}
|
|
|
|
|
position:absolute !important;
|
|
|
|
|
z-index:-1000 !important;
|
|
|
|
|
top:0 !important;
|
|
|
|
|
right:0 !important;
|
2023-10-18 06:10:06 +00:00
|
|
|
`,YQ=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function GQ(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),o=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),a=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:YQ.map(s=>`${s}:${t.getPropertyValue(s)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:n}}function V0(e,t=1,n){var o;Wn||(Wn=document.createElement("textarea"),document.body.appendChild(Wn));const{paddingSize:a,borderSize:l,boxSizing:s,contextStyle:i}=GQ(e);Wn.setAttribute("style",`${i};${UQ}`),Wn.value=e.value||e.placeholder||"";let u=Wn.scrollHeight;const c={};s==="border-box"?u=u+l:s==="content-box"&&(u=u-a),Wn.value="";const f=Wn.scrollHeight-a;if(Be(t)){let d=f*t;s==="border-box"&&(d=d+a+l),u=Math.max(d,u),c.minHeight=`${d}px`}if(Be(n)){let d=f*n;s==="border-box"&&(d=d+a+l),u=Math.min(d,u)}return c.height=`${u}px`,(o=Wn.parentNode)==null||o.removeChild(Wn),Wn=void 0,c}const XQ=_e({id:{type:String,default:void 0},size:ln,disabled:Boolean,modelValue:{type:Q([String,Number,Object]),default:""},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Q([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:St},prefixIcon:{type:St},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Q([Object,Array,String]),default:()=>xt({})},autofocus:{type:Boolean,default:!1}}),ZQ={[tt]:e=>it(e),input:e=>it(e),change:e=>it(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},JQ=["role"],QQ=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],eee=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],tee=U({name:"ElInput",inheritAttrs:!1}),nee=U({...tee,props:XQ,emits:ZQ,setup(e,{expose:t,emit:n}){const o=e,a=ga(),l=Jt(),s=$(()=>{const Ce={};return o.containerRole==="combobox"&&(Ce["aria-haspopup"]=a["aria-haspopup"],Ce["aria-owns"]=a["aria-owns"],Ce["aria-expanded"]=a["aria-expanded"]),Ce}),i=$(()=>[o.type==="textarea"?y.b():v.b(),v.m(h.value),v.is("disabled",m.value),v.is("exceed",le.value),{[v.b("group")]:l.prepend||l.append,[v.bm("group","append")]:l.append,[v.bm("group","prepend")]:l.prepend,[v.m("prefix")]:l.prefix||o.prefixIcon,[v.m("suffix")]:l.suffix||o.suffixIcon||o.clearable||o.showPassword,[v.bm("suffix","password-clear")]:D.value&&j.value},a.class]),u=$(()=>[v.e("wrapper"),v.is("focus",B.value)]),c=pc({excludeKeys:$(()=>Object.keys(s.value))}),{form:f,formItem:d}=gn(),{inputId:p}=jo(o,{formItemContext:d}),h=Yt(),m=Mn(),v=fe("input"),y=fe("textarea"),g=$t(),b=$t(),w=A(!1),C=A(!1),T=A(!1),M=A(),O=$t(o.inputStyle),E=$(()=>g.value||b.value),{wrapperRef:N,isFocused:B,handleFocus:V,handleBlur:H}=ip(E,{afterBlur(){var Ce;o.validateEvent&&((Ce=d==null?void 0:d.validate)==null||Ce.call(d,"blur").catch(We=>void 0))}}),L=$(()=>{var Ce;return(Ce=f==null?void 0:f.statusIcon)!=null?Ce:!1}),R=$(()=>(d==null?void 0:d.validateState)||""),K=$(()=>R.value&&fc[R.value]),F=$(()=>T.value?b1:i1),I=$(()=>[a.style,o.inputStyle]),P=$(()=>[o.in
|
2023-10-17 06:44:04 +00:00
|
|
|
Add an empty element to avoid render label,
|
|
|
|
|
do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485
|
|
|
|
|
`),Cae]),_:1},8,["model-value","label","disabled","onUpdate:modelValue"])):e.isLeaf&&e.node.checked?(_(),te(c,{key:2,class:x(e.ns.e("prefix"))},{default:G(()=>[W(u)]),_:1},8,["class"])):J("v-if",!0),J(" content "),W(f),J(" postfix "),e.isLeaf?J("v-if",!0):(_(),S(Ve,{key:3},[e.node.loading?(_(),te(c,{key:0,class:x([e.ns.is("loading"),e.ns.e("postfix")])},{default:G(()=>[W(d)]),_:1},8,["class"])):(_(),te(c,{key:1,class:x(["arrow-right",e.ns.e("postfix")])},{default:G(()=>[W(p)]),_:1},8,["class"]))],64))],42,wae)}var kae=ye(bae,[["render",$ae],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader-panel/src/node.vue"]]);const Sae=U({name:"ElCascaderMenu",components:{Loading:Eo,ElIcon:Me,ElScrollbar:xo,ElCascaderNode:kae},props:{nodes:{type:Array,required:!0},index:{type:Number,required:!0}},setup(e){const t=Qe(),n=fe("cascader-menu"),{t:o}=pt(),a=Bs();let l=null,s=null;const i=Te(Hc),u=A(null),c=$(()=>!e.nodes.length),f=$(()=>!i.initialLoaded),d=$(()=>`cascader-menu-${a}-${e.index}`),p=y=>{l=y.target},h=y=>{if(!(!i.isHoverMenu||!l||!u.value))if(l.contains(y.target)){m();const g=t.vnode.el,{left:b}=g.getBoundingClientRect(),{offsetWidth:w,offsetHeight:C}=g,T=y.clientX-b,M=l.offsetTop,O=M+l.offsetHeight;u.value.innerHTML=`
|
|
|
|
|
<path style="pointer-events: auto;" fill="transparent" d="M${T} ${M} L${w} 0 V${M} Z" />
|
|
|
|
|
<path style="pointer-events: auto;" fill="transparent" d="M${T} ${O} L${w} ${C} V${O} Z" />
|
2023-10-18 06:10:06 +00:00
|
|
|
`}else s||(s=window.setTimeout(v,i.config.hoverThreshold))},m=()=>{s&&(clearTimeout(s),s=null)},v=()=>{u.value&&(u.value.innerHTML="",m())};return{ns:n,panel:i,hoverZone:u,isEmpty:c,isLoading:f,menuId:d,t:o,handleExpand:p,handleMouseMove:h,clearHoverZone:v}}});function Mae(e,t,n,o,a,l){const s=Ue("el-cascader-node"),i=Ue("loading"),u=Ue("el-icon"),c=Ue("el-scrollbar");return _(),te(c,{key:e.menuId,tag:"ul",role:"menu",class:x(e.ns.b()),"wrap-class":e.ns.e("wrap"),"view-class":[e.ns.e("list"),e.ns.is("empty",e.isEmpty)],onMousemove:e.handleMouseMove,onMouseleave:e.clearHoverZone},{default:G(()=>{var f;return[(_(!0),S(Ve,null,dt(e.nodes,d=>(_(),te(s,{key:d.uid,node:d,"menu-id":e.menuId,onExpand:e.handleExpand},null,8,["node","menu-id","onExpand"]))),128)),e.isLoading?(_(),S("div",{key:0,class:x(e.ns.e("empty-text"))},[W(u,{size:"14",class:x(e.ns.is("loading"))},{default:G(()=>[W(i)]),_:1},8,["class"]),gt(" "+be(e.t("el.cascader.loading")),1)],2)):e.isEmpty?(_(),S("div",{key:1,class:x(e.ns.e("empty-text"))},be(e.t("el.cascader.noData")),3)):(f=e.panel)!=null&&f.isHoverMenu?(_(),S("svg",{key:2,ref:"hoverZone",class:x(e.ns.e("hover-zone"))},null,2)):J("v-if",!0)]}),_:1},8,["class","wrap-class","view-class","onMousemove","onMouseleave"])}var Eae=ye(Sae,[["render",Mae],["__file","/home/runner/work/element-plus/element-plus/packages/components/cascader-panel/src/menu.vue"]]);let xae=0;const Tae=e=>{const t=[e];let{parent:n}=e;for(;n;)t.unshift(n),n=n.parent;return t};let lu=class ru{constructor(t,n,o,a=!1){this.data=t,this.config=n,this.parent=o,this.root=a,this.uid=xae++,this.checked=!1,this.indeterminate=!1,this.loading=!1;const{value:l,label:s,children:i}=n,u=t[i],c=Tae(this);this.level=a?0:o?o.level+1:1,this.value=t[l],this.label=t[s],this.pathNodes=c,this.pathValues=c.map(f=>f.value),this.pathLabels=c.map(f=>f.label),this.childrenData=u,this.children=(u||[]).map(f=>new ru(f,n,this)),this.loaded=!n.lazy||this.isLeaf||!An(u)}get isDisabled(){const{data:t,parent:n,config:o}=this,{disabled:a,checkStrictly:l}=o;return(yt(a)?a(t,this):!!t[a])||!l&&(n==null?void 0:n.isDisabled)}get isLeaf(){const{data:t,config:n,childrenData:o,loaded:a}=this,{lazy:l,leaf:s}=n,i=yt(s)?s(t,this):t[s];return Wt(i)?l&&!a?!1:!(Array.isArray(o)&&o.length):!!i}get valueByOption(){return this.config.emitPath?this.pathValues:this.value}appendChild(t){const{childrenData:n,children:o}=this,a=new ru(t,this.config,this);return Array.isArray(n)?n.push(t):this.childrenData=[t],o.push(a),a}calcText(t,n){const o=t?this.pathLabels.join(n):this.label;return this.text=o,o}broadcast(t,...n){const o=`onParent${eo(t)}`;this.children.forEach(a=>{a&&(a.broadcast(t,...n),a[o]&&a[o](...n))})}emit(t,...n){const{parent:o}=this,a=`onChild${eo(t)}`;o&&(o[a]&&o[a](...n),o.emit(t,...n))}onParentCheck(t){this.isDisabled||this.setCheckState(t)}onChildCheck(){const{children:t}=this,n=t.filter(a=>!a.isDisabled),o=n.length?n.every(a=>a.checked):!1;this.setCheckState(o)}setCheckState(t){const n=this.children.length,o=this.children.reduce((a,l)=>{const s=l.checked?1:l.indeterminate?.5:0;return a+s},0);this.checked=this.loaded&&this.children.filter(a=>!a.isDisabled).every(a=>a.loaded&&a.checked)&&t,this.indeterminate=this.loaded&&o!==n&&o>0}doCheck(t){if(this.checked===t)return;const{checkStrictly:n,multiple:o}=this.config;n||!o?this.checked=t:(this.broadcast("check",t),this.setCheckState(t),this.emit("check"))}};const su=(e,t)=>e.reduce((n,o)=>(o.isLeaf?n.push(o):(!t&&n.push(o),n=n.concat(su(o.children,t))),n),[]);class u2{constructor(t,n){this.config=n;const o=(t||[]).map(a=>new lu(a,this.config));this.nodes=o,this.allNodes=su(o,!1),this.leafNodes=su(o,!0)}getNodes(){return this.nodes}getFlattedNodes(t){return t?this.leafNodes:this.allNodes}appendNode(t,n){const o=n?n.appendChild(t):new lu(t,this.config);n||this.nodes.push(o),this.allNodes.push(o),o.isLeaf&&this.leafNodes.push(o)}appendNodes(t,n){t.forEach(o=>this.appendNode(o,n))}getNodeByValue(t,n=!1){return!t&&t!==0?null:this.getFlattedNodes(n).find(a=>wn(a.value,t)||wn(a.pathValues,t))||null}getSameNode(t){return t&&this.g
|
2023-10-17 06:44:04 +00:00
|
|
|
M 50 50
|
|
|
|
|
m 0 ${C?"":"-"}${w}
|
|
|
|
|
a ${w} ${w} 0 1 1 0 ${C?"-":""}${w*2}
|
|
|
|
|
a ${w} ${w} 0 1 1 0 ${C?"":"-"}${w*2}
|
2023-10-18 06:10:06 +00:00
|
|
|
`}),u=$(()=>2*Math.PI*s.value),c=$(()=>t.type==="dashboard"?.75:1),f=$(()=>`${-1*u.value*(1-c.value)/2}px`),d=$(()=>({strokeDasharray:`${u.value*c.value}px, ${u.value}px`,strokeDashoffset:f.value})),p=$(()=>({strokeDasharray:`${u.value*c.value*(t.percentage/100)}px, ${u.value}px`,strokeDashoffset:f.value,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"})),h=$(()=>{let w;return t.color?w=b(t.percentage):w=n[t.status]||n.default,w}),m=$(()=>t.status==="warning"?ir:t.type==="line"?t.status==="success"?Ns:Mo:t.status==="success"?al:Pn),v=$(()=>t.type==="line"?12+t.strokeWidth*.4:t.width*.111111+2),y=$(()=>t.format(t.percentage));function g(w){const C=100/w.length;return w.map((M,O)=>it(M)?{color:M,percentage:(O+1)*C}:M).sort((M,O)=>M.percentage-O.percentage)}const b=w=>{var C;const{color:T}=t;if(yt(T))return T(w);if(it(T))return T;{const M=g(T);for(const O of M)if(O.percentage>w)return O.color;return(C=M[M.length-1])==null?void 0:C.color}};return(w,C)=>(_(),S("div",{class:x([r(o).b(),r(o).m(w.type),r(o).is(w.status),{[r(o).m("without-text")]:!w.showText,[r(o).m("text-inside")]:w.textInside}]),role:"progressbar","aria-valuenow":w.percentage,"aria-valuemin":"0","aria-valuemax":"100"},[w.type==="line"?(_(),S("div",{key:0,class:x(r(o).b("bar"))},[k("div",{class:x(r(o).be("bar","outer")),style:ze({height:`${w.strokeWidth}px`})},[k("div",{class:x([r(o).be("bar","inner"),{[r(o).bem("bar","inner","indeterminate")]:w.indeterminate},{[r(o).bem("bar","inner","striped")]:w.striped},{[r(o).bem("bar","inner","striped-flow")]:w.stripedFlow}]),style:ze(r(a))},[(w.showText||w.$slots.default)&&w.textInside?(_(),S("div",{key:0,class:x(r(o).be("bar","innerText"))},[ue(w.$slots,"default",{percentage:w.percentage},()=>[k("span",null,be(r(y)),1)])],2)):J("v-if",!0)],6)],6)],2)):(_(),S("div",{key:1,class:x(r(o).b("circle")),style:ze({height:`${w.width}px`,width:`${w.width}px`})},[(_(),S("svg",N0e,[k("path",{class:x(r(o).be("circle","track")),d:r(i),stroke:`var(${r(o).cssVarName("fill-color-light")}, #e5e9f2)`,"stroke-linecap":w.strokeLinecap,"stroke-width":r(l),fill:"none",style:ze(r(d))},null,14,A0e),k("path",{class:x(r(o).be("circle","path")),d:r(i),stroke:r(h),fill:"none",opacity:w.percentage?1:0,"stroke-linecap":w.strokeLinecap,"stroke-width":r(l),style:ze(r(p))},null,14,I0e)]))],6)),(w.showText||w.$slots.default)&&!w.textInside?(_(),S("div",{key:2,class:x(r(o).e("text")),style:ze({fontSize:`${r(v)}px`})},[ue(w.$slots,"default",{percentage:w.percentage},()=>[w.status?(_(),te(r(Me),{key:1},{default:G(()=>[(_(),te(ot(r(m))))]),_:1})):(_(),S("span",V0e,be(r(y)),1))])],6)):J("v-if",!0)],10,O0e))}});var P0e=ye(H0e,[["__file","/home/runner/work/element-plus/element-plus/packages/components/progress/src/progress.vue"]]);const ih=Je(P0e),B0e=_e({modelValue:{type:Number,default:0},id:{type:String,default:void 0},lowThreshold:{type:Number,default:2},highThreshold:{type:Number,default:4},max:{type:Number,default:5},colors:{type:Q([Array,Object]),default:()=>xt(["","",""])},voidColor:{type:String,default:""},disabledVoidColor:{type:String,default:""},icons:{type:Q([Array,Object]),default:()=>[hl,hl,hl]},voidIcon:{type:St,default:()=>y1},disabledVoidIcon:{type:St,default:()=>hl},disabled:Boolean,allowHalf:Boolean,showText:Boolean,showScore:Boolean,textColor:{type:String,default:""},texts:{type:Q(Array),default:()=>xt(["Extremely bad","Disappointed","Fair","Satisfied","Surprise"])},scoreTemplate:{type:String,default:"{value}"},size:ln,label:{type:String,default:void 0},clearable:{type:Boolean,default:!1}}),R0e={[Mt]:e=>Be(e),[tt]:e=>Be(e)},D0e=["id","aria-label","aria-labelledby","aria-valuenow","aria-valuetext","aria-valuemax"],F0e=["onMousemove","onClick"],K0e=U({name:"ElRate"}),W0e=U({...K0e,props:B0e,emits:R0e,setup(e,{expose:t,emit:n}){const o=e;function a(F,I){const P=j=>kt(j),z=Object.keys(I).map(j=>+j).filter(j=>{const Z=I[j];return(P(Z)?Z.excluded:!1)?F<j:F<=j}).sort((j,Z)=>j-Z),D=I[z[0]];return P(D)&&D.value||D}const l=Te($a,void 0),s=Te(io,void 0),i=Yt(),u=fe("rate"),{inputId:c,isLabeledByFormItem:f}=jo(o,
|