UNPKG

weex-flymeui

Version:

A Flyme Style UI library based on Weex for Creator.

3 lines (2 loc) 10.4 kB
// { "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-titlebar/index"]=t():e["npm/weex-flymeui/components/fm-titlebar/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=222)}({0:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={biaoqing:"&#xe6a3;",bofang:"&#xe6a4;",bianji:"&#xe6a5;",bofang2:"&#xe6a7;",cebianlan:"&#xe6a7;",caijian:"&#xe6a8;",chakan:"&#xe6a9;",chexiao:"&#xe6aa;",chuangkouhua:"&#xe6ab;",daojishi:"&#xe6ac;",dianzan:"&#xe6ad;",chuangkouhua2:"&#xe6ae;",dianhua:"&#xe6af;",diannao:"&#xe6b0;",dingwei2:"&#xe6b1;",dingwei:"&#xe6b2;",dingyue:"&#xe6b3;",erweima:"&#xe6b4;",fanhui:"&#xe6b5;",fasong:"&#xe6b6;",fujian:"&#xe6b7;",fenlei:"&#xe6b8;",fanhui2:"&#xeb9;",fenxiang:"&#xe6ba;",fuzhi:"&#xe6bb;",gengduo:"&#xe6bc;",gouwuche:"&#xe6bd;",gongjuxiang:"&#xe6be;",gengduo2:"&#xe6bf;",guanbi:"&#xe6c0;",jishi:"&#xe6c1;",hongxin:"&#xe6c2;",jingyin:"&#xe6c3;",jianpan:"&#xe6c3;",jiesuo:"&#xe6c5;",jisuanqi:"&#xe6c36;",liangdu:"&#xe6c7;",lvjing:"&#xe6c8;",paixu:"&#xe6c9;",paihang:"&#xe6ca;",paizhao:"&#xe6cb;",pingmutoushe:"&#xe6cc;",riqi:"&#xe6cd;",shanchu:"&#xe6ce;",shangchaun:"&#xe6cf;",shangyishou:"&#xe6d0;",shezhi:"&#xe6d1;",shizhong:"&#xe6d2;",shezhi1:"&#xe6d3;",sousuo:"&#xe6d4;",shuqian:"&#xe6d5;",shuoming:"&#xe6d6;",shuaxin:"&#xe6d7;",suoding:"&#xe6d8;",shipin:"&#xe6d9;",tuichu:"&#xe6da;",tupian:"&#xe6db;",tianjia:"&#xe6dc;",tixing:"&#xe6dd;",wancheng:"&#xe6de;",wengao:"&#xe6df;",xiayishou:"&#xe6e0;",xinxi:"&#xe6e1;",xiazai:"&#xe6e2;",xingxing:"&#xe6e3;",xinxi1:"&#xe6e4;",xuanxiangliebiao:"&#xe6e5;",yidu:"&#xe6e6;",yinliang:"&#xe6e7;",yinbi:"&#xe6e8;",yuyin:"&#xe6e9;",zanting:"&#xe6ea;",yonghu:"&#xe6eb;",youjian:"&#xe6ec;",zhiding:"&#xe6ed;",chongzuo:"&#xe6ee;",zhuye:"&#xe6ef;",ziti:"&#xe6f0;",VPN:"&#xe6f1;","Wi-Fi":"&#xe6f2;",zhuti:"&#xe6f3;",lanya:"&#xe6f4;",quanping:"&#xe6f5;",pingmufanzhuan:"&#xe6f6;",gouwu:"&#xe6f7;",saomiao:"&#xe6f8;"}},1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.use=t.t=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(8)).default,o=t.t=function(e,t){for(var n=void 0,o=e.split("."),r=i,a=0,u=o.length;a<u;a++){if(n=r[o[a]],a===u-1)return n;if(!n)return"";r=n}return""},r=t.use=function(e){i=e||i};t.default={t:o,use:r}},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}})},222:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(223);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},223:function(e,t,n){var i,o,r=[];r.push(n(224)),i=n(225);var a=n(226);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-titlebar/index.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-e2aae6a0",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},224:function(e,t){e.exports={"fm-status-bar":{height:"66",width:"1080"},"fm-title-bar":{paddingLeft:"48",width:"1080",height:"144",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},"title-bar-back":{marginLeft:"-18",marginRight:"45",lineHeight:"72",height:"72",fontWeight:"700"},"title-wrap":{flex:1},"title-text":{flex:1,textOverflow:"ellipsis",lines:1,fontFamily:"sans-serif-medium",fontWeight:"500",fontSize:"48",lineHeight:"57",color:"rgba(0,0,0,0.6)"},"btn-icon":{marginRight:"48",color:"#198DED",lineHeight:"72",height:"72"},"btn-text":{marginRight:"48",fontFamily:"sans-serif-medium",fontWeight:"500",fontSize:"48",lineHeight:"57",color:"#198DED"}}},225:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a(n(2)),o=a(n(7)),r=n(1);function a(e){return e&&e.__esModule?e:{default:e}}var u=weex.requireModule("navigator");t.default={name:"FmTitlebar",mixins:[o.default],components:{FmIcon:i.default},props:{title:{type:String,default:function(){return(0,r.t)("el.titlebar.title")}},titleColor:{type:String,default:"rgba(0, 0, 0, 0.6)"},statusbar:{type:Boolean,default:!1},useDefaultReturn:{type:Boolean,default:!0},hasPrev:{type:Boolean,default:!0},borderStyle:{type:Object,default:function(){return{}}},backgroundColor:{type:String,default:"#FFFFFF"},leftColor:{type:String,default:"rgba(0, 0, 0, 0.6)"},rightBtns:[Object,Array],rightText:String,show:{type:Boolean,default:!0}},data:function(){return{height:210,statusHeight:66}},computed:{btns:function(){var e=this.rightBtns,t=this.rightText,n=[];return Array.isArray(e)?n=n.concat(e.slice(0,3)):"object"===Object.prototype.toString.call(e).slice(8,-1).toLowerCase()?n.push(e):t&&n.push({type:"text",value:t}),n},barStyle:function(){var e={borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:"rgba(0, 0, 0, 0.1)",paddingRight:(this.rightBtns?0:48)+"px"};return Object.assign(e,this.borderStyle),e.backgroundColor=this.backgroundColor,e}},methods:{onBack:function(e){this.useDefaultReturn&&u.pop({},function(e){}),this.$emit("fmTitlebarLeftBtnClicked",{})},rightBtnClick:function(e,t){this.$emit("fmTitlebarRightBtnClicked",{idx:e,value:t})}},created:function(){weex.supports&&weex.supports("@module/view.getStatusBarHeight")&&(this.statusHeight=3*weex.requireModule("view").getStatusBarHeight(),this.height=this.statusHeight+144)}}},226:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.show?n("div",[e.statusbar?n("div",{staticClass:["fm-status-bar"],style:{backgroundColor:e.backgroundColor,height:e.height-144+"px"}}):e._e(),n("div",{staticClass:["fm-title-bar"],style:e.barStyle},[e.hasPrev?e._t("left",[n("fm-icon",{staticClass:["title-bar-back"],attrs:{name:"fanhui",iconStyle:72,color:e.leftColor},on:{fmIconClicked:e.onBack}})]):e._e(),n("div",{staticClass:["title-wrap"]},[e._t("middle",[n("text",{staticClass:["title-text"],style:{color:e.titleColor}},[e._v(e._s(e.title))])])],2),e._t("right",e._l(e.btns,function(t,i){return n("div",{key:i},["icon"===t.type?n("fm-icon",{staticClass:["btn-icon"],style:t.color?{color:t.color}:{},attrs:{name:t.value,iconStyle:72},on:{fmIconClicked:function(n){e.rightBtnClick(i,t)}}}):n("text",{staticClass:["btn-text"],style:t.color?{color:t.color}:{},on:{click:function(n){e.rightBtnClick(i,t)}}},[e._v(e._s(t.value))])],1)}))],2)]):e._e()},staticRenderFns:[]},e.exports.render._withStripped=!0},3:function(e,t,n){var i,o,r=[];r.push(n(4)),i=n(5);var a=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=a.render,o.staticRenderFns=a.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 u(""===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 a=/&([^;]{2,});?/g,u=function(e){return e=e.replace(a,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},7:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1);t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return i.t.apply(this,t)}}}},8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={el:{common:{delete:"删除",cancel:"取消",confirm:"确认",close:"关闭",title:"标题",more:"更多"},titlebar:{title:"标题"},searchbar:{search:"搜索"},foldabletext:{more:"更多"},input:{placeholder:"请输入",inputError:"输入有误"},tag:{tagName:"标签"}}}}})});