m2-webui
Version:
The package is provided web components and utilities based on vue and element-ui.
6 lines • 12.3 kB
JavaScript
/*!
* m2-webui 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 i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));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=65)}([,,function(t,e){t.exports=require("m2-core")},function(t,e){t.exports=require("vue")},function(t,e,n){"use strict";function r(t,e,n,r,i,a,o,s){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),a&&(c._scopeId="data-v-"+a),o?(u=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(o)},c._ssrRegister=u):i&&(u=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return o}));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},i=("function"==typeof Symbol&&Symbol.iterator,function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}),a=function(t,e){for(var n=arguments.length,i=Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];return i.reduce((function(n,i){var a;return r({},n,((a={})[i]=t[e[i]]||t[i],a))}),{})},o=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.startsWith("/")||t.startsWith("#/")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return c}));var r=n(8).default,i=n(9).default,a=n(10).default,o=n(11).default,s=n(18).default,u=n(14).default,c=(n(15).default,n(19).default,n(16).default,n(17).default)},function(t,e){t.exports=require("deepmerge")},function(t,e,n){"use strict";n.r(e);var r=n(2);e.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 t=this;this.$nextTick((function(){return t.initContentHeight()}))},methods:{initContentHeight:function(){this.resizeWindow(),window.addEventListener("resize",this.resizeWindow)},resizeWindow:function(){var t=document.documentElement;this.clientHeight=""+t.clientHeight,r.DataType.isFunction(this.calculateHeight)?this.contentHeight=this.calculateHeight(this.clientHeight):this.contentHeight=this.clientHeight}},destroyed:function(){window.removeEventListener("resize",this.resizeWindow)}}},function(t,e,n){"use strict";n.r(e),e.default={props:{mClass:String}}},function(t,e,n){"use strict";n.r(e);var r=n(2);e.default={props:{layout:{type:Array,default:function(){return[]}}},computed:{empty:function(){return r.DataType.isEmptyArray(this.layout)}},methods:{has:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"layout";return this[e]&&this[e].some((function(e){return e===t}))}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=n(5);e.default={methods:{handleLinkClick:function(t){if(t.url)if(Object(i.c)(t.url)&&this.$router)try{var e=this.$router.push({path:t.url});e&&e.catch&&e.catch((function(){}))}catch(t){}else window.open(t.url,t.target||"_blank");else r.DataType.isFunction(t.click)&&t.click(t)}}}},function(t,e,n){"use strict";n.r(e),e.default={m2:{loading:"Loading...",toast:"Toast Message",table:{caption:"List",select:"Select",number:"No.",action:"Action"},modal:{ok:"OK",cancel:"Cancel"},alert:{title:"Information",message:"Success!"},confirm:{title:"Delete Confirmation",message:"This will delete the data permanently, continue?"},queryPanel:{query:"Query",reset:"Reset"},layout:{navMenu:"Navigation",navbar:{more:"More"},search:{placeholder:"Search People, Material, Guideline..."},links:{feedback:"Suggestion & Feedback",exit:"Exit"},icons:{setting:"Setting",message:"Message"},backtop:"Back Top"},exception:{error:{401:"You don't have the authority to access this page!",404:"Sorry, the page has wrong!"},back:"Back",or:"or",home:"Home",apply:"Apply Authority",contactUs:"Contact Us: 8008"}}}},function(t,e,n){"use strict";n.r(e),e.default={m2:{loading:"正在努力加载中",toast:"提示消息",table:{caption:"列表",select:"选择",number:"序号",action:"操作"},modal:{ok:"确定",cancel:"取消"},alert:{title:"消息提示",message:"成功!"},confirm:{title:"删除提示",message:"此操作将永久删除该数据, 是否继续?"},queryPanel:{query:"查询",reset:"重置"},layout:{navMenu:"导航",navbar:{more:"更多"},search:{placeholder:"找人、搜功能、看指引"},links:{feedback:"意见反馈",exit:"退出"},icons:{setting:"个人设置",message:"消息通知"},backtop:"返回顶部"},exception:{error:{401:"你暂时没有访问该页面的权限!",404:"很抱歉出错了!"},back:"返回上一页",or:"或者",home:"返回主页",apply:"申请权限",contactUs:"联系我们: 8008"}}}},function(t,e,n){"use strict";n.r(e),e.default={methods:{show:function(){this.$refs.modal&&this.$refs.modal.show()},hide:function(){this.$refs.modal&&this.$refs.modal.hide()}}}},function(t,e,n){"use strict";n.r(e);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};e.default={methods:{getSelectedItems:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){var n=t.getCurrentItem(e),i=n.key,a=n.text,o=n.tags,s=n.modal;return r({},e,{_key:i+"-"+a,_text:a,_tags:o,_modal:s})}))}}}},function(t,e,n){"use strict";n.r(e);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};e.default={data:function(){return{queryTypes:{}}},methods:{createdBus:function(){var t=this;Object.keys(this.queryTypes).map((function(e){var n=t.queryTypes[e];n.params=r({},n.params,{current:n.pager.current,size:n.pager.size}),n.auto&&n.list&&n.list.query(),t.$bus.$on(n.list.event||"query",(function(e){return t.getPageDataList(n,e)})),t.$bus.$on(n.pager.event||"pager-change",(function(e){return t.getPageDataList(n,e)}))}))},getPageDataList:function(t,e){t.pager.current=e.pageIndex,t.pager.size=e.pageSize,t.params=r({},t.params,e),t.list.query()}},destroyed:function(){var t=this;Object.keys(this.queryTypes).map((function(e){var n=t.queryTypes[e];t.$bus.$off(n.list.event||"query"),t.$bus.$off(n.pager.event||"query")}))}}},function(t,e,n){"use strict";n.r(e);var r=n(5);e.default={data:function(){return{menuList:[],collapseClass:"",activeIndex:""}},watch:{menus:{handler:function(t){this.handleMenus()},deep:!0}},mounted:function(){this.handleMenus()},methods:{handleMenus:function(){var t=this.menus,e=t.active,n=t.map,r=void 0===n?{}:n,i=t.data,a=void 0===i?[]:i;this.activeIndex=e,this.menuList=this.getMenuList(r,a,1)},getMenuList:function(t,e,n){var i=this;return e.map((function(e){var a=Object(r.a)(e,t,"key","text","icon","url","target","click","badge","badgeMax"),o=e[t.children]||e.children;return a.level=n,1===n&&(a.icon=a.icon||"el-icon-menu",a.title=e.alias||a.text),a.level&&(a.className="m2-menu-item-"+a.level),o&&o.length>0?(a.slotName="title",a.children=i.getMenuList(t,o,n+1)):a.slotName="default",a}))},handleToggleMenu:function(t){this.collapseClass=t?"nav-collapse":"",this.$emit("toggleCollapse",t)}}}},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),a=n(7),o=n.n(a),s=n(2),u=n(5),c="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},l=/(%|)\{([0-9a-zA-Z_]+)\}/g,f=function(){return function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return 1===n.length&&"object"===c(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),t.replace(l,(function(e,r,i,a){var o=void 0;return"{"===t[a-1]&&"}"===t[a+e.length]?i:null==(o=Object(u.b)(n,i)?n[i]:null)?"":o}))}},d=void 0,h=arguments,p=null,g=!1,m=function(){var t=Object.getPrototypeOf(d||i.a).$t;if("function"==typeof t&&i.a.locale)return g||(g=!0,i.a.locale(i.a.config.lang,o()(p,i.a.locale(i.a.config.lang)||{},{clone:!0}))),t.apply(d,h)},v=function(t,e){var n=s.DataStorage.get(s.DEFAULT_LANGUAGE_SETTING);y(n);var r=m.apply(d,h);if(null!=r)return r;for(var i=t.split("."),a=p,o=0,u=i.length;o<u;o++){if(r=a[i[o]],o===u-1)return f()(r,e);if(!r)return"";a=r}return""},y=function(t){switch(t){case"en-us":case"en":p=n(12).default;break;case"zh-cn":case"zh":default:p=n(13).default}},b={t:v,use:y,i18n:function(t){return m=t||m}};e.default={methods:{$st:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return b.t.apply(this,e)}}}},function(t,e,n){"use strict";n.r(e);var r=n(2),i=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};e.default={data:function(){return{auto:!0,queryEvent:"query",pagerEvent:"pager-change",condition:{},pager:{total:0,current:1,size:10}}},computed:{params:function(){return i({},this.condition,{current:this.pager.current,size:this.pager.size})}},created:function(){var t=this;this.$data._original=this.$data._original||r.DataUtil.clone(this.condition),this.auto&&this.getDataList(),this.$bus.$on(this.queryEvent,this.getPageDataList),this.$bus.$on(this.pager.event||this.pagerEvent,this.getPageDataList),this.$bus.$on("m2-clear-query-form",(function(){return t.condition=t.$data._original}))},methods:{getPageDataList:function(t){this.pager.current=t.pageIndex,this.pager.size=t.pageSize,this.getDataList()}},destroyed:function(){this.$bus.$off(this.queryEvent,this.getPageDataList),this.$bus.$off(this.pager.event||this.pagerEvent,this.getPageDataList),this.$bus.$off("m2-clear-query-form")}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),a={name:"m2-loading",mixins:[n(6).e],data:function(){return{visible:!1,message:""}}},o=n(4),s=Object(o.a)(a,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"m2-loading"},[e("transition",{attrs:{name:"fade"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"mask"},[e("div",{staticClass:"spinner"},[e("i"),e("i"),e("i"),e("i"),e("i"),e("i"),e("i"),e("i")]),e("div",{staticClass:"text"},[this._v(this._s(this.message||this.$st("m2.loading")))])])])],1)}),[],!1,null,null,null).exports,u=i.a.extend(s),c=function(){return document.body.querySelector(".m2-loading")};u.prototype.close=function(){c()&&(this.visible=!1,document.body.removeChild(this.$el))};var l=void 0,f=function(t){if(!c())return l=new u({data:{message:t,visible:!0}}).$mount(document.createElement("div")),document.body.appendChild(l.$el),l.visible=!0,l};f.hide=function(){return i.a.nextTick((function(){l&&l.close()}))};e.default=f}]);