u-checkbox.js 5.3 KB

1234567891011
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uview-ui/components/u-checkbox/u-checkbox"],{1207:function(e,t,n){"use strict";n.r(t);var i=n(1208),r=n(1210);for(var a in r)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(a);n(1212);var s,o=n(32),c=Object(o["default"])(r["default"],i["render"],i["staticRenderFns"],!1,null,"54acf820",null,!1,i["components"],s);c.options.__file="uview-ui/components/u-checkbox/u-checkbox.vue",t["default"]=c.exports},1208:function(e,t,n){"use strict";n.r(t);var i=n(1209);n.d(t,"render",(function(){return i["render"]})),n.d(t,"staticRenderFns",(function(){return i["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return i["recyclableRender"]})),n.d(t,"components",(function(){return i["components"]}))},1209:function(e,t,n){"use strict";var i;n.r(t),n.d(t,"render",(function(){return r})),n.d(t,"staticRenderFns",(function(){return s})),n.d(t,"recyclableRender",(function(){return a})),n.d(t,"components",(function(){return i}));try{i={uIcon:function(){return n.e("uview-ui/components/u-icon/u-icon").then(n.bind(null,1128))}}}catch(o){if(-1===o.message.indexOf("Cannot find module")||-1===o.message.indexOf(".vue"))throw o;console.error(o.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__get_style([e.checkboxStyle])),i=e.__get_style([e.iconStyle]),r=e.$u.addUnit(e.labelSize);e.$mp.data=Object.assign({},{$root:{s0:n,s1:i,g0:r}})},a=!1,s=[];r._withStripped=!0},1210:function(e,t,n){"use strict";n.r(t);var i=n(1211),r=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);t["default"]=r.a},1211:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i={name:"u-checkbox",props:{name:{type:[String,Number],default:""},shape:{type:String,default:""},value:{type:Boolean,default:!1},disabled:{type:[String,Boolean],default:""},labelDisabled:{type:[String,Boolean],default:""},activeColor:{type:String,default:""},iconSize:{type:[String,Number],default:""},labelSize:{type:[String,Number],default:""},size:{type:[String,Number],default:""}},data:function(){return{parentDisabled:!1,newParams:{}}},created:function(){this.parent=this.$u.$parent.call(this,"u-checkbox-group"),this.parent&&this.parent.children.push(this)},computed:{isDisabled:function(){return""!==this.disabled?this.disabled:!!this.parent&&this.parent.disabled},isLabelDisabled:function(){return""!==this.labelDisabled?this.labelDisabled:!!this.parent&&this.parent.labelDisabled},checkboxSize:function(){return this.size?this.size:this.parent?this.parent.size:34},checkboxIconSize:function(){return this.iconSize?this.iconSize:this.parent?this.parent.iconSize:20},elActiveColor:function(){return this.activeColor?this.activeColor:this.parent?this.parent.activeColor:"primary"},elShape:function(){return this.shape?this.shape:this.parent?this.parent.shape:"square"},iconStyle:function(){var e={};return this.elActiveColor&&this.value&&!this.isDisabled&&(e.borderColor=this.elActiveColor,e.backgroundColor=this.elActiveColor),e.width=this.$u.addUnit(this.checkboxSize),e.height=this.$u.addUnit(this.checkboxSize),e},iconColor:function(){return this.value?"#ffffff":"transparent"},iconClass:function(){var e=[];return e.push("u-checkbox__icon-wrap--"+this.elShape),1==this.value&&e.push("u-checkbox__icon-wrap--checked"),this.isDisabled&&e.push("u-checkbox__icon-wrap--disabled"),this.value&&this.isDisabled&&e.push("u-checkbox__icon-wrap--disabled--checked"),e.join(" ")},checkboxStyle:function(){var e={};return this.parent&&this.parent.width&&(e.width=this.parent.width,e.float="left"),this.parent&&this.parent.wrap&&(e.width="100%"),e}},methods:{onClickLabel:function(){this.isLabelDisabled||this.isDisabled||this.setValue()},toggle:function(){this.isDisabled||this.setValue()},emitEvent:function(){var e=this;this.$emit("change",{value:!this.value,name:this.name}),setTimeout((function(){e.parent&&e.parent.emitEvent&&e.parent.emitEvent()}),80)},setValue:function(){var e=0;if(this.parent&&this.parent.children&&this.parent.children.map((function(t){t.value&&e++})),1==this.value)this.emitEvent(),this.$emit("input",!this.value);else{if(this.parent&&e>=this.parent.max)return this.$u.toast("最多可选".concat(this.parent.max,"项"));this.emitEvent(),this.$emit("input",!this.value)}}}};t.default=i},1212:function(e,t,n){"use strict";n.r(t);var i=n(1213),r=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);t["default"]=r.a},1213:function(e,t,n){}}]);
  2. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-checkbox/u-checkbox.js.map
  3. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  4. 'uview-ui/components/u-checkbox/u-checkbox-create-component',
  5. {
  6. 'uview-ui/components/u-checkbox/u-checkbox-create-component':(function(module, exports, __webpack_require__){
  7. __webpack_require__('2')['createComponent'](__webpack_require__(1207))
  8. })
  9. },
  10. [['uview-ui/components/u-checkbox/u-checkbox-create-component']]
  11. ]);