UNPKG

weex-flymeui

Version:

A Flyme Style UI library based on Weex for Creator.

3 lines (2 loc) 18.5 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-searchbar/index"]=t():e["npm/weex-flymeui/components/fm-searchbar/index"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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=182)}({0:function(e,t){e.exports=function(e,t,n,r,o){var i,a=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(i=e,a=e.default);var c,u="function"==typeof a?a.options:a;if(t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns),r&&(u._scopeId=r),o?(c=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(o)},u._ssrRegister=c):n&&(c=n),c){var l=u.functional,f=l?u.render:u.beforeCreate;l?u.render=function(e,t){return c.call(t),f(e,t)}:u.beforeCreate=f?[].concat(f,c):[c]}return{esModule:i,exports:a,options:u}}},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 o=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(r),i=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(i).concat([o]).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={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];"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},o=function(e){return e&&e.__esModule?e:{default:e}}(n(4));var i=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 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||i.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:"标签"}}}},182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(183);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(r).default}})},183:function(e,t,n){var r=!1;var o=n(0)(n(186),n(187),function(e){r||n(184)},"data-v-4cf19c5c",null);o.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-searchbar/index.vue",o.esModule&&Object.keys(o.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),o.options.functional&&console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions."),e.exports=o.exports},184:function(e,t,n){var r=n(185);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(2)("679c1aec",r,!1,{})},185:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n.fm-status-bar[data-v-4cf19c5c] {\n height: 0.61111rem;\n width: 10rem;\n background-color: #ffffff;\n}\n.fm-search-bar[data-v-4cf19c5c] {\n padding: 0 0.44444rem;\n background-color: #ffffff;\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 border-bottom-style: solid;\n border-bottom-width: 0.01852rem;\n border-bottom-color: rgba(0, 0, 0, 0.1);\n}\n.search-input-wrap[data-v-4cf19c5c] {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n flex: 1;\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: center;\n -webkit-justify-content: center;\n justify-content: center;\n padding-left: 0.32407rem;\n height: 0.83333rem;\n background-color: rgba(0, 0, 0, 0.05);\n outline: none;\n border-radius: 0.41667rem;\n}\n.search-bar-input[data-v-4cf19c5c] {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n flex: 1;\n height: 0.83333rem;\n margin-left: 0.22222rem;\n margin-right: 0.08333rem;\n line-height: 0.83333rem;\n font-size: 0.38889rem;\n background-color: transparent;\n font-family: sans-serif-medium;\n font-weight: 500;\n color: #616161;\n}\n.search-bar-icon[data-v-4cf19c5c] {\n line-height: 0.38889rem;\n height: 0.38889rem;\n font-weight: 700;\n}\n.search-bar-back[data-v-4cf19c5c] {\n\t\tmargin-left: -0.16667rem;\n\t\tmargin-right: 0.27778rem;\n line-height: 0.66667rem;\n height: 0.66667rem;\n font-weight: 700;\n}\n.search-bar-delete[data-v-4cf19c5c] {\n width: 0.55556rem;\n height: 0.55556rem;\n margin-right: 0.13889rem;\n font-weight: 700;\n padding: 0.03704rem 0 0 0.05556rem;\n background-color: rgba(77, 77, 77, 0.5);\n border-radius: 0.27778rem;\n}\n.search-enter[data-v-4cf19c5c] {\n font-family: sans-serif-medium;\n font-weight: 500;\n font-size: 0.44444rem;\n line-height: 0.88889rem;\n margin-left: 0.44444rem;\n color: rgba(0, 0, 0, 0.4);\n text-align: center;\n}\n.right-btn[data-v-4cf19c5c] {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0.22222rem;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n}\n",""])},186:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(6)),o=a(n(12)),i=n(5);function a(e){return e&&e.__esModule?e:{default:e}}var s=weex.requireModule("navigator");t.default={name:"FmSearchbar",mixins:[o.default],components:{FmIcon:r.default},props:{statusbar:{type:Boolean,default:!1},inputValue:{type:[String,Number],default:""},useDefaultReturn:{type:Boolean,default:!0},hasPrev:{type:Boolean,default:!0},backgroundColor:{type:String,default:"#FFFFFF"},iconColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},leftColor:{type:String,default:"rgba(0, 0, 0, 0.6)"},inputBackground:String,borderStyle:{type:Object,default:function(){return{}}},placeholder:String,autofocus:Boolean,disabled:Boolean,inputType:{type:String,default:"text"},searchText:{type:String,default:function(){return(0,i.t)("el.searchbar.search")}},searchColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},searchHighlightColor:{type:String,default:"#198DED"},searchTextSize:{type:Number,default:48},returnKeyType:{type:String,default:"search"},placeholderColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},inputColor:{type:String,default:"#616161"},show:{type:Boolean,default:!0}},watch:{inputValue:function(e){this.value=e}},data:function(){return{isFocus:!1,value:""}},computed:{delShow:function(){return this.isFocus&&this.value},barStyle:function(){var e={borderBottomStyle:"solid",borderBottomWidth:"2px",borderBottomColor:"rgba(0, 0, 0, 0.1)"};return Object.assign(e,this.borderStyle),e.backgroundColor=this.backgroundColor,e},searchTextStyle:function(){var e=this.value,t=this.searchColor,n=this.searchHighlightColor,r=this.searchTextSize;return{color:e?n:t,fontSize:r+"px"}}},methods:{onBack:function(e){this.useDefaultReturn&&s.pop({},function(e){}),this.$emit("fmSearchbarleftBtnClicked",{})},delClick:function(e){this.value=""},onInput:function(e){this.value=e.value,this.$emit("input",e)},onFocus:function(e){this.isFocus=!0,this.$emit("focus",e)},onBlur:function(e){this.isFocus=!1,this.$emit("blur",e)},focus:function(){this.$refs.input.focus()},blur:function(){this.$refs.input.blur()},onSubmit:function(e){this.$emit("fmSearchbarSubmit",{value:this.value})},onSearch:function(e){this.$emit("fmSearchbarSubmit",{value:this.value})},setSelectionRange:function(e,t){this.$refs.input.setSelectionRange(e,t)},getEditSelectionRange:function(e){this.$refs.input.getEditSelectionRange(e)},setValue:function(e){this.value=e}},mounted:function(){this.value=this.inputValue||""}}},187: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})}):e._e(),e._v(" "),n("div",{staticClass:"fm-search-bar",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.barStyle)},[e.hasPrev?e._t("left",[n("fm-icon",{staticClass:"search-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:"search-input-wrap",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.inputBackground?{backgroundColor:e.inputBackground}:{})},[n("fm-icon",{staticClass:"search-bar-icon",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{name:"sousuo","icon-style":42,color:e.iconColor}}),e._v(" "),n("input",{ref:"input",staticClass:"search-bar-input",staticStyle:e.$processStyle(void 0),style:e.$processStyle({color:e.inputColor,"placeholder-color":e.placeholderColor}),attrs:{autofocus:e.autofocus,disabled:e.disabled,type:e.inputType,"return-key-type":e.returnKeyType,placeholder:e.placeholder},domProps:{value:e.value},on:{blur:e.onBlur,focus:e.onFocus,input:e.onInput,return:e.onSubmit}}),e._v(" "),n("fm-icon",{staticClass:"search-bar-delete",staticStyle:e.$processStyle(void 0),style:e.$processStyle({opacity:e.delShow?1:0}),attrs:{name:"guanbi","icon-style":48,color:"#FFFFFF"},on:{fmIconClicked:e.delClick}}),e._v(" "),n("div",{staticClass:"right-btn",staticStyle:e.$processStyle(void 0),style:e.$processStyle({opacity:e.delShow?0:1})},[e._t("input-right")],2)],1),e._v(" "),e._t("right",[e.searchText?n("text",{staticClass:"search-enter",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.searchTextStyle),on:{click:e.onSearch}},[e._v(e._s(e.searchText))]):e._e()])],2)]):e._e()},staticRenderFns:[]},e.exports.render._withStripped=!0},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 o=n(3),i={},a=r&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,u=!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=i[n.id];if(r){r.refs++;for(var o=0;o<r.parts.length;o++)r.parts[o](n.parts[o]);for(;o<n.parts.length;o++)r.parts.push(g(n.parts[o]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o<n.parts.length;o++)a.push(g(n.parts[o]));i[n.id]={id:n.id,refs:1,parts:a}}}}function b(){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(u)return l;r.parentNode.removeChild(r)}if(p){var o=c++;r=s||(s=b()),t=m.bind(null,r,o,!1),n=m.bind(null,r,o,!0)}else r=b(),t=function(e,t){var n=t.css,r=t.media,o=t.sourceMap;r&&e.setAttribute("media",r);f.ssrId&&e.setAttribute(d,t.id);o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");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){u=n,f=r||{};var a=o(e,t);return h(a),function(t){for(var n=[],r=0;r<a.length;r++){var s=a[r];(c=i[s.id]).refs--,n.push(c)}t?h(a=o(e,t)):a=[];for(r=0;r<n.length;r++){var c;if(0===(c=n[r]).refs){for(var u=0;u<c.parts.length;u++)c.parts[u]();delete i[c.id]}}}};var x=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function m(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},3:function(e,t){e.exports=function(e,t){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=i[0],s={id:e+":"+o,css:i[1],media:i[2],sourceMap:i[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:"&#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;"}},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,o=t.t=function(e,t){for(var n=void 0,o=e.split("."),i=r,a=0,s=o.length;a<s;a++){if(n=i[o[a]],a===s-1)return n;if(!n)return"";i=n}return""},i=t.use=function(e){r=e||r};t.default={t:o,use:i}},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 o=n(0)(n(10),n(11),function(e){r||n(8)},"data-v-77aa90fe",null);o.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-icon/index.vue",o.esModule&&Object.keys(o.esModule).some(function(e){return"default"!==e&&"__"!==e.substr(0,2)})&&console.error("named exports are not supported in *.vue files."),o.options.functional&&console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions."),e.exports=o.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",""])}})});