UNPKG

weex-flymeui

Version:

A Flyme Style UI library based on Weex for Creator.

3 lines (2 loc) 16 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-rich-text/index"]=t():e["npm/weex-flymeui/components/fm-rich-text/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=147)}({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,s=o.length;a<s;a++){if(n=r[o[a]],a===s-1)return n;if(!n)return"";r=n}return""},r=t.use=function(e){i=e||i};t.default={t:o,use:r}},147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(148);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},148:function(e,t,n){var i,o,r=[];r.push(n(149)),i=n(150);var a=n(154);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-rich-text/index.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-e6b03882",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},149:function(e,t){e.exports={"fm-rich-text":{justifyContent:"flex-start",alignItems:"center",flexWrap:"wrap",flexDirection:"row",flexShrink:1},"default-text":{color:"#A5A5A5",fontSize:"36",lineHeight:"48"}}},150:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=u(n(81)),o=u(n(21)),r=u(n(2)),a=u(n(48)),s=u(n(151));function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"FmRichText",components:{FmText:o.default,FmIcon:r.default,FmTag:a.default,FmRichTextLink:s.default},props:{configList:{type:[Array,String],default:function(){return[]}},hasTextMargin:{type:Boolean,default:!0}},data:function(){return{}},computed:{isNotEmptyArray:function(){return i.default.isNonEmptyArray(this.configList)},isString:function(){return i.default.isString(this.configList)}},methods:{linkBeClick:function(e){this.$emit("linkBeClick",e)}}}},151:function(e,t,n){var i,o,r=[];i=n(152);var a=n(153);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-rich-text/fm-rich-text-link.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,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},152:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(21));t.default={components:{FmText:i.default},props:{linkValue:{type:[String,Number],default:""},hasTextMargin:{type:Boolean,default:!0},linkHref:{type:String,default:""},linkStyle:{type:Object,default:function(){return{}}}},methods:{onLinkClick:function(e){this.$emit("fmRichTextLinkClick",{event:e,href:this.linkHref})}}}},153:function(e,t){e.exports={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{on:{click:this.onLinkClick}},[t("fm-text",{attrs:{value:this.linkValue,hasTextMargin:this.hasTextMargin}})],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},154:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.isNotEmptyArray?n("div",{staticClass:["fm-rich-text"]},e._l(e.configList,function(t,i){return n("div",{key:i},["text"==t.type&&t.text?n("fm-text",{attrs:{value:t.text,hasTextMargin:e.hasTextMargin}}):e._e(),"link"==t.type&&t.href&&t.text?n("fm-rich-text-link",{attrs:{linkValue:t.text,linkStyle:t.style,linkHref:t.href,hasTextMargin:e.hasTextMargin},on:{fmRichTextLinkClick:e.linkBeClick}}):e._e(),"icon"==t.type?n("fm-icon",{attrs:{color:t.color,name:t.value,iconStyle:t.style}}):e._e(),"tag"==t.type?n("fm-tag",{attrs:{type:t.tagType,size:t.size,value:t.value,color:t.color,fontColor:t.fontColor}}):e._e()],1)})):e._e(),e.isString?n("fm-text",{attrs:{value:e.configList}}):e._e()],1)},staticRenderFns:[]},e.exports.render._withStripped=!0},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}})},21:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(33);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 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},33:function(e,t,n){var i,o,r=[];r.push(n(34)),i=n(35);var a=n(36);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-text/index.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-5cfa2da2",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},34:function(e,t){e.exports={text:{fontSize:"42",lineHeight:"63",color:"#999999",fontFamily:'"Source Han Sans CN", Roboto, sans-serif'},medium:{fontFamily:"sans-serif-medium",fontWeight:"500"},bold:{fontWeight:"700"},light:{fontWeight:"400"},small:{fontSize:"36"},large:{fontSize:"48",fontWeight:"500",lineHeight:"72",color:"#000000"},huge:{fontSize:"54",lineHeight:"81",color:"#000000"},"margin-text":{marginRight:"9"}}},35:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"FmText",props:{value:String,fontWeight:{type:String,default:"normal"},size:{type:String,default:"normal"},textStyle:{type:Object,default:function(){return{}}},hasTextMargin:{type:Boolean,default:!0}},data:function(){return{inValue:""}},watch:{value:function(e){this.inValue=e}},computed:{textClz:function(){var e=["text"];return this.hasTextMargin&&e.push("margin-text"),"normal"!==this.size&&e.push(""+this.size),"normal"!==this.fontWeight&&e.push(""+this.fontWeight),e}},created:function(){this.value&&(this.inValue=this.value),this.$slots.default&&(this.inValue=this.$slots.default[0].text)}}},36:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement;return(e._self._c||t)("text",{class:e.textClz,style:e.textStyle},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.inValue))]],2)},staticRenderFns:[]},e.exports.render._withStripped=!0},4:function(e,t){e.exports={}},48:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(49);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(i).default}})},49:function(e,t,n){var i,o,r=[];r.push(n(50)),i=n(51);var a=n(52);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-tag/index.vue",o.render=a.render,o.staticRenderFns=a.staticRenderFns,o._scopeId="data-v-2d637d5b",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},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 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,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,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})}},50:function(e,t){e.exports={"fm-tag":{alignItems:"center",flexDirection:"row"},"tag-item":{paddingTop:"9",paddingRight:"9",paddingBottom:"9",paddingLeft:"9",justifyContent:"center",alignItems:"center",overflow:"hidden"},"tag-border":{borderRadius:"4.5"},"tag-huge":{borderRadius:"100",height:"72",paddingTop:"12",paddingRight:"42",paddingBottom:"12",paddingLeft:"42"},"tag-hollow":{borderWidth:"3"},"tag-text":{fontFamily:'"Source Han Sans CN", Roboto, sans-serif',fontWeight:"bold"},"tag-font-small":{fontSize:"24"},"tag-font-big":{fontSize:"30"},"tag-font-huge":{fontSize:"42",fontFamily:"sans-serif-medium",fontWeight:"500"},"tag-margin-small":{marginRight:"6",marginBottom:"6"},"tag-margin-big":{marginRight:"12",marginBottom:"12"},"tag-margin-huge":{marginRight:"36",marginBottom:"36"}}},51:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){return e&&e.__esModule?e:{default:e}}(n(7)),o=n(1);t.default={name:"FmTag",mixins:[i.default],props:{type:{type:String,default:"solid"},size:{type:String,default:"small"},value:{type:[String,Number],default:function(){return(0,o.t)("el.tag.tagName")}},color:{type:String,default:"#198DED"},fontColor:{type:String,default:"#FFFFFF"}},computed:{showSolid:function(){var e=this.type,t=this.value;return"solid"===e&&""!==t},showHollow:function(){var e=this.type,t=this.value;return"hollow"===e&&""!==t},tagTextStyle:function(){var e=this.color;return this.showSolid?{backgroundColor:e}:{borderColor:e}},textStyle:function(){return{color:this.fontColor}},textClass:function(){var e=["tag-text"],t=this.size;return e.push("tag-font-"+t),e},tagClass:function(){var e=["fm-tag"],t=this.size;return e.push("tag-margin-"+t),e}},created:function(){this.$slots.default&&(this.value=this.$slots.default[0].text)}}},52:function(e,t){e.exports={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.tagClass},[e.showSolid||e.showHollow?n("div",{class:["tag-item","tag-border","huge"===e.size&&"tag-huge",e.showHollow&&"tag-hollow"],style:e.tagTextStyle},[n("text",{ref:"content",class:e.textClass,style:e.textStyle},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.value))]],2)]):e._e()])},staticRenderFns:[]},e.exports.render._withStripped=!0},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:"标签"}}}},81:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={_typeof:function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},isPlainObject:function(e){return"object"===i._typeof(e)},isString:function(e){return"string"==typeof e},isNonEmptyArray:function(e){return e&&e.length>0&&Array.isArray(e)&&void 0!==e}};t.default=i}})});