UNPKG

m2-ui

Version:

The package is provided web components and utilities based on vue and element-ui.

6 lines 4.38 kB
/*! * m2-ui v1.0.0 * (c) 2020 by Miracle He * Released under the MIT License. */ module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=33)}({0:function(t,e,n){"use strict";function r(t,e,n,r,o,l,i,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=c):o&&(c=s?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var f=u.render;u.render=function(t,e){return c.call(e),f(t,e)}}else{var a=u.beforeCreate;u.beforeCreate=a?[].concat(a,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},2:function(t,e,n){"use strict";var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.a={hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},isListened:function(t,e){return t._events[e]&&"object"===o(t._events[e])},getClientHeight:function(){return document.documentElement.clientHeight},getScrollTop:function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop},setScrollTop:function(t){document.documentElement.scrollTop=document.body.scrollTop=t},getMapItem:function(t,e){for(var n=arguments.length,o=Array(n>2?n-2:0),l=2;l<n;l++)o[l-2]=arguments[l];return o.reduce((function(n,o){var l;return r({},n,((l={})[o]=t[e[o]]||t[o],l))}),{})},oneOf:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.some((function(e){return e===t}));return n}}},22:function(t,e){t.exports=require("better-scroll")},33:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{ref:"wrapper",staticClass:"wrapper"},[e("div",{staticClass:"content"},[this._t("default")],2)])};r._withStripped=!0;var o=n(22),l=n.n(o),i=n(2),s={name:"m2-scroll",data:function(){return{$scroll:null}},mounted:function(){this.initScroll()},methods:{initScroll:function(){var t=this,e=i.a.isListened(this,"scroll"),n=i.a.isListened(this,"pullingUp");this.$scroll=new l.a(this.$refs.wrapper,{click:!0,probeType:e?3:0,pullUpLoad:n}),e&&this.$scroll.on("scroll",(function(e){return t.$emit("scroll",e)})),n&&this.$scroll.on("pullingUp",(function(){return t.$emit("pullingUp")}))},scrollTop:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;this.scrollTo(0,0,t)},scrollTo:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;return this.$scroll&&this.$scroll.scrollTo(t,e,n),this.$scroll},finishPullUp:function(){return this.$scroll&&this.$scroll.finishPullUp(),this.$scroll},refresh:function(){return this.$scroll&&this.$scroll.refresh(),this.$scroll},getScrollY:function(){return this.$scroll?this.$scroll.y:0}}},c=n(0),u=Object(c.a)(s,r,[],!1,null,null,null);u.options.__file="packages/scroll/src/main.vue";var f=u.exports;f.install=function(t){t.component(f.name,f)};e.default=f}});