weex-flymeui
Version:
A Flyme Style UI library based on Weex for Creator.
3 lines (2 loc) • 11.3 kB
JavaScript
// { "framework": "Vue" }
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["npm/weex-flymeui/components/fm-multi-check-cell/index"]=t():e["npm/weex-flymeui/components/fm-multi-check-cell/index"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=72)}({0:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={biaoqing:"",bofang:"",bianji:"",bofang2:"",cebianlan:"",caijian:"",chakan:"",chexiao:"",chuangkouhua:"",daojishi:"",dianzan:"",chuangkouhua2:"",dianhua:"",diannao:"",dingwei2:"",dingwei:"",dingyue:"",erweima:"",fanhui:"",fasong:"",fujian:"",fenlei:"",fanhui2:"ູ",fenxiang:"",fuzhi:"",gengduo:"",gouwuche:"",gongjuxiang:"",gengduo2:"",guanbi:"",jishi:"",hongxin:"",jingyin:"",jianpan:"",jiesuo:"",jisuanqi:"󦰶",liangdu:"",lvjing:"",paixu:"",paihang:"",paizhao:"",pingmutoushe:"",riqi:"",shanchu:"",shangchaun:"",shangyishou:"",shezhi:"",shizhong:"",shezhi1:"",sousuo:"",shuqian:"",shuoming:"",shuaxin:"",suoding:"",shipin:"",tuichu:"",tupian:"",tianjia:"",tixing:"",wancheng:"",wengao:"",xiayishou:"",xinxi:"",xiazai:"",xingxing:"",xinxi1:"",xuanxiangliebiao:"",yidu:"",yinliang:"",yinbi:"",yuyin:"",zanting:"",yonghu:"",youjian:"",zhiding:"",chongzuo:"",zhuye:"",ziti:"",VPN:"","Wi-Fi":"",zhuti:"",lanya:"",quanping:"",pingmufanzhuan:"",gouwu:"",saomiao:""}},2:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(3);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},3:function(e,t,n){var i,o,r=[];r.push(n(4)),i=n(5);var s=n(6);o=i=i||{},"object"!=typeof i.default&&"function"!=typeof i.default||(Object.keys(i).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),o=i=i.default),"function"==typeof o&&(o=o.options),o.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-icon/index.vue",o.render=s.render,o.staticRenderFns=s.staticRenderFns,o._scopeId="data-v-08d175ee",o.style=o.style||{},r.forEach(function(e){for(var t in e)o.style[t]=e[t]}),"function"==typeof __register_static_styles__&&__register_static_styles__(o._scopeId,r),e.exports=i},4:function(e,t){e.exports={}},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=function(e){return e&&e.__esModule?e:{default:e}}(n(0));var r=weex.requireModule("dom");t.default={name:"FmIcon",props:{name:{default:"wancheng",type:String},value:{type:String,default:""},iconStyle:{type:[Number,Object,String],default:42},color:{type:String,default:"#666666"}},data:function(){return{Icon:o.default}},computed:{getIcon:function(){var e=this.Icon,t=this.name,n=this.value;return c(""===n?e[t]||"wancheng":n)},mergeStyle:function(){var e=this.iconStyle,t={fontFamily:"flymeicon",color:this.color};return"object"!==Object.prototype.toString.call(this.iconStyle).slice(8,-1).toLowerCase()?(t.fontSize=e+"px",t.height=e+"px"):t=Object.assign({},t,i({},e)),t}},beforeCreate:function(){this.isCreator||r.addRule("fontFace",{fontFamily:"flymeicon",src:"url('http://weixin-res.flyme.cn/resources/weex-flymeui/assets/iconfont.ttf')"})},methods:{itemClicked:function(e){this.$emit("fmIconClicked",{name:e})}}};var s=/&([^;]{2,});?/g,c=function(e){return e=e.replace(s,function(e,t){if("#"===t.charAt(0)){var n=0;if(n="x"===t.charAt(1).toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),!isNaN(n)&&n>=-32768&&n<=65535)return String.fromCharCode(n)}return e})}},6:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("text",{style:e.mergeStyle,on:{click:function(t){e.itemClicked(e.name)}}},[e._v(e._s(e.getIcon))])},staticRenderFns:[]},e.exports.render._withStripped=!0},72:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(73);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},73:function(e,t,n){var i,o,r=[];r.push(n(74)),i=n(75);var s=n(80);o=i=i||{},"object"!=typeof i.default&&"function"!=typeof i.default||(Object.keys(i).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),o=i=i.default),"function"==typeof o&&(o=o.options),o.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-multi-check-cell/index.vue",o.render=s.render,o.staticRenderFns=s.staticRenderFns,o._scopeId="data-v-3590f410",o.style=o.style||{},r.forEach(function(e){for(var t in e)o.style[t]=e[t]}),"function"==typeof __register_static_styles__&&__register_static_styles__(o._scopeId,r),e.exports=i},74:function(e,t){e.exports={"check-cell-wrap":{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:0,paddingRight:"20",paddingBottom:0,paddingLeft:"20","backgroundColor:active":"#eeeeee"},right:{width:"24",height:"24"}}},75:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(76));weex.requireModule("dom");t.default={name:"FmMultiCheckCell",components:{CheckIcon:i.default},props:{identity:{type:[String,Object,Number,Array],required:!0},disabled:{type:Boolean,default:!1}},computed:{_selected:{get:function(){return-1!==this.store.indexOf(this.identity)},set:function(e){e?this.addToStore():this.deleteFromStore()}},isGroup:function(){for(var e=this.$parent;e;){if("FmM\bultiCheckGroup"===e.$options.componentName)return this._group=e,!0;e=e.$parent}return!1},checking:function(){return this._group.checking},store:function(){return this._group.value}},methods:{onClick:function(e){this._group.checking&&!this.disabled&&this.toggleSelected()},toggleSelected:function(){!this.disabled&&(this._selected=!this._selected)},onLongpress:function(e){!this._group.checking&&(this._group.checking=!0)&&!this.disabled&&(this._selected=!0)},addToStore:function(){var e=this.identity;Array.isArray(this.store)&&-1===this.store.indexOf(e)&&this.store.push(e)},deleteFromStore:function(){var e=this.identity;Array.isArray(this.store)&&-1!==this.store.indexOf(e)&&this.store.splice(this.store.indexOf(e),1)}},created:function(){if(!this.isGroup)throw Error("fm-multi-check-cell must be used in fm-multi-check-group !")}}},76:function(e,t,n){var i,o,r=[];r.push(n(77)),i=n(78);var s=n(79);o=i=i||{},"object"!=typeof i.default&&"function"!=typeof i.default||(Object.keys(i).some(function(e){return"default"!==e&&"__esModule"!==e})&&console.error("named exports are not supported in *.vue files."),o=i=i.default),"function"==typeof o&&(o=o.options),o.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-multi-check-cell/check-icon.vue",o.render=s.render,o.staticRenderFns=s.staticRenderFns,o._scopeId="data-v-566f17d0",o.style=o.style||{},r.forEach(function(e){for(var t in e)o.style[t]=e[t]}),"function"==typeof __register_static_styles__&&__register_static_styles__(o._scopeId,r),e.exports=i},77:function(e,t){e.exports={"animate-wrap":{width:"24",height:"24"},unchecked:{width:"24",height:"24"},checked:{position:"absolute",left:0,top:0,width:"24",height:"24",transform:"scale(0)",backgroundColor:"#ffffff",borderRadius:"12"}}},78:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(2));var o=weex.requireModule("animation");t.default={components:{FmIcon:i.default},props:{show:{type:Boolean,default:!1},checked:{type:Boolean,default:!1},bgImg:{type:String,default:"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_off.png"},checkedImg:{type:String,default:"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_on.png"},checkedDisableImg:{type:String,default:"http://design.flyme.cn/weexui/assets/mz_btn_check_button_square_on_disable.png"},disabled:{type:Boolean,default:!1}},watch:{checked:function(e){this.appearChecked(e)}},data:function(){return{}},computed:{getCheckedImg:function(){var e=this.disabled,t=this.checkedImg,n=this.checkedDisableImg;return e?n:t},wrapStyle:function(){return this.show?{opacity:1}:{opacity:0,transform:"rotateX(90deg)"}},checkedStyle:function(){return this.checked?{opacity:1}:{opacity:0}},isNeedShow:function(){this.appear(this.show)},isNeedChecked:function(){var e=this;setTimeout(function(){e.appearChecked(e.checked)},50)}},methods:{appear:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=this.$refs["animate-wrap"];if(n&&e){o.transition(n,{styles:{transform:"rotateX(0deg)"},duration:t,delay:0,timingFunction:"ease-out"},function(){})}},appearChecked:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=this.$refs["check-icon"];if(n){var i=e?{transform:"scale(1)"}:{transform:"scale(0)"};o.transition(n,{styles:i,duration:t,delay:0,timingFunction:"ease-out"},function(){})}}}}},79:function(e,t){e.exports={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:["check-icon"]},[t("div",{ref:"animate-wrap",staticClass:["animate-wrap"],style:this.wrapStyle,attrs:{hack:this.isNeedShow}},[t("image",{staticClass:["unchecked"],attrs:{src:this.bgImg}}),t("image",{ref:"check-icon",staticClass:["checked"],attrs:{src:this.getCheckedImg,watch:this.isNeedChecked}})])])},staticRenderFns:[]},e.exports.render._withStripped=!0},80:function(e,t){e.exports={render:function(){var e=this.$createElement,t=this._self._c||e;return t("cell",{staticClass:["check-cell-wrap"],appendAsTree:!0,attrs:{ripple:"normal",append:"tree"},on:{longpress:this.onLongpress,click:this.onClick}},[t("div",{ref:"wrapper",staticClass:["wrapper"]},[this._t("default")],2),t("div",{staticClass:["right"]},[t("check-icon",{attrs:{show:this.checking,checked:this._selected,disabled:this.disabled}})],1)])},staticRenderFns:[]},e.exports.render._withStripped=!0}})});