-
Notifications
You must be signed in to change notification settings - Fork 0
/
textHoleEle.js
2 lines (2 loc) · 3.62 KB
/
textHoleEle.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([["new-card/textHoleEle"],{"4ScS":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("jm62"),n("ioFf"),n("rGqo"),n("yt8O"),n("Btvt"),n("RW0V"),n("f3/d"),n("KKXr"),n("pIFo");var i=n("YdJS"),o=n("H8mG");function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={name:"textHoleEle",props:{wrapStyle:Object,info:Object,dataEle:String,paging:Function,fontList:Array},data:function(){return{isEdit:this.$route.meta.isEdit}},watch:{info:function(t,e){t.smallFontPath===e.smallFontPath||this.isEdit||this.loadFonts()}},computed:{withBrContent:function(){var t=this.info.content;return(void 0===t?"":t).replace(/\r\n|\n|\r/g,"<br>")},fontStyle:function(){var t=this.wrapStyle,e=this.info,n=this.isEdit,r=e.lineSpacing,c=void 0===r?-1:r,f=e.fontSize,l=e.color,s=e.alignment,u=void 0===s?0:s,d=e.smallFontPath,p=e.fontName,h=e.fitFullScreen,m=e.width,g=e.height,b=e.fontVersion,w=e.content;"MS.WANG"===(void 0===w?"":w)&&console.log("info",e,window.isLongPage);var v=n?p:d.split("/").pop().split(".")[0],S=window.isLongPage,O=a(a({},t),{},{wordBreak:"break-word",fontSize:(0,i.rem)(f)+"rem",color:l,textAlign:{0:"left",1:"center",2:"right"}[u],fontFamily:v,whiteSpace:"pre-wrap",transformOrigin:"left top",transform:"scale(.5)",width:(0,i.rem)(m)+"rem",height:(0,i.rem)(g)+"rem"}),y={fontSize:100,defaultLineHeight:120};return this.fontList.forEach((function(t){p===t.name&&(y=t)})),-1!==c&&(b&&0!==b?(O.lineHeight=(0,i.rem)(+c)+"rem",h&&(0,o.isMobile)()&&!S&&(O.lineHeight=+c+"px")):(O.lineHeight=(0,i.rem)(+(+f*y.defaultLineHeight/y.fontSize+ +(+c).toFixed()))+"rem",y.top&&(O.paddingTop=(0,i.rem)(y.top*f/y.fontSize)+"rem"),O.marginTop=-(0,i.rem)(c/4)+"rem",h&&(0,o.isMobile)()&&!S&&(O.lineHeight=+(+f*y.defaultLineHeight/y.fontSize+ +(+c).toFixed())+"px",y.top&&(O.paddingTop=y.top*f/y.fontSize+"px"),O.marginTop=-+c/4+"px"))),h&&(0,o.isMobile)()&&!S&&(O.fontSize=f+"px",O.width=m+"px",O.height=g+"px"),O}},destroyed:function(){},mounted:function(){},methods:{loadFonts:function(){if("fonts"in document){var t=this.info.smallFontPath,e=t.split("/").pop().split(".")[0],n=new FontFace(e,"url('".concat(t,"') format('woff2')"));n&&n.load().then((function(t){document.fonts.add(t)}))}}}};e.default=f},N8KS:function(t,e,n){"use strict";n.r(e);var i=n("4ScS"),o=n.n(i);for(var r in i)"default"!==r&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e.default=o.a},"i+/c":function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var i=function(){var t=this.$createElement;return(this._self._c||t)("div",{style:this.fontStyle,attrs:{"data-ele":this.dataEle},domProps:{innerHTML:this._s(this.withBrContent)},on:{click:this.paging}})},o=[]},"smD/":function(t,e,n){"use strict";n.r(e);var i=n("i+/c"),o=n("N8KS");for(var r in o)"default"!==r&&function(t){n.d(e,t,(function(){return o[t]}))}(r);var a=n("KHd+"),c=Object(a.a)(o.default,i.a,i.b,!1,null,"bea338ca",null);e.default=c.exports}}]);
//# sourceMappingURL=textHoleEle.65251027.js.map