weex-flymeui
Version:
A Flyme Style UI library based on Weex for Creator.
3 lines (2 loc) • 15.9 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-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(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},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=262)}({0:function(e,t){e.exports=function(e,t,n,r,i){var o,a=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(o=e,a=e.default);var u,c="function"==typeof a?a.options:a;if(t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns),r&&(c._scopeId=r),i?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=u):n&&(u=n),u){var l=c.functional,f=l?c.render:c.beforeCreate;l?c.render=function(e,t){return u.call(t),f(e,t)}:c.beforeCreate=f?[].concat(f,u):[u]}return{esModule:o,exports:a,options:c}}},1:function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var i=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(r),o=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(o).concat([i]).join("\n")}return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},10:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(e){return e&&e.__esModule?e:{default:e}}(n(4));var o=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:i.default}},computed:{getIcon:function(){var e=this.Icon,t=this.name,n=this.value;return s(""===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,r({},e)),t}},beforeCreate:function(){this.isCreator||o.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,s=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})}},11:function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("text",{staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.mergeStyle),on:{click:function(t){e.itemClicked(e.name)}}},[e._v(e._s(e.getIcon))])},staticRenderFns:[]},e.exports.render._withStripped=!0},12:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5);t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.t.apply(this,t)}}}},13: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:"标签"}}}},2:function(e,t,n){var r="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!r)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var i=n(3),o={},a=r&&(document.head||document.getElementsByTagName("head")[0]),s=null,u=0,c=!1,l=function(){},f=null,d="data-vue-ssr-id",p="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e){for(var t=0;t<e.length;t++){var n=e[t],r=o[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(g(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i<n.parts.length;i++)a.push(g(n.parts[i]));o[n.id]={id:n.id,refs:1,parts:a}}}}function x(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function g(e){var t,n,r=document.querySelector("style["+d+'~="'+e.id+'"]');if(r){if(c)return l;r.parentNode.removeChild(r)}if(p){var i=u++;r=s||(s=x()),t=y.bind(null,r,i,!1),n=y.bind(null,r,i,!0)}else r=x(),t=function(e,t){var n=t.css,r=t.media,i=t.sourceMap;r&&e.setAttribute("media",r);f.ssrId&&e.setAttribute(d,t.id);i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}e.exports=function(e,t,n,r){c=n,f=r||{};var a=i(e,t);return h(a),function(t){for(var n=[],r=0;r<a.length;r++){var s=a[r];(u=o[s.id]).refs--,n.push(u)}t?h(a=i(e,t)):a=[];for(r=0;r<n.length;r++){var u;if(0===(u=n[r]).refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete o[u.id]}}}};var m=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function y(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}},262:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(263);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(r).default}})},263:function(e,t,n){var r=!1;var i=n(0)(n(266),n(267),function(e){r||n(264)},"data-v-665f9fc0",null);i.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-titlebar/index.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},264:function(e,t,n){var r=n(265);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("2b4701ea",r,!1,{})},265:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n.fm-status-bar[data-v-665f9fc0] {\n height: 0.61111rem;\n width: 10rem;\n}\n.fm-title-bar[data-v-665f9fc0] {\n padding-left: 0.44444rem;\n width: 10rem;\n height: 1.33333rem;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: justify;\n -webkit-justify-content: space-between;\n justify-content: space-between;\n}\n.title-bar-back[data-v-665f9fc0] {\n margin-left: -0.16667rem;\n margin-right: 0.41667rem;\n line-height: 0.66667rem;\n height: 0.66667rem;\n font-weight: 700;\n}\n.title-wrap[data-v-665f9fc0] {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n flex: 1;\n}\n.title-text[data-v-665f9fc0] {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n flex: 1;\n text-overflow: ellipsis;\n lines: 1;\n font-family: sans-serif-medium;\n font-weight: 500;\n font-size: 0.44444rem;\n line-height: 0.52778rem;\n color: rgba(0, 0, 0, 0.6);\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-line-clamp: 1;\n}\n.btn-icon[data-v-665f9fc0] {\n margin-right: 0.44444rem;\n color: #198DED;\n line-height: 0.66667rem;\n height: 0.66667rem;\n}\n.btn-text[data-v-665f9fc0] {\n margin-right: 0.44444rem;\n font-family: sans-serif-medium;\n font-weight: 500;\n font-size: 0.44444rem;\n line-height: 0.52778rem;\n color: #198DED;\n}\n",""])},266:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(6)),i=a(n(12)),o=n(5);function a(e){return e&&e.__esModule?e:{default:e}}var s=weex.requireModule("navigator");t.default={name:"FmTitlebar",mixins:[i.default],components:{FmIcon:r.default},props:{title:{type:String,default:function(){return(0,o.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&&s.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)}}},267:function(e,t,n){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",staticStyle:e.$processStyle(void 0),style:e.$processStyle({backgroundColor:e.backgroundColor,height:e.height-144+"px"})}):e._e(),e._v(" "),n("div",{staticClass:"fm-title-bar",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.barStyle)},[e.hasPrev?e._t("left",[n("fm-icon",{staticClass:"title-bar-back",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{name:"fanhui","icon-style":72,color:e.leftColor},on:{fmIconClicked:e.onBack}})]):e._e(),e._v(" "),n("div",{staticClass:"title-wrap",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[e._t("middle",[n("text",{staticClass:"title-text",staticStyle:e.$processStyle(void 0),style:e.$processStyle({color:e.titleColor})},[e._v(e._s(e.title))])])],2),e._v(" "),e._t("right",e._l(e.btns,function(t,r){return n("div",{key:r,staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},["icon"===t.type?n("fm-icon",{staticClass:"btn-icon",staticStyle:e.$processStyle(void 0),style:e.$processStyle(t.color?{color:t.color}:{}),attrs:{name:t.value,"icon-style":72},on:{fmIconClicked:function(n){e.rightBtnClick(r,t)}}}):n("text",{staticClass:"btn-text",staticStyle:e.$processStyle(void 0),style:e.$processStyle(t.color?{color:t.color}:{}),on:{click:function(n){e.rightBtnClick(r,t)}}},[e._v(e._s(t.value))])],1)}))],2)]):e._e()},staticRenderFns:[]},e.exports.render._withStripped=!0},3:function(e,t){e.exports=function(e,t){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=o[0],s={id:e+":"+i,css:o[1],media:o[2],sourceMap:o[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}},4: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:""}},5:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.use=t.t=void 0;var r=function(e){return e&&e.__esModule?e:{default:e}}(n(13)).default,i=t.t=function(e,t){for(var n=void 0,i=e.split("."),o=r,a=0,s=i.length;a<s;a++){if(n=o[i[a]],a===s-1)return n;if(!n)return"";o=n}return""},o=t.use=function(e){r=e||r};t.default={t:i,use:o}},6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(r).default}})},7:function(e,t,n){var r=!1;var i=n(0)(n(10),n(11),function(e){r||n(8)},"data-v-77aa90fe",null);i.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-icon/index.vue",i.esModule&&Object.keys(i.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),i.options.functional&&console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions."),e.exports=i.exports},8:function(e,t,n){var r=n(9);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("1a663314",r,!1,{})},9:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n\n\n\n\n\n\n",""])}})});