weex-flymeui
Version:
A Flyme Style UI library based on Weex for Creator.
3 lines (2 loc) • 17.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-popover/index"]=t():e["npm/weex-flymeui/components/fm-popover/index"]=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},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=154)}({0:function(e,t){e.exports=function(e,t,n,o,i){var r,a=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(r=e,a=e.default);var u,c="function"==typeof a?a.options:a;if(t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns),o&&(c._scopeId=o),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,d=l?c.render:c.beforeCreate;l?c.render=function(e,t){return u.call(t),d(e,t)}:c.beforeCreate=d?[].concat(d,u):[u]}return{esModule:r,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]||"",o=e[3];if(!o)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))))+" */"}(o),r=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(r).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 o={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(o[r]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&o[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 o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},i=function(e){return e&&e.__esModule?e:{default:e}}(n(4));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: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,o({},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,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},154:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(155);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(o).default}})},155:function(e,t,n){var o=!1;var i=n(0)(n(158),n(159),function(e){o||n(156)},"data-v-69ed5ad4",null);i.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-popover/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},156:function(e,t,n){var o=n(157);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(2)("2a660318",o,!1,{})},157:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n.popover-wrap[data-v-69ed5ad4]{\n position: fixed;\n width: 10rem;\n /*兼容H5异常*/\n z-index: 99999;\n}\n.popover[data-v-69ed5ad4] {\n position: fixed;\n z-index: 99;\n width: 5.81481rem;\n padding: 0.18519rem;\n border-radius: 0.09259rem;\n}\n.content[data-v-69ed5ad4] {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n flex: 1;\n box-shadow: 0 0 0.13889rem 0 rgba(0, 0, 0, 0.2);\n background-color: #FFFFFF;\n border-radius: 0.09259rem;\n overflow: hidden;\n}\n.item[data-v-69ed5ad4] {\n height: 1.55556rem;\n padding: 0 0.44444rem;\n}\n.item-content[data-v-69ed5ad4] {\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 border-bottom-width: 0.01852rem;\n border-color: rgba(0,0,0,0.10);\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n}\n.item-text[data-v-69ed5ad4] {\n font-size: 0.44444rem;\n}\n.item-icon[data-v-69ed5ad4] {\n margin-right: 0.13889rem;\n}\n",""])},158:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(21)),i=r(n(6));function r(e){return e&&e.__esModule?e:{default:e}}var a=weex.requireModule("animation");t.default={name:"FmPopover",components:{FmOverlay:o.default,FmIcon:i.default},props:{buttons:{type:Array,default:function(){return[]}},position:{type:Object,default:function(){return{pos:"top",x:0,y:0}}},hasAnimation:{type:Boolean,default:!0},overlayOpacity:{type:Number,default:0}},data:function(){return{show:!1,showIn:!1}},computed:{popoverStyle:function(){var e=this.position,t=e.x,n=void 0===t?0:t,o=e.y,i=void 0===o?0:o,r=e.pos,a=void 0===r?"top":r,s={};switch(n<0?s.right=-n+"px":s.left=n+"px",i<0?s.bottom=-i+"px":s.top=i+"px",a){case"top":s.transform="translateY("+(this.showIn?0:-20)+"px)";break;case"bottom":s.transform="translateY("+(this.showIn?0:20)+"px)";break;case"left":s.transform="translateX("+(this.showIn?0:-20)+"px)";break;case"right":s.transform="translateX("+(this.showIn?0:20)+"px)"}return s.opacity=this.showIn?1:0,s}},methods:{handleTouchEnd:function(e){e.preventDefault&&e.preventDefault()},appearPopover:function(e){var t=this,n=this.hasAnimation,o=this.position.pos,i=void 0===o?"top":o,r=this.$refs["fm-popover"];if(r){var s=void 0;switch(i){case"top":s="translateY(-20px)";break;case"bottom":s="translateY(20px)";break;case"left":s="translateX(-20px)";break;case"right":s="translateX(20px)"}var u=e?{transform:"translateX(0px) translateY(0px)",opacity:1}:{transform:s,opacity:0};a.transition(r,{styles:u,duration:n?150:1e-4,timingFunction:"ease-out"},function(n){t.showIn=e})}},onClicked:function(e){this.visible(!1),this.$emit("fmPopoverBtnClicked",{index:e})},visible:function(e){var t=this;this.show=e,setTimeout(function(){t.appearPopover(e)},40)}}}},159:function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"popover-wrap",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[e.show||e.showIn?n("fm-overlay",{ref:"fm-overlay",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{hasAnimation:!0,canAutoClose:!0,"use-native":!1,opacity:e.overlayOpacity},on:{fmOverlayBodyClicking:function(t){e.visible(!1)}}}):e._e(),e._v(" "),e.show||e.showIn?n("div",{ref:"fm-popover",staticClass:"popover",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.popoverStyle),on:{touchend:e.handleTouchEnd}},[n("div",{staticClass:"content",staticStyle:e.$processStyle(void 0),style:e.$processStyle({height:168*e.buttons.length-2+"px"})},e._l(e.buttons,function(t,o){return n("div",{key:o,staticClass:"item",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),on:{click:function(t){e.onClicked(o)}}},[n("div",{staticClass:"item-content",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[t.icon?n("fm-icon",{staticClass:"item-icon",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{name:t.icon,"icon-style":67}}):e._e(),e._v(" "),n("text",{staticClass:"item-text",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0)},[e._v(e._s(t.text))])],1)])}))]):e._e()],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},2:function(e,t,n){var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)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),r={},a=o&&(document.head||document.getElementsByTagName("head")[0]),s=null,u=0,c=!1,l=function(){},d=null,f="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],o=r[n.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](n.parts[i]);for(;i<n.parts.length;i++)o.parts.push(x(n.parts[i]));o.parts.length>n.parts.length&&(o.parts.length=n.parts.length)}else{var a=[];for(i=0;i<n.parts.length;i++)a.push(x(n.parts[i]));r[n.id]={id:n.id,refs:1,parts:a}}}}function v(){var e=document.createElement("style");return e.type="text/css",a.appendChild(e),e}function x(e){var t,n,o=document.querySelector("style["+f+'~="'+e.id+'"]');if(o){if(c)return l;o.parentNode.removeChild(o)}if(p){var i=u++;o=s||(s=v()),t=m.bind(null,o,i,!1),n=m.bind(null,o,i,!0)}else o=v(),t=function(e,t){var n=t.css,o=t.media,i=t.sourceMap;o&&e.setAttribute("media",o);d.ssrId&&e.setAttribute(f,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,o),n=function(){o.parentNode.removeChild(o)};return t(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;t(e=o)}else n()}}e.exports=function(e,t,n,o){c=n,d=o||{};var a=i(e,t);return h(a),function(t){for(var n=[],o=0;o<a.length;o++){var s=a[o];(u=r[s.id]).refs--,n.push(u)}t?h(a=i(e,t)):a=[];for(o=0;o<n.length;o++){var u;if(0===(u=n[o]).refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete r[u.id]}}}};var y=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}();function m(e,t,n,o){var i=n?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,i);else{var r=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(r,a[t]):e.appendChild(r)}}},21:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(22);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(o).default}})},22:function(e,t,n){var o=!1;var i=n(0)(n(25),n(26),function(e){o||n(23)},"data-v-10e45e81",null);i.options.__file="/Users/suen/Documents/develop/project/weex-flymeui/packages/fm-overlay/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},23:function(e,t,n){var o=n(24);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(2)("94068fec",o,!1,{})},24:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n.fm-overlay[data-v-10e45e81] {\n width: 10rem;\n position: fixed;\n left: 0;\n top: 0;\n bottom: 0;\n right: 0;\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}\n",""])},25:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=weex.requireModule("animation");t.default={name:"FmOverlay",props:{show:{type:Boolean,default:!0},hasAnimation:{type:Boolean,default:!0},duration:{type:[Number,String],default:300},timingFunction:{type:Array,default:function(){return["ease-in","ease-out"]}},opacity:{type:[Number,String],default:.5},canAutoClose:{type:Boolean,default:!0},useNative:{type:Boolean,default:!0}},computed:{overlayStyle:function(){return{opacity:this.hasAnimation?0:1,backgroundColor:"rgba(0, 0, 0,"+this.opacity+")"}},shouldShow:function(){var e=this;if(!this.isCreator){var t=this.show;return this.hasAnimation&&setTimeout(function(){e.appearOverlay(t)},50),t}},isCreator:function(){return this.useNative&&weex.supports&&weex.supports("@component/FmOverlayNative")}},methods:{overlayClicked:function(e){this.canAutoClose?this.appearOverlay(!1):this.$emit("fmOverlayBodyClicked",{})},appearOverlay:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.duration,i=this.hasAnimation,r=this.timingFunction,a=this.canAutoClose,s=!e&&a;s&&this.$emit("fmOverlayBodyClicking",{});var u=this.$refs["fm-overlay"];i&&u?o.transition(u,{styles:{opacity:e?1:0},duration:n,timingFunction:r[e?0:1],delay:0},function(){s&&t.$emit("fmOverlayBodyClicked",{})}):s&&this.$emit("fmOverlayBodyClicked",{})},hide:function(){this.appearOverlay(!1)}}}},26:function(e,t,n){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e.isCreator?"FmOverlayNative":"div",{tag:"component",staticStyle:e.$processStyle(void 0),style:e.$processStyle(void 0),attrs:{visible:e.show,touchable:e.canAutoClose},on:{onDismiss:e.overlayClicked}},[e.show&&!e.isCreator?n("div",{ref:"fm-overlay",staticClass:"fm-overlay",staticStyle:e.$processStyle(void 0),style:e.$processStyle(e.overlayStyle),attrs:{watch:e.shouldShow},on:{click:e.overlayClicked}},[e._t("default")],2):e._e(),e._v(" "),e.isCreator?n("div",[e._t("default")],2):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0},3:function(e,t){e.exports=function(e,t){for(var n=[],o={},i=0;i<t.length;i++){var r=t[i],a=r[0],s={id:e+":"+i,css:r[1],media:r[2],sourceMap:r[3]};o[a]?o[a].parts.push(s):n.push(o[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:""}},6:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(7);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(o).default}})},7:function(e,t,n){var o=!1;var i=n(0)(n(10),n(11),function(e){o||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 o=n(9);"string"==typeof o&&(o=[[e.i,o,""]]),o.locals&&(e.exports=o.locals);n(2)("1a663314",o,!1,{})},9:function(e,t,n){(e.exports=n(1)(!1)).push([e.i,"\n\n\n\n\n\n\n",""])}})});