UNPKG

m2-ui

Version:

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

6 lines 8.87 kB
/*! * m2-ui v1.0.0 * (c) 2020 by Miracle He * Released under the MIT License. */ module.exports=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,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return 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="/dist/",n(n.s=28)}([function(e,t,n){"use strict";function i(e,t,n,i,o,r,a,u){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),a?(c=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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},l._ssrRegister=c):o&&(c=u?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var s=l.render;l.render=function(e,t){return c.call(t),s(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return{exports:e,options:l}}n.d(t,"a",(function(){return i}))},function(e,t){e.exports=require("vue")},function(e,t,n){"use strict";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"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.a={hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},isListened:function(e,t){return e._events[t]&&"object"===o(e._events[t])},getClientHeight:function(){return document.documentElement.clientHeight},getScrollTop:function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop},setScrollTop:function(e){document.documentElement.scrollTop=document.body.scrollTop=e},getMapItem:function(e,t){for(var n=arguments.length,o=Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return o.reduce((function(n,o){var r;return i({},n,((r={})[o]=e[t[o]]||e[o],r))}),{})},oneOf:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.some((function(t){return t===e}));return n}}},function(e,t){e.exports=require("m2-core")},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return a}));var i=n(7).default,o=n(12).default,r=n(10).default,a=n(11).default},function(e,t){e.exports=require("deepmerge")},,function(e,t,n){"use strict";n.r(t);var i=n(3);t.default={data:function(){return{contentHeight:"100%",clientHeight:"1000px"}},computed:{contentStyle:function(){return this.contentHeight>0?{height:this.contentHeight+"px"}:{height:this.contentHeight}}},mounted:function(){var e=this;this.$nextTick((function(){return e.initContentHeight()}))},methods:{initContentHeight:function(){this.resizeWindow(),window.addEventListener("resize",this.resizeWindow)},resizeWindow:function(){var e=document.documentElement;this.clientHeight=""+e.clientHeight,i.DataType.isFunction(this.calculateHeight)?this.contentHeight=this.calculateHeight(this.clientHeight):this.contentHeight=this.clientHeight}},destroyed:function(){window.removeEventListener("resize",this.resizeWindow)}}},function(e,t,n){"use strict";n.r(t),t.default={m2:{backtop:"Back Top",loading:"Loading...",modal:{ok:"OK",cancel:"Cancel"},confirm:{title:"Delete Confirmation",message:"This will delete the data permanently, continue?"},toast:"Toast Message",header:{navigation:"Navigation",logoText:"M2 MFE",placeholder:"Search People, Material, Guideline...",feedback:"Suggestion & Feedback",exit:"Exit"},sidebar:{home:"Home Page"},table:{index:"No.",menu:"Action"},queryPanel:{query:"Query",reset:"Reset"}}}},function(e,t,n){"use strict";n.r(t),t.default={m2:{backtop:"返回顶部",loading:"正在努力加载中",modal:{ok:"确定",cancel:"取消"},confirm:{title:"删除提示",message:"此操作将永久删除该数据, 是否继续?"},toast:"提示消息",header:{navigation:"导航",logoText:"M2微前端框架",placeholder:"找人、搜功能、看指引",feedback:"意见反馈",exit:"退出"},sidebar:{home:"返回首页"},table:{index:"序号",menu:"操作"},queryPanel:{query:"查询",reset:"重置"}}}},function(e,t,n){"use strict";n.r(t),t.default={methods:{show:function(){this.$refs.modal&&this.$refs.modal.show()},hide:function(){this.$refs.modal&&this.$refs.modal.hide()}}}},function(e,t,n){"use strict";n.r(t);var i=n(2);t.default={props:{showMenu:{type:Boolean,default:!1},config:{type:Object,default:function(){return{menus:{active:"0",map:{},data:[]}}}}},mounted:function(){this.handleMenuConfig()},data:function(){return{menuList:[],collapseClass:"",activeIndex:""}},watch:{config:{handler:function(e){this.handleMenuConfig()},deep:!0}},methods:{handleMenuConfig:function(){var e=this.config.menus,t=e.active,n=e.map,i=e.data;this.activeIndex=t,this.menuList=this.getMenuList(n,i)},getMenuList:function(e,t){var n=this;return t.map((function(t){var o=i.a.getMapItem(t,e,"key","text","url","level","pid"),r=t[e.children]||t.children;return o.pid===(e.root||"0")&&(o.icon=t.icon?"iconfont el-icon-"+t.icon:"iconfont el-icon-menu",o.title=t.alias||o.text),o.level&&(o.className="m2-menu-item-"+o.level),t.click?o.click=t.click:o.click=function(){},r&&r.length>0?(o.hasChildren=!!r&&r.length>0,o.hasChildren&&(o.slotName="title",o.children=n.getMenuList(e,r))):o.slotName="default",o}))},handleToggleMenu:function(e){this.collapseClass=e?"nav-collapse":""}}}},function(e,t,n){"use strict";n.r(t);var i=n(1),o=n.n(i),r=n(5),a=n.n(r),u=n(3),c=n(2),l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=/(%|)\{([0-9a-zA-Z_]+)\}/g,f=function(){return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return 1===n.length&&"object"===l(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(s,(function(t,i,o,r){var a=void 0;return"{"===e[r-1]&&"}"===e[r+t.length]?o:null==(a=c.a.hasOwn(n,o)?n[o]:null)?"":a}))}},d=void 0,h=arguments,p=null,m=!1,g=function(){var e=Object.getPrototypeOf(d||o.a).$t;if("function"==typeof e&&o.a.locale)return m||(m=!0,o.a.locale(o.a.config.lang,a()(p,o.a.locale(o.a.config.lang)||{},{clone:!0}))),e.apply(d,h)},v=function(e,t){var n=u.DataStorage.get(u.DEFAULT_LANGUAGE_SETTING);y(n);var i=g.apply(d,h);if(null!=i)return i;for(var o=e.split("."),r=p,a=0,c=o.length;a<c;a++){if(i=r[o[a]],a===c-1)return f()(i,t);if(!i)return"";r=i}return""},y=function(e){switch(e){case"en":p=n(8).default;break;case"zh":default:p=n(9).default}},b={t:v,use:y,i18n:function(e){return g=e||g}};t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.t.apply(this,t)}}}},,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var i=n(1),o=n.n(i),r=function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"m2-loading"},[t("transition",{attrs:{name:"fade"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"mask"},[t("div",{staticClass:"spinner"},[t("i"),t("i"),t("i"),t("i"),t("i"),t("i"),t("i"),t("i")]),t("div",{staticClass:"text"},[this._v(this._s(this.message||this.t("m2.loading")))])])])],1)};r._withStripped=!0;var a={name:"m2-loading",mixins:[n(4).b],data:function(){return{visible:!1,message:""}}},u=n(0),c=Object(u.a)(a,r,[],!1,null,null,null);c.options.__file="packages/loading/src/main.vue";var l=c.exports,s=o.a.extend(l),f=function(){return document.body.querySelector(".m2-loading")};s.prototype.close=function(){f()&&(this.visible=!1,document.body.removeChild(this.$el))};var d=void 0,h=function(e){if(!f())return d=new s({data:{message:e}}).$mount(document.createElement("div")),document.body.appendChild(d.$el),d.visible=!0,d};h.hide=function(){return o.a.nextTick((function(){d&&d.close()}))};t.default=h}]);