u-radio.js 4.3 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uni_modules/vk-uview-ui/components/u-radio/u-radio"],{"0505":function(t,e,a){"use strict";a.r(e);var i=a("9dc0"),n=a("ceca");for(var l in n)"default"!==l&&function(t){a.d(e,t,(function(){return n[t]}))}(l);a("0973");var s,r=a("f0c5"),u=Object(r["a"])(n["default"],i["b"],i["c"],!1,null,"76e26235",null,!1,i["a"],s);e["default"]=u.exports},"0973":function(t,e,a){"use strict";var i=a("e0a1"),n=a.n(i);n.a},"0d05":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={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:""},labelColor:{type:[String,Number],default:"#606266"}},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},"9dc0":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("uni_modules/vk-uview-ui/components/u-icon/u-icon").then(a.bind(null,"ba35"))}},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=[]},ceca:function(t,e,a){"use strict";a.r(e);var i=a("0d05"),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},e0a1:function(t,e,a){}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'uni_modules/vk-uview-ui/components/u-radio/u-radio-create-component',
  4. {
  5. 'uni_modules/vk-uview-ui/components/u-radio/u-radio-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("0505"))
  7. })
  8. },
  9. [['uni_modules/vk-uview-ui/components/u-radio/u-radio-create-component']]
  10. ]);