mwl-components 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/dist/index.cjs.js +0 -1
- package/dist/index.es.js +0 -999
- package/dist/index.umd.js +0 -1
- package/dist/mwl-components.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mwl-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"import": "./dist/index.es.js",
|
|
14
14
|
"require": "./dist/index.cjs.js"
|
|
15
15
|
},
|
|
16
|
-
"./dist/index.umd.js": "./dist/index.umd.js"
|
|
16
|
+
"./dist/index.umd.js": "./dist/index.umd.js",
|
|
17
|
+
"./dist/mwl-components.css": "./dist/mwl-components.css"
|
|
17
18
|
},
|
|
18
19
|
"sideEffects": false,
|
|
19
20
|
"scripts": {
|
package/dist/index.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),F=require("element-plus"),_=e.defineComponent({name:"EasyButton",inheritAttrs:!1,__name:"index",setup(t){const{onClick:o,...n}=e.useAttrs(),r=e.ref(!1),i=async()=>{console.log("Button clicked"),r.value=!0;try{await o?.()}catch(c){console.error("Error in button onClick handler:",c)}finally{r.value=!1}};return(c,u)=>{const a=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(a,e.mergeProps(n,{loading:r.value,onClick:i}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["loading"])}}}),z={class:"card-header"},O={key:0,class:"card-header__message"},W=e.defineComponent({name:"ContentWarp",__name:"index",props:{title:String,message:String},setup(t){const o=e.useSlots(),n=e.ref("content-wrap");return(r,i)=>{const c=e.resolveComponent("ElCard");return e.openBlock(),e.createBlock(c,{class:e.normalizeClass([n.value]),shadow:"never"},e.createSlots({default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:2},[t.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",z,[e.createElementVNode("span",null,e.toDisplayString(t.title),1),t.message?(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0)])]),key:"0"}:void 0,o.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["class"])}}}),b=(t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n},M=b(W,[["__scopeId","data-v-fdaaba5e"]]),A={class:"dialog-header"},$=e.defineComponent({name:"Dialog",__name:"index",props:{title:{type:String,default:""},fullscreen:{type:Boolean,default:!1},scroll:{type:Boolean,default:!1},width:{type:String,default:"61.8%"},maxHeight:{type:[String,Number],default:""}},setup(t){const o=e.useSlots(),n=t,r=e.ref(n.fullscreen),i=()=>{r.value=!e.unref(r)},c=e.ref(n.maxHeight);e.watch(()=>r.value,async a=>{if(await e.nextTick(),a){const l=document.documentElement.offsetHeight;c.value=`${l-55-40-(o.footer?63:0)}px`}else c.value=n.maxHeight},{immediate:!0});const u=e.computed(()=>{if(n.maxHeight)return{height:e.unref(c)}});return(a,l)=>{const m=e.resolveComponent("FullScreen"),d=e.resolveComponent("el-icon"),h=e.resolveComponent("ElScrollbar"),f=e.resolveComponent("ElDialog");return e.openBlock(),e.createBlock(f,e.mergeProps({"close-on-click-modal":!1,"destroy-on-close":"",draggable:"","lock-scroll":"",class:"custom-dialog","append-to-body":""},a.$attrs,{fullscreen:r.value,width:t.width}),e.createSlots({default:e.withCtx(()=>[t.scroll?(e.openBlock(),e.createBlock(h,{key:0,style:e.normalizeStyle(u.value)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["style"])):e.renderSlot(a.$slots,"default",{key:1})]),_:2},[t.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",A,[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),e.createElementVNode("div",{onClick:i},[e.createVNode(d,{class:"fullScreen"},{default:e.withCtx(()=>[e.createVNode(m)]),_:1})])])]),key:"0"}:void 0,o.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"footer")]),key:"1"}:void 0]),1040,["fullscreen","width"])}}}),j={key:1},D=t=>{let o=t.label;if(t.label&&typeof t.label=="function"&&(o=t.label()),t.type.indexOf("select")>-1||t.type.indexOf("cascader")>-1||t.type.indexOf("date")>-1)return`请选择${o}`;if(t.type.indexOf("text")>-1||t.type.indexOf("number")>-1)return`请输入${o}`},w={valueFormat:"YYYY-MM-DD HH:mm:ss",format:"YYYY-MM-DD HH:mm:ss"},R=t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-option"),{label:n.label,value:n.value,key:n.value}))}},S={clearable:!0},N=[{type:"slider",component:"el-slider"},{type:"text",component:"el-input",attrs:{...S}},{type:"textarea",component:"el-input",attrs:{...S}},{type:"number",component:"el-input-number",attrs:{controlsPosition:"right"}},{type:"switch",component:"el-switch"},{type:"checkbox",component:"el-checkbox-group",slots:t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-checkbox"),{value:n.value},{default:()=>n.label}))}}},{type:"radio",component:"el-radio-group",slots:t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-radio"),{value:n.value},{default:()=>n.label}))}}},{type:"select",component:"el-select",slots:R},{type:"select-v2",component:"el-select-v2"},{type:"tree-select",component:"el-tree-select",attrs:{...S,checkStrictly:!0,renderAfterExpand:!0}},{type:"date,dates",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD"}},{type:"datetime,week",component:"el-date-picker",attrs:{showConfirm:!1,...w}},{type:"month,months",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY-MM",format:"YYYY-MM"}},{type:"year,years",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY",format:"YYYY"}},{type:"datetimerange,daterange,monthrange,yearrange",component:"el-date-picker",attrs:{showConfirm:!1,rangeSeparator:"至",startPlaceholder:"开始日期",endPlaceholder:"结束日期",...w}},{type:"cascader",component:"el-cascader",attrs:{clearable:!0}},{type:"upload",component:"el-upload"},{type:"custom",component:"el-form-item"}],q=e.defineComponent({name:"EasyForm",__name:"index",props:e.mergeModels({inline:{type:Boolean,default:!0},formItems:{type:Array,default:()=>[]},labelWidth:{type:[String,Number],default:"120px"},itemWidth:{type:[String],default:"200px"}},{modelValue:{default:{},type:Object},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=e.getCurrentInstance(),r=a=>{i(a,"formRef")},i=(a,l)=>{if(!a){delete n?.exposeProxy?.[l],delete n?.exposed?.[l];return}n.exposeProxy={...n?.exposed,[l]:a},n.exposed={...n?.exposed,[l]:a}},c=e.useSlots(),u=(a,l,m)=>{const{value:d,component:h,...f}=l,p=N.find(y=>!!a&&y.type.indexOf(a)>-1),k=p?.component==="el-select"&&l.props,g=l.options&&!k?p?.slots?.(l):{};if(!p&&!l.component)return new Error(`未找到type为${a}的组件且当前也未传递component`);const s=e.resolveDynamicComponent(p?.component||h);if(s)return e.h(s,{...p?.attrs,...f,placeholder:f.placeholder||D(l)},{...g,...m})};return(a,l)=>{const m=e.resolveComponent("el-form-item"),d=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(d,e.mergeProps({model:o.value,"label-width":t.labelWidth,inline:t.inline,"scroll-to-error":!0},{...a.$attrs},{ref:r,class:"easy-form"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,({id:h,type:f,rule:p,width:k,slots:g,...s},y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f!="custom"&&!s.hidden?(e.openBlock(),e.createBlock(m,{prop:s.prop,key:y,"label-width":s.labelWidth,rules:p,required:s.required},{label:e.withCtx(()=>[s.label&&typeof s.label=="function"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.label),{key:0})):(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(s.label),1))]),default:e.withCtx(()=>[c[s.prop]?e.renderSlot(a.$slots,s.prop,{key:0,item:s},void 0,!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(f,{...s,type:f},g)),{key:1,modelValue:o.value[s.prop],"onUpdate:modelValue":v=>o.value[s.prop]=v,modelModifiers:{trim:!0},style:e.normalizeStyle({width:k||t.itemWidth})},null,8,["modelValue","onUpdate:modelValue","style"]))]),_:2},1032,["prop","label-width","rules","required"])):e.createCommentVNode("",!0),f=="custom"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[g?.[s.prop]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g[s.prop]),{key:0})):e.renderSlot(a.$slots,s.prop,{key:1,item:{width:k,rule:p,...s}},void 0,!0)],64)):e.createCommentVNode("",!0)],64))),256)),c.append?(e.openBlock(),e.createBlock(m,{key:0},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"append",{},void 0,!0)]),_:3})):e.createCommentVNode("",!0)]),_:3},16,["model","label-width","inline"])}}}),H=b(q,[["__scopeId","data-v-ebcd5674"]]),U=e.defineComponent({name:"EasyTable",__name:"index",props:{data:{type:Array,required:!0,default:()=>[]},tableColumns:{type:Array,default:()=>[]},buttons:{type:Array,default:()=>[]},buttonWidth:{type:[Number,String],default:120},align:{type:String,default:"center"},height:{type:Number||String,default:void 0},maxHeight:{type:String||Number,default:void 0},footerHeight:{type:Number,default:65}},setup(t){const o=e.inject(F.configProviderContextKey),n=t,r=e.computed(()=>n.buttonWidth.toString().indexOf("px")>-1?n.buttonWidth.toString().slice(0,-2):n.buttonWidth),i=e.ref(),c=e.ref("auto");let u=e.getCurrentInstance();const a=()=>{let p="auto";if(u?.parent?.attrs?.class?.indexOf("content-wrap")>-1){let s=n.footerHeight;o?.value?.size==="small"?s=s-8:o?.value?.size==="large"&&(s=s+8);try{const y=u?.refs.tableRef,{top:v}=y?.getBoundingClientRect();p=document.documentElement.clientHeight-v-s-20}catch{}return p}return p},l=e.ref(),m=()=>{l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{c.value=a(),l.value=null},100)};e.onMounted(()=>{c.value=a(),window.addEventListener("resize",m)}),e.onUnmounted(()=>{window.removeEventListener("resize",m)});const d=e.resolveComponent("el-table-column"),h=e.useSlots(),f=p=>{const{slots:k={},children:g=[],...s}=p;if(g&&g.length>0){const y=g.map(v=>f(v));return e.h(d,{align:n.align,...s},{...k,default:()=>y})}return e.h(d,{align:n.align,...s},{default:y=>h[p.prop]&&h[p.prop](y),...k})};return(p,k)=>{const g=e.resolveComponent("el-button"),s=e.resolveComponent("el-table-column"),y=e.resolveComponent("el-table");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableRef",ref:i},[e.createVNode(y,e.mergeProps({style:{width:"100%"}},p.$attrs,{data:t.data,height:t.height,maxHeight:t.maxHeight?t.maxHeight:c.value}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tableColumns,(v,x)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(v)),{key:x}))),128)),t.buttons&&t.buttons.length?(e.openBlock(),e.createBlock(s,{key:0,align:"center",fixed:"right",label:"操作",width:r.value},{default:e.withCtx(v=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(x,T)=>e.withDirectives((e.openBlock(),e.createBlock(g,e.mergeProps({ref_for:!0},{...x},{key:T,type:x.type.includes("del")?"danger":"primary",onClick:()=>{x.click?.(v.row)},disabled:x.disabled?.(v.row)||!1,link:x.link?.(v.row)||!0}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.label),1)]),_:2},1040,["type","onClick","disabled","link"])),[[e.vShow,x.show?.(v.row)||!0]])),128))]),_:1},8,["width"])):e.createCommentVNode("",!0)]),_:1},16,["data","height","maxHeight"])],512)}}}),Y=b(U,[["__scopeId","data-v-1c87357b"]]),X={name:"",components:{},props:{icon:{type:String,default:""}}};function K(t,o,n,r,i,c){return n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,class:"menu_icon"})):e.createCommentVNode("",!0)}const B=b(X,[["render",K],["__scopeId","data-v-261ce99a"]]),G=e.defineComponent({name:"subMenu",__name:"subMenu",props:{routeData:{type:Object,default:()=>({})}},emits:["handleMenuItemClick"],setup(t,{emit:o}){const n=o;function r(i){n("handleMenuItemClick",i)}return(i,c)=>{const u=e.resolveComponent("subMenu",!0),a=e.resolveComponent("el-sub-menu"),l=e.resolveComponent("el-menu-item");return t.routeData.children&&t.routeData.children.length>0?(e.openBlock(),e.createBlock(a,{key:0,index:t.routeData.path},{title:e.withCtx(()=>[e.createVNode(B,{icon:t.routeData.meta.icon},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(t.routeData.meta.title),1)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routeData.children,(m,d)=>(e.openBlock(),e.createBlock(u,{onHandleMenuItemClick:r,routeData:m,key:d},null,8,["routeData"]))),128))]),_:1},8,["index"])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:c[0]||(c[0]=m=>r(t.routeData))},[e.createVNode(l,{index:t.routeData.path},{title:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.routeData.meta.title),1)]),default:e.withCtx(()=>[e.createVNode(B,{icon:t.routeData.meta.icon},null,8,["icon"])]),_:1},8,["index"])]))}}}),L=e.defineComponent({name:"MenuTree",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["handleMenuItemClick"],setup(t,{emit:o}){const n=o,r=i=>{n("handleMenuItemClick",i)};return(i,c)=>{const u=e.resolveComponent("el-menu");return e.openBlock(),e.createBlock(u,e.normalizeProps(e.guardReactiveProps(i.$attrs)),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuList,a=>(e.openBlock(),e.createBlock(G,{routeData:a,onHandleMenuItemClick:r},null,8,["routeData"]))),256))]),_:1},16)}}}),J=e.defineComponent({name:"Pagination",__name:"index",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pagerCount:{type:Number,default:document.body.clientWidth<992?5:7},onPagination:{type:Function}},emits:["update:page","update:limit","pagination"],setup(t,{emit:o}){const n=t,r=o,i=e.computed({get(){return n.page},set(l){r("update:page",l)}}),c=e.computed({get(){return n.limit},set(l){r("update:limit",l)}}),u=l=>{i.value*l>n.total&&(i.value=1),r("pagination",{page:i.value,limit:l})},a=l=>{r("pagination",{page:l,limit:c.value})};return(l,m)=>{const d=e.resolveComponent("el-pagination");return e.withDirectives((e.openBlock(),e.createBlock(d,{"current-page":i.value,"onUpdate:currentPage":m[0]||(m[0]=h=>i.value=h),"page-size":c.value,"onUpdate:pageSize":m[1]||(m[1]=h=>c.value=h),background:!0,"page-sizes":[10,20,30,50,100],"pager-count":t.pagerCount,total:t.total,class:"pagination",layout:"total, sizes, prev, pager, next, jumper",onSizeChange:u,onCurrentChange:a},null,8,["current-page","page-size","pager-count","total"])),[[e.vShow,t.total>0]])}}}),P=b(J,[["__scopeId","data-v-1e34e383"]]),Q=["onClick","onMouseover"],Z=e.defineComponent({name:"EasyContextMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},maxHeight:{type:[String,Number],default:200},backgroundColor:{type:String,default:"#fff"},hoverItemStyle:{type:Object,default:()=>({backgroundColor:"#ddd"})},animationCurve:{type:String,default:"linear"}},setup(t){const o=t,n=e.ref(-1),r=e.ref(!1),i=e.ref({x:0,y:0}),c=d=>{r.value=!1,d.preventDefault(),d.stopPropagation(),setTimeout(()=>{r.value=!0;const{clientX:h,clientY:f}=d;i.value={x:h,y:f},u.value?.scrollTo(0,0)},0)},u=e.ref(null),a=e.ref(null);e.onMounted(()=>{const d=a.value?.parentElement;d?.addEventListener("contextmenu",c),document.addEventListener("click",()=>{r.value=!1}),d?.addEventListener("blur",()=>{console.log("blur"),r.value=!1})});const l=e.computed(()=>o.maxHeight=="auto"?"auto":o.maxHeight.toString().indexOf("px")>-1?o.maxHeight:`${o.maxHeight}px`),m=e.computed(()=>({backgroundColor:o.backgroundColor,left:`${i.value.x}px`,top:`${i.value.y}px`,maxHeight:r.value?l.value:"0px",transition:r.value?`max-height .2s ${o.animationCurve}`:"none"}));return(d,h)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextMenu",ref:a},[e.createElementVNode("div",e.mergeProps({class:"easy-context-menu"},d.$attrs,{style:{...e.unref(m)},ref_key:"menuListRef",ref:u}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuList,(f,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,onContextmenu:h[0]||(h[0]=e.withModifiers(()=>{},["stop"])),onClick:f.onClick,onMouseover:k=>n.value=p,onMouseout:h[1]||(h[1]=k=>n.value=-1),style:e.normalizeStyle(e.unref(n)===p?o.hoverItemStyle:"")},e.toDisplayString(f.label),45,Q))),128))],16)],512))}}),V=b(Z,[["__scopeId","data-v-f9f5bc05"]]);class C{vnode=null;#e={bindEvent:!0};defaultStyle={position:"fixed","z-index":1e3,"border-radius":"4px",color:"#666","font-size":"14px","min-width":"100px","box-shadow":"1px 1px 11px 0px #a6b5ba","background-color":"#fff",padding:"4px",overflow:"hidden"};hoverStyle={"background-color":"#8f9f80ff"};menu=null;static#t=null;static getInstance(){return C.#t||(C.#t=new C),C.#t}constructor(){C.#t||(C.#t=this)}create(o){const n=C.getInstance();return n.vnode!==o.target&&n.destroy(),n.vnode=o.target||null,n.#e={...n.#e,...o},n.#o(),n}#o(){this.defaultStyle={...this.defaultStyle,...this.#e.style},this.hoverStyle={...this.hoverStyle,...this.#e.hoverStyle},this.vnode&&this.vnode?.addEventListener(this.#e.event||"contextmenu",this.showMenu),document.addEventListener("click",this.hideMenu),document.addEventListener("keydown",this.hideMenu)}destroy(){this.vnode?.removeEventListener(this.#e.event||"contextmenu",this.showMenu),document.removeEventListener("click",this.hideMenu),document.removeEventListener("keydown",this.hideMenu),this.resetContextMenu()}resetContextMenu(){this.#e.appendToBody?this.menu&&document.body.removeChild(this.menu):this.vnode?.contains(this.menu)&&this.menu&&this.vnode?.removeChild(this.menu),this.menu=null}#n(){this.menu&&(this.menu.style.transition="none",this.menu.style.maxHeight="0",this.menu.style.display="none")}setMenuList(o){this.#e.menuList=o}showMenu(o){C.#t.#l(o)}hideMenu(){C.#t.#n()}#l(o){if(o.preventDefault(),o.stopPropagation(),this.#e.menuList.length===0)return;if(this.vnode||(this.vnode=o.target),console.log(this,"this"),this.#n(),!this.menu){const u=document.createElement("div");u.className=this.#e.classNames||"",this.menu=u,this.#e.menuList.forEach(a=>{const l=document.createElement("div");if(!a.label&&a.divider){l.style="padding: 0; margin: 5px 0; border-top: 1px solid #e6e6e6;",u.appendChild(l);return}const m=";padding: 5px 10px; cursor: pointer;";if(l.style=m,l.innerText=a.label,a.disabled){l.style.cssText+="color: #ccc; cursor: not-allowed;",u.appendChild(l);return}u.appendChild(l),l.addEventListener("click",d=>{o.stopPropagation(),a.onClick&&a.onClick(d),this.#n()}),l.addEventListener("mouseover",()=>{l.style.cssText=Object.entries(this.hoverStyle).map(([d,h])=>`${d}:${h}`).join(";")+m}),l.addEventListener("mouseout",()=>{l.style=m})}),this.#e.appendToBody?document.body.appendChild(u):this.vnode?.appendChild(u)}const{clientX:n,clientY:r}=o,i={display:"block",...this.defaultStyle,left:`${n}px`,top:`${r}px`};let c=Object.entries(i).map(([u,a])=>`${u}:${a}`).join(";");this.menu.style.cssText=c,this.menu.style.transition="none",this.menu.style.maxHeight="0",setTimeout(()=>{this.menu&&(this.menu.style.maxHeight=`${this.#e.style?.["max-height"]||"200px"}`,this.menu.style.transition=`${this.#e.style?.transition||"max-height 0.1s ease-in-out"}`)},0),this.menu.scrollTo(0,0)}}const ee=C.getInstance(),te=[_,M,$,H,Y,L,P,V],E=[],I=(t,o)=>{te.forEach(n=>{E.push(n.name),t.component(n.name,n)}),console.log("mwl-components",E)},ne={install:I};exports.ContentWarp=M;exports.ContextMenu=ee;exports.Dialog=$;exports.EasyButton=_;exports.EasyContextMenu=V;exports.EasyForm=H;exports.EasyTable=Y;exports.MenuTree=L;exports.Pagination=P;exports.componentsMap=N;exports.default=ne;exports.getPlaceholder=D;exports.install=I;
|
package/dist/index.es.js
DELETED
|
@@ -1,999 +0,0 @@
|
|
|
1
|
-
import { defineComponent as E, useAttrs as ee, ref as w, resolveComponent as y, createBlock as g, openBlock as s, mergeProps as P, withCtx as h, renderSlot as M, useSlots as F, normalizeClass as te, createSlots as U, createElementVNode as D, createElementBlock as b, createCommentVNode as I, toDisplayString as Y, watch as ne, nextTick as oe, computed as T, unref as B, normalizeStyle as V, createTextVNode as X, createVNode as N, mergeModels as ae, useModel as le, getCurrentInstance as K, Fragment as H, renderList as z, resolveDynamicComponent as L, h as O, inject as se, onMounted as G, onUnmounted as re, withDirectives as J, vShow as Q, normalizeProps as ie, guardReactiveProps as ue, withModifiers as ce } from "vue";
|
|
2
|
-
import { configProviderContextKey as de } from "element-plus";
|
|
3
|
-
const me = /* @__PURE__ */ E({
|
|
4
|
-
name: "EasyButton",
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
__name: "index",
|
|
7
|
-
setup(e) {
|
|
8
|
-
const { onClick: n, ...t } = ee(), l = w(!1), i = async () => {
|
|
9
|
-
console.log("Button clicked"), l.value = !0;
|
|
10
|
-
try {
|
|
11
|
-
await n?.();
|
|
12
|
-
} catch (u) {
|
|
13
|
-
console.error("Error in button onClick handler:", u);
|
|
14
|
-
} finally {
|
|
15
|
-
l.value = !1;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
return (u, c) => {
|
|
19
|
-
const a = y("el-button");
|
|
20
|
-
return s(), g(a, P(t, {
|
|
21
|
-
loading: l.value,
|
|
22
|
-
onClick: i
|
|
23
|
-
}), {
|
|
24
|
-
default: h(() => [
|
|
25
|
-
M(u.$slots, "default")
|
|
26
|
-
]),
|
|
27
|
-
_: 3
|
|
28
|
-
}, 16, ["loading"]);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}), pe = { class: "card-header" }, he = {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "card-header__message"
|
|
34
|
-
}, fe = /* @__PURE__ */ E({
|
|
35
|
-
name: "ContentWarp",
|
|
36
|
-
__name: "index",
|
|
37
|
-
props: {
|
|
38
|
-
title: String,
|
|
39
|
-
message: String
|
|
40
|
-
},
|
|
41
|
-
setup(e) {
|
|
42
|
-
const n = F(), t = w("content-wrap");
|
|
43
|
-
return (l, i) => {
|
|
44
|
-
const u = y("ElCard");
|
|
45
|
-
return s(), g(u, {
|
|
46
|
-
class: te([t.value]),
|
|
47
|
-
shadow: "never"
|
|
48
|
-
}, U({
|
|
49
|
-
default: h(() => [
|
|
50
|
-
M(l.$slots, "default", {}, void 0, !0)
|
|
51
|
-
]),
|
|
52
|
-
_: 2
|
|
53
|
-
}, [
|
|
54
|
-
e.title ? {
|
|
55
|
-
name: "header",
|
|
56
|
-
fn: h(() => [
|
|
57
|
-
D("div", pe, [
|
|
58
|
-
D("span", null, Y(e.title), 1),
|
|
59
|
-
e.message ? (s(), b("span", he, Y(e.message), 1)) : I("", !0)
|
|
60
|
-
])
|
|
61
|
-
]),
|
|
62
|
-
key: "0"
|
|
63
|
-
} : void 0,
|
|
64
|
-
n.footer ? {
|
|
65
|
-
name: "footer",
|
|
66
|
-
fn: h(() => [
|
|
67
|
-
M(l.$slots, "footer", {}, void 0, !0)
|
|
68
|
-
]),
|
|
69
|
-
key: "1"
|
|
70
|
-
} : void 0
|
|
71
|
-
]), 1032, ["class"]);
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}), W = (e, n) => {
|
|
75
|
-
const t = e.__vccOpts || e;
|
|
76
|
-
for (const [l, i] of n)
|
|
77
|
-
t[l] = i;
|
|
78
|
-
return t;
|
|
79
|
-
}, ye = /* @__PURE__ */ W(fe, [["__scopeId", "data-v-fdaaba5e"]]), ge = { class: "dialog-header" }, ve = /* @__PURE__ */ E({
|
|
80
|
-
name: "Dialog",
|
|
81
|
-
__name: "index",
|
|
82
|
-
props: {
|
|
83
|
-
title: {
|
|
84
|
-
type: String,
|
|
85
|
-
default: ""
|
|
86
|
-
},
|
|
87
|
-
fullscreen: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: !1
|
|
90
|
-
},
|
|
91
|
-
scroll: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: !1
|
|
94
|
-
},
|
|
95
|
-
width: {
|
|
96
|
-
type: String,
|
|
97
|
-
default: "61.8%"
|
|
98
|
-
},
|
|
99
|
-
maxHeight: {
|
|
100
|
-
type: [String, Number],
|
|
101
|
-
default: ""
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
setup(e) {
|
|
105
|
-
const n = F(), t = e, l = w(t.fullscreen), i = () => {
|
|
106
|
-
l.value = !B(l);
|
|
107
|
-
}, u = w(t.maxHeight);
|
|
108
|
-
ne(
|
|
109
|
-
() => l.value,
|
|
110
|
-
async (a) => {
|
|
111
|
-
if (await oe(), a) {
|
|
112
|
-
const o = document.documentElement.offsetHeight;
|
|
113
|
-
u.value = `${o - 55 - 40 - (n.footer ? 63 : 0)}px`;
|
|
114
|
-
} else
|
|
115
|
-
u.value = t.maxHeight;
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
immediate: !0
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
const c = T(() => {
|
|
122
|
-
if (t.maxHeight)
|
|
123
|
-
return {
|
|
124
|
-
height: B(u)
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
return (a, o) => {
|
|
128
|
-
const m = y("FullScreen"), d = y("el-icon"), f = y("ElScrollbar"), v = y("ElDialog");
|
|
129
|
-
return s(), g(v, P({
|
|
130
|
-
"close-on-click-modal": !1,
|
|
131
|
-
"destroy-on-close": "",
|
|
132
|
-
draggable: "",
|
|
133
|
-
"lock-scroll": "",
|
|
134
|
-
class: "custom-dialog",
|
|
135
|
-
"append-to-body": ""
|
|
136
|
-
}, a.$attrs, {
|
|
137
|
-
fullscreen: l.value,
|
|
138
|
-
width: e.width
|
|
139
|
-
}), U({
|
|
140
|
-
default: h(() => [
|
|
141
|
-
e.scroll ? (s(), g(f, {
|
|
142
|
-
key: 0,
|
|
143
|
-
style: V(c.value)
|
|
144
|
-
}, {
|
|
145
|
-
default: h(() => [
|
|
146
|
-
M(a.$slots, "default")
|
|
147
|
-
]),
|
|
148
|
-
_: 3
|
|
149
|
-
}, 8, ["style"])) : M(a.$slots, "default", { key: 1 })
|
|
150
|
-
]),
|
|
151
|
-
_: 2
|
|
152
|
-
}, [
|
|
153
|
-
e.title ? {
|
|
154
|
-
name: "header",
|
|
155
|
-
fn: h(() => [
|
|
156
|
-
D("div", ge, [
|
|
157
|
-
M(a.$slots, "title", {}, () => [
|
|
158
|
-
X(Y(e.title), 1)
|
|
159
|
-
]),
|
|
160
|
-
D("div", { onClick: i }, [
|
|
161
|
-
N(d, { class: "fullScreen" }, {
|
|
162
|
-
default: h(() => [
|
|
163
|
-
N(m)
|
|
164
|
-
]),
|
|
165
|
-
_: 1
|
|
166
|
-
})
|
|
167
|
-
])
|
|
168
|
-
])
|
|
169
|
-
]),
|
|
170
|
-
key: "0"
|
|
171
|
-
} : void 0,
|
|
172
|
-
n.footer ? {
|
|
173
|
-
name: "footer",
|
|
174
|
-
fn: h(() => [
|
|
175
|
-
M(a.$slots, "footer")
|
|
176
|
-
]),
|
|
177
|
-
key: "1"
|
|
178
|
-
} : void 0
|
|
179
|
-
]), 1040, ["fullscreen", "width"]);
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
}), be = { key: 1 }, xe = (e) => {
|
|
183
|
-
let n = e.label;
|
|
184
|
-
if (e.label && typeof e.label == "function" && (n = e.label()), e.type.indexOf("select") > -1 || e.type.indexOf("cascader") > -1 || e.type.indexOf("date") > -1)
|
|
185
|
-
return `请选择${n}`;
|
|
186
|
-
if (e.type.indexOf("text") > -1 || e.type.indexOf("number") > -1)
|
|
187
|
-
return `请输入${n}`;
|
|
188
|
-
}, R = {
|
|
189
|
-
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
190
|
-
format: "YYYY-MM-DD HH:mm:ss"
|
|
191
|
-
}, ke = (e) => {
|
|
192
|
-
const { options: n } = e;
|
|
193
|
-
return {
|
|
194
|
-
default: () => n?.map((t) => O(y("el-option"), {
|
|
195
|
-
label: t.label,
|
|
196
|
-
value: t.value,
|
|
197
|
-
key: t.value
|
|
198
|
-
}))
|
|
199
|
-
};
|
|
200
|
-
}, A = {
|
|
201
|
-
clearable: !0
|
|
202
|
-
}, Ce = [
|
|
203
|
-
{
|
|
204
|
-
type: "slider",
|
|
205
|
-
component: "el-slider"
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
type: "text",
|
|
209
|
-
component: "el-input",
|
|
210
|
-
attrs: {
|
|
211
|
-
...A
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
type: "textarea",
|
|
216
|
-
component: "el-input",
|
|
217
|
-
attrs: {
|
|
218
|
-
...A
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
type: "number",
|
|
223
|
-
component: "el-input-number",
|
|
224
|
-
attrs: {
|
|
225
|
-
controlsPosition: "right"
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
type: "switch",
|
|
230
|
-
component: "el-switch"
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
type: "checkbox",
|
|
234
|
-
component: "el-checkbox-group",
|
|
235
|
-
slots: (e) => {
|
|
236
|
-
const { options: n } = e;
|
|
237
|
-
return {
|
|
238
|
-
default: () => n?.map((t) => O(
|
|
239
|
-
y("el-checkbox"),
|
|
240
|
-
{
|
|
241
|
-
value: t.value
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
default: () => t.label
|
|
245
|
-
}
|
|
246
|
-
))
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
type: "radio",
|
|
252
|
-
component: "el-radio-group",
|
|
253
|
-
slots: (e) => {
|
|
254
|
-
const { options: n } = e;
|
|
255
|
-
return {
|
|
256
|
-
default: () => n?.map((t) => O(
|
|
257
|
-
y("el-radio"),
|
|
258
|
-
{
|
|
259
|
-
value: t.value
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
default: () => t.label
|
|
263
|
-
}
|
|
264
|
-
))
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
type: "select",
|
|
270
|
-
component: "el-select",
|
|
271
|
-
slots: ke
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
type: "select-v2",
|
|
275
|
-
component: "el-select-v2"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
type: "tree-select",
|
|
279
|
-
component: "el-tree-select",
|
|
280
|
-
attrs: {
|
|
281
|
-
...A,
|
|
282
|
-
checkStrictly: !0,
|
|
283
|
-
//是否严格的遵循父子不互相关联的做法,默认为 false
|
|
284
|
-
renderAfterExpand: !0
|
|
285
|
-
// 是否在第一次展开时即渲染子节点,默认为 false
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
type: "date,dates",
|
|
290
|
-
component: "el-date-picker",
|
|
291
|
-
attrs: {
|
|
292
|
-
showConfirm: !1,
|
|
293
|
-
valueFormat: "YYYY-MM-DD",
|
|
294
|
-
format: "YYYY-MM-DD"
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
type: "datetime,week",
|
|
299
|
-
component: "el-date-picker",
|
|
300
|
-
attrs: {
|
|
301
|
-
showConfirm: !1,
|
|
302
|
-
...R
|
|
303
|
-
}
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
type: "month,months",
|
|
307
|
-
component: "el-date-picker",
|
|
308
|
-
attrs: {
|
|
309
|
-
showConfirm: !1,
|
|
310
|
-
valueFormat: "YYYY-MM",
|
|
311
|
-
format: "YYYY-MM"
|
|
312
|
-
}
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
type: "year,years",
|
|
316
|
-
component: "el-date-picker",
|
|
317
|
-
attrs: {
|
|
318
|
-
showConfirm: !1,
|
|
319
|
-
valueFormat: "YYYY",
|
|
320
|
-
format: "YYYY"
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
type: "datetimerange,daterange,monthrange,yearrange",
|
|
325
|
-
component: "el-date-picker",
|
|
326
|
-
attrs: {
|
|
327
|
-
showConfirm: !1,
|
|
328
|
-
rangeSeparator: "至",
|
|
329
|
-
startPlaceholder: "开始日期",
|
|
330
|
-
endPlaceholder: "结束日期",
|
|
331
|
-
...R
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
type: "cascader",
|
|
336
|
-
component: "el-cascader",
|
|
337
|
-
attrs: {
|
|
338
|
-
clearable: !0
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
type: "upload",
|
|
343
|
-
component: "el-upload"
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
type: "custom",
|
|
347
|
-
component: "el-form-item"
|
|
348
|
-
}
|
|
349
|
-
], we = /* @__PURE__ */ E({
|
|
350
|
-
name: "EasyForm",
|
|
351
|
-
__name: "index",
|
|
352
|
-
props: /* @__PURE__ */ ae({
|
|
353
|
-
inline: {
|
|
354
|
-
type: Boolean,
|
|
355
|
-
default: !0
|
|
356
|
-
},
|
|
357
|
-
// // 表单数据对象
|
|
358
|
-
// formData: {
|
|
359
|
-
// type: Object as PropType<Record<string, any>>,
|
|
360
|
-
// required: true,
|
|
361
|
-
// },
|
|
362
|
-
// 表单项配置数组
|
|
363
|
-
formItems: {
|
|
364
|
-
type: Array,
|
|
365
|
-
default: () => []
|
|
366
|
-
},
|
|
367
|
-
// 表单标签宽度
|
|
368
|
-
labelWidth: {
|
|
369
|
-
type: [String, Number],
|
|
370
|
-
default: "120px"
|
|
371
|
-
},
|
|
372
|
-
// 表单项宽度
|
|
373
|
-
itemWidth: {
|
|
374
|
-
type: [String],
|
|
375
|
-
default: "200px"
|
|
376
|
-
}
|
|
377
|
-
}, {
|
|
378
|
-
modelValue: {
|
|
379
|
-
default: {},
|
|
380
|
-
type: Object
|
|
381
|
-
},
|
|
382
|
-
modelModifiers: {}
|
|
383
|
-
}),
|
|
384
|
-
emits: ["update:modelValue"],
|
|
385
|
-
setup(e) {
|
|
386
|
-
const n = le(e, "modelValue"), t = K(), l = (a) => {
|
|
387
|
-
i(a, "formRef");
|
|
388
|
-
}, i = (a, o) => {
|
|
389
|
-
if (!a) {
|
|
390
|
-
delete t?.exposeProxy?.[o], delete t?.exposed?.[o];
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
t.exposeProxy = {
|
|
394
|
-
...t?.exposed,
|
|
395
|
-
[o]: a
|
|
396
|
-
}, t.exposed = {
|
|
397
|
-
...t?.exposed,
|
|
398
|
-
[o]: a
|
|
399
|
-
};
|
|
400
|
-
}, u = F(), c = (a, o, m) => {
|
|
401
|
-
const { value: d, component: f, ...v } = o, p = Ce.find(
|
|
402
|
-
(k) => !!a && k.type.indexOf(a) > -1
|
|
403
|
-
), _ = p?.component === "el-select" && o.props, x = o.options && !_ ? p?.slots?.(o) : {};
|
|
404
|
-
if (!p && !o.component)
|
|
405
|
-
return new Error(`未找到type为${a}的组件且当前也未传递component`);
|
|
406
|
-
const r = L(p?.component || f);
|
|
407
|
-
if (r)
|
|
408
|
-
return O(
|
|
409
|
-
r,
|
|
410
|
-
{
|
|
411
|
-
...p?.attrs,
|
|
412
|
-
// 这里的ref还是从配置注入吧。不是每次都要用到ref
|
|
413
|
-
// ref: (el: any) => {
|
|
414
|
-
// setRefs(el, formItem.prop)
|
|
415
|
-
// },
|
|
416
|
-
...v,
|
|
417
|
-
//外部传入的 优先级最高
|
|
418
|
-
placeholder: v.placeholder || xe(o)
|
|
419
|
-
},
|
|
420
|
-
{ ...x, ...m }
|
|
421
|
-
);
|
|
422
|
-
};
|
|
423
|
-
return (a, o) => {
|
|
424
|
-
const m = y("el-form-item"), d = y("el-form");
|
|
425
|
-
return s(), g(d, P({
|
|
426
|
-
model: n.value,
|
|
427
|
-
"label-width": e.labelWidth,
|
|
428
|
-
inline: e.inline,
|
|
429
|
-
"scroll-to-error": !0
|
|
430
|
-
}, { ...a.$attrs }, {
|
|
431
|
-
ref: l,
|
|
432
|
-
class: "easy-form"
|
|
433
|
-
}), {
|
|
434
|
-
default: h(() => [
|
|
435
|
-
(s(!0), b(H, null, z(e.formItems, ({ id: f, type: v, rule: p, width: _, slots: x, ...r }, k) => (s(), b(H, null, [
|
|
436
|
-
v != "custom" && !r.hidden ? (s(), g(m, {
|
|
437
|
-
prop: r.prop,
|
|
438
|
-
key: k,
|
|
439
|
-
"label-width": r.labelWidth,
|
|
440
|
-
rules: p,
|
|
441
|
-
required: r.required
|
|
442
|
-
}, {
|
|
443
|
-
label: h(() => [
|
|
444
|
-
r.label && typeof r.label == "function" ? (s(), g(L(r.label), { key: 0 })) : (s(), b("span", be, Y(r.label), 1))
|
|
445
|
-
]),
|
|
446
|
-
default: h(() => [
|
|
447
|
-
u[r.prop] ? M(a.$slots, r.prop, {
|
|
448
|
-
key: 0,
|
|
449
|
-
item: r
|
|
450
|
-
}, void 0, !0) : (s(), g(L(c(v, { ...r, type: v }, x)), {
|
|
451
|
-
key: 1,
|
|
452
|
-
modelValue: n.value[r.prop],
|
|
453
|
-
"onUpdate:modelValue": (C) => n.value[r.prop] = C,
|
|
454
|
-
modelModifiers: { trim: !0 },
|
|
455
|
-
style: V({ width: _ || e.itemWidth })
|
|
456
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"]))
|
|
457
|
-
]),
|
|
458
|
-
_: 2
|
|
459
|
-
}, 1032, ["prop", "label-width", "rules", "required"])) : I("", !0),
|
|
460
|
-
v == "custom" ? (s(), b(H, { key: 1 }, [
|
|
461
|
-
x?.[r.prop] ? (s(), g(L(x[r.prop]), { key: 0 })) : M(a.$slots, r.prop, {
|
|
462
|
-
key: 1,
|
|
463
|
-
item: { width: _, rule: p, ...r }
|
|
464
|
-
}, void 0, !0)
|
|
465
|
-
], 64)) : I("", !0)
|
|
466
|
-
], 64))), 256)),
|
|
467
|
-
u.append ? (s(), g(m, { key: 0 }, {
|
|
468
|
-
default: h(() => [
|
|
469
|
-
M(a.$slots, "append", {}, void 0, !0)
|
|
470
|
-
]),
|
|
471
|
-
_: 3
|
|
472
|
-
})) : I("", !0)
|
|
473
|
-
]),
|
|
474
|
-
_: 3
|
|
475
|
-
}, 16, ["model", "label-width", "inline"]);
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
}), _e = /* @__PURE__ */ W(we, [["__scopeId", "data-v-ebcd5674"]]), Se = /* @__PURE__ */ E({
|
|
479
|
-
name: "EasyTable",
|
|
480
|
-
__name: "index",
|
|
481
|
-
props: {
|
|
482
|
-
data: {
|
|
483
|
-
type: Array,
|
|
484
|
-
required: !0,
|
|
485
|
-
default: () => []
|
|
486
|
-
},
|
|
487
|
-
tableColumns: {
|
|
488
|
-
type: Array,
|
|
489
|
-
default: () => []
|
|
490
|
-
},
|
|
491
|
-
buttons: {
|
|
492
|
-
type: Array,
|
|
493
|
-
default: () => []
|
|
494
|
-
},
|
|
495
|
-
buttonWidth: {
|
|
496
|
-
type: [Number, String],
|
|
497
|
-
default: 120
|
|
498
|
-
},
|
|
499
|
-
align: {
|
|
500
|
-
type: String,
|
|
501
|
-
default: "center"
|
|
502
|
-
},
|
|
503
|
-
height: {
|
|
504
|
-
type: Number || String,
|
|
505
|
-
default: void 0
|
|
506
|
-
},
|
|
507
|
-
maxHeight: {
|
|
508
|
-
type: String || Number,
|
|
509
|
-
default: void 0
|
|
510
|
-
},
|
|
511
|
-
footerHeight: {
|
|
512
|
-
type: Number,
|
|
513
|
-
default: 65
|
|
514
|
-
}
|
|
515
|
-
},
|
|
516
|
-
setup(e) {
|
|
517
|
-
const n = se(de), t = e, l = T(() => t.buttonWidth.toString().indexOf("px") > -1 ? t.buttonWidth.toString().slice(0, -2) : t.buttonWidth), i = w(), u = w("auto");
|
|
518
|
-
let c = K();
|
|
519
|
-
const a = () => {
|
|
520
|
-
let p = "auto";
|
|
521
|
-
if (c?.parent?.attrs?.class?.indexOf("content-wrap") > -1) {
|
|
522
|
-
let r = t.footerHeight;
|
|
523
|
-
n?.value?.size === "small" ? r = r - 8 : n?.value?.size === "large" && (r = r + 8);
|
|
524
|
-
try {
|
|
525
|
-
const k = c?.refs.tableRef, { top: C } = k?.getBoundingClientRect();
|
|
526
|
-
p = document.documentElement.clientHeight - C - r - 20;
|
|
527
|
-
} catch {
|
|
528
|
-
}
|
|
529
|
-
return p;
|
|
530
|
-
}
|
|
531
|
-
return p;
|
|
532
|
-
}, o = w(), m = () => {
|
|
533
|
-
o.value && clearTimeout(o.value), o.value = setTimeout(() => {
|
|
534
|
-
u.value = a(), o.value = null;
|
|
535
|
-
}, 100);
|
|
536
|
-
};
|
|
537
|
-
G(() => {
|
|
538
|
-
u.value = a(), window.addEventListener("resize", m);
|
|
539
|
-
}), re(() => {
|
|
540
|
-
window.removeEventListener("resize", m);
|
|
541
|
-
});
|
|
542
|
-
const d = y("el-table-column"), f = F(), v = (p) => {
|
|
543
|
-
const { slots: _ = {}, children: x = [], ...r } = p;
|
|
544
|
-
if (x && x.length > 0) {
|
|
545
|
-
const k = x.map((C) => v(C));
|
|
546
|
-
return O(
|
|
547
|
-
d,
|
|
548
|
-
{
|
|
549
|
-
align: t.align,
|
|
550
|
-
...r
|
|
551
|
-
},
|
|
552
|
-
// default 插槽默认使用 childrenNode 不能被slots 覆盖
|
|
553
|
-
{ ..._, default: () => k }
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
return O(
|
|
557
|
-
d,
|
|
558
|
-
{
|
|
559
|
-
align: t.align,
|
|
560
|
-
...r
|
|
561
|
-
},
|
|
562
|
-
// 最里层的表格列 default 插槽 slots传递的优先级最高 模版直接传递的可被 slots 覆盖
|
|
563
|
-
{
|
|
564
|
-
default: (k) => f[p.prop] && f[p.prop](k),
|
|
565
|
-
..._
|
|
566
|
-
}
|
|
567
|
-
);
|
|
568
|
-
};
|
|
569
|
-
return (p, _) => {
|
|
570
|
-
const x = y("el-button"), r = y("el-table-column"), k = y("el-table");
|
|
571
|
-
return s(), b("div", {
|
|
572
|
-
ref_key: "tableRef",
|
|
573
|
-
ref: i
|
|
574
|
-
}, [
|
|
575
|
-
N(k, P({ style: { width: "100%" } }, p.$attrs, {
|
|
576
|
-
data: e.data,
|
|
577
|
-
height: e.height,
|
|
578
|
-
maxHeight: e.maxHeight ? e.maxHeight : u.value
|
|
579
|
-
}), {
|
|
580
|
-
default: h(() => [
|
|
581
|
-
(s(!0), b(H, null, z(e.tableColumns, (C, $) => (s(), g(L(v(C)), { key: $ }))), 128)),
|
|
582
|
-
e.buttons && e.buttons.length ? (s(), g(r, {
|
|
583
|
-
key: 0,
|
|
584
|
-
align: "center",
|
|
585
|
-
fixed: "right",
|
|
586
|
-
label: "操作",
|
|
587
|
-
width: l.value
|
|
588
|
-
}, {
|
|
589
|
-
default: h((C) => [
|
|
590
|
-
(s(!0), b(H, null, z(e.buttons, ($, Z) => J((s(), g(x, P({ ref_for: !0 }, { ...$ }, {
|
|
591
|
-
key: Z,
|
|
592
|
-
type: $.type.includes("del") ? "danger" : "primary",
|
|
593
|
-
onClick: () => {
|
|
594
|
-
$.click?.(C.row);
|
|
595
|
-
},
|
|
596
|
-
disabled: $.disabled?.(C.row) || !1,
|
|
597
|
-
link: $.link?.(C.row) || !0
|
|
598
|
-
}), {
|
|
599
|
-
default: h(() => [
|
|
600
|
-
X(Y($.label), 1)
|
|
601
|
-
]),
|
|
602
|
-
_: 2
|
|
603
|
-
}, 1040, ["type", "onClick", "disabled", "link"])), [
|
|
604
|
-
[Q, $.show?.(C.row) || !0]
|
|
605
|
-
])), 128))
|
|
606
|
-
]),
|
|
607
|
-
_: 1
|
|
608
|
-
}, 8, ["width"])) : I("", !0)
|
|
609
|
-
]),
|
|
610
|
-
_: 1
|
|
611
|
-
}, 16, ["data", "height", "maxHeight"])
|
|
612
|
-
], 512);
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
}), Me = /* @__PURE__ */ W(Se, [["__scopeId", "data-v-1c87357b"]]), $e = {
|
|
616
|
-
name: "",
|
|
617
|
-
components: {},
|
|
618
|
-
props: {
|
|
619
|
-
icon: {
|
|
620
|
-
type: String,
|
|
621
|
-
default: ""
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
};
|
|
625
|
-
function Ee(e, n, t, l, i, u) {
|
|
626
|
-
return t.icon ? (s(), g(L(t.icon), {
|
|
627
|
-
key: 0,
|
|
628
|
-
class: "menu_icon"
|
|
629
|
-
})) : I("", !0);
|
|
630
|
-
}
|
|
631
|
-
const j = /* @__PURE__ */ W($e, [["render", Ee], ["__scopeId", "data-v-261ce99a"]]), He = /* @__PURE__ */ E({
|
|
632
|
-
name: "subMenu",
|
|
633
|
-
__name: "subMenu",
|
|
634
|
-
props: {
|
|
635
|
-
routeData: {
|
|
636
|
-
type: Object,
|
|
637
|
-
default: () => ({})
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
emits: ["handleMenuItemClick"],
|
|
641
|
-
setup(e, { emit: n }) {
|
|
642
|
-
const t = n;
|
|
643
|
-
function l(i) {
|
|
644
|
-
t("handleMenuItemClick", i);
|
|
645
|
-
}
|
|
646
|
-
return (i, u) => {
|
|
647
|
-
const c = y("subMenu", !0), a = y("el-sub-menu"), o = y("el-menu-item");
|
|
648
|
-
return e.routeData.children && e.routeData.children.length > 0 ? (s(), g(a, {
|
|
649
|
-
key: 0,
|
|
650
|
-
index: e.routeData.path
|
|
651
|
-
}, {
|
|
652
|
-
title: h(() => [
|
|
653
|
-
N(j, {
|
|
654
|
-
icon: e.routeData.meta.icon
|
|
655
|
-
}, null, 8, ["icon"]),
|
|
656
|
-
D("span", null, Y(e.routeData.meta.title), 1)
|
|
657
|
-
]),
|
|
658
|
-
default: h(() => [
|
|
659
|
-
(s(!0), b(H, null, z(e.routeData.children, (m, d) => (s(), g(c, {
|
|
660
|
-
onHandleMenuItemClick: l,
|
|
661
|
-
routeData: m,
|
|
662
|
-
key: d
|
|
663
|
-
}, null, 8, ["routeData"]))), 128))
|
|
664
|
-
]),
|
|
665
|
-
_: 1
|
|
666
|
-
}, 8, ["index"])) : (s(), b("div", {
|
|
667
|
-
key: 1,
|
|
668
|
-
onClick: u[0] || (u[0] = (m) => l(e.routeData))
|
|
669
|
-
}, [
|
|
670
|
-
N(o, {
|
|
671
|
-
index: e.routeData.path
|
|
672
|
-
}, {
|
|
673
|
-
title: h(() => [
|
|
674
|
-
D("span", null, Y(e.routeData.meta.title), 1)
|
|
675
|
-
]),
|
|
676
|
-
default: h(() => [
|
|
677
|
-
N(j, {
|
|
678
|
-
icon: e.routeData.meta.icon
|
|
679
|
-
}, null, 8, ["icon"])
|
|
680
|
-
]),
|
|
681
|
-
_: 1
|
|
682
|
-
}, 8, ["index"])
|
|
683
|
-
]));
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
}), Ye = /* @__PURE__ */ E({
|
|
687
|
-
name: "MenuTree",
|
|
688
|
-
__name: "index",
|
|
689
|
-
props: {
|
|
690
|
-
menuList: {
|
|
691
|
-
type: Array,
|
|
692
|
-
default: () => []
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
emits: ["handleMenuItemClick"],
|
|
696
|
-
setup(e, { emit: n }) {
|
|
697
|
-
const t = n, l = (i) => {
|
|
698
|
-
t("handleMenuItemClick", i);
|
|
699
|
-
};
|
|
700
|
-
return (i, u) => {
|
|
701
|
-
const c = y("el-menu");
|
|
702
|
-
return s(), g(c, ie(ue(i.$attrs)), {
|
|
703
|
-
default: h(() => [
|
|
704
|
-
(s(!0), b(H, null, z(e.menuList, (a) => (s(), g(He, {
|
|
705
|
-
routeData: a,
|
|
706
|
-
onHandleMenuItemClick: l
|
|
707
|
-
}, null, 8, ["routeData"]))), 256))
|
|
708
|
-
]),
|
|
709
|
-
_: 1
|
|
710
|
-
}, 16);
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
}), De = /* @__PURE__ */ E({
|
|
714
|
-
name: "Pagination",
|
|
715
|
-
__name: "index",
|
|
716
|
-
props: {
|
|
717
|
-
// 总条目数
|
|
718
|
-
total: {
|
|
719
|
-
required: !0,
|
|
720
|
-
type: Number
|
|
721
|
-
},
|
|
722
|
-
// 当前页数:pageNo
|
|
723
|
-
page: {
|
|
724
|
-
type: Number,
|
|
725
|
-
default: 1
|
|
726
|
-
},
|
|
727
|
-
// 每页显示条目个数:pageSize
|
|
728
|
-
limit: {
|
|
729
|
-
type: Number,
|
|
730
|
-
default: 20
|
|
731
|
-
},
|
|
732
|
-
// 设置最大页码按钮数。 页码按钮的数量,当总页数超过该值时会折叠
|
|
733
|
-
// 移动端页码按钮的数量端默认值 5
|
|
734
|
-
pagerCount: {
|
|
735
|
-
type: Number,
|
|
736
|
-
default: document.body.clientWidth < 992 ? 5 : 7
|
|
737
|
-
},
|
|
738
|
-
onPagination: { type: Function }
|
|
739
|
-
},
|
|
740
|
-
emits: ["update:page", "update:limit", "pagination"],
|
|
741
|
-
setup(e, { emit: n }) {
|
|
742
|
-
const t = e, l = n, i = T({
|
|
743
|
-
get() {
|
|
744
|
-
return t.page;
|
|
745
|
-
},
|
|
746
|
-
set(o) {
|
|
747
|
-
l("update:page", o);
|
|
748
|
-
}
|
|
749
|
-
}), u = T({
|
|
750
|
-
get() {
|
|
751
|
-
return t.limit;
|
|
752
|
-
},
|
|
753
|
-
set(o) {
|
|
754
|
-
l("update:limit", o);
|
|
755
|
-
}
|
|
756
|
-
}), c = (o) => {
|
|
757
|
-
i.value * o > t.total && (i.value = 1), l("pagination", { page: i.value, limit: o });
|
|
758
|
-
}, a = (o) => {
|
|
759
|
-
l("pagination", { page: o, limit: u.value });
|
|
760
|
-
};
|
|
761
|
-
return (o, m) => {
|
|
762
|
-
const d = y("el-pagination");
|
|
763
|
-
return J((s(), g(d, {
|
|
764
|
-
"current-page": i.value,
|
|
765
|
-
"onUpdate:currentPage": m[0] || (m[0] = (f) => i.value = f),
|
|
766
|
-
"page-size": u.value,
|
|
767
|
-
"onUpdate:pageSize": m[1] || (m[1] = (f) => u.value = f),
|
|
768
|
-
background: !0,
|
|
769
|
-
"page-sizes": [10, 20, 30, 50, 100],
|
|
770
|
-
"pager-count": e.pagerCount,
|
|
771
|
-
total: e.total,
|
|
772
|
-
class: "pagination",
|
|
773
|
-
layout: "total, sizes, prev, pager, next, jumper",
|
|
774
|
-
onSizeChange: c,
|
|
775
|
-
onCurrentChange: a
|
|
776
|
-
}, null, 8, ["current-page", "page-size", "pager-count", "total"])), [
|
|
777
|
-
[Q, e.total > 0]
|
|
778
|
-
]);
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
}), Le = /* @__PURE__ */ W(De, [["__scopeId", "data-v-1e34e383"]]), Ie = ["onClick", "onMouseover"], Ne = /* @__PURE__ */ E({
|
|
782
|
-
name: "EasyContextMenu",
|
|
783
|
-
__name: "index",
|
|
784
|
-
props: {
|
|
785
|
-
// 菜单列表
|
|
786
|
-
menuList: {
|
|
787
|
-
type: Array,
|
|
788
|
-
default: () => []
|
|
789
|
-
},
|
|
790
|
-
// 菜单最大高度
|
|
791
|
-
maxHeight: {
|
|
792
|
-
type: [String, Number],
|
|
793
|
-
default: 200
|
|
794
|
-
},
|
|
795
|
-
// 菜单背景颜色
|
|
796
|
-
backgroundColor: {
|
|
797
|
-
type: String,
|
|
798
|
-
default: "#fff"
|
|
799
|
-
},
|
|
800
|
-
// 当前hover的菜单样式
|
|
801
|
-
hoverItemStyle: {
|
|
802
|
-
type: Object,
|
|
803
|
-
default: () => ({
|
|
804
|
-
backgroundColor: "#ddd"
|
|
805
|
-
})
|
|
806
|
-
},
|
|
807
|
-
// 菜单显示动画曲线
|
|
808
|
-
animationCurve: {
|
|
809
|
-
type: String,
|
|
810
|
-
default: "linear"
|
|
811
|
-
}
|
|
812
|
-
},
|
|
813
|
-
setup(e) {
|
|
814
|
-
const n = e, t = w(-1), l = w(!1), i = w({ x: 0, y: 0 }), u = (d) => {
|
|
815
|
-
l.value = !1, d.preventDefault(), d.stopPropagation(), setTimeout(() => {
|
|
816
|
-
l.value = !0;
|
|
817
|
-
const { clientX: f, clientY: v } = d;
|
|
818
|
-
i.value = { x: f, y: v }, c.value?.scrollTo(0, 0);
|
|
819
|
-
}, 0);
|
|
820
|
-
}, c = w(null), a = w(null);
|
|
821
|
-
G(() => {
|
|
822
|
-
const d = a.value?.parentElement;
|
|
823
|
-
d?.addEventListener("contextmenu", u), document.addEventListener("click", () => {
|
|
824
|
-
l.value = !1;
|
|
825
|
-
}), d?.addEventListener("blur", () => {
|
|
826
|
-
console.log("blur"), l.value = !1;
|
|
827
|
-
});
|
|
828
|
-
});
|
|
829
|
-
const o = T(() => n.maxHeight == "auto" ? "auto" : n.maxHeight.toString().indexOf("px") > -1 ? n.maxHeight : `${n.maxHeight}px`), m = T(() => ({
|
|
830
|
-
backgroundColor: n.backgroundColor,
|
|
831
|
-
left: `${i.value.x}px`,
|
|
832
|
-
top: `${i.value.y}px`,
|
|
833
|
-
maxHeight: l.value ? o.value : "0px",
|
|
834
|
-
transition: l.value ? `max-height .2s ${n.animationCurve}` : "none"
|
|
835
|
-
}));
|
|
836
|
-
return (d, f) => (s(), b("div", {
|
|
837
|
-
ref_key: "contextMenu",
|
|
838
|
-
ref: a
|
|
839
|
-
}, [
|
|
840
|
-
D("div", P({ class: "easy-context-menu" }, d.$attrs, {
|
|
841
|
-
style: { ...B(m) },
|
|
842
|
-
ref_key: "menuListRef",
|
|
843
|
-
ref: c
|
|
844
|
-
}), [
|
|
845
|
-
(s(!0), b(H, null, z(e.menuList, (v, p) => (s(), b("div", {
|
|
846
|
-
key: p,
|
|
847
|
-
onContextmenu: f[0] || (f[0] = ce(() => {
|
|
848
|
-
}, ["stop"])),
|
|
849
|
-
onClick: v.onClick,
|
|
850
|
-
onMouseover: (_) => t.value = p,
|
|
851
|
-
onMouseout: f[1] || (f[1] = (_) => t.value = -1),
|
|
852
|
-
style: V(B(t) === p ? n.hoverItemStyle : "")
|
|
853
|
-
}, Y(v.label), 45, Ie))), 128))
|
|
854
|
-
], 16)
|
|
855
|
-
], 512));
|
|
856
|
-
}
|
|
857
|
-
}), Pe = /* @__PURE__ */ W(Ne, [["__scopeId", "data-v-f9f5bc05"]]);
|
|
858
|
-
class S {
|
|
859
|
-
// 右键菜单的节点
|
|
860
|
-
vnode = null;
|
|
861
|
-
// 右键菜单的配置
|
|
862
|
-
#e = {
|
|
863
|
-
bindEvent: !0
|
|
864
|
-
//初始化绑定事件
|
|
865
|
-
};
|
|
866
|
-
// 右键菜单的默认样式
|
|
867
|
-
defaultStyle = {
|
|
868
|
-
position: "fixed",
|
|
869
|
-
"z-index": 1e3,
|
|
870
|
-
"border-radius": "4px",
|
|
871
|
-
color: "#666",
|
|
872
|
-
"font-size": "14px",
|
|
873
|
-
"min-width": "100px",
|
|
874
|
-
"box-shadow": "1px 1px 11px 0px #a6b5ba",
|
|
875
|
-
"background-color": "#fff",
|
|
876
|
-
padding: "4px",
|
|
877
|
-
overflow: "hidden"
|
|
878
|
-
};
|
|
879
|
-
// 右键菜单hover的样式
|
|
880
|
-
hoverStyle = {
|
|
881
|
-
"background-color": "#8f9f80ff"
|
|
882
|
-
};
|
|
883
|
-
// 当前右键菜单的dom节点
|
|
884
|
-
menu = null;
|
|
885
|
-
// 实例
|
|
886
|
-
static #t = null;
|
|
887
|
-
static getInstance() {
|
|
888
|
-
return S.#t || (S.#t = new S()), S.#t;
|
|
889
|
-
}
|
|
890
|
-
constructor() {
|
|
891
|
-
S.#t || (S.#t = this);
|
|
892
|
-
}
|
|
893
|
-
create(n) {
|
|
894
|
-
const t = S.getInstance();
|
|
895
|
-
return t.vnode !== n.target && t.destroy(), t.vnode = n.target || null, t.#e = { ...t.#e, ...n }, t.#o(), t;
|
|
896
|
-
}
|
|
897
|
-
// 初始化
|
|
898
|
-
#o() {
|
|
899
|
-
this.defaultStyle = { ...this.defaultStyle, ...this.#e.style }, this.hoverStyle = { ...this.hoverStyle, ...this.#e.hoverStyle }, this.vnode && this.vnode?.addEventListener(this.#e.event || "contextmenu", this.showMenu), document.addEventListener("click", this.hideMenu), document.addEventListener("keydown", this.hideMenu);
|
|
900
|
-
}
|
|
901
|
-
// 销毁右键菜单
|
|
902
|
-
destroy() {
|
|
903
|
-
this.vnode?.removeEventListener(this.#e.event || "contextmenu", this.showMenu), document.removeEventListener("click", this.hideMenu), document.removeEventListener("keydown", this.hideMenu), this.resetContextMenu();
|
|
904
|
-
}
|
|
905
|
-
// 重置右键菜单
|
|
906
|
-
resetContextMenu() {
|
|
907
|
-
this.#e.appendToBody ? this.menu && document.body.removeChild(this.menu) : this.vnode?.contains(this.menu) && this.menu && this.vnode?.removeChild(this.menu), this.menu = null;
|
|
908
|
-
}
|
|
909
|
-
// 隐藏右键菜单
|
|
910
|
-
#n() {
|
|
911
|
-
this.menu && (this.menu.style.transition = "none", this.menu.style.maxHeight = "0", this.menu.style.display = "none");
|
|
912
|
-
}
|
|
913
|
-
/**
|
|
914
|
-
* 这个函数的用途写在这里
|
|
915
|
-
* @param {menuList Array<MenuItem> } 右键菜单的列表
|
|
916
|
-
*/
|
|
917
|
-
setMenuList(n) {
|
|
918
|
-
this.#e.menuList = n;
|
|
919
|
-
}
|
|
920
|
-
/**
|
|
921
|
-
* 手动显示右键菜单 需要传入一个事件对象
|
|
922
|
-
*/
|
|
923
|
-
showMenu(n) {
|
|
924
|
-
S.#t.#a(n);
|
|
925
|
-
}
|
|
926
|
-
/**
|
|
927
|
-
* 隐藏右键菜单
|
|
928
|
-
*/
|
|
929
|
-
hideMenu() {
|
|
930
|
-
S.#t.#n();
|
|
931
|
-
}
|
|
932
|
-
// 显示右键菜单
|
|
933
|
-
#a(n) {
|
|
934
|
-
if (n.preventDefault(), n.stopPropagation(), this.#e.menuList.length === 0)
|
|
935
|
-
return;
|
|
936
|
-
if (this.vnode || (this.vnode = n.target), console.log(this, "this"), this.#n(), !this.menu) {
|
|
937
|
-
const c = document.createElement("div");
|
|
938
|
-
c.className = this.#e.classNames || "", this.menu = c, this.#e.menuList.forEach((a) => {
|
|
939
|
-
const o = document.createElement("div");
|
|
940
|
-
if (!a.label && a.divider) {
|
|
941
|
-
o.style = "padding: 0; margin: 5px 0; border-top: 1px solid #e6e6e6;", c.appendChild(o);
|
|
942
|
-
return;
|
|
943
|
-
}
|
|
944
|
-
const m = ";padding: 5px 10px; cursor: pointer;";
|
|
945
|
-
if (o.style = m, o.innerText = a.label, a.disabled) {
|
|
946
|
-
o.style.cssText += "color: #ccc; cursor: not-allowed;", c.appendChild(o);
|
|
947
|
-
return;
|
|
948
|
-
}
|
|
949
|
-
c.appendChild(o), o.addEventListener("click", (d) => {
|
|
950
|
-
n.stopPropagation(), a.onClick && a.onClick(d), this.#n();
|
|
951
|
-
}), o.addEventListener("mouseover", () => {
|
|
952
|
-
o.style.cssText = Object.entries(this.hoverStyle).map(([d, f]) => `${d}:${f}`).join(";") + m;
|
|
953
|
-
}), o.addEventListener("mouseout", () => {
|
|
954
|
-
o.style = m;
|
|
955
|
-
});
|
|
956
|
-
}), this.#e.appendToBody ? document.body.appendChild(c) : this.vnode?.appendChild(c);
|
|
957
|
-
}
|
|
958
|
-
const { clientX: t, clientY: l } = n, i = {
|
|
959
|
-
display: "block",
|
|
960
|
-
...this.defaultStyle,
|
|
961
|
-
left: `${t}px`,
|
|
962
|
-
top: `${l}px`
|
|
963
|
-
};
|
|
964
|
-
let u = Object.entries(i).map(([c, a]) => `${c}:${a}`).join(";");
|
|
965
|
-
this.menu.style.cssText = u, this.menu.style.transition = "none", this.menu.style.maxHeight = "0", setTimeout(() => {
|
|
966
|
-
this.menu && (this.menu.style.maxHeight = `${this.#e.style?.["max-height"] || "200px"}`, this.menu.style.transition = `${this.#e.style?.transition || "max-height 0.1s ease-in-out"}`);
|
|
967
|
-
}, 0), this.menu.scrollTo(0, 0);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
const Be = S.getInstance(), Te = [
|
|
971
|
-
me,
|
|
972
|
-
ye,
|
|
973
|
-
ve,
|
|
974
|
-
_e,
|
|
975
|
-
// EasyFormH,
|
|
976
|
-
Me,
|
|
977
|
-
Ye,
|
|
978
|
-
Le,
|
|
979
|
-
Pe
|
|
980
|
-
], q = [], ze = (e, n) => {
|
|
981
|
-
Te.forEach((t) => {
|
|
982
|
-
q.push(t.name), e.component(t.name, t);
|
|
983
|
-
}), console.log("mwl-components", q);
|
|
984
|
-
}, Fe = { install: ze };
|
|
985
|
-
export {
|
|
986
|
-
ye as ContentWarp,
|
|
987
|
-
Be as ContextMenu,
|
|
988
|
-
ve as Dialog,
|
|
989
|
-
me as EasyButton,
|
|
990
|
-
Pe as EasyContextMenu,
|
|
991
|
-
_e as EasyForm,
|
|
992
|
-
Me as EasyTable,
|
|
993
|
-
Ye as MenuTree,
|
|
994
|
-
Le as Pagination,
|
|
995
|
-
Ce as componentsMap,
|
|
996
|
-
Fe as default,
|
|
997
|
-
xe as getPlaceholder,
|
|
998
|
-
ze as install
|
|
999
|
-
};
|
package/dist/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","element-plus"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.mwlComponents={},h.Vue,h.ElementPlus))})(this,function(h,e,z){"use strict";const _=e.defineComponent({name:"EasyButton",inheritAttrs:!1,__name:"index",setup(t){const{onClick:o,...n}=e.useAttrs(),r=e.ref(!1),i=async()=>{console.log("Button clicked"),r.value=!0;try{await o?.()}catch(c){console.error("Error in button onClick handler:",c)}finally{r.value=!1}};return(c,d)=>{const a=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(a,e.mergeProps(n,{loading:r.value,onClick:i}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["loading"])}}}),O={class:"card-header"},W={key:0,class:"card-header__message"},j=e.defineComponent({name:"ContentWarp",__name:"index",props:{title:String,message:String},setup(t){const o=e.useSlots(),n=e.ref("content-wrap");return(r,i)=>{const c=e.resolveComponent("ElCard");return e.openBlock(),e.createBlock(c,{class:e.normalizeClass([n.value]),shadow:"never"},e.createSlots({default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:2},[t.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",O,[e.createElementVNode("span",null,e.toDisplayString(t.title),1),t.message?(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(t.message),1)):e.createCommentVNode("",!0)])]),key:"0"}:void 0,o.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["class"])}}}),w=(t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n},E=w(j,[["__scopeId","data-v-fdaaba5e"]]),A={class:"dialog-header"},M=e.defineComponent({name:"Dialog",__name:"index",props:{title:{type:String,default:""},fullscreen:{type:Boolean,default:!1},scroll:{type:Boolean,default:!1},width:{type:String,default:"61.8%"},maxHeight:{type:[String,Number],default:""}},setup(t){const o=e.useSlots(),n=t,r=e.ref(n.fullscreen),i=()=>{r.value=!e.unref(r)},c=e.ref(n.maxHeight);e.watch(()=>r.value,async a=>{if(await e.nextTick(),a){const l=document.documentElement.offsetHeight;c.value=`${l-55-40-(o.footer?63:0)}px`}else c.value=n.maxHeight},{immediate:!0});const d=e.computed(()=>{if(n.maxHeight)return{height:e.unref(c)}});return(a,l)=>{const p=e.resolveComponent("FullScreen"),m=e.resolveComponent("el-icon"),f=e.resolveComponent("ElScrollbar"),g=e.resolveComponent("ElDialog");return e.openBlock(),e.createBlock(g,e.mergeProps({"close-on-click-modal":!1,"destroy-on-close":"",draggable:"","lock-scroll":"",class:"custom-dialog","append-to-body":""},a.$attrs,{fullscreen:r.value,width:t.width}),e.createSlots({default:e.withCtx(()=>[t.scroll?(e.openBlock(),e.createBlock(f,{key:0,style:e.normalizeStyle(d.value)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["style"])):e.renderSlot(a.$slots,"default",{key:1})]),_:2},[t.title?{name:"header",fn:e.withCtx(()=>[e.createElementVNode("div",A,[e.renderSlot(a.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),e.createElementVNode("div",{onClick:i},[e.createVNode(m,{class:"fullScreen"},{default:e.withCtx(()=>[e.createVNode(p)]),_:1})])])]),key:"0"}:void 0,o.footer?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"footer")]),key:"1"}:void 0]),1040,["fullscreen","width"])}}}),R={key:1},$=t=>{let o=t.label;if(t.label&&typeof t.label=="function"&&(o=t.label()),t.type.indexOf("select")>-1||t.type.indexOf("cascader")>-1||t.type.indexOf("date")>-1)return`请选择${o}`;if(t.type.indexOf("text")>-1||t.type.indexOf("number")>-1)return`请输入${o}`},D={valueFormat:"YYYY-MM-DD HH:mm:ss",format:"YYYY-MM-DD HH:mm:ss"},q=t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-option"),{label:n.label,value:n.value,key:n.value}))}},B={clearable:!0},N=[{type:"slider",component:"el-slider"},{type:"text",component:"el-input",attrs:{...B}},{type:"textarea",component:"el-input",attrs:{...B}},{type:"number",component:"el-input-number",attrs:{controlsPosition:"right"}},{type:"switch",component:"el-switch"},{type:"checkbox",component:"el-checkbox-group",slots:t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-checkbox"),{value:n.value},{default:()=>n.label}))}}},{type:"radio",component:"el-radio-group",slots:t=>{const{options:o}=t;return{default:()=>o?.map(n=>e.h(e.resolveComponent("el-radio"),{value:n.value},{default:()=>n.label}))}}},{type:"select",component:"el-select",slots:q},{type:"select-v2",component:"el-select-v2"},{type:"tree-select",component:"el-tree-select",attrs:{...B,checkStrictly:!0,renderAfterExpand:!0}},{type:"date,dates",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD"}},{type:"datetime,week",component:"el-date-picker",attrs:{showConfirm:!1,...D}},{type:"month,months",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY-MM",format:"YYYY-MM"}},{type:"year,years",component:"el-date-picker",attrs:{showConfirm:!1,valueFormat:"YYYY",format:"YYYY"}},{type:"datetimerange,daterange,monthrange,yearrange",component:"el-date-picker",attrs:{showConfirm:!1,rangeSeparator:"至",startPlaceholder:"开始日期",endPlaceholder:"结束日期",...D}},{type:"cascader",component:"el-cascader",attrs:{clearable:!0}},{type:"upload",component:"el-upload"},{type:"custom",component:"el-form-item"}],H=w(e.defineComponent({name:"EasyForm",__name:"index",props:e.mergeModels({inline:{type:Boolean,default:!0},formItems:{type:Array,default:()=>[]},labelWidth:{type:[String,Number],default:"120px"},itemWidth:{type:[String],default:"200px"}},{modelValue:{default:{},type:Object},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=e.useModel(t,"modelValue"),n=e.getCurrentInstance(),r=a=>{i(a,"formRef")},i=(a,l)=>{if(!a){delete n?.exposeProxy?.[l],delete n?.exposed?.[l];return}n.exposeProxy={...n?.exposed,[l]:a},n.exposed={...n?.exposed,[l]:a}},c=e.useSlots(),d=(a,l,p)=>{const{value:m,component:f,...g}=l,u=N.find(k=>!!a&&k.type.indexOf(a)>-1),b=u?.component==="el-select"&&l.props,y=l.options&&!b?u?.slots?.(l):{};if(!u&&!l.component)return new Error(`未找到type为${a}的组件且当前也未传递component`);const s=e.resolveDynamicComponent(u?.component||f);if(s)return e.h(s,{...u?.attrs,...g,placeholder:g.placeholder||$(l)},{...y,...p})};return(a,l)=>{const p=e.resolveComponent("el-form-item"),m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(m,e.mergeProps({model:o.value,"label-width":t.labelWidth,inline:t.inline,"scroll-to-error":!0},{...a.$attrs},{ref:r,class:"easy-form"}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,({id:f,type:g,rule:u,width:b,slots:y,...s},k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[g!="custom"&&!s.hidden?(e.openBlock(),e.createBlock(p,{prop:s.prop,key:k,"label-width":s.labelWidth,rules:u,required:s.required},{label:e.withCtx(()=>[s.label&&typeof s.label=="function"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.label),{key:0})):(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(s.label),1))]),default:e.withCtx(()=>[c[s.prop]?e.renderSlot(a.$slots,s.prop,{key:0,item:s},void 0,!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(g,{...s,type:g},y)),{key:1,modelValue:o.value[s.prop],"onUpdate:modelValue":C=>o.value[s.prop]=C,modelModifiers:{trim:!0},style:e.normalizeStyle({width:b||t.itemWidth})},null,8,["modelValue","onUpdate:modelValue","style"]))]),_:2},1032,["prop","label-width","rules","required"])):e.createCommentVNode("",!0),g=="custom"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[y?.[s.prop]?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(y[s.prop]),{key:0})):e.renderSlot(a.$slots,s.prop,{key:1,item:{width:b,rule:u,...s}},void 0,!0)],64)):e.createCommentVNode("",!0)],64))),256)),c.append?(e.openBlock(),e.createBlock(p,{key:0},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"append",{},void 0,!0)]),_:3})):e.createCommentVNode("",!0)]),_:3},16,["model","label-width","inline"])}}}),[["__scopeId","data-v-ebcd5674"]]),Y=w(e.defineComponent({name:"EasyTable",__name:"index",props:{data:{type:Array,required:!0,default:()=>[]},tableColumns:{type:Array,default:()=>[]},buttons:{type:Array,default:()=>[]},buttonWidth:{type:[Number,String],default:120},align:{type:String,default:"center"},height:{type:Number||String,default:void 0},maxHeight:{type:String||Number,default:void 0},footerHeight:{type:Number,default:65}},setup(t){const o=e.inject(z.configProviderContextKey),n=t,r=e.computed(()=>n.buttonWidth.toString().indexOf("px")>-1?n.buttonWidth.toString().slice(0,-2):n.buttonWidth),i=e.ref(),c=e.ref("auto");let d=e.getCurrentInstance();const a=()=>{let u="auto";if(d?.parent?.attrs?.class?.indexOf("content-wrap")>-1){let s=n.footerHeight;o?.value?.size==="small"?s=s-8:o?.value?.size==="large"&&(s=s+8);try{const k=d?.refs.tableRef,{top:C}=k?.getBoundingClientRect();u=document.documentElement.clientHeight-C-s-20}catch{}return u}return u},l=e.ref(),p=()=>{l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{c.value=a(),l.value=null},100)};e.onMounted(()=>{c.value=a(),window.addEventListener("resize",p)}),e.onUnmounted(()=>{window.removeEventListener("resize",p)});const m=e.resolveComponent("el-table-column"),f=e.useSlots(),g=u=>{const{slots:b={},children:y=[],...s}=u;if(y&&y.length>0){const k=y.map(C=>g(C));return e.h(m,{align:n.align,...s},{...b,default:()=>k})}return e.h(m,{align:n.align,...s},{default:k=>f[u.prop]&&f[u.prop](k),...b})};return(u,b)=>{const y=e.resolveComponent("el-button"),s=e.resolveComponent("el-table-column"),k=e.resolveComponent("el-table");return e.openBlock(),e.createElementBlock("div",{ref_key:"tableRef",ref:i},[e.createVNode(k,e.mergeProps({style:{width:"100%"}},u.$attrs,{data:t.data,height:t.height,maxHeight:t.maxHeight?t.maxHeight:c.value}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tableColumns,(C,S)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(C)),{key:S}))),128)),t.buttons&&t.buttons.length?(e.openBlock(),e.createBlock(s,{key:0,align:"center",fixed:"right",label:"操作",width:r.value},{default:e.withCtx(C=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttons,(S,ee)=>e.withDirectives((e.openBlock(),e.createBlock(y,e.mergeProps({ref_for:!0},{...S},{key:ee,type:S.type.includes("del")?"danger":"primary",onClick:()=>{S.click?.(C.row)},disabled:S.disabled?.(C.row)||!1,link:S.link?.(C.row)||!0}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.label),1)]),_:2},1040,["type","onClick","disabled","link"])),[[e.vShow,S.show?.(C.row)||!0]])),128))]),_:1},8,["width"])):e.createCommentVNode("",!0)]),_:1},16,["data","height","maxHeight"])],512)}}}),[["__scopeId","data-v-1c87357b"]]),U={name:"",components:{},props:{icon:{type:String,default:""}}};function X(t,o,n,r,i,c){return n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,class:"menu_icon"})):e.createCommentVNode("",!0)}const L=w(U,[["render",X],["__scopeId","data-v-261ce99a"]]),K=e.defineComponent({name:"subMenu",__name:"subMenu",props:{routeData:{type:Object,default:()=>({})}},emits:["handleMenuItemClick"],setup(t,{emit:o}){const n=o;function r(i){n("handleMenuItemClick",i)}return(i,c)=>{const d=e.resolveComponent("subMenu",!0),a=e.resolveComponent("el-sub-menu"),l=e.resolveComponent("el-menu-item");return t.routeData.children&&t.routeData.children.length>0?(e.openBlock(),e.createBlock(a,{key:0,index:t.routeData.path},{title:e.withCtx(()=>[e.createVNode(L,{icon:t.routeData.meta.icon},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(t.routeData.meta.title),1)]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.routeData.children,(p,m)=>(e.openBlock(),e.createBlock(d,{onHandleMenuItemClick:r,routeData:p,key:m},null,8,["routeData"]))),128))]),_:1},8,["index"])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:c[0]||(c[0]=p=>r(t.routeData))},[e.createVNode(l,{index:t.routeData.path},{title:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.routeData.meta.title),1)]),default:e.withCtx(()=>[e.createVNode(L,{icon:t.routeData.meta.icon},null,8,["icon"])]),_:1},8,["index"])]))}}}),V=e.defineComponent({name:"MenuTree",__name:"index",props:{menuList:{type:Array,default:()=>[]}},emits:["handleMenuItemClick"],setup(t,{emit:o}){const n=o,r=i=>{n("handleMenuItemClick",i)};return(i,c)=>{const d=e.resolveComponent("el-menu");return e.openBlock(),e.createBlock(d,e.normalizeProps(e.guardReactiveProps(i.$attrs)),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuList,a=>(e.openBlock(),e.createBlock(K,{routeData:a,onHandleMenuItemClick:r},null,8,["routeData"]))),256))]),_:1},16)}}}),G=e.defineComponent({name:"Pagination",__name:"index",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pagerCount:{type:Number,default:document.body.clientWidth<992?5:7},onPagination:{type:Function}},emits:["update:page","update:limit","pagination"],setup(t,{emit:o}){const n=t,r=o,i=e.computed({get(){return n.page},set(l){r("update:page",l)}}),c=e.computed({get(){return n.limit},set(l){r("update:limit",l)}}),d=l=>{i.value*l>n.total&&(i.value=1),r("pagination",{page:i.value,limit:l})},a=l=>{r("pagination",{page:l,limit:c.value})};return(l,p)=>{const m=e.resolveComponent("el-pagination");return e.withDirectives((e.openBlock(),e.createBlock(m,{"current-page":i.value,"onUpdate:currentPage":p[0]||(p[0]=f=>i.value=f),"page-size":c.value,"onUpdate:pageSize":p[1]||(p[1]=f=>c.value=f),background:!0,"page-sizes":[10,20,30,50,100],"pager-count":t.pagerCount,total:t.total,class:"pagination",layout:"total, sizes, prev, pager, next, jumper",onSizeChange:d,onCurrentChange:a},null,8,["current-page","page-size","pager-count","total"])),[[e.vShow,t.total>0]])}}}),P=w(G,[["__scopeId","data-v-1e34e383"]]),J=["onClick","onMouseover"],I=w(e.defineComponent({name:"EasyContextMenu",__name:"index",props:{menuList:{type:Array,default:()=>[]},maxHeight:{type:[String,Number],default:200},backgroundColor:{type:String,default:"#fff"},hoverItemStyle:{type:Object,default:()=>({backgroundColor:"#ddd"})},animationCurve:{type:String,default:"linear"}},setup(t){const o=t,n=e.ref(-1),r=e.ref(!1),i=e.ref({x:0,y:0}),c=m=>{r.value=!1,m.preventDefault(),m.stopPropagation(),setTimeout(()=>{r.value=!0;const{clientX:f,clientY:g}=m;i.value={x:f,y:g},d.value?.scrollTo(0,0)},0)},d=e.ref(null),a=e.ref(null);e.onMounted(()=>{const m=a.value?.parentElement;m?.addEventListener("contextmenu",c),document.addEventListener("click",()=>{r.value=!1}),m?.addEventListener("blur",()=>{console.log("blur"),r.value=!1})});const l=e.computed(()=>o.maxHeight=="auto"?"auto":o.maxHeight.toString().indexOf("px")>-1?o.maxHeight:`${o.maxHeight}px`),p=e.computed(()=>({backgroundColor:o.backgroundColor,left:`${i.value.x}px`,top:`${i.value.y}px`,maxHeight:r.value?l.value:"0px",transition:r.value?`max-height .2s ${o.animationCurve}`:"none"}));return(m,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextMenu",ref:a},[e.createElementVNode("div",e.mergeProps({class:"easy-context-menu"},m.$attrs,{style:{...e.unref(p)},ref_key:"menuListRef",ref:d}),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.menuList,(g,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,onContextmenu:f[0]||(f[0]=e.withModifiers(()=>{},["stop"])),onClick:g.onClick,onMouseover:b=>n.value=u,onMouseout:f[1]||(f[1]=b=>n.value=-1),style:e.normalizeStyle(e.unref(n)===u?o.hoverItemStyle:"")},e.toDisplayString(g.label),45,J))),128))],16)],512))}}),[["__scopeId","data-v-f9f5bc05"]]);class x{vnode=null;#e={bindEvent:!0};defaultStyle={position:"fixed","z-index":1e3,"border-radius":"4px",color:"#666","font-size":"14px","min-width":"100px","box-shadow":"1px 1px 11px 0px #a6b5ba","background-color":"#fff",padding:"4px",overflow:"hidden"};hoverStyle={"background-color":"#8f9f80ff"};menu=null;static#t=null;static getInstance(){return x.#t||(x.#t=new x),x.#t}constructor(){x.#t||(x.#t=this)}create(o){const n=x.getInstance();return n.vnode!==o.target&&n.destroy(),n.vnode=o.target||null,n.#e={...n.#e,...o},n.#o(),n}#o(){this.defaultStyle={...this.defaultStyle,...this.#e.style},this.hoverStyle={...this.hoverStyle,...this.#e.hoverStyle},this.vnode&&this.vnode?.addEventListener(this.#e.event||"contextmenu",this.showMenu),document.addEventListener("click",this.hideMenu),document.addEventListener("keydown",this.hideMenu)}destroy(){this.vnode?.removeEventListener(this.#e.event||"contextmenu",this.showMenu),document.removeEventListener("click",this.hideMenu),document.removeEventListener("keydown",this.hideMenu),this.resetContextMenu()}resetContextMenu(){this.#e.appendToBody?this.menu&&document.body.removeChild(this.menu):this.vnode?.contains(this.menu)&&this.menu&&this.vnode?.removeChild(this.menu),this.menu=null}#n(){this.menu&&(this.menu.style.transition="none",this.menu.style.maxHeight="0",this.menu.style.display="none")}setMenuList(o){this.#e.menuList=o}showMenu(o){x.#t.#l(o)}hideMenu(){x.#t.#n()}#l(o){if(o.preventDefault(),o.stopPropagation(),this.#e.menuList.length===0)return;if(this.vnode||(this.vnode=o.target),console.log(this,"this"),this.#n(),!this.menu){const d=document.createElement("div");d.className=this.#e.classNames||"",this.menu=d,this.#e.menuList.forEach(a=>{const l=document.createElement("div");if(!a.label&&a.divider){l.style="padding: 0; margin: 5px 0; border-top: 1px solid #e6e6e6;",d.appendChild(l);return}const p=";padding: 5px 10px; cursor: pointer;";if(l.style=p,l.innerText=a.label,a.disabled){l.style.cssText+="color: #ccc; cursor: not-allowed;",d.appendChild(l);return}d.appendChild(l),l.addEventListener("click",m=>{o.stopPropagation(),a.onClick&&a.onClick(m),this.#n()}),l.addEventListener("mouseover",()=>{l.style.cssText=Object.entries(this.hoverStyle).map(([m,f])=>`${m}:${f}`).join(";")+p}),l.addEventListener("mouseout",()=>{l.style=p})}),this.#e.appendToBody?document.body.appendChild(d):this.vnode?.appendChild(d)}const{clientX:n,clientY:r}=o,i={display:"block",...this.defaultStyle,left:`${n}px`,top:`${r}px`};let c=Object.entries(i).map(([d,a])=>`${d}:${a}`).join(";");this.menu.style.cssText=c,this.menu.style.transition="none",this.menu.style.maxHeight="0",setTimeout(()=>{this.menu&&(this.menu.style.maxHeight=`${this.#e.style?.["max-height"]||"200px"}`,this.menu.style.transition=`${this.#e.style?.transition||"max-height 0.1s ease-in-out"}`)},0),this.menu.scrollTo(0,0)}}const Q=x.getInstance(),Z=[_,E,M,H,Y,V,P,I],T=[],F=(t,o)=>{Z.forEach(n=>{T.push(n.name),t.component(n.name,n)}),console.log("mwl-components",T)},v={install:F};h.ContentWarp=E,h.ContextMenu=Q,h.Dialog=M,h.EasyButton=_,h.EasyContextMenu=I,h.EasyForm=H,h.EasyTable=Y,h.MenuTree=V,h.Pagination=P,h.componentsMap=N,h.default=v,h.getPlaceholder=$,h.install=F,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/mwl-components.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.el-card[data-v-fdaaba5e]{background-color:transparent;margin-bottom:10px}[data-v-fdaaba5e] .el-card__body:has(>.el-form){padding:18px 20px 0}[data-v-fdaaba5e] .el-card__body{padding:20px;height:100%}[data-v-fdaaba5e] .el-card__footer{padding:0 20px}.custom-dialog{padding:0;box-shadow:0 0 5px 0 var(--el-text-color-secondary)}.custom-dialog .el-dialog__header{padding:0}.dialog-header{--el-dialog-padding-primary: 20px;border-bottom:1px solid var(--el-border-color);padding:var(--el-dialog-padding-primary);padding-bottom:10px;padding-right:44px;display:flex;align-items:center;justify-content:space-between;color:var(--el-text-color-primary)}.dialog-header .fullScreen{cursor:pointer;z-index:99}.dialog-header .fullScreen:hover{color:var(--el-color-primary)}.el-dialog__headerbtn{--el-message-close-size: 20px;top:7px;margin-right:10px;width:20px}.el-dialog__body{padding:20px 30px}.el-dialog__footer{padding:10px 20px 20px;border-top:1px solid var(--el-border-color)}.is-hover:hover{color:var(--el-color-primary)}[data-v-ebcd5674] .el-form-item__label{font-size:var(--el-font-size-base)}.easy-form .el-form-item[data-v-ebcd5674]{margin-right:10px}[data-v-ebcd5674] .el-date-editor{flex-grow:initial}[data-v-1c87357b] .el-table,[data-v-1c87357b] th.el-table__cell,[data-v-1c87357b] tr{background-color:transparent!important}.menu_icon[data-v-261ce99a]{width:22px;height:22px;margin-right:5px;fill:currentColor;display:inline-block;font-size:16px}.pagination[data-v-1e34e383]{margin-top:15px;margin-bottom:15px;float:right}@media screen and (max-width: 1370px){.pagination[data-v-1e34e383]{margin-top:8px;margin-bottom:8px}}.easy-context-menu[data-v-f9f5bc05]{position:fixed;min-width:100px;z-index:1000;border-radius:4px;overflow:auto;color:#666;font-size:14px;box-shadow:1px 1px 11px #a6b5ba}.easy-context-menu div[data-v-f9f5bc05]{cursor:pointer;margin:5px;padding:4px 15px;border-radius:3px}
|