u-radio.js 4.1 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-radio/u-radio"],{"2c40":function(t,e,a){"use strict";a.r(e);var i=a("5c76"),n=a("539a");for(var l in n)"default"!==l&&function(t){a.d(e,t,(function(){return n[t]}))}(l);a("5db0");var s,r=a("f0c5"),u=Object(r["a"])(n["default"],i["b"],i["c"],!1,null,"a3b1c128",null,!1,i["a"],s);e["default"]=u.exports},"539a":function(t,e,a){"use strict";a.r(e);var i=a("a91d"),n=a.n(i);for(var l in i)"default"!==l&&function(t){a.d(e,t,(function(){return i[t]}))}(l);e["default"]=n.a},"5c76":function(t,e,a){"use strict";a.d(e,"b",(function(){return n})),a.d(e,"c",(function(){return l})),a.d(e,"a",(function(){return i}));var i={uIcon:function(){return a.e("uview-ui/components/u-icon/u-icon").then(a.bind(null,"c500"))}},n=function(){var t=this,e=t.$createElement,a=(t._self._c,t.__get_style([t.radioStyle])),i=t.__get_style([t.iconStyle]),n=t.$u.addUnit(t.labelSize);t.$mp.data=Object.assign({},{$root:{s0:a,s1:i,g0:n}})},l=[]},"5db0":function(t,e,a){"use strict";var i=a("fe70"),n=a.n(i);n.a},a91d:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"u-radio",props:{name:{type:[String,Number],default:""},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:function(){return{parentData:{iconSize:null,labelDisabled:null,disabled:null,shape:null,activeColor:null,size:null,width:null,height:null,value:null,wrap:null}}},created:function(){this.parent=!1,this.updateParentData(),this.parent.children.push(this)},computed:{elDisabled:function(){return""!==this.disabled?this.disabled:null!==this.parentData.disabled&&this.parentData.disabled},elLabelDisabled:function(){return""!==this.labelDisabled?this.labelDisabled:null!==this.parentData.labelDisabled&&this.parentData.labelDisabled},elSize:function(){return this.size?this.size:this.parentData.size?this.parentData.size:34},elIconSize:function(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:20},elActiveColor:function(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"primary"},elShape:function(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},iconStyle:function(){var t={};return this.elActiveColor&&this.parentData.value==this.name&&!this.elDisabled&&(t.borderColor=this.elActiveColor,t.backgroundColor=this.elActiveColor),t.width=this.$u.addUnit(this.elSize),t.height=this.$u.addUnit(this.elSize),t},iconColor:function(){return this.name==this.parentData.value?"#ffffff":"transparent"},iconClass:function(){var t=[];return t.push("u-radio__icon-wrap--"+this.elShape),this.name==this.parentData.value&&t.push("u-radio__icon-wrap--checked"),this.elDisabled&&t.push("u-radio__icon-wrap--disabled"),this.name==this.parentData.value&&this.elDisabled&&t.push("u-radio__icon-wrap--disabled--checked"),t.join(" ")},radioStyle:function(){var t={};return this.parentData.width&&(t.width=this.$u.addUnit(this.parentData.width),t.float="left"),this.parentData.wrap&&(t.width="100%"),t}},methods:{updateParentData:function(){this.getParentData("u-radio-group")},onClickLabel:function(){this.elLabelDisabled||this.elDisabled||this.setRadioCheckedStatus()},toggle:function(){this.elDisabled||this.setRadioCheckedStatus()},emitEvent:function(){this.parentData.value!=this.name&&this.$emit("change",this.name)},setRadioCheckedStatus:function(){this.emitEvent(),this.parent&&(this.parent.setValue(this.name),this.parentData.value=this.name)}}};e.default=i},fe70:function(t,e,a){}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'uview-ui/components/u-radio/u-radio-create-component',
  4. {
  5. 'uview-ui/components/u-radio/u-radio-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("2c40"))
  7. })
  8. },
  9. [['uview-ui/components/u-radio/u-radio-create-component']]
  10. ]);