1234567891011 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["tuniao-ui/components/tn-checkbox/tn-checkbox"],{252:function(t,e,n){"use strict";n.r(e);var i=n(253),a=n(255);for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);n(257);var r,l=n(36),c=Object(l["default"])(a["default"],i["render"],i["staticRenderFns"],!1,null,"314d0a6a",null,!1,i["components"],r);c.options.__file="tuniao-ui/components/tn-checkbox/tn-checkbox.vue",e["default"]=c.exports},253:function(t,e,n){"use strict";n.r(e);var i=n(254);n.d(e,"render",(function(){return i["render"]})),n.d(e,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(e,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(e,"components",(function(){return i["components"]}))},254:function(t,e,n){"use strict";var i;n.r(e),n.d(e,"render",(function(){return a})),n.d(e,"staticRenderFns",(function(){return r})),n.d(e,"recyclableRender",(function(){return s})),n.d(e,"components",(function(){return i}));var a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__get_style([t.checkboxStyle])),i=t.__get_style([t.iconStyle]);t.$mp.data=Object.assign({},{$root:{s0:n,s1:i}})},s=!1,r=[];a._withStripped=!0},255:function(t,e,n){"use strict";n.r(e);var i=n(256),a=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=a.a},256:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={name:"tn-checkbox",props:{name:{type:[String,Number],default:""},value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disabledLabel:{type:Boolean,default:!1},shape:{type:String,default:""},activeColor:{type:String,default:""},size:{type:Number,default:0},iconName:{type:String,default:"success"},iconSize:{type:Number,default:0},labelSize:{type:Number,default:0}},computed:{isDisabled:function(){return this.disabled?this.disabled:!!this.parent&&this.parentData.disabled},isDisabledLabel:function(){return this.disabledLabel?this.disabledLabel:!!this.parent&&this.parentData.disabledLabel},checkboxSize:function(){return this.size?this.size:this.parent?this.parentData.size:34},elAvtiveColor:function(){return this.activeColor?this.activeColor:this.parent?this.parentData.activeColor:"#01BEFF"},elShape:function(){return this.shape?this.shape:this.parent?this.parentData.shape:"square"},iconClass:function(){var t="";return t+=" tn-checkbox__icon-wrap--"+this.elShape,this.checkValue&&(t+=" tn-checkbox__icon-wrap--checked"),this.isDisabled&&(t+=" tn-checkbox__icon-wrap--disabled"),this.value&&this.isDisabled&&(t+=" tn-checkbox__icon-wrap--disabled--checked"),t},iconStyle:function(){var t={};return this.elAvtiveColor&&this.checkValue&&!this.isDisabled&&(t.borderColor=this.elAvtiveColor,t.backgroundColor=this.elAvtiveColor),t.color=this.checkValue?"#FFFFFF":"transparent",t.width=this.checkboxSize+"rpx",t.height=t.width,t.fontSize=(this.iconSize?this.iconSize:this.parent?this.parentData.iconSize:20)+"rpx",t},checkboxStyle:function(){var t={};return this.parent&&this.parentData.width&&(t.float="left"),this.parent&&this.parentData.wrap&&(t.width="100%"),t},labelClass:function(){var t="";return this.isDisabled&&(t+=" tn-checkbox__label--disabled"),t}},data:function(){return{checkValue:!1,parentData:{value:null,max:null,disabled:null,disabledLabel:null,shape:null,activeColor:null,size:null,width:null,wrap:null,iconSize:null}}},watch:{value:function(t){this.checkValue=t}},created:function(){this.updateParentData(),this.parent&&this.parent.children.push(this)},methods:{updateCheckValue:function(){this.checkValue=this.parent&&this.parentData.value.includes(this.name)||!0===this.value,this.parent&&this.value&&!this.parentData.value.includes(this.name)&&(this.parentData.value.push(this.name),this.parent.initValue(this.parentData.value))},updateParentData:function(){this.getParentData("tn-checkbox-group"),this.updateCheckValue()},onClickLabel:function(){this.isDisabled||this.isDisabledLabel||this.setValue()},toggle:function(){this.isDisabled||this.setValue()},emitEvent:function(){var t=this;this.$emit("change",{name:this.name,value:!this.checkValue}),this.parent&&(this.checkValue=!this.checkValue,setTimeout((function(){t.parent.emitEvent&&t.parent.emitEvent()}),80))},setValue:function(){if(this.parent)if(!0===this.checkValue)this.emitEvent();else{if(this.parentData.value.length>=this.parentData.max)return this.$t.message.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent()}else this.emitEvent(),this.$emit("input",!this.checkValue)}}};e.default=i},257:function(t,e,n){"use strict";n.r(e);var i=n(258),a=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=a.a},258:function(t,e,n){}}]);
- //# sourceMappingURL=../../../../.sourcemap/mp-weixin/tuniao-ui/components/tn-checkbox/tn-checkbox.js.map
- ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
- 'tuniao-ui/components/tn-checkbox/tn-checkbox-create-component',
- {
- 'tuniao-ui/components/tn-checkbox/tn-checkbox-create-component':(function(module, exports, __webpack_require__){
- __webpack_require__('2')['createComponent'](__webpack_require__(252))
- })
- },
- [['tuniao-ui/components/tn-checkbox/tn-checkbox-create-component']]
- ]);
|