Files
chazhi_admin_parten/public/h5/assets/wd-radio.CUA1Ezn6.js
2026-03-14 16:20:49 +08:00

2 lines
2.7 KiB
JavaScript

var x=Object.defineProperty,N=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var C=(l,e,a)=>e in l?x(l,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[e]=a,c=(l,e)=>{for(var a in e||(e={}))R.call(e,a)&&C(l,a,e[a]);if(P)for(var a of P(e))W.call(e,a)&&C(l,a,e[a]);return l},d=(l,e)=>N(l,G(e));import{aJ as f,a5 as _,a6 as V,aN as I,d as O,aK as q,T as o,au as t,at as i,W as D,c as S,j as $,l as K,aa as p,s as j,w as k,k as g,aq as A,af as E,_ as H,x as J}from"./index-B-O76M86.js";const T=Symbol("wd-radio-group"),Q=d(c({},V),{modelValue:[String,Number,Boolean],shape:f("check"),checkedColor:String,disabled:_(!1),cell:_(!1),size:f(""),inline:_(!1),iconPlacement:f("auto")}),U=d(c({},V),{value:I([String,Number,Boolean]),shape:String,checkedColor:String,disabled:{type:[Boolean,null],default:null},cell:{type:[Boolean,null],default:null},size:String,inline:{type:[Boolean,null],default:null},maxWidth:String,iconPlacement:{type:String}}),Y={name:"wd-radio",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"}},F=O(d(c({},Y),{props:U,setup(l){const e=l,{parent:a}=q(T),u=o(()=>a?e.value===a.props.modelValue:!1),n=o(()=>e.shape||t(a,"props.shape")),m=o(()=>e.checkedColor||t(a,"props.checkedColor")),r=o(()=>i(e.disabled)?e.disabled:t(a,"props.disabled")),w=o(()=>i(e.inline)?e.inline:t(a,"props.inline")),y=o(()=>e.size||t(a,"props.size")),b=o(()=>i(e.cell)?e.cell:t(a,"props.cell")),B=o(()=>i(e.iconPlacement)?e.iconPlacement:t(a,"props.iconPlacement"));D(()=>e.shape,s=>{const v=["check","dot","button"];(!s||v.indexOf(s)===-1)&&console.error(`shape must be one of ${v.toString()}`)});function z(){const{value:s}=e;!r.value&&a&&i(s)&&a.updateValue(s)}return(s,v)=>{const h=K;return $(),S(h,{class:j(`wd-radio ${b.value?"is-cell-radio":""} ${b.value&&n.value=="button"?"is-button-radio":""} ${y.value?"is-"+y.value:""} ${w.value?"is-inline":""} ${u.value?"is-checked":""} ${n.value!=="check"?"is-"+n.value:""} ${r.value?"is-disabled":""} icon-placement-${B.value} ${s.customClass}`),style:p(s.customStyle),onClick:z},{default:k(()=>[g(h,{class:"wd-radio__label",style:p(`${s.maxWidth?"max-width:"+s.maxWidth:""}; ${u.value&&n.value==="button"&&!r.value?"color :"+m.value:""}`)},{default:k(()=>[A(s.$slots,"default",{},void 0,!0)]),_:3},8,["style"]),g(h,{class:"wd-radio__shape",style:p(u.value&&!r.value?"color: "+m.value:"")},{default:k(()=>[n.value==="check"?($(),S(H,{key:0,style:p(u.value&&!r.value?"color: "+m.value:""),name:"check"},null,8,["style"])):E("",!0)]),_:1},8,["style"])]),_:3},8,["class","style"])}}})),X=J(F,[["__scopeId","data-v-66db7d09"]]);export{T as R,X as _,Q as r};