Files
PORTAL_COD2/src/front/dist/assets/VField-c26a6eca.js
T
2024-03-11 13:58:38 +03:00

2 lines
5.7 KiB
JavaScript

import{p as F,ac as S,b$ as ae,ae as p,c as s,ah as B,G as a,P as M,Q as N,by as le,b9 as V,bs as P,bp as ne,as as te,ad as ie,af as se,bq as oe,ax as re,ag as de,h as ce,r as x,au as ue,al as ve,bb as fe,w as be,cm as me,b as ge,bc as ye,bd as Ce,br as he,a1 as _e,I as ke,bi as Ie,cn as Ve}from"./index-6e8ea384.js";import{e as Pe,c as xe}from"./index-399a7799.js";import{a as Fe,c as Se,u as pe,d as Be}from"./VInput-f521182a.js";const $e=F({active:Boolean,max:[Number,String],value:{type:[Number,String],default:0},...S(),...ae({transition:{component:Pe}})},"VCounter"),Oe=p()({name:"VCounter",functional:!0,props:$e(),setup(e,o){let{slots:n}=o;const k=s(()=>e.max?`${e.value} / ${e.max}`:String(e.value));return B(()=>a(le,{transition:e.transition},{default:()=>[M(a("div",{class:["v-counter",e.class],style:e.style},[n.default?n.default({counter:k.value,max:e.max,value:e.value}):k.value]),[[N,e.active]])]})),{}}});const Le=F({floating:Boolean,...S()},"VFieldLabel"),_=p()({name:"VFieldLabel",props:Le(),setup(e,o){let{slots:n}=o;return B(()=>a(Fe,{class:["v-field-label",{"v-field-label--floating":e.floating},e.class],style:e.style,"aria-hidden":e.floating||void 0},n)),{}}}),Re=["underlined","outlined","filled","solo","solo-inverted","solo-filled","plain"],we=F({appendInnerIcon:V,bgColor:String,clearable:Boolean,clearIcon:{type:V,default:"$clear"},active:Boolean,centerAffix:{type:Boolean,default:void 0},color:String,baseColor:String,dirty:Boolean,disabled:{type:Boolean,default:null},error:Boolean,flat:Boolean,label:String,persistentClear:Boolean,prependInnerIcon:V,reverse:Boolean,singleLine:Boolean,variant:{type:String,default:"filled",validator:e=>Re.includes(e)},"onClick:clear":P(),"onClick:appendInner":P(),"onClick:prependInner":P(),...S(),...ne(),...te(),...ie()},"VField"),Te=p()({name:"VField",inheritAttrs:!1,props:{id:String,...Se(),...we()},emits:{"update:focused":e=>!0,"update:modelValue":e=>!0},setup(e,o){let{attrs:n,emit:k,slots:l}=o;const{themeClasses:U}=se(e),{loaderClasses:q}=oe(e),{focusClasses:W,isFocused:$,focus:L,blur:R}=pe(e),{InputIcon:I}=Be(e),{roundedClasses:j}=re(e),{rtlClasses:G}=de(),f=s(()=>e.dirty||e.active),b=s(()=>!e.singleLine&&!!(e.label||l.label)),Q=ce(),r=s(()=>e.id||`input-${Q}`),X=s(()=>`${r.value}-messages`),w=x(),m=x(),T=x(),A=s(()=>["plain","underlined"].includes(e.variant)),{backgroundColorClasses:Y,backgroundColorStyles:z}=ue(ve(e,"bgColor")),{textColorClasses:E,textColorStyles:D}=fe(s(()=>e.error||e.disabled?void 0:f.value&&$.value?e.color:e.baseColor));be(f,u=>{if(b.value){const i=w.value.$el,d=m.value.$el;requestAnimationFrame(()=>{const c=me(i),t=d.getBoundingClientRect(),y=t.x-c.x,C=t.y-c.y-(c.height/2-t.height/2),v=t.width/.75,h=Math.abs(v-c.width)>1?{maxWidth:ge(v)}:void 0,J=getComputedStyle(i),O=getComputedStyle(d),K=parseFloat(J.transitionDuration)*1e3||150,Z=parseFloat(O.getPropertyValue("--v-field-label-scale")),ee=O.getPropertyValue("color");i.style.visibility="visible",d.style.visibility="hidden",ye(i,{transform:`translate(${y}px, ${C}px) scale(${Z})`,color:ee,...h},{duration:K,easing:Ce,direction:u?"normal":"reverse"}).finished.then(()=>{i.style.removeProperty("visibility"),d.style.removeProperty("visibility")})})}},{flush:"post"});const g=s(()=>({isActive:f,isFocused:$,controlRef:T,blur:R,focus:L}));function H(u){u.target!==document.activeElement&&u.preventDefault()}return B(()=>{var y,C,v;const u=e.variant==="outlined",i=l["prepend-inner"]||e.prependInnerIcon,d=!!(e.clearable||l.clear),c=!!(l["append-inner"]||e.appendInnerIcon||d),t=()=>l.label?l.label({...g.value,label:e.label,props:{for:r.value}}):e.label;return a("div",ke({class:["v-field",{"v-field--active":f.value,"v-field--appended":c,"v-field--center-affix":e.centerAffix??!A.value,"v-field--disabled":e.disabled,"v-field--dirty":e.dirty,"v-field--error":e.error,"v-field--flat":e.flat,"v-field--has-background":!!e.bgColor,"v-field--persistent-clear":e.persistentClear,"v-field--prepended":i,"v-field--reverse":e.reverse,"v-field--single-line":e.singleLine,"v-field--no-label":!t(),[`v-field--variant-${e.variant}`]:!0},U.value,Y.value,W.value,q.value,j.value,G.value,e.class],style:[z.value,e.style],onClick:H},n),[a("div",{class:"v-field__overlay"},null),a(he,{name:"v-field",active:!!e.loading,color:e.error?"error":typeof e.loading=="string"?e.loading:e.color},{default:l.loader}),i&&a("div",{key:"prepend",class:"v-field__prepend-inner"},[e.prependInnerIcon&&a(I,{key:"prepend-icon",name:"prependInner"},null),(y=l["prepend-inner"])==null?void 0:y.call(l,g.value)]),a("div",{class:"v-field__field","data-no-activator":""},[["filled","solo","solo-inverted","solo-filled"].includes(e.variant)&&b.value&&a(_,{key:"floating-label",ref:m,class:[E.value],floating:!0,for:r.value,style:D.value},{default:()=>[t()]}),a(_,{ref:w,for:r.value},{default:()=>[t()]}),(C=l.default)==null?void 0:C.call(l,{...g.value,props:{id:r.value,class:"v-field__input","aria-describedby":X.value},focus:L,blur:R})]),d&&a(xe,{key:"clear"},{default:()=>[M(a("div",{class:"v-field__clearable",onMousedown:h=>{h.preventDefault(),h.stopPropagation()}},[l.clear?l.clear():a(I,{name:"clear"},null)]),[[N,e.dirty]])]}),c&&a("div",{key:"append",class:"v-field__append-inner"},[(v=l["append-inner"])==null?void 0:v.call(l,g.value),e.appendInnerIcon&&a(I,{key:"append-icon",name:"appendInner"},null)]),a("div",{class:["v-field__outline",E.value],style:D.value},[u&&a(_e,null,[a("div",{class:"v-field__outline__start"},null),b.value&&a("div",{class:"v-field__outline__notch"},[a(_,{ref:m,floating:!0,for:r.value},{default:()=>[t()]})]),a("div",{class:"v-field__outline__end"},null)]),A.value&&b.value&&a(_,{ref:m,floating:!0,for:r.value},{default:()=>[t()]})])])}),{controlRef:T}}});function Me(e){const o=Object.keys(Te.props).filter(n=>!Ie(n)&&n!=="class"&&n!=="style");return Ve(e,o)}export{Te as V,Oe as a,Me as f,we as m};