2 lines
6.6 KiB
JavaScript
2 lines
6.6 KiB
JavaScript
![]() |
var e,t,a,i;import{Y as l,Z as o,o as r,j as s,w as n,a0 as d,m as c,y as h,B as u,G as p,H as b,h as m,Q as v,I as f,l as C,A as S}from"./index-90c12cc1.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as y}from"./uv-icon.c815b875.js";const g=D({name:"uv-radio-group",mixins:[l,o,{props:{value:{type:[String,Number,Boolean],default:""},modelValue:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1},shape:{type:String,default:"circle"},activeColor:{type:String,default:"#2979ff"},inactiveColor:{type:String,default:"#c8c9cc"},name:{type:String,default:""},size:{type:[String,Number],default:18},placement:{type:String,default:"row"},label:{type:[String],default:""},labelColor:{type:[String],default:"#303133"},labelSize:{type:[String,Number],default:14},labelDisabled:{type:Boolean,default:!1},iconColor:{type:String,default:"#fff"},iconSize:{type:[String,Number],default:12},borderBottom:{type:Boolean,default:!1},iconPlacement:{type:String,default:"left"},...null==(t=null==(e=uni.$uv)?void 0:e.props)?void 0:t.radioGroup}}],computed:{parentData(){return[this.value||this.modelValue,this.disabled,this.inactiveColor,this.activeColor,this.size,this.labelDisabled,this.shape,this.iconSize,this.borderBottom,this.placement]},bemClass(){return this.bem("radio-group",["placement"])}},watch:{parentData(){this.children.length&&this.children.map((e=>{"function"==typeof e.init&&e.init()}))}},data:()=>({}),created(){this.children=[]},methods:{unCheckedOther(e){this.children.map((t=>{e!==t&&(t.checked=!1)}));const{name:t}=e;this.$emit("update:modelValue",t),this.$emit("change",t)}}},[["render",function(e,t,a,i,l,o){const p=u;return r(),s(p,{class:c(["uv-radio-group",o.bemClass]),style:h([e.$uv.addStyle(this.customStyle)])},{default:n((()=>[d(e.$slots,"default",{},void 0,!0)])),_:3},8,["class","style"])}],["__scopeId","data-v-fe601beb"]]);const k=D({name:"uv-radio",mixins:[l,o,{props:{name:{type:[String,Number,Boolean],default:""},shape:{type:String,default:""},disabled:{type:[String,Boolean],default:""},labelDisabled:{type:[String,Boolean],default:""},activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},iconSize:{type:[String,Number],default:""},labelSize:{type:[String,Number],default:""},label:{type:[String,Number,Boolean],default:""},size:{type:[String,Number],default:""},iconColor:{type:String,default:""},labelColor:{type:String,default:""},...null==(i=null==(a=uni.$uv)?void 0:a.props)?void 0:i.radio}}],data:()=>({checked:!1,parentData:{iconSize:12,labelSize:14,labelDisabled:null,disabled:null,shape:null,activeColor:null,inactiveColor:null,size:18,value:null,modelValue:null,iconColor:null,placement:"row",borderBottom:!1,iconPlacement:"left"}}),computed:{elDisabled(){return""!==this.disabled?this.disabled:null!==this.parentData.disabled&&this.parentData.disabled},elLabelDisabled(){return""!==this.labelDisabled?this.labelDisabled:null!==this.parentData.labelDisabled&&this.parentData.labelDisabled},elSize(){return this.size?this.size:this.parentData.size?this.parentData.size:21},elIconSize(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:12},elActiveColor(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"#2979ff"},elInactiveColor(){return this.inactiveColor?this.inactiveColor:this.parentData.inactiveColor?this.parentData.inactiveColor:"#c8c9cc"},elLabelColor(){return this.labelColor?this.labelColor:this.parentData.labelColor?this.parentData.labelColor:"#606266"},elShape(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},elLabelSize(){return this.$uv.addUnit(this.labelSize?this.labelSize:this.parentData.labelSize?this.parentData.labelSize:"15")},elIconColor(){const e=this.iconColor?this.iconColor:this.parentData.iconColor?this.parentData.iconColor:"#ffffff";return this.elDisabled?this.checked?this.elInactiveColor:"transparent":this.checked?e:"transparent"},iconClasses(){let e=[];return e.push("uv-radio__icon-wrap--"+this.elShape),this.elDisabled&&e.push("uv
|