Files
PORTAL_COD2/src/front/dist/assets/PatternTabs-303c1c7c.js
T
2024-11-08 08:33:35 +03:00

2 lines
5.6 KiB
JavaScript

import{a7 as P,c_ as N,d5 as Q,ab as _,d6 as Z,r as I,f as S,af as B,A as D,x as n,S as R,z as T,d7 as ee,d8 as ae,d9 as te,k as le,ak as O,da as se,db as oe,aq as ne,dc as re,aC as de,an as f,aH as ie,aJ as ue,cL as A,at as ce,dd as be,_ as me,s as W,t as G,v as g,K as ve,R as fe,T as ge,E as j,c3 as Ve,D as ye,y as we,$ as xe}from"./index-7e61a9cf.js";import{m as Te,V as E,b as he,a as H}from"./VWindowItem-7c9dff0d.js";const z=Symbol.for("vuetify:v-tabs"),ke=P({fixed:Boolean,sliderColor:String,hideSlider:Boolean,direction:{type:String,default:"horizontal"},...N(Q({selectedClass:"v-tab--selected",variant:"text"}),["active","block","flat","location","position","symbol"])},"VTab"),q=_()({name:"VTab",props:ke(),setup(e,l){let{slots:r,attrs:a}=l;const{textColorClasses:d,textColorStyles:c}=Z(e,"sliderColor"),t=I(),i=I(),b=S(()=>e.direction==="horizontal"),h=S(()=>{var m,s;return((s=(m=t.value)==null?void 0:m.group)==null?void 0:s.isSelected.value)??!1});function $(m){var o,v;let{value:s}=m;if(s){const u=(v=(o=t.value)==null?void 0:o.$el.parentElement)==null?void 0:v.querySelector(".v-tab--selected .v-tab__slider"),p=i.value;if(!u||!p)return;const F=getComputedStyle(u).color,V=u.getBoundingClientRect(),y=p.getBoundingClientRect(),k=b.value?"x":"y",C=b.value?"X":"Y",M=b.value?"right":"bottom",w=b.value?"width":"height",L=V[k],X=y[k],x=L>X?V[M]-y[M]:V[k]-y[k],Y=Math.sign(x)>0?b.value?"right":"bottom":Math.sign(x)<0?b.value?"left":"top":"center",J=(Math.abs(x)+(Math.sign(x)<0?V[w]:y[w]))/Math.max(V[w],y[w])||0,K=V[w]/y[w]||0,U=1.5;ae(p,{backgroundColor:[F,"currentcolor"],transform:[`translate${C}(${x}px) scale${C}(${K})`,`translate${C}(${x/U}px) scale${C}(${(J-1)/U+1})`,"none"],transformOrigin:Array(3).fill(Y)},{duration:225,easing:te})}}return B(()=>{const m=D.filterProps(e);return n(D,T({symbol:z,ref:t,class:["v-tab",e.class],style:e.style,tabindex:h.value?0:-1,role:"tab","aria-selected":String(h.value),active:!1},m,a,{block:e.fixed,maxWidth:e.fixed?300:void 0,"onGroup:selected":$}),{...r,default:()=>{var s;return n(R,null,[((s=r.default)==null?void 0:s.call(r))??e.text,!e.hideSlider&&n("div",{ref:i,class:["v-tab__slider",d.value],style:c.value},null)])}})}),ee({},t)}});const Ce=P({...N(Te(),["continuous","nextIcon","prevIcon","showArrows","touch","mandatory"])},"VTabsWindow"),Se=_()({name:"VTabsWindow",props:Ce(),emits:{"update:modelValue":e=>!0},setup(e,l){let{slots:r}=l;const a=le(z,null),d=O(e,"modelValue"),c=S({get(){var t;return d.value!=null||!a?d.value:(t=a.items.value.find(i=>a.selected.value.includes(i.id)))==null?void 0:t.value},set(t){d.value=t}});return B(()=>{const t=E.filterProps(e);return n(E,T({_as:"VTabsWindow"},t,{modelValue:c.value,"onUpdate:modelValue":i=>c.value=i,class:["v-tabs-window",e.class],style:e.style,mandatory:!1,touch:!1}),r)}),{}}}),Pe=P({...he()},"VTabsWindowItem"),_e=_()({name:"VTabsWindowItem",props:Pe(),setup(e,l){let{slots:r}=l;return B(()=>{const a=H.filterProps(e);return n(H,T({_as:"VTabsWindowItem"},a,{class:["v-tabs-window-item",e.class],style:e.style}),r)}),{}}});function Be(e){return e?e.map(l=>be(l)?l:{text:l,value:l}):[]}const $e=P({alignTabs:{type:String,default:"start"},color:String,fixedTabs:Boolean,items:{type:Array,default:()=>[]},stacked:Boolean,bgColor:String,grow:Boolean,height:{type:[Number,String],default:void 0},hideSlider:Boolean,sliderColor:String,...se({mandatory:"force",selectedClass:"v-tab-item--selected"}),...oe(),...ne()},"VTabs"),pe=_()({name:"VTabs",props:$e(),emits:{"update:modelValue":e=>!0},setup(e,l){let{attrs:r,slots:a}=l;const d=O(e,"modelValue"),c=S(()=>Be(e.items)),{densityClasses:t}=re(e),{backgroundColorClasses:i,backgroundColorStyles:b}=de(f(e,"bgColor")),{scopeId:h}=ie();return ue({VTab:{color:f(e,"color"),direction:f(e,"direction"),stacked:f(e,"stacked"),fixed:f(e,"fixedTabs"),sliderColor:f(e,"sliderColor"),hideSlider:f(e,"hideSlider")}}),B(()=>{const $=A.filterProps(e),m=!!(a.window||e.items.length>0);return n(R,null,[n(A,T($,{modelValue:d.value,"onUpdate:modelValue":s=>d.value=s,class:["v-tabs",`v-tabs--${e.direction}`,`v-tabs--align-tabs-${e.alignTabs}`,{"v-tabs--fixed-tabs":e.fixedTabs,"v-tabs--grow":e.grow,"v-tabs--stacked":e.stacked},t.value,i.value,e.class],style:[{"--v-tabs-height":ce(e.height)},b.value,e.style],role:"tablist",symbol:z},h,r),{default:()=>{var s;return[((s=a.default)==null?void 0:s.call(a))??c.value.map(o=>{var v;return((v=a.tab)==null?void 0:v.call(a,{item:o}))??n(q,T(o,{key:o.text,value:o.value}),{default:a[`tab.${o.value}`]?()=>{var u;return(u=a[`tab.${o.value}`])==null?void 0:u.call(a,{item:o})}:void 0})})]}}),m&&n(Se,T({modelValue:d.value,"onUpdate:modelValue":s=>d.value=s,key:"tabs-window"},h),{default:()=>{var s;return[c.value.map(o=>{var v;return((v=a.item)==null?void 0:v.call(a,{item:o}))??n(_e,{value:o.value},{default:()=>{var u;return(u=a[`item.${o.value}`])==null?void 0:u.call(a,{item:o})}})}),(s=a.window)==null?void 0:s.call(a)]}})])}),{}}}),We={props:{tabs:{type:Object,default:()=>{}}},setup(){return{tab:I(null)}}};function Ie(e,l,r,a,d,c){return W(),G(ye,{"no-gutters":"",class:"flex-column gap pa-1"},{default:g(()=>[n(j,{class:"v-col-auto"},{default:g(()=>[n(ve,null,{default:g(()=>[n(pe,{modelValue:a.tab,"onUpdate:modelValue":l[0]||(l[0]=t=>a.tab=t),"bg-color":"teal-darken-1","slider-color":"teal-lighten-3","selected-class":"active-tab",grow:!0},{default:g(()=>[(W(!0),fe(R,null,ge(r.tabs,(t,i)=>(W(),G(q,{value:t.value,key:i},{default:g(()=>[we(xe(t.title),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),n(j,{class:""},{default:g(()=>[n(E,{modelValue:a.tab,"onUpdate:modelValue":l[1]||(l[1]=t=>a.tab=t),class:"h-100"},{default:g(()=>[Ve(e.$slots,"item")]),_:3},8,["modelValue"])]),_:3})]),_:3})}const Me=me(We,[["render",Ie]]);export{Me as P};