2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
|
|
var e=Object.defineProperty;import{r as a,a as t,o as s,c as l,w as r,b as i,s as o,x as n,E as u,k as d,aW as c,aX as p,d as h,z as m,aN as f,A as y,a8 as _,ad as b,N as w,a5 as v,e as g,F as x,f as C,l as S,t as D,g as k,af as I,aY as z,aZ as A,aw as N,H as P,a1 as $,m as j,W as E,aa as V,I as L,y as U,i as F}from"./index.fe40b928.js";import{_ as R}from"./u-button.027407c6.js";import{_ as O,a as W,b as B,g as H,p as T}from"./pay.20e051ec.js";import{_ as X}from"./u-icon.ecff0a89.js";import{_ as q}from"./plugin-vue_export-helper.21dcd24c.js";import{E as M}from"./emitter.5b880544.js";import{_ as G}from"./u-popup.3445ccd1.js";import{w as Y,u as Z}from"./wechat.f0083b02.js";import{s as J}from"./util.0a60ad1b.js";import{r as K,a as Q}from"./recharge.46459c2c.js";import"./account.fe20c01d.js";var ee=q({name:"u-radio",emits:["change"],props:{name:{type:[String,Number],default:""},size:{type:[String,Number],default:34},shape:{type:String,default:""},disabled:{type:[String,Boolean],default:""},labelDisabled:{type:[String,Boolean],default:""},activeColor:{type:String,default:""},iconSize:{type:[String,Number],default:""},labelSize:{type:[String,Number],default:""}},data:()=>({parentData:{iconSize:null,labelDisabled:null,disabled:null,shape:null,activeColor:null,size:null,width:null,height:null,value:null,wrap:null}}),created(){this.parent=!1,this.updateParentData(),this.parent.children.push(this)},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:34},elIconSize(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:20},elActiveColor(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"primary"},elShape(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},iconStyle(){let e={};return this.elActiveColor&&this.parentData.value===this.name&&!this.elDisabled&&(e.borderColor=this.elActiveColor,e.backgroundColor=this.elActiveColor),e.width=this.$u.addUnit(this.elSize),e.height=this.$u.addUnit(this.elSize),e},iconColor(){return this.name===this.parentData.value?"#ffffff":"transparent"},iconClass(){let e=[];return e.push("u-radio__icon-wrap--"+this.elShape),this.name===this.parentData.value&&e.push("u-radio__icon-wrap--checked"),this.elDisabled&&e.push("u-radio__icon-wrap--disabled"),this.name===this.parentData.value&&this.elDisabled&&e.push("u-radio__icon-wrap--disabled--checked"),e.join(" ")},radioStyle(){let e={};return this.parentData.width&&(e.width=this.$u.addUnit(this.parentData.width),e.flex=`0 0 ${this.$u.addUnit(this.parentData.width)}`),this.parentData.wrap&&(e.width="100%",e.flex="0 0 100%"),e}},methods:{updateParentData(){this.getParentData("u-radio-group")},onClickLabel(){this.elLabelDisabled||this.elDisabled||this.setRadioCheckedStatus()},toggle(){this.elDisabled||this.setRadioCheckedStatus()},emitEvent(){this.parentData.value!=this.name&&this.$emit("change",this.name)},setRadioCheckedStatus(){this.emitEvent(),this.parent&&(this.parent.setValue(this.name),this.parentData.value=this.name)}}},[["render",function(e,c,p,h,m,f){const y=a(t("u-icon"),X),_=d;return s(),l(_,{class:"u-radio",style:n([f.radioStyle])},{default:r((()=>[i(_,{class:o(["u-radio__icon-wrap",[f.iconClass]]),onClick:f.toggle,style:n([f.iconStyle])},{default:r((()=>[i(y,{class:"u-radio__icon-wrap__icon",name:"checkbox-mark",size:f.elIconSize,color:f.iconColor},null,8,["size","color"])])),_:1},8,["onClick","class","style"]),i(_,{class:"u-radio__label",onClick:f.onClickLabel,style:n({fontSize:e.$u.addUnit(p.labelSize)})},{default:r((()=>[u(e.$slots,"default",{},void 0,!0)])),_:3},8,["onClick","style"])])),_:3},8,["style"])}],["__scopeId","data-v-1458021f"]]);const ae={name:"u-radio-group",emits:["update:modelValue","input","change"],mixins:[M],props:{value:{type:[String,Nu
|