UNPKG

lp-vue

Version:

vue2组件库&方法&指令集合

1 lines 11.1 kB
module.exports=(n=>{var r={};function i(t){var e;return(r[t]||(e=r[t]={i:t,l:!1,exports:{}},n[t].call(e.exports,e,e.exports,i),e.l=!0,e)).exports}return i.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/dist/",i(i.s=31)})([,function(t,e,n){function r(t,e,n,r,i,o,s,a){var c,u,l="function"==typeof t?t.options:t;return e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):i&&(c=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),c&&(l.functional?(l._injectStyles=c,u=l.render,l.render=function(t,e){return c.call(e),u(t,e)}):(e=l.beforeCreate,l.beforeCreate=e?[].concat(e,c):[c])),{exports:t,options:l}}n.d(e,"a",function(){return r})},,,,,,,,function(t,e,n){t.exports=function(n){var s=[];return s.toString=function(){return this.map(function(t){var e=((t,e)=>{var n=t[1]||"",r=t[3];return r?(e&&"function"==typeof btoa?(t=(t=>"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */")(r),e=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}),[n].concat(e).concat([t])):[n]).join("\n"):n})(t,n);return t[2]?"@media "+t[2]+"{"+e+"}":e}).join("")},s.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},r=0;r<this.length;r++){var i=this[r][0];null!=i&&(n[i]=!0)}for(r=0;r<t.length;r++){var o=t[r];null!=o[0]&&n[o[0]]||(e&&!o[2]?o[2]=e:e&&(o[2]="("+o[2]+") and ("+e+")"),s.push(o))}},s}},function(t,e,r){var n,i,o,c={},u=(n=function(){return window&&document&&document.all&&!window.atob},function(){return i=void 0===i?n.apply(this,arguments):i}),s=(o={},function(t,e){if("function"==typeof t)return t();if(void 0===o[t]){e=function(t,e){return(e||document).querySelector(t)}.call(this,t,e);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(t){e=null}o[t]=e}return o[t]}),a=null,l=0,f=[],d=r(13);function h(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=c[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(g(r.parts[o],e))}else{for(var s=[],o=0;o<r.parts.length;o++)s.push(g(r.parts[o],e));c[r.id]={id:r.id,refs:1,parts:s}}}}function p(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],s=e.base?o[0]+e.base:o[0],o={css:o[1],media:o[2],sourceMap:o[3]};r[s]?r[s].parts.push(o):n.push(r[s]={id:s,parts:[o]})}return n}function v(t,e){var n=s(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=f[f.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),f.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");r=s(t.insertAt.before,n);n.insertBefore(e,r)}}function m(t){null!==t.parentNode&&(t.parentNode.removeChild(t),0<=(t=f.indexOf(t)))&&f.splice(t,1)}function b(t){var e,n=document.createElement("style");return void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce&&(e=r.nc)&&(t.attrs.nonce=e),y(n,t.attrs),v(t,n),n}function y(e,n){Object.keys(n).forEach(function(t){e.setAttribute(t,n[t])})}function g(e,t){var n,r,i,o,s;if(t.transform&&e.css){if(!(o="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=o}return i=t.singleton?(o=l++,n=a=a||b(t),r=x.bind(null,n,o,!1),x.bind(null,n,o,!0)):e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(o=t,s=document.createElement("link"),void 0===o.attrs.type&&(o.attrs.type="text/css"),o.attrs.rel="stylesheet",y(s,o.attrs),v(o,s),n=s,r=function(t,e,n){var r=n.css,n=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&n;(e.convertToAbsoluteUrls||i)&&(r=d(r));n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");e=new Blob([r],{type:"text/css"}),i=t.href;t.href=URL.createObjectURL(e),i&&URL.revokeObjectURL(i)}.bind(null,n,t),function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(t),r=function(t,e){var n=e.css,e=e.media;e&&t.setAttribute("media",e);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),function(){m(n)}),r(e),function(t){t?t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap||r(e=t):i()}}t.exports=function(t,s){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(s=s||{}).attrs="object"==typeof s.attrs?s.attrs:{},s.singleton||"boolean"==typeof s.singleton||(s.singleton=u()),s.insertInto||(s.insertInto="head"),s.insertAt||(s.insertAt="bottom");var a=p(t,s);return h(a,s),function(t){for(var e=[],n=0;n<a.length;n++){var r=a[n];(i=c[r.id]).refs--,e.push(i)}t&&h(p(t,s),s);for(var i,n=0;n<e.length;n++)if(0===(i=e[n]).refs){for(var o=0;o<i.parts.length;o++)i.parts[o]();delete c[i.id]}}};w=[];var w,_=function(t,e){return w[t]=e,w.filter(Boolean).join("\n")};function x(t,e,n,r){var n=n?"":r.css;t.styleSheet?t.styleSheet.cssText=_(e,n):(r=document.createTextNode(n),(n=t.childNodes)[e]&&t.removeChild(n[e]),n.length?t.insertBefore(r,n[e]):t.appendChild(r))}},,,function(t,e){t.exports=function(t){var n,r,e="undefined"!=typeof window&&window.location;if(e)return t&&"string"==typeof t?(n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/"),t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){e=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(e)?t:(t=0===e.indexOf("//")?e:0===e.indexOf("/")?n+e:r+e.replace(/^\.\//,""),"url("+JSON.stringify(t)+")")})):t;throw new Error("fixUrls requires window.location")}},,,,function(t,e,n){var r=n(29),i=("string"==typeof r&&(r=[[t.i,r,""]]),{hmr:!0});i.transform=void 0,i.insertInto=void 0,n(10)(r,i);r.locals&&(t.exports=r.locals)},,,,function(t,e){t.exports=require("echarts")},,,,,,,function(t,e,n){n(17)},function(t,e,n){(t.exports=n(9)(!1)).push([t.i,".lp-chart[data-v-b43167f0]{width:var(--width);height:var(--height)}",""])},,function(t,e,n){n.r(e);function r(){return(0,this._self._c)("div",{ref:"lpChart",staticClass:"lp-chart",style:`--height:${this.height}px;--width:`+(this.width?this.width+"px":"100%")})}r._withStripped=!0;var i=n(21);function o(i,o,s){function a(){var t=+new Date-l;t<o&&0<t?c=setTimeout(a,o-t):(c=null,s||(f=i.apply(u,e),c)||(u=e=null))}var c=void 0,e=void 0,u=void 0,l=void 0,f=void 0;return function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];u=this,l=+new Date;var r=s&&!c;return c=c||setTimeout(a,o),r&&(f=i.apply(u,e),u=e=null),f}}var a=null,s={name:"LpChart",mixins:[{data:function(){return{$_sidebarElm:null,$_resizeHandler:null}},mounted:function(){this.initListener()},activated:function(){this.$_resizeHandler||this.initListener(),this.resize()},beforeDestroy:function(){this.destroyListener()},deactivated:function(){this.destroyListener()},methods:{$_sidebarResizeHandler:function(t){"width"===t.propertyName&&this.$_resizeHandler()},initListener:function(){var t=this;this.$_resizeHandler=o(function(){t.resize()},100),window.addEventListener("resize",this.$_resizeHandler),this.$_sidebarElm=document.getElementsByClassName("sidebar-container")[0],this.$_sidebarElm&&this.$_sidebarElm.addEventListener("transitionend",this.$_sidebarResizeHandler)},destroyListener:function(){window.removeEventListener("resize",this.$_resizeHandler),this.$_resizeHandler=null,this.$_sidebarElm&&this.$_sidebarElm.removeEventListener("transitionend",this.$_sidebarResizeHandler)},resize:function(){var t=this.chart;t&&t.resize()}}}],props:{height:{type:Number,default:300},width:{type:Number,default:null},watch:{type:[String,Array],default:""}},data:function(){return{chart:{}}},mounted:function(){var s=this,t=(this.initChart(),a=new MutationObserver(function(t){for(var e,n=t,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){if(r){if(i>=n.length)break;e=n[i++]}else{if((i=n.next()).done)break;e=i.value}var o=e;"attributes"===o.type&&"style"===o.attributeName&&"none"!==window.getComputedStyle(o.target).display&&s.chart.resize()}}),Array.isArray(this.watch)?this.watch:[this.watch]);if(t.filter(Boolean).length)for(var e=0;e<t.length;e++){var n=document.querySelector(t[e]);n&&a.observe(n,{attributes:!0})}},beforeDestroy:function(){this.chart.clear(),this.chart.dispose(),this.chart={},a.disconnect()},methods:{initChart:function(){this.chart=i.init(this.$refs.lpChart),this.chart.resize()},setOptions:function(t){this.chart.hideLoading(),this.chart.setOption(t,!0)},emptyOptions:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=(this.chart.hideLoading(),t.text),t=t.color;this.chart.setOption({title:{text:void 0===e?"暂无数据":e,x:"center",y:"center",textStyle:{color:void 0===t?"#0058D8":t,fontWeight:"normal",fontSize:16}}},!0)},showLoading:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=(this.chart.clear(),t.text),n=t.color,r=t.textColor,t=t.maskColor;this.chart.showLoading("default",{text:void 0===e?"加载中...":e,color:void 0===n?"#0058D8":n,textColor:void 0===r?"#0058D8":r,maskColor:void 0===t?"rgba(255, 255, 255, 0)":t})},hideLoading:function(){this.chart.clear(),this.chart.hideLoading()},findAncestor:function(t){for(var e=this.watchDom?document.querySelector(this.watchDom):this.$parent.$el,n=[];null!==t.parentNode&&(n.push(t),t!==e);)t=t.parentNode;return n}}},n=(n(28),n(1)),c=Object(n.a)(s,r,[],!1,null,"b43167f0",null).exports;c.install=function(t){t.component(c.name,c)},e.default=c}]);