u-radio.js 4.1 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-radio/u-radio"],{1200:function(t,e,i){"use strict";var a=i("c3b5"),n=i.n(a);n.a},"32f4":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return a}));var a={uIcon:function(){return i.e("uview-ui/components/u-icon/u-icon").then(i.bind(null,"572e"))}},n=function(){var t=this.$createElement,e=(this._self._c,this.__get_style([this.radioStyle])),i=this.__get_style([this.iconStyle]),a=this.$u.addUnit(this.labelSize);this.$mp.data=Object.assign({},{$root:{s0:e,s1:i,g0:a}})},s=[]},"8ccd":function(t,e,i){"use strict";i.r(e);var a=i("32f4"),n=i("e557");for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);i("1200");var l=i("f0c5"),r=Object(l["a"])(n["default"],a["b"],a["c"],!1,null,"56336111",null,!1,a["a"],void 0);e["default"]=r.exports},b04e:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a={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=a},c3b5:function(t,e,i){},e557:function(t,e,i){"use strict";i.r(e);var a=i("b04e"),n=i.n(a);for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);e["default"]=n.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__("8ccd"))
  7. })
  8. },
  9. [['uview-ui/components/u-radio/u-radio-create-component']]
  10. ]);