13 lines
39 KiB
JavaScript
13 lines
39 KiB
JavaScript
import{t as dt,d as Wt,f as Ne,a as xe,F as Vt,u as Xe,E as kt}from"./index.e7365e3c.js";import{b7 as ct,b8 as Ze,b9 as pt,aL as zt,ba as Ut,aR as De,b as we,bb as Yt,aI as We,bc as ue,aE as Gt,q as ae,bd as Kt,a9 as mt,be as Je,aj as Z,bf as Ht,bg as Xt,bh as Zt,bi as Jt,aS as Te,p as oe,bj as gt,M as ne,aX as Qt,aA as je,bk as Ve,r as D,s as j,a as Y,v as ke,D as vt,P as yt,o as K,e as se,x as V,y as W,u as f,B as Fe,O as re,bl as en,aH as tn,f as H,F as nn,ak as ze,a$ as ht,bm as rn,bn as Se,w as U,c as ye,A as bt,z as he,h as an,t as $e,k as fe,j as te,aW as on,C as wt,Q as sn,bo as ln,L as un,af as fn,E as dn,bp as cn,N as pn,ag as mn,bq as gn,br as vn,bs as Qe,a0 as yn,ay as hn,b1 as bn,a1 as wn,as as Fn,at as En}from"./entry.539d3b49.js";import{a as Ft}from"./use-form-item.aa386fad.js";import{u as Pe}from"./index.68b3a059.js";import{k as Et,a as At,s as An,b as On,c as Tn,d as Ue,n as be,e as Ot,i as Sn,S as Cn,f as qn,h as xn,U as Tt}from"./el-input.60ea0dae.js";import{c as Ee,k as Ye,g as jn,a as St,b as $n,d as Pn,e as Mn,i as In}from"./_initCloneObject.18c5d913.js";import{P as Ce}from"./vnode.48eda29e.js";function _n(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function Me(){if(!arguments.length)return[];var t=arguments[0];return ct(t)?t:[t]}function Ln(t,e){return t&&Ee(e,Et(e),t)}function Bn(t,e){return t&&Ee(e,Ye(e),t)}function Rn(t,e){return Ee(t,At(t),e)}var Nn=Object.getOwnPropertySymbols,Dn=Nn?function(t){for(var e=[];t;)On(e,At(t)),t=jn(t);return e}:An;const Ct=Dn;function Wn(t,e){return Ee(t,Ct(t),e)}function Vn(t){return Tn(t,Ye,Ct)}var kn=Object.prototype,zn=kn.hasOwnProperty;function Un(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&zn.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function Yn(t,e){var n=e?St(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var Gn=/\w*$/;function Kn(t){var e=new t.constructor(t.source,Gn.exec(t));return e.lastIndex=t.lastIndex,e}var et=Ze?Ze.prototype:void 0,tt=et?et.valueOf:void 0;function Hn(t){return tt?Object(tt.call(t)):{}}var Xn="[object Boolean]",Zn="[object Date]",Jn="[object Map]",Qn="[object Number]",er="[object RegExp]",tr="[object Set]",nr="[object String]",rr="[object Symbol]",ar="[object ArrayBuffer]",or="[object DataView]",ir="[object Float32Array]",sr="[object Float64Array]",lr="[object Int8Array]",ur="[object Int16Array]",fr="[object Int32Array]",dr="[object Uint8Array]",cr="[object Uint8ClampedArray]",pr="[object Uint16Array]",mr="[object Uint32Array]";function gr(t,e,n){var r=t.constructor;switch(e){case ar:return St(t);case Xn:case Zn:return new r(+t);case or:return Yn(t,n);case ir:case sr:case lr:case ur:case fr:case dr:case cr:case pr:case mr:return $n(t,n);case Jn:return new r;case Qn:case nr:return new r(t);case er:return Kn(t);case tr:return new r;case rr:return Hn(t)}}var vr="[object Map]";function yr(t){return pt(t)&&Ue(t)==vr}var nt=be&&be.isMap,hr=nt?Ot(nt):yr;const br=hr;var wr="[object Set]";function Fr(t){return pt(t)&&Ue(t)==wr}var rt=be&&be.isSet,Er=rt?Ot(rt):Fr;const Ar=Er;var Or=1,Tr=2,Sr=4,qt="[object Arguments]",Cr="[object Array]",qr="[object Boolean]",xr="[object Date]",jr="[object Error]",xt="[object Function]",$r="[object GeneratorFunction]",Pr="[object Map]",Mr="[object Number]",jt="[object Object]",Ir="[object RegExp]",_r="[object Set]",Lr="[object String]",Br="[object Symbol]",Rr="[object WeakMap]",Nr="[object ArrayBuffer]",Dr="[object DataView]",Wr="[object Float32Array]",Vr="[object Float64Array]",kr="[object Int8Array]",zr="[object Int16Array]",Ur="[object Int32Array]",Yr="[object Uint8Array]",Gr="[object Uint8ClampedArray]",Kr="[object Uint16Array]",Hr="[object Uint32Array]",x={};x[qt]=x[Cr]=x[Nr]=x[Dr]=x[qr]=x[xr]=x[Wr]=x[Vr]=x[kr]=x[zr]=x[Ur]=x[Pr]=x[Mr]=x[jt]=x[Ir]=x[_r]=x[Lr]=x[Br]=x[Yr]=x[Gr]=x[Kr]=x[Hr]=!0;x[jr]=x[xt]=x[Rr]=!1;function ge(t,e,n,r,a,i){var o,s=e&Or,l=e&Tr,h=e&Sr;if(n&&(o=a?n(t,r,a,i):n(t)),o!==void 0)return o;if(!zt(t))return t;var c=ct(t);if(c){if(o=Un(t),!s)return Pn(t,o)}else{var g=Ue(t),p=g==xt||g==$r;if(Sn(t))return Mn(t,s);if(g==jt||g==qt||p&&!a){if(o=l||p?{}:In(t),!s)return l?Wn(t,Bn(o,t)):Rn(t,Ln(o,t))}else{if(!x[g])return a?t:{};o=gr(t,g,s)}}i||(i=new Cn);var F=i.get(t);if(F)return F;i.set(t,o),Ar(t)?t.forEach(function(y){o.add(ge(y,e,n,y,t,i))}):br(t)&&t.forEach(function(y,u){o.set(u,ge(y,e,n,u,t,i))});var S=h?l?Vn:qn:l?Ye:Et,m=c?void 0:S(t);return _n(m||t,function(y,u){m&&(u=y,y=t[u]),Ut(o,u,ge(y,e,n,u,t,i))}),o}var Xr=4;function at(t){return ge(t,Xr)}const Zr=(...t)=>e=>{t.forEach(n=>{De(n)?n(e):n.value=e})},Jr=(t,e,n)=>{let r={offsetX:0,offsetY:0};const a=s=>{const l=s.clientX,h=s.clientY,{offsetX:c,offsetY:g}=r,p=t.value.getBoundingClientRect(),F=p.left,S=p.top,m=p.width,y=p.height,u=document.documentElement.clientWidth,b=document.documentElement.clientHeight,d=-F+c,w=-S+g,A=u-F-m+c,O=b-S-y+g,M=B=>{const T=Math.min(Math.max(c+B.clientX-l,d),A),I=Math.min(Math.max(g+B.clientY-h,w),O);r={offsetX:T,offsetY:I},t.value.style.transform=`translate(${ue(T)}, ${ue(I)})`},q=()=>{document.removeEventListener("mousemove",M),document.removeEventListener("mouseup",q)};document.addEventListener("mousemove",M),document.addEventListener("mouseup",q)},i=()=>{e.value&&t.value&&e.value.addEventListener("mousedown",a)},o=()=>{e.value&&t.value&&e.value.removeEventListener("mousedown",a)};we(()=>{Yt(()=>{n.value?i():o()})}),We(()=>{o()})},Qr=(t,e={})=>{Gt(t)||dt("[useLockscreen]","You need to pass a ref param to this function");const n=e.ns||ae("popup"),r=Kt(()=>n.bm("parent","hidden"));if(!mt||Je(document.body,r.value))return;let a=0,i=!1,o="0";const s=()=>{setTimeout(()=>{Jt(document==null?void 0:document.body,r.value),i&&document&&(document.body.style.width=o)},200)};Z(t,l=>{if(!l){s();return}i=!Je(document.body,r.value),i&&(o=document.body.style.width),a=xn(n.namespace.value);const h=document.documentElement.clientHeight<document.body.scrollHeight,c=Ht(document.body,"overflowY");a>0&&(h||c==="scroll")&&i&&(document.body.style.width=`calc(100% - ${a}px)`),Xt(document.body,r.value)}),Zt(()=>s())},$t=t=>{if(!t)return{onClick:Te,onMousedown:Te,onMouseup:Te};let e=!1,n=!1;return{onClick:o=>{e&&n&&t(o),e=n=!1},onMousedown:o=>{e=o.target===o.currentTarget},onMouseup:o=>{n=o.target===o.currentTarget}}},ea=oe({size:{type:String,values:gt},disabled:Boolean}),ta=oe({...ea,model:Object,rules:{type:ne(Object)},labelPosition:{type:String,values:["left","right","top"],default:"right"},requireAsteriskPosition:{type:String,values:["left","right"],default:"left"},labelWidth:{type:[String,Number],default:""},labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:Boolean,scrollIntoViewOptions:{type:[Object,Boolean]}}),na={validate:(t,e,n)=>(Qt(t)||je(t))&&Ve(e)&&je(n)};function ra(){const t=D([]),e=j(()=>{if(!t.value.length)return"0";const i=Math.max(...t.value);return i?`${i}px`:""});function n(i){const o=t.value.indexOf(i);return o===-1&&e.value,o}function r(i,o){if(i&&o){const s=n(o);t.value.splice(s,1,i)}else i&&t.value.push(i)}function a(i){const o=n(i);o>-1&&t.value.splice(o,1)}return{autoLabelWidth:e,registerLabelWidth:r,deregisterLabelWidth:a}}const pe=(t,e)=>{const n=Me(e);return n.length>0?t.filter(r=>r.prop&&n.includes(r.prop)):t},aa="ElForm",oa=Y({name:aa}),ia=Y({...oa,props:ta,emits:na,setup(t,{expose:e,emit:n}){const r=t,a=[],i=Ft(),o=ae("form"),s=j(()=>{const{labelPosition:b,inline:d}=r;return[o.b(),o.m(i.value||"default"),{[o.m(`label-${b}`)]:b,[o.m("inline")]:d}]}),l=b=>{a.push(b)},h=b=>{b.prop&&a.splice(a.indexOf(b),1)},c=(b=[])=>{r.model&&pe(a,b).forEach(d=>d.resetField())},g=(b=[])=>{pe(a,b).forEach(d=>d.clearValidate())},p=j(()=>!!r.model),F=b=>{if(a.length===0)return[];const d=pe(a,b);return d.length?d:[]},S=async b=>y(void 0,b),m=async(b=[])=>{if(!p.value)return!1;const d=F(b);if(d.length===0)return!0;let w={};for(const A of d)try{await A.validate("")}catch(O){w={...w,...O}}return Object.keys(w).length===0?!0:Promise.reject(w)},y=async(b=[],d)=>{const w=!De(d);try{const A=await m(b);return A===!0&&(d==null||d(A)),A}catch(A){if(A instanceof Error)throw A;const O=A;return r.scrollToError&&u(Object.keys(O)[0]),d==null||d(!1,O),w&&Promise.reject(O)}},u=b=>{var d;const w=pe(a,b)[0];w&&((d=w.$el)==null||d.scrollIntoView(r.scrollIntoViewOptions))};return Z(()=>r.rules,()=>{r.validateOnRuleChange&&S().catch(b=>Wt())},{deep:!0}),ke(Ne,vt({...yt(r),emit:n,resetFields:c,clearValidate:g,validateField:y,addField:l,removeField:h,...ra()})),e({validate:S,validateField:y,resetFields:c,clearValidate:g,scrollToField:u}),(b,d)=>(K(),se("form",{class:W(f(s))},[V(b.$slots,"default")],2))}});var sa=Fe(ia,[["__file","/home/runner/work/element-plus/element-plus/packages/components/form/src/form.vue"]]);function X(){return X=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},X.apply(this,arguments)}function la(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,de(t,e)}function Ie(t){return Ie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ie(t)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},de(t,e)}function ua(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ve(t,e,n){return ua()?ve=Reflect.construct.bind():ve=function(a,i,o){var s=[null];s.push.apply(s,i);var l=Function.bind.apply(a,s),h=new l;return o&&de(h,o.prototype),h},ve.apply(null,arguments)}function fa(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function _e(t){var e=typeof Map=="function"?new Map:void 0;return _e=function(r){if(r===null||!fa(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,a)}function a(){return ve(r,arguments,Ie(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),de(a,r)},_e(t)}var da=/%[sdj%]/g,ca=function(){};typeof process<"u"&&process.env;function Le(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var r=n.field;e[r]=e[r]||[],e[r].push(n)}),e}function k(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var a=0,i=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var o=t.replace(da,function(s){if(s==="%%")return"%";if(a>=i)return s;switch(s){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch{return"[Circular]"}break;default:return s}});return o}return t}function pa(t){return t==="string"||t==="url"||t==="hex"||t==="email"||t==="date"||t==="pattern"}function P(t,e){return!!(t==null||e==="array"&&Array.isArray(t)&&!t.length||pa(e)&&typeof t=="string"&&!t)}function ma(t,e,n){var r=[],a=0,i=t.length;function o(s){r.push.apply(r,s||[]),a++,a===i&&n(r)}t.forEach(function(s){e(s,o)})}function ot(t,e,n){var r=0,a=t.length;function i(o){if(o&&o.length){n(o);return}var s=r;r=r+1,s<a?e(t[s],i):n([])}i([])}function ga(t){var e=[];return Object.keys(t).forEach(function(n){e.push.apply(e,t[n]||[])}),e}var it=function(t){la(e,t);function e(n,r){var a;return a=t.call(this,"Async Validation Error")||this,a.errors=n,a.fields=r,a}return e}(_e(Error));function va(t,e,n,r,a){if(e.first){var i=new Promise(function(p,F){var S=function(u){return r(u),u.length?F(new it(u,Le(u))):p(a)},m=ga(t);ot(m,n,S)});return i.catch(function(p){return p}),i}var o=e.firstFields===!0?Object.keys(t):e.firstFields||[],s=Object.keys(t),l=s.length,h=0,c=[],g=new Promise(function(p,F){var S=function(y){if(c.push.apply(c,y),h++,h===l)return r(c),c.length?F(new it(c,Le(c))):p(a)};s.length||(r(c),p(a)),s.forEach(function(m){var y=t[m];o.indexOf(m)!==-1?ot(y,n,S):ma(y,n,S)})});return g.catch(function(p){return p}),g}function ya(t){return!!(t&&t.message!==void 0)}function ha(t,e){for(var n=t,r=0;r<e.length;r++){if(n==null)return n;n=n[e[r]]}return n}function st(t,e){return function(n){var r;return t.fullFields?r=ha(e,t.fullFields):r=e[n.field||t.fullField],ya(n)?(n.field=n.field||t.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||t.fullField}}}function lt(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];typeof r=="object"&&typeof t[n]=="object"?t[n]=X({},t[n],r):t[n]=r}}return t}var Pt=function(e,n,r,a,i,o){e.required&&(!r.hasOwnProperty(e.field)||P(n,o||e.type))&&a.push(k(i.messages.required,e.fullField))},ba=function(e,n,r,a,i){(/^\s+$/.test(n)||n==="")&&a.push(k(i.messages.whitespace,e.fullField))},me,wa=function(){if(me)return me;var t="[a-fA-F\\d:]",e=function(w){return w&&w.includeBoundaries?"(?:(?<=\\s|^)(?="+t+")|(?<="+t+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",a=(`
|
|
(?:
|
|
(?:`+r+":){7}(?:"+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
(?:`+r+":){6}(?:"+n+"|:"+r+`|:)| // 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
|
|
(?:`+r+":){5}(?::"+n+"|(?::"+r+`){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
|
|
(?:`+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+`){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
|
|
(?:`+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+`){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
|
|
(?:`+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
(?:`+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
(?::(?:(?::`+r+"){0,5}:"+n+"|(?::"+r+`){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
|
|
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),i=new RegExp("(?:^"+n+"$)|(?:^"+a+"$)"),o=new RegExp("^"+n+"$"),s=new RegExp("^"+a+"$"),l=function(w){return w&&w.exact?i:new RegExp("(?:"+e(w)+n+e(w)+")|(?:"+e(w)+a+e(w)+")","g")};l.v4=function(d){return d&&d.exact?o:new RegExp(""+e(d)+n+e(d),"g")},l.v6=function(d){return d&&d.exact?s:new RegExp(""+e(d)+a+e(d),"g")};var h="(?:(?:[a-z]+:)?//)",c="(?:\\S+(?::\\S*)?@)?",g=l.v4().source,p=l.v6().source,F="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",S="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",y="(?::\\d{2,5})?",u='(?:[/?#][^\\s"]*)?',b="(?:"+h+"|www\\.)"+c+"(?:localhost|"+g+"|"+p+"|"+F+S+m+")"+y+u;return me=new RegExp("(?:^"+b+"$)","i"),me},ut={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},ie={integer:function(e){return ie.number(e)&&parseInt(e,10)===e},float:function(e){return ie.number(e)&&!ie.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!ie.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(ut.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(wa())},hex:function(e){return typeof e=="string"&&!!e.match(ut.hex)}},Fa=function(e,n,r,a,i){if(e.required&&n===void 0){Pt(e,n,r,a,i);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=e.type;o.indexOf(s)>-1?ie[s](n)||a.push(k(i.messages.types[s],e.fullField,e.type)):s&&typeof n!==e.type&&a.push(k(i.messages.types[s],e.fullField,e.type))},Ea=function(e,n,r,a,i){var o=typeof e.len=="number",s=typeof e.min=="number",l=typeof e.max=="number",h=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=n,g=null,p=typeof n=="number",F=typeof n=="string",S=Array.isArray(n);if(p?g="number":F?g="string":S&&(g="array"),!g)return!1;S&&(c=n.length),F&&(c=n.replace(h,"_").length),o?c!==e.len&&a.push(k(i.messages[g].len,e.fullField,e.len)):s&&!l&&c<e.min?a.push(k(i.messages[g].min,e.fullField,e.min)):l&&!s&&c>e.max?a.push(k(i.messages[g].max,e.fullField,e.max)):s&&l&&(c<e.min||c>e.max)&&a.push(k(i.messages[g].range,e.fullField,e.min,e.max))},ee="enum",Aa=function(e,n,r,a,i){e[ee]=Array.isArray(e[ee])?e[ee]:[],e[ee].indexOf(n)===-1&&a.push(k(i.messages[ee],e.fullField,e[ee].join(", ")))},Oa=function(e,n,r,a,i){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(n)||a.push(k(i.messages.pattern.mismatch,e.fullField,n,e.pattern));else if(typeof e.pattern=="string"){var o=new RegExp(e.pattern);o.test(n)||a.push(k(i.messages.pattern.mismatch,e.fullField,n,e.pattern))}}},E={required:Pt,whitespace:ba,type:Fa,range:Ea,enum:Aa,pattern:Oa},Ta=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n,"string")&&!e.required)return r();E.required(e,n,a,o,i,"string"),P(n,"string")||(E.type(e,n,a,o,i),E.range(e,n,a,o,i),E.pattern(e,n,a,o,i),e.whitespace===!0&&E.whitespace(e,n,a,o,i))}r(o)},Sa=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&E.type(e,n,a,o,i)}r(o)},Ca=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(n===""&&(n=void 0),P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&(E.type(e,n,a,o,i),E.range(e,n,a,o,i))}r(o)},qa=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&E.type(e,n,a,o,i)}r(o)},xa=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),P(n)||E.type(e,n,a,o,i)}r(o)},ja=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&(E.type(e,n,a,o,i),E.range(e,n,a,o,i))}r(o)},$a=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&(E.type(e,n,a,o,i),E.range(e,n,a,o,i))}r(o)},Pa=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(n==null&&!e.required)return r();E.required(e,n,a,o,i,"array"),n!=null&&(E.type(e,n,a,o,i),E.range(e,n,a,o,i))}r(o)},Ma=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&E.type(e,n,a,o,i)}r(o)},Ia="enum",_a=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i),n!==void 0&&E[Ia](e,n,a,o,i)}r(o)},La=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n,"string")&&!e.required)return r();E.required(e,n,a,o,i),P(n,"string")||E.pattern(e,n,a,o,i)}r(o)},Ba=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n,"date")&&!e.required)return r();if(E.required(e,n,a,o,i),!P(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),E.type(e,l,a,o,i),l&&E.range(e,l.getTime(),a,o,i)}}r(o)},Ra=function(e,n,r,a,i){var o=[],s=Array.isArray(n)?"array":typeof n;E.required(e,n,a,o,i,s),r(o)},qe=function(e,n,r,a,i){var o=e.type,s=[],l=e.required||!e.required&&a.hasOwnProperty(e.field);if(l){if(P(n,o)&&!e.required)return r();E.required(e,n,a,s,i,o),P(n,o)||E.type(e,n,a,s,i)}r(s)},Na=function(e,n,r,a,i){var o=[],s=e.required||!e.required&&a.hasOwnProperty(e.field);if(s){if(P(n)&&!e.required)return r();E.required(e,n,a,o,i)}r(o)},le={string:Ta,method:Sa,number:Ca,boolean:qa,regexp:xa,integer:ja,float:$a,array:Pa,object:Ma,enum:_a,pattern:La,date:Ba,url:qe,hex:qe,email:qe,required:Ra,any:Na};function Be(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Re=Be(),ce=function(){function t(n){this.rules=null,this._messages=Re,this.define(n)}var e=t.prototype;return e.define=function(r){var a=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var o=r[i];a.rules[i]=Array.isArray(o)?o:[o]})},e.messages=function(r){return r&&(this._messages=lt(Be(),r)),this._messages},e.validate=function(r,a,i){var o=this;a===void 0&&(a={}),i===void 0&&(i=function(){});var s=r,l=a,h=i;if(typeof l=="function"&&(h=l,l={}),!this.rules||Object.keys(this.rules).length===0)return h&&h(null,s),Promise.resolve(s);function c(m){var y=[],u={};function b(w){if(Array.isArray(w)){var A;y=(A=y).concat.apply(A,w)}else y.push(w)}for(var d=0;d<m.length;d++)b(m[d]);y.length?(u=Le(y),h(y,u)):h(null,s)}if(l.messages){var g=this.messages();g===Re&&(g=Be()),lt(g,l.messages),l.messages=g}else l.messages=this.messages();var p={},F=l.keys||Object.keys(this.rules);F.forEach(function(m){var y=o.rules[m],u=s[m];y.forEach(function(b){var d=b;typeof d.transform=="function"&&(s===r&&(s=X({},s)),u=s[m]=d.transform(u)),typeof d=="function"?d={validator:d}:d=X({},d),d.validator=o.getValidationMethod(d),d.validator&&(d.field=m,d.fullField=d.fullField||m,d.type=o.getType(d),p[m]=p[m]||[],p[m].push({rule:d,value:u,source:s,field:m}))})});var S={};return va(p,l,function(m,y){var u=m.rule,b=(u.type==="object"||u.type==="array")&&(typeof u.fields=="object"||typeof u.defaultField=="object");b=b&&(u.required||!u.required&&m.value),u.field=m.field;function d(O,M){return X({},M,{fullField:u.fullField+"."+O,fullFields:u.fullFields?[].concat(u.fullFields,[O]):[O]})}function w(O){O===void 0&&(O=[]);var M=Array.isArray(O)?O:[O];!l.suppressWarning&&M.length&&t.warning("async-validator:",M),M.length&&u.message!==void 0&&(M=[].concat(u.message));var q=M.map(st(u,s));if(l.first&&q.length)return S[u.field]=1,y(q);if(!b)y(q);else{if(u.required&&!m.value)return u.message!==void 0?q=[].concat(u.message).map(st(u,s)):l.error&&(q=[l.error(u,k(l.messages.required,u.field))]),y(q);var B={};u.defaultField&&Object.keys(m.value).map(function($){B[$]=u.defaultField}),B=X({},B,m.rule.fields);var T={};Object.keys(B).forEach(function($){var N=B[$],R=Array.isArray(N)?N:[N];T[$]=R.map(d.bind(null,$))});var I=new t(T);I.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),I.validate(m.value,m.rule.options||l,function($){var N=[];q&&q.length&&N.push.apply(N,q),$&&$.length&&N.push.apply(N,$),y(N.length?N:null)})}}var A;if(u.asyncValidator)A=u.asyncValidator(u,m.value,w,m.source,l);else if(u.validator){try{A=u.validator(u,m.value,w,m.source,l)}catch(O){console.error==null||console.error(O),l.suppressValidatorError||setTimeout(function(){throw O},0),w(O.message)}A===!0?w():A===!1?w(typeof u.message=="function"?u.message(u.fullField||u.field):u.message||(u.fullField||u.field)+" fails"):A instanceof Array?w(A):A instanceof Error&&w(A.message)}A&&A.then&&A.then(function(){return w()},function(O){return w(O)})},function(m){c(m)},s)},e.getType=function(r){if(r.type===void 0&&r.pattern instanceof RegExp&&(r.type="pattern"),typeof r.validator!="function"&&r.type&&!le.hasOwnProperty(r.type))throw new Error(k("Unknown rule type %s",r.type));return r.type||"string"},e.getValidationMethod=function(r){if(typeof r.validator=="function")return r.validator;var a=Object.keys(r),i=a.indexOf("message");return i!==-1&&a.splice(i,1),a.length===1&&a[0]==="required"?le.required:le[this.getType(r)]||void 0},t}();ce.register=function(e,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");le[e]=n};ce.warning=ca;ce.messages=Re;ce.validators=le;const Da=["","error","validating","success"],Wa=oe({label:String,labelWidth:{type:[String,Number],default:""},prop:{type:ne([String,Array])},required:{type:Boolean,default:void 0},rules:{type:ne([Object,Array])},error:String,validateStatus:{type:String,values:Da},for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:{type:String,values:gt}}),ft="ElLabelWrap";var Va=Y({name:ft,props:{isAutoWidth:Boolean,updateAll:Boolean},setup(t,{slots:e}){const n=re(Ne,void 0),r=re(xe);r||dt(ft,"usage: <el-form-item><label-wrap /></el-form-item>");const a=ae("form"),i=D(),o=D(0),s=()=>{var c;if((c=i.value)!=null&&c.firstElementChild){const g=window.getComputedStyle(i.value.firstElementChild).width;return Math.ceil(Number.parseFloat(g))}else return 0},l=(c="update")=>{ze(()=>{e.default&&t.isAutoWidth&&(c==="update"?o.value=s():c==="remove"&&(n==null||n.deregisterLabelWidth(o.value)))})},h=()=>l("update");return we(()=>{h()}),We(()=>{l("remove")}),en(()=>h()),Z(o,(c,g)=>{t.updateAll&&(n==null||n.registerLabelWidth(c,g))}),tn(j(()=>{var c,g;return(g=(c=i.value)==null?void 0:c.firstElementChild)!=null?g:null}),h),()=>{var c,g;if(!e)return null;const{isAutoWidth:p}=t;if(p){const F=n==null?void 0:n.autoLabelWidth,S=r==null?void 0:r.hasLabel,m={};if(S&&F&&F!=="auto"){const y=Math.max(0,Number.parseInt(F,10)-o.value),u=n.labelPosition==="left"?"marginRight":"marginLeft";y&&(m[u]=`${y}px`)}return H("div",{ref:i,class:[a.be("item","label-wrap")],style:m},[(c=e.default)==null?void 0:c.call(e)])}else return H(nn,{ref:i},[(g=e.default)==null?void 0:g.call(e)])}}});const ka=["role","aria-labelledby"],za=Y({name:"ElFormItem"}),Ua=Y({...za,props:Wa,setup(t,{expose:e}){const n=t,r=ht(),a=re(Ne,void 0),i=re(xe,void 0),o=Ft(void 0,{formItem:!1}),s=ae("form-item"),l=Pe().value,h=D([]),c=D(""),g=rn(c,100),p=D(""),F=D();let S,m=!1;const y=j(()=>{if((a==null?void 0:a.labelPosition)==="top")return{};const v=ue(n.labelWidth||(a==null?void 0:a.labelWidth)||"");return v?{width:v}:{}}),u=j(()=>{if((a==null?void 0:a.labelPosition)==="top"||a!=null&&a.inline)return{};if(!n.label&&!n.labelWidth&&B)return{};const v=ue(n.labelWidth||(a==null?void 0:a.labelWidth)||"");return!n.label&&!r.label?{marginLeft:v}:{}}),b=j(()=>[s.b(),s.m(o.value),s.is("error",c.value==="error"),s.is("validating",c.value==="validating"),s.is("success",c.value==="success"),s.is("required",R.value||n.required),s.is("no-asterisk",a==null?void 0:a.hideRequiredAsterisk),(a==null?void 0:a.requireAsteriskPosition)==="right"?"asterisk-right":"asterisk-left",{[s.m("feedback")]:a==null?void 0:a.statusIcon}]),d=j(()=>Ve(n.inlineMessage)?n.inlineMessage:(a==null?void 0:a.inlineMessage)||!1),w=j(()=>[s.e("error"),{[s.em("error","inline")]:d.value}]),A=j(()=>n.prop?je(n.prop)?n.prop:n.prop.join("."):""),O=j(()=>!!(n.label||r.label)),M=j(()=>n.for||h.value.length===1?h.value[0]:void 0),q=j(()=>!M.value&&O.value),B=!!i,T=j(()=>{const v=a==null?void 0:a.model;if(!(!v||!n.prop))return Se(v,n.prop).value}),I=j(()=>{const{required:v}=n,C=[];n.rules&&C.push(...Me(n.rules));const L=a==null?void 0:a.rules;if(L&&n.prop){const _=Se(L,n.prop).value;_&&C.push(...Me(_))}if(v!==void 0){const _=C.map((z,Q)=>[z,Q]).filter(([z])=>Object.keys(z).includes("required"));if(_.length>0)for(const[z,Q]of _)z.required!==v&&(C[Q]={...z,required:v});else C.push({required:v})}return C}),$=j(()=>I.value.length>0),N=v=>I.value.filter(L=>!L.trigger||!v?!0:Array.isArray(L.trigger)?L.trigger.includes(v):L.trigger===v).map(({trigger:L,..._})=>_),R=j(()=>I.value.some(v=>v.required)),G=j(()=>{var v;return g.value==="error"&&n.showMessage&&((v=a==null?void 0:a.showMessage)!=null?v:!0)}),Ge=j(()=>`${n.label||""}${(a==null?void 0:a.labelSuffix)||""}`),J=v=>{c.value=v},Lt=v=>{var C,L;const{errors:_,fields:z}=v;(!_||!z)&&console.error(v),J("error"),p.value=_?(L=(C=_==null?void 0:_[0])==null?void 0:C.message)!=null?L:`${n.prop} is required`:"",a==null||a.emit("validate",n.prop,!1,p.value)},Bt=()=>{J("success"),a==null||a.emit("validate",n.prop,!0,"")},Rt=async v=>{const C=A.value;return new ce({[C]:v}).validate({[C]:T.value},{firstFields:!0}).then(()=>(Bt(),!0)).catch(_=>(Lt(_),Promise.reject(_)))},Ke=async(v,C)=>{if(m||!n.prop)return!1;const L=De(C);if(!$.value)return C==null||C(!1),!1;const _=N(v);return _.length===0?(C==null||C(!0),!0):(J("validating"),Rt(_).then(()=>(C==null||C(!0),!0)).catch(z=>{const{fields:Q}=z;return C==null||C(!1,Q),L?!1:Promise.reject(Q)}))},Ae=()=>{J(""),p.value="",m=!1},He=async()=>{const v=a==null?void 0:a.model;if(!v||!n.prop)return;const C=Se(v,n.prop);m=!0,C.value=at(S),await ze(),Ae(),m=!1},Nt=v=>{h.value.includes(v)||h.value.push(v)},Dt=v=>{h.value=h.value.filter(C=>C!==v)};Z(()=>n.error,v=>{p.value=v||"",J(v?"error":"")},{immediate:!0}),Z(()=>n.validateStatus,v=>J(v||""));const Oe=vt({...yt(n),$el:F,size:o,validateState:c,labelId:l,inputIds:h,isGroup:q,hasLabel:O,addInputId:Nt,removeInputId:Dt,resetField:He,clearValidate:Ae,validate:Ke});return ke(xe,Oe),we(()=>{n.prop&&(a==null||a.addField(Oe),S=at(T.value))}),We(()=>{a==null||a.removeField(Oe)}),e({size:o,validateMessage:p,validateState:c,validate:Ke,clearValidate:Ae,resetField:He}),(v,C)=>{var L;return K(),se("div",{ref_key:"formItemRef",ref:F,class:W(f(b)),role:f(q)?"group":void 0,"aria-labelledby":f(q)?f(l):void 0},[H(f(Va),{"is-auto-width":f(y).width==="auto","update-all":((L=f(a))==null?void 0:L.labelWidth)==="auto"},{default:U(()=>[f(O)?(K(),ye(bt(f(M)?"label":"div"),{key:0,id:f(l),for:f(M),class:W(f(s).e("label")),style:he(f(y))},{default:U(()=>[V(v.$slots,"label",{label:f(Ge)},()=>[an($e(f(Ge)),1)])]),_:3},8,["id","for","class","style"])):fe("v-if",!0)]),_:3},8,["is-auto-width","update-all"]),te("div",{class:W(f(s).e("content")),style:he(f(u))},[V(v.$slots,"default"),H(on,{name:`${f(s).namespace.value}-zoom-in-top`},{default:U(()=>[f(G)?V(v.$slots,"error",{key:0,error:p.value},()=>[te("div",{class:W(f(w))},$e(p.value),3)]):fe("v-if",!0)]),_:3},8,["name"])],6)],10,ka)}}});var Mt=Fe(Ua,[["__file","/home/runner/work/element-plus/element-plus/packages/components/form/src/form-item.vue"]]);const ho=wt(sa,{FormItem:Mt}),bo=sn(Mt),Ya=oe({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:ne([String,Array,Object])},zIndex:{type:ne([String,Number])}}),Ga={click:t=>t instanceof MouseEvent},Ka="overlay";var Ha=Y({name:"ElOverlay",props:Ya,emits:Ga,setup(t,{slots:e,emit:n}){const r=ae(Ka),a=l=>{n("click",l)},{onClick:i,onMousedown:o,onMouseup:s}=$t(t.customMaskEvent?void 0:a);return()=>t.mask?H("div",{class:[r.b(),t.overlayClass],style:{zIndex:t.zIndex},onClick:i,onMousedown:o,onMouseup:s},[V(e,"default")],Ce.STYLE|Ce.CLASS|Ce.PROPS,["onClick","onMouseup","onMousedown"]):ln("div",{class:t.overlayClass,style:{zIndex:t.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[V(e,"default")])}});const Xa=Ha,It=Symbol("dialogInjectionKey"),_t=oe({center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{type:un},customClass:{type:String,default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{type:String,default:""}}),Za={close:()=>!0},Ja=["aria-label"],Qa=["id"],eo=Y({name:"ElDialogContent"}),to=Y({...eo,props:_t,emits:Za,setup(t){const e=t,{t:n}=fn(),{Close:r}=cn,{dialogRef:a,headerRef:i,bodyId:o,ns:s,style:l}=re(It),{focusTrapRef:h}=re(Vt),c=Zr(h,a),g=j(()=>e.draggable);return Jr(a,i,g),(p,F)=>(K(),se("div",{ref:f(c),class:W([f(s).b(),f(s).is("fullscreen",p.fullscreen),f(s).is("draggable",f(g)),f(s).is("align-center",p.alignCenter),{[f(s).m("center")]:p.center},p.customClass]),style:he(f(l)),tabindex:"-1"},[te("header",{ref_key:"headerRef",ref:i,class:W(f(s).e("header"))},[V(p.$slots,"header",{},()=>[te("span",{role:"heading",class:W(f(s).e("title"))},$e(p.title),3)]),p.showClose?(K(),se("button",{key:0,"aria-label":f(n)("el.dialog.close"),class:W(f(s).e("headerbtn")),type:"button",onClick:F[0]||(F[0]=S=>p.$emit("close"))},[H(f(dn),{class:W(f(s).e("close"))},{default:U(()=>[(K(),ye(bt(p.closeIcon||f(r))))]),_:1},8,["class"])],10,Ja)):fe("v-if",!0)],2),te("div",{id:f(o),class:W(f(s).e("body"))},[V(p.$slots,"default")],10,Qa),p.$slots.footer?(K(),se("footer",{key:0,class:W(f(s).e("footer"))},[V(p.$slots,"footer")],2)):fe("v-if",!0)],6))}});var no=Fe(to,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);const ro=oe({..._t,appendToBody:{type:Boolean,default:!1},beforeClose:{type:ne(Function)},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:{type:Boolean,default:!1},modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1}}),ao={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[Tt]:t=>Ve(t),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},oo=(t,e)=>{const r=pn().emit,{nextZIndex:a}=mn();let i="";const o=Pe(),s=Pe(),l=D(!1),h=D(!1),c=D(!1),g=D(t.zIndex||a());let p,F;const S=gn("namespace",vn),m=j(()=>{const R={},G=`--${S.value}-dialog`;return t.fullscreen||(t.top&&(R[`${G}-margin-top`]=t.top),t.width&&(R[`${G}-width`]=ue(t.width))),R}),y=j(()=>t.alignCenter?{display:"flex"}:{});function u(){r("opened")}function b(){r("closed"),r(Tt,!1),t.destroyOnClose&&(c.value=!1)}function d(){r("close")}function w(){F==null||F(),p==null||p(),t.openDelay&&t.openDelay>0?{stop:p}=Qe(()=>q(),t.openDelay):q()}function A(){p==null||p(),F==null||F(),t.closeDelay&&t.closeDelay>0?{stop:F}=Qe(()=>B(),t.closeDelay):B()}function O(){function R(G){G||(h.value=!0,l.value=!1)}t.beforeClose?t.beforeClose(R):A()}function M(){t.closeOnClickModal&&O()}function q(){mt&&(l.value=!0)}function B(){l.value=!1}function T(){r("openAutoFocus")}function I(){r("closeAutoFocus")}function $(R){var G;((G=R.detail)==null?void 0:G.focusReason)==="pointer"&&R.preventDefault()}t.lockScroll&&Qr(l);function N(){t.closeOnPressEscape&&O()}return Z(()=>t.modelValue,R=>{R?(h.value=!1,w(),c.value=!0,g.value=t.zIndex?g.value++:a(),ze(()=>{r("open"),e.value&&(e.value.scrollTop=0)})):l.value&&A()}),Z(()=>t.fullscreen,R=>{e.value&&(R?(i=e.value.style.transform,e.value.style.transform=""):e.value.style.transform=i)}),we(()=>{t.modelValue&&(l.value=!0,c.value=!0,w())}),{afterEnter:u,afterLeave:b,beforeLeave:d,handleClose:O,onModalClick:M,close:A,doClose:B,onOpenAutoFocus:T,onCloseAutoFocus:I,onCloseRequested:N,onFocusoutPrevented:$,titleId:o,bodyId:s,closed:h,style:m,overlayDialogStyle:y,rendered:c,visible:l,zIndex:g}},io=["aria-label","aria-labelledby","aria-describedby"],so=Y({name:"ElDialog",inheritAttrs:!1}),lo=Y({...so,props:ro,emits:ao,setup(t,{expose:e}){const n=t,r=ht();Xe({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},j(()=>!!r.title)),Xe({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},j(()=>!!n.customClass));const a=ae("dialog"),i=D(),o=D(),s=D(),{visible:l,titleId:h,bodyId:c,style:g,overlayDialogStyle:p,rendered:F,zIndex:S,afterEnter:m,afterLeave:y,beforeLeave:u,handleClose:b,onModalClick:d,onOpenAutoFocus:w,onCloseAutoFocus:A,onCloseRequested:O,onFocusoutPrevented:M}=oo(n,i);ke(It,{dialogRef:i,headerRef:o,bodyId:c,ns:a,rendered:F,style:g});const q=$t(d),B=j(()=>n.draggable&&!n.fullscreen);return e({visible:l,dialogContentRef:s}),(T,I)=>(K(),ye(En,{to:"body",disabled:!T.appendToBody},[H(Fn,{name:"dialog-fade",onAfterEnter:f(m),onAfterLeave:f(y),onBeforeLeave:f(u),persisted:""},{default:U(()=>[yn(H(f(Xa),{"custom-mask-event":"",mask:T.modal,"overlay-class":T.modalClass,"z-index":f(S)},{default:U(()=>[te("div",{role:"dialog","aria-modal":"true","aria-label":T.title||void 0,"aria-labelledby":T.title?void 0:f(h),"aria-describedby":f(c),class:W(`${f(a).namespace.value}-overlay-dialog`),style:he(f(p)),onClick:I[0]||(I[0]=(...$)=>f(q).onClick&&f(q).onClick(...$)),onMousedown:I[1]||(I[1]=(...$)=>f(q).onMousedown&&f(q).onMousedown(...$)),onMouseup:I[2]||(I[2]=(...$)=>f(q).onMouseup&&f(q).onMouseup(...$))},[H(f(kt),{loop:"",trapped:f(l),"focus-start-el":"container",onFocusAfterTrapped:f(w),onFocusAfterReleased:f(A),onFocusoutPrevented:f(M),onReleaseRequested:f(O)},{default:U(()=>[f(F)?(K(),ye(no,hn({key:0,ref_key:"dialogContentRef",ref:s},T.$attrs,{"custom-class":T.customClass,center:T.center,"align-center":T.alignCenter,"close-icon":T.closeIcon,draggable:f(B),fullscreen:T.fullscreen,"show-close":T.showClose,title:T.title,onClose:f(b)}),bn({header:U(()=>[T.$slots.title?V(T.$slots,"title",{key:1}):V(T.$slots,"header",{key:0,close:f(b),titleId:f(h),titleClass:f(a).e("title")})]),default:U(()=>[V(T.$slots,"default")]),_:2},[T.$slots.footer?{name:"footer",fn:U(()=>[V(T.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","onClose"])):fe("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,io)]),_:3},8,["mask","overlay-class","z-index"]),[[wn,f(l)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"]))}});var uo=Fe(lo,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);const wo=wt(uo);export{bo as E,ho as a,wo as b,ge as c};
|