2 lines
30 KiB
JavaScript
2 lines
30 KiB
JavaScript
|
import{ay as F,p as h,V as $,x as u,az as M,af as Le,aA as Ce,aB as bt,aC as Ct,aD as St,d,F as kt,W as Se,m as E,a as N,b as z,g as B,c as A,J as Ne,t as P,u as L,a7 as K,H as _t,v as $e,s as pt,r as ae,z as se,ak as wt,G as Te,y as Vt,E as Re,P as xt,aE as Bt,M as Pt,aF as Et,a3 as y,I as ee,A as le,aG as It,aH as Lt,aI as Nt,C as $t,a6 as Tt,as as Rt,ag as zt,Z as ie,S as At,aJ as Ot,aK as ke,ae as Dt,B as ze,K as Gt,aL as jt,aM as _e,N as Mt,O as Ht,aN as X,k as oe,n as Ae}from"./index-46b44c7e.js";const Oe=["top","bottom"],Wt=["start","end","left","right"];function Ft(e,t){let[n,a]=e.split(" ");return a||(a=F(Oe,n)?"start":F(Wt,n)?"top":"center"),{side:pe(n,t),align:pe(a,t)}}function pe(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function jn(e){return{side:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.side],align:e.align}}function Mn(e){return{side:e.side,align:{center:"center",top:"bottom",bottom:"top",left:"right",right:"left"}[e.align]}}function Hn(e){return{side:e.align,align:e.side}}function Wn(e){return F(Oe,e.side)?"y":"x"}const De=h({border:[Boolean,Number,String]},"border");function Ge(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$();return{borderClasses:u(()=>{const a=M(e)?e.value:e.border,s=[];if(a===!0||a==="")s.push(`${t}--border`);else if(typeof a=="string"||a===0)for(const l of String(a).split(" "))s.push(`border-${l}`);return s})}}const Ut=[null,"default","comfortable","compact"],je=h({density:{type:String,default:"default",validator:e=>Ut.includes(e)}},"density");function Me(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$();return{densityClasses:u(()=>`${t}--density-${e.density}`)}}const He=h({elevation:{type:[Number,String],validator(e){const t=parseInt(e);return!isNaN(t)&&t>=0&&t<=24}}},"elevation");function We(e){return{elevationClasses:u(()=>{const n=M(e)?e.value:e.elevation,a=[];return n==null||a.push(`elevation-${n}`),a})}}const re=h({rounded:{type:[Boolean,Number,String],default:void 0}},"rounded");function ue(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$();return{roundedClasses:u(()=>{const a=M(e)?e.value:e.rounded,s=[];if(a===!0||a==="")s.push(`${t}--rounded`);else if(typeof a=="string"||a===0)for(const l of String(a).split(" "))s.push(`rounded-${l}`);return s})}}function ce(e){return Le(()=>{const t=[],n={};if(e.value.background)if(Ce(e.value.background)){if(n.backgroundColor=e.value.background,!e.value.text&&bt(e.value.background)){const a=Ct(e.value.background);if(a.a==null||a.a===1){const s=St(a);n.color=s,n.caretColor=s}}}else t.push(`bg-${e.value.background}`);return e.value.text&&(Ce(e.value.text)?(n.color=e.value.text,n.caretColor=e.value.text):t.push(`text-${e.value.text}`)),{colorClasses:t,colorStyles:n}})}function D(e,t){const n=u(()=>({text:M(e)?e.value:t?e[t]:null})),{colorClasses:a,colorStyles:s}=ce(n);return{textColorClasses:a,textColorStyles:s}}function we(e,t){const n=u(()=>({background:M(e)?e.value:t?e[t]:null})),{colorClasses:a,colorStyles:s}=ce(n);return{backgroundColorClasses:a,backgroundColorStyles:s}}const Kt=["elevated","flat","tonal","outlined","text","plain"];function Xt(e,t){return d(kt,null,[e&&d("span",{key:"overlay",class:`${t}__overlay`},null),d("span",{key:"underlay",class:`${t}__underlay`},null)])}const Fe=h({color:String,variant:{type:String,default:"elevated",validator:e=>Kt.includes(e)}},"variant");function Yt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$();const n=u(()=>{const{variant:l}=Se(e);return`${t}--variant-${l}`}),{colorClasses:a,colorStyles:s}=ce(u(()=>{const{variant:l,color:i}=Se(e);return{[["elevated","flat"].includes(l)?"background":"text"]:i}}));return{colorClasses:a,colorStyles:s,variantClasses:n}}const Ue=h({divided:Boolean,...De(),...E(),...je(),...He(),...re(),...N(),...z(),...Fe()},"VBtnGroup"),Ve=B()({name:"VBtnGroup",props:Ue(),setup(e,t){let{slots:n}=t;const{themeClasses:a}=A(e),{densityClasses:s}=Me(e),{borderClasses:l}=Ge(e),{elevationClasses:i}=We(e),{roundedClasses:r}=ue(e);Ne({VBtn:{height:"auto",colo
|