@vtj/ui 0.9.0-alpha.46 → 0.9.0-alpha.48

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/dist/index.mjs CHANGED
@@ -9,10 +9,10 @@ import { VXETable as jt, VxeGrid as rr, VxeTableFilterModule as al, VxeTableEdit
9
9
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
10
10
  * @name @vtj/ui
11
11
  * @author CHC chenhuachun1549@dingtalk.com
12
- * @version 0.9.0-alpha.46
12
+ * @version 0.9.0-alpha.48
13
13
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
14
14
  */
15
- const a2 = "0.9.0-alpha.46", gl = {
15
+ const a2 = "0.9.0-alpha.48", gl = {
16
16
  default: 14,
17
17
  small: 12,
18
18
  large: 18
package/dist/index.umd.js CHANGED
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/ui
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.9.0-alpha.46
5
+ * @version 0.9.0-alpha.48
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const K="0.9.0-alpha.46",Q={default:14,small:12,large:18},Et={icon:{type:[String,Object]},color:{type:String},size:{type:[Number,String],default:"inherit"},src:{type:String},background:{type:String},padding:{type:Number},radius:{type:Number}};function de(o){return typeof o=="string"?o:`${o}px`}function $e(o=0,e){if(typeof o=="number")return o;if(/(%|vh|vw)$/i.test(o)){const n=Number.parseInt(o);return Math.floor(e*n/100)}return Number.parseInt(o)}function st(o,e={}){const t=N({},e);return typeof o=="boolean"?t:Object.assign(t,o||{})}const Re="__VTJ_UI_INSTALLED__",he=Symbol("ADAPTER_KEY");function Pe(){const o=Vue.getCurrentInstance(),e=o==null?void 0:o.appContext.config.globalProperties.$adapter;return e||Vue.inject(he,{})}const Or={getCustom:o=>P(this,null,function*(){return VtjUtils.storage.get(o,{type:"local"})}),saveCustom:o=>P(this,null,function*(){VtjUtils.storage.save(o.id,o,{type:"local"})})},jr={install(o,e={}){const t=Object.assign(Or,e),{components:n=[],fieldEditors:r={}}=t;Jo(r);for(const l of n)l.name&&o.component(l.name,l);[ElementPlus.ElMessage,ElementPlus.ElMessageBox,ElementPlus.ElNotification].forEach(l=>{o.use(l)}),o.config.globalProperties.$adapter=t,o.provide(he,t)}},eo=(o=[])=>({install:(t,n={})=>{t[Re]||(t[Re]=!0,o.forEach(r=>{r.name&&t.component(r.name,r)}),n.adapter&&t.provide(he,n.adapter))}});let Ke;const to=new RegExp(`\\<script.*src=["'](?<src>[^"']+)`,"gm");let Ur=1e4;function Lr(){return P(this,null,function*(){var n;const o=yield fetch("?t="+Date.now()).then(r=>r.text());to.lastIndex=0;let e=[],t;for(;t=to.exec(o);)(n=t.groups)!=null&&n.src&&e.push(t.groups.src);return e})}function Hr(){return P(this,null,function*(){const o=yield Lr();if(!Ke)return Ke=o,!1;let e=!1;Ke.length!==o.length&&(e=!0);for(let t=0;t<Ke.length;t++)if(Ke[t]!==o[t]){e=!0;break}return Ke=o,e})}function Xr(){return P(this,null,function*(){(yield ElementPlus.ElMessageBox.confirm("系统发现新版本,请确认是否需要更新。如果确定,系统将会重新登录,请注意存档。",{title:"系统更新",type:"warning",closeOnClickModal:!1}).catch(()=>!1))&&(top||window).location.reload()})}function no(){setTimeout(()=>P(this,null,function*(){(yield Hr())&&(yield Xr()),no()}),Ur)}function Yr(){no()}const Kr=["src"],ge=Vue.defineComponent({name:"XIcon",__name:"Icon",props:Et,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),r=Vue.computed(()=>{if(!e.icon)return null;const i=n==null?void 0:n.appContext.app;return typeof e.icon=="object"?Vue.markRaw(e.icon):(i==null?void 0:i.component(e.icon))||e.icon}),l=Vue.computed(()=>{const i={"is-pointer":!!t.onClick};return!r.value&&e.icon&&(i[e.icon]=!0),i}),u=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?de(e.radius):void 0,padding:e.padding?de(e.padding):void 0})),a=Vue.computed(()=>{var i;return typeof e.size=="number"?e.size:(i=Q[e.size])!=null?i:void 0});return(i,s)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElIcon),{class:Vue.normalizeClass(["x-icon",l.value]),color:e.color,size:a.value,style:Vue.normalizeStyle(u.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(i.$slots,"default",{},()=>[r.value?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(r.value),{key:0})):Vue.createCommentVNode("",!0),e.src?(Vue.openBlock(),Vue.createElementBlock("img",{key:1,src:e.src},null,8,Kr)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),Gr={class:"x-menu__wrapper"},Wr={key:1,class:"x-menu__title"},qr={key:0,class:"x-menu__title"},oo=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,t=Vue.getCurrentInstance(),n=u=>{if(u){if(typeof u=="string"){const a=t==null?void 0:t.appContext.app;return(a==null?void 0:a.component(u))||e.defaultIcon||u}return u}},r=u=>typeof u=="object"?u:{value:u},l=(u=[])=>u.filter(a=>!a.hidden);return(u,a)=>e.item.children?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSubMenu),Vue.mergeProps({key:0,disabled:e.item.disabled},e.subMenu,{index:String(e.item.id)}),{title:Vue.withCtx(()=>[Vue.createElementVNode("div",Gr,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",Wr,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:2,class:"x-menu__badge"},r(e.item.badge)),{default:Vue.withCtx(()=>a[0]||(a[0]=[Vue.createElementVNode("i",null,null,-1)])),_:1},16)):Vue.createCommentVNode("",!0)])]),default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(l(e.item.children),i=>(Vue.openBlock(),Vue.createBlock(Vue.unref(oo),{key:i.id,item:i,subMenu:e.subMenu,defaultIcon:e.defaultIcon},null,8,["item","subMenu","defaultIcon"]))),128))]),_:1},16,["disabled","index"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenuItem),{key:1,index:String(e.item.id),disabled:e.item.disabled},{title:Vue.withCtx(()=>[e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",qr,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:1,class:"x-menu__badge"},r(e.item.badge)),{default:Vue.withCtx(()=>a[1]||(a[1]=[Vue.createElementVNode("i",null,null,-1)])),_:1},16)):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0)]),_:1},8,["index","disabled"]))}}),Ne=Vue.defineComponent({inheritAttrs:!1,name:"XMenu",__name:"Menu",props:{data:{default:()=>[]},subMenu:{},defaultIcon:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>t.data.filter(a=>!a.hidden)),l=(a,i)=>{const s=(c,d=[])=>{var m;for(const p of d){if(p.id.toString()===c.toString())return p;if((m=p.children)!=null&&m.length){const f=s(c,p.children);if(f)return f}}};return s(i,a)},u=a=>{const i=l(r.value,a);i&&n("select",i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenu),Vue.mergeProps({class:"x-menu"},a.$attrs,{onSelect:u}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,s=>(Vue.openBlock(),Vue.createBlock(Vue.unref(oo),{item:X(N({},s),{icon:s.icon}),defaultIcon:t.defaultIcon,subMenu:t.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),ln={name:{type:String},label:{type:String},value:{type:[String,Number,Object,Array,Boolean]},icon:{type:[String,Object]},mode:{type:String,default:"button"},menus:{type:Array},tooltip:{type:[String,Object]},badge:{type:[String,Number,Object]},dropdown:{type:Object},button:{type:Object},disabled:{type:[Boolean,Function]},size:{type:String,default:"default"},type:{type:String},background:{type:String,default:"always"},circle:{type:Boolean},draggable:{type:Boolean}};function Jr(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function Qr(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function Zr(o){return Vue.computed(()=>{const{dropdown:e,menus:t}=o;if(t&&t.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function ro(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const t=Vue.unref(o);if(t)if(typeof t=="string"||t.setup||t.render||Vue.isVNode(t)){const n=e==null?void 0:e.appContext.app;return{icon:typeof t=="string"&&(n==null?void 0:n.component(t))||t}}else return t;return null})}function Fe(o){const e=ro(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(ge,e.value)})):void 0}function St(o,e){return Vue.computed(()=>{const t=Vue.unref(o);return typeof t=="function"?t(e):!!t})}function lo(o,e,t){const n=Vue.shallowRef(e),r=Vue.ref(!1),l=a=>P(this,null,function*(){const i=Vue.unref(o);return i?typeof i=="function"?yield i(a):i:e}),u=a=>P(this,null,function*(){return r.value=!0,yield l(a).then(i=>(n.value=i||e,r.value=!1,Vue.unref(n)))});return Vue.watch(()=>o,()=>{u(t)},{immediate:!0}),t&&Vue.watch(t,()=>{u(t)}),{data:n,loading:r,loader:u}}function el(o=1e3){const e=Vue.ref(0);let t;const n=()=>{t=VtjUtils.rAF(()=>{++e.value,e.value<o&&n()})};return Vue.onMounted(n),Vue.onUnmounted(()=>{t&&VtjUtils.cAF(t)}),r=>e.value>=r}function ao(o=[]){const e=Vue.useSlots();return Object.keys(e).filter(t=>!o.includes(t))}const tl={key:0},nl=Vue.defineComponent({__name:"Trigger",props:ln,emits:["click"],setup(o,{emit:e}){const t=o,n=e,r=Fe(Vue.toRef(t,"icon")),l=St(Vue.toRef(t,"disabled")),u=Vue.computed(()=>({[`is-${t.mode}`]:!!t.mode,[`is-${t.type}`]:!!t.type,[`is-${t.size}`]:!!t.size&&t.size!=="default",[`is-background-${t.background}`]:t.mode==="icon"&&!!t.background,"is-disabled":!!t.disabled,"is-circle":!!t.circle})),a=i=>{if(i.preventDefault(),!l.value)return n("click"),!1};return(i,s)=>t.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(r),type:t.type,size:t.size,disabled:Vue.unref(l)},t.button,{onClick:a}),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(i.label),1)]),_:1},16,["icon","type","size","disabled"])):(Vue.openBlock(),Vue.createElementBlock("div",{key:1,class:Vue.normalizeClass(["x-action__inner",u.value]),onClick:a},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(r)))),i.label?(Vue.openBlock(),Vue.createElementBlock("span",tl,Vue.toDisplayString(i.label),1)):Vue.createCommentVNode("",!0)],2))}}),ol=["draggable"],te=Vue.defineComponent({name:"XAction",__name:"Action",props:ln,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const t=o,n=Vue.useSlots(),r=e,l=Jr(t),u=Qr(t),a=Zr(t),i=St(Vue.toRef(t,"disabled")),s=Vue.computed(()=>!!t.draggable&&!i.value),c=Vue.computed(()=>({[`x-action--${t.mode}`]:!!t.mode})),d=()=>{i.value||r("click",Vue.toRaw(t))},m=w=>{var C;if(i.value)return;const v=(C=t.menus)==null?void 0:C.find(S=>S.command===w);v&&r("command",Vue.toRaw(v))},p=w=>{s&&r("dragstart",Vue.toRaw(t),w)},f=w=>{s&&r("dragend",Vue.toRaw(t),w)},V=w=>Vue.h(ElementPlus.ElBadge,u.value,()=>[].concat(w)),h=w=>Vue.h(ElementPlus.ElDropdown,X(N({},a.value),{disabled:i.value,onCommand:m}),{default:()=>[w],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(t.menus||[]).map((v,C)=>Vue.h(ElementPlus.ElDropdownItem,v,()=>n.item?n.item({item:v,index:C}):v.label)))]}),y=w=>Vue.h(ElementPlus.ElTooltip,X(N({},l.value),{disabled:i.value}),()=>[w]),g=Vue.computed(()=>{var C;let w=Vue.h(Vue.markRaw(nl),X(N({},t),{onClick:d}));const v=(C=n.default)==null?void 0:C.call(n);return v&&v.length&&(w=v[0]),u.value&&(w=V(w)),a.value&&(w=h(w)),l.value&&(w=y(w)),w});return(w,v)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-action",c.value]),draggable:s.value,onDragstart:p,onDragend:f},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(g.value)))],42,ol))}}),uo={items:{type:Array},mode:{type:String,default:"button"},size:{type:String,default:"default"},type:{type:String},background:{type:String,default:"always"},circle:{type:Boolean},disabled:{type:[Boolean,Function]},tooltip:{type:Object},badge:{type:Object},dropdown:{type:Object},button:{type:Object}},Oe=Vue.defineComponent({name:"XActionBar",__name:"ActionBar",props:uo,emits:["click","command"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>(t.items||[]).map(a=>a==="|"?a:X(N({},a),{badge:a.badge?N(N({},t.badge),typeof a.badge=="object"?a.badge||{}:{value:a.badge}):void 0,tooltip:a.tooltip?N(N({},t.tooltip),typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}):void 0}))),l=a=>{n("click",a)},u=(a,i)=>{n("command",a,i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-action-bar",align:"center"},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,s=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[s==="|"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:0,direction:"vertical",class:"x-action-bar__divider"})):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),Vue.mergeProps({key:1,mode:t.mode,size:t.size,type:t.type,circle:t.circle,background:t.background,button:t.button,dropdown:t.dropdown,disabled:Vue.unref(St)(t.disabled,s).value,ref_for:!0},s,{onClick:l,onCommand:c=>u(s,c)}),null,16,["mode","size","type","circle","background","button","dropdown","disabled","onCommand"]))],64))),256))]),_:1}))}}),io={tag:{type:String,default:"div"},fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},flex:{type:Boolean,default:!0},inline:{type:Boolean},direction:{type:String,default:"row"},wrap:{type:String,default:"nowrap"},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},alignContent:{type:String,default:"stretch"},grow:{type:Boolean,default:!1},shrink:{type:Boolean,default:!1},alignSelf:{type:String,default:"auto"},overflow:{type:String},padding:{type:Boolean,default:!1},gap:{type:Boolean},autoPointer:{type:Boolean}},$=Vue.defineComponent({name:"XContainer",__name:"Container",props:io,setup(o,{expose:e}){const t=o,n=Vue.useAttrs(),r=Vue.getCurrentInstance(),l=Vue.ref(),u=Vue.computed(()=>{var c;return(c=l.value)==null?void 0:c.$el}),a=Vue.computed(()=>{const c=r==null?void 0:r.parent;if(!c)return!1;const d=c.proxy;return d.$options.name==="XContainer"||!!d.flex}),i=Vue.computed(()=>{var c;return{"is-fit":t.fit,"is-flex":t.flex&&!t.inline,"is-inline-flex":t.flex&&t.inline,[`is-direction-${t.direction}`]:t.flex&&t.direction!=="row",[`is-wrap-${t.wrap}`]:t.flex&&t.wrap!=="nowrap",[`is-justify-${t.justify}`]:t.flex&&t.justify!=="flex-start",[`is-align-${t.align}`]:t.flex&&t.align!=="flex-start",[`is-align-content-${t.alignContent}`]:t.flex&&t.alignContent!=="stretch","is-grow":(c=t.grow)!=null?c:a.value,"is-shrink":t.shrink,[`is-align-self-${t.alignSelf}`]:a.value&&t.alignSelf!=="auto",[`is-overflow-${t.overflow}`]:!!t.overflow,"is-padding":!!t.padding,"is-pointer":t.autoPointer&&!!n.onClick,"is-gap":!!t.gap}}),s=Vue.computed(()=>{const{width:c,height:d,fit:m}=t;return m?null:{width:c?de(c):void 0,height:d?de(d):void 0}});return e({$vtjEl:u}),(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.tag),{ref_key:"elRef",ref:l,class:Vue.normalizeClass(["x-container",i.value]),style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(c.$slots,"default")]),_:3},8,["class","style"]))}}),so={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},rl={class:"x-header__content"},ll={key:0,class:"x-header__actions"},an=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:so,setup(o){const e=o,t=Fe(Vue.toRef(e,"icon")),n=Vue.useAttrs(),r=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!n.onClick}));return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-header",r.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",r.value]),grow:"",onClick:Vue.unref(n).onClick},{default:Vue.withCtx(()=>[Vue.unref(t)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(t)),{key:0,class:"x-header__icon",onClick:Vue.unref(n).onClickIcon||Vue.unref(n).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",rl,[Vue.renderSlot(l.$slots,"default",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.content),1)])]),e.more?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:1,class:"x-header__more",icon:Vue.unref(VtjIcons.ArrowRight)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.subtitle||l.$slots.subtitle?(Vue.openBlock(),Vue.createElementBlock("span",{key:2,class:"x-header__subtitle",onClick:u[0]||(u[0]=(...a)=>Vue.unref(n).onClick&&Vue.unref(n).onClick(...a))},[Vue.renderSlot(l.$slots,"subtitle",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.subtitle),1)])])):Vue.createCommentVNode("",!0)]),_:3},8,["class","onClick"]),l.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",ll,[Vue.renderSlot(l.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),co={fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},border:{type:Boolean,default:!0},radius:{type:Boolean,default:!0},card:{type:Boolean},size:{type:String},shadow:{type:String},header:{type:[String,Object]},body:{type:Object},footer:{type:Object}},Ge=Vue.defineComponent({name:"XPanel",__name:"Panel",props:co,setup(o,{expose:e}){const t=o,n=Vue.ref(),r=Vue.computed(()=>({"x-panel--card":!!t.card,"x-panel--default":!t.card,[`is-${t.size}`]:!!t.size&&t.size!=="default","is-border":!!t.border,"is-radius":!!t.radius,[`is-shadow-${t.shadow}`]:!!t.shadow&&t.shadow!=="none"})),l=Vue.computed(()=>t.header===null?null:typeof t.header=="string"?{content:t.header,size:t.size}:X(N({},t.header),{size:t.size})),u=Vue.computed(()=>t.fit||t.height?"auto":void 0);return e({bodyRef:n}),(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-panel",r.value]),direction:"column",fit:t.fit,width:t.width,height:t.height},{default:Vue.withCtx(()=>[l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(an),Vue.normalizeProps(Vue.guardReactiveProps(l.value)),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"title")]),actions:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"actions")]),_:3},16)])]),_:3})):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref($),Vue.mergeProps({ref_key:"bodyRef",ref:n,flex:!1,overflow:u.value,grow:"",padding:"",class:"x-panel__body"},t.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref($),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},t.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),fo="user-select-none";class un{constructor(e,t={}){Be(this,"scope");Be(this,"dragging",!1);this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}getHandle(){const{selector:e,handle:t}=this.options;return e?this.el.querySelector(e):t}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:t}=this,{disabled:n,delay:r=150,onStart:l,onEnd:u}=t;if(n)return;let a=null;const i=this.getHandle(),s=this.getTarget();let c=e.getBoundingClientRect(),d=null;const{x:m,y:p}=VueUse.useDraggable(e,X(N({initialValue:{x:c.x,y:c.y}},t),{handle:i,onStart:(f,V)=>{document.body.classList.add(fo),clearTimeout(a),a=setTimeout(()=>{this.dragging=!0,c=e.getBoundingClientRect(),d=s==null?void 0:s.getBoundingClientRect(),l&&l(f,V)},r)},onEnd:(f,V)=>{if(clearTimeout(a),document.body.classList.remove(fo),this.dragging&&d){this.dragging=!1;const{x:h,y}=f,g=this.getPosition(d,c,h,y);u&&u(g,V),d=null}}}));Vue.watch([m,p],()=>{if(this.dragging&&d){const f=this.getPosition(d,c,m.value,p.value);e.style.left=`${f.x}px`,e.style.top=`${f.y}px`}})}getPosition(e,t,n,r){const{edge:l=50}=this.options,u=-t.width+e.x+l,a=e.width+e.x-l,i=e.y,s=e.height+e.y-l,c=Math.min(a,Math.max(n,u)),d=Math.min(s,Math.max(r,i));return{x:c-e.x,y:d-e.y}}destory(){this.scope.stop()}}const po={mounted(o,e){const t=e.value||{},n=new un(o,t);o.__draggable__=n},updated(o,e){const t=e.value||{};let n=o.__draggable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__draggable__=new un(o,t))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},sn="user-select-none";class cn{constructor(e,t={}){Be(this,"scope");Be(this,"resizing",Vue.ref(!1));Be(this,"direction",Vue.ref(""));Be(this,"MIE",null);Be(this,"cleanMousedown");Be(this,"cleanMouseup");this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}init(){const{el:e,options:t}=this,{disabled:n,onStart:r,onEnd:l}=t;if(n)return;this.MIE=VueUse.useMouseInElement(e),this.cleanMousedown=VueUse.useEventListener(document,"mousedown",()=>{var i;(i=this.direction)!=null&&i.value&&this.MIE&&(this.resizing.value=!0,e.classList.add("is-resizing",`is-${this.direction.value}-resizing`),r&&r(this.direction.value,this.MIE))}),this.cleanMouseup=VueUse.useEventListener(document,"mouseup",()=>{var i;this.resizing.value&&((i=this.direction)!=null&&i.value)&&this.MIE&&(e.classList.remove("is-resizing",`is-${this.direction.value}-resizing`),l&&l(this.direction.value,this.MIE)),this.resizing.value=!1}),Vue.watch(this.direction,i=>{const s=document.body;s.style.cursor=i?`${i}-resize`:"",i?s.classList.add(sn):s.classList.remove(sn)});const{x:u,y:a}=this.MIE;Vue.watch([u,a],()=>{this.resizing.value?this.resize():this.direction.value=this.getDirection()})}resize(){const{MIE:e,direction:t,resizing:n,options:r,el:l}=this,u=(t==null?void 0:t.value)||"";if(!e||!n.value||!u)return;const{x:a,y:i,elementX:s,elementY:c,elementHeight:d,elementWidth:m}=e,{onResizing:p}=r,{minWidth:f=0,minHeight:V=0,maxWidth:h=99999,maxHeight:y=99999}=r;if(u.includes("e")){const g=Math.min(Math.max(s.value,f),h);l.style.width=`${g}px`}if(u.includes("s")){const g=Math.min(Math.max(c.value,V),y);l.style.height=`${g}px`}if(u.includes("w")){const g=Math.min(Math.max(m.value-s.value,f),h);l.style.width=`${g}px`,l.style.left=`${a.value}px`}if(u.includes("n")){const g=Math.min(Math.max(d.value-c.value,V),y);this.el.style.height=`${g}px`,this.el.style.top=`${i.value}px`}p&&p(u,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:t,elementHeight:n,elementWidth:r,isOutside:l}=this.MIE;if(l.value)return"";const{dirs:u=["n","s","w","e"],edge:a=5}=this.options;let i="";return u.includes("n")&&t.value<=a?i+="n":u.includes("s")&&t.value>n.value-a&&(i+="s"),u.includes("w")&&e.value<=a?i+="w":u.includes("e")&&e.value>r.value-a&&(i+="e"),i}destory(){var t;const e=document.body;e.style.cursor="",e.classList.remove(sn),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),(t=this.MIE)==null||t.stop(),this.scope.stop()}}const dn={mounted(o,e){const t=e.value||{},n=new cn(o,t);o.__resizable__=n},updated(o,e){const t=e.value||{};let n=o.__resizable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__resizable__=new cn(o,t))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},mo={modelValue:{type:Boolean,default:!0},title:{type:String},subtitle:{type:String},icon:{type:[String,Object]},size:{type:String,default:"default"},width:{type:[Number,String],default:"70%"},height:{type:[Number,String],default:"70%"},left:{type:[Number,String]},top:{type:[Number,String]},modal:{type:Boolean,default:!0},draggable:{type:[Boolean,Object],default:!0},resizable:{type:[Boolean,Object]},closable:{type:Boolean,default:!0},maximizable:{type:Boolean,default:!1},minimizable:{type:Boolean,default:!1},mode:{type:String,default:"normal"},content:{type:Object},src:{type:String},componentInstance:{type:Object},beforeClose:{type:Function},submit:{type:[Boolean,String]},cancel:{type:[Boolean,String]},bodyPadding:{type:Boolean,default:!0},primary:{type:Boolean},pure:{type:Boolean}};let We=1e3;function al(o,e){const{width:t,height:n}=VueUse.useElementSize(e),r=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++We,dragging:!1,resizing:!1});return Vue.watch([t,n],([l,u])=>{r.wrapperWidth=l,r.wrapperHeight=u,r.width=$e(o.width,l),r.height=$e(o.height,u),r.left=o.left?$e(o.left,l)-r.width/2:Math.max(Math.floor((l-r.width)/2),0),r.top=o.top?$e(o.top,u):Math.max(Math.floor((u-r.height)/2),0)}),Vue.watch(r,l=>{We=Math.max(l.zIndex,We)}),{state:r,normal:Vue.computed(()=>r.mode==="normal"),maximized:Vue.computed(()=>r.mode==="maximized"),minimized:Vue.computed(()=>r.mode==="minimized")}}function ul(o,e){const t=Vue.computed(()=>{const{width:a,height:i,top:s,left:c,zIndex:d}=e;return{width:`${a}px`,height:`${i}px`,top:`${s}px`,left:`${c}px`,zIndex:d}}),n=Vue.computed(()=>{const{zIndex:a}=e;return{zIndex:a}}),r=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary,"is-pure":!!o.pure})),l=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),u=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:t,classes:r,wrapperClass:l,modalStyle:u,zIndexStyle:n}}function il(o,e,t){const n=c=>{e.mode=c,["maximized","minimized","normal"].includes(c)&&t(c),t("modeChange",c)},r=()=>P(this,null,function*(){(!o.beforeClose||(yield o.beforeClose()))&&(t("update:modelValue",!1),t("close"),t("destroy"))});return{close:r,changeMode:n,show:()=>n("normal"),hide:()=>n("minimized"),active:c=>{const d=c.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++We))},submit:()=>t("submit"),cancel:()=>{t("cancel"),r()}}}function sl(o,e,t,n){return Vue.computed(()=>{var l;const r=typeof o.draggable=="boolean"?!o.draggable:!!((l=o.draggable)!=null&&l.disabled);return X(N({},VtjUtils.isObject(o.draggable)?o.draggable:{}),{disabled:r,target:n,selector:".x-panel__header",onStart(u){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++We),t("dragStart",u)},onMove(u){t("dragging",u)},onEnd(u){if(e.mode==="maximized")return;const{x:a,y:i}=u;e.left=a,e.top=i,e.dragging=!1,t("dragEnd",u)}})})}function cl(o,e,t){return Vue.computed(()=>{var r;const n=typeof o.resizable=="boolean"?!o.resizable:!!((r=o.resizable)!=null&&r.disabled);return X(N({minWidth:200,minHeight:150},VtjUtils.isObject(o.resizable)?o.resizable:{}),{disabled:n,dirs:["e","s","w"],onStart(l,u){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++We),t("resizeStart",l,u)},onResizing(l,u){t("resizing",l,u)},onEnd(l,u){const a=document.body.getBoundingClientRect();e.left=u.elementPositionX.value-a.x,e.top=u.elementPositionY.value-a.y,e.width=u.elementWidth.value,e.height=u.elementHeight.value,e.resizing=!1,t("resizeEnd",l,u)}})})}function dl(o,e){const t=o.componentInstance;if(!t)return;let n=null;return Vue.onMounted(()=>{const r=Vue.unref(e),l=Vue.unref(r==null?void 0:r.bodyRef);n=t.$el,l&&l.$el&&l.$el.appendChild(n)}),Vue.onUnmounted(()=>{n&&n.parentNode&&n.parentNode.removeChild(n)}),{componentInstance:t}}const fl=["src"],qe=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:mo,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:t}){const n=o,r=t,l=Vue.getCurrentInstance(),u=Vue.ref(),a=Vue.ref(),{state:i,maximized:s,minimized:c,normal:d}=al(n,u),{styles:m,classes:p,wrapperClass:f,modalStyle:V,zIndexStyle:h}=ul(n,i),{changeMode:y,active:g,close:w,show:v,hide:C,submit:S,cancel:b}=il(n,i,r),T=sl(n,i,r,u),z=cl(n,i,r),j=dl(n,a);Vue.watchEffect(()=>P(this,null,function*(){n.modelValue?(yield Vue.nextTick(),l&&(r("open",l),document.body.classList.add("x-dialog-visible"))):document.body.classList.remove("x-dialog-visible")})),Vue.onUnmounted(()=>{document.body.classList.remove("x-dialog-visible")});const H=Vue.computed(()=>{var L;return(L=a.value)==null?void 0:L.$el});return e({$vtjEl:H,panelRef:a,state:i,maximized:s,minimized:c,changeMode:y,show:v,hide:C,submit:S,cancel:b,close:w,componentInstance:j}),(L,F)=>n.modelValue?(Vue.openBlock(),Vue.createBlock(Vue.Teleport,{key:0,to:"body"},[Vue.createElementVNode("div",{ref_key:"wrapper",ref:u,class:Vue.normalizeClass(["x-dialog__wrapper",Vue.unref(f)]),style:Vue.normalizeStyle(Vue.unref(h))},[n.modal?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-dialog__modal",style:Vue.normalizeStyle(Vue.unref(V))},null,4)):Vue.createCommentVNode("",!0),Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(Ge),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(p)],card:"",shadow:"always",header:{icon:n.icon,subtitle:n.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(m),size:n.size,body:{padding:n.bodyPadding},onClick:Vue.unref(g)},L.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"actions"),n.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[0]||(F[0]=ne=>Vue.unref(y)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.maximizable?(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:1},[Vue.unref(d)?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:1,icon:Vue.unref(VtjIcons.Maximize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[2]||(F[2]=ne=>Vue.unref(y)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Popup),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[1]||(F[1]=ne=>Vue.unref(y)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),n.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:n.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(w)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"default",{},()=>[n.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.content),{key:0})):Vue.createCommentVNode("",!0),n.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:n.src,class:"x-dialog__frame"},null,8,fl)):Vue.createCommentVNode("",!0)])]),_:2},[n.cancel||n.submit||L.$slots.footer||L.$slots.extra||L.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref($),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref($),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"handle"),n.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:n.size,onClick:Vue.unref(b)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.cancel=="string"?n.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),n.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:n.size,onClick:Vue.unref(S)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.submit=="string"?n.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(po),Vue.unref(T)],[Vue.unref(dn),Vue.unref(z)]])],6)])):Vue.createCommentVNode("",!0)}});function xt(o,e){const t=document.createElement("div"),n=Vue.createVNode(qe,o);n.appContext=e!=null?e:xt._context,Vue.render(n,t);const r=()=>{var l;Vue.render(null,t),(l=t.parentNode)==null||l.removeChild(t)};return n.props.onDestroy=()=>{r()},document.body.appendChild(t),{vnode:n,destroy:r}}const pl=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(t,n)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"brand"),Vue.createVNode(Vue.unref($),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),n[0]||(n[0]=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1))]),_:3})]),_:3},8,["class"])),[[Vue.unref(dn),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),ml=Vue.defineComponent({__name:"SwitchBar",props:{collasped:{type:Boolean,default:!1},favorite:{type:Boolean,default:!1},keyword:{}},emits:["update:collasped","update:keyword","update:favorite"],setup(o,{emit:e}){const t=o,n=e,r=Vue.ref(!1),l=Vue.ref(""),u=Vue.ref(!1),a=()=>{r.value=!0},i=()=>{l.value="",r.value=!1,n("update:keyword",l.value)},s=()=>{n("update:collasped",!t.collasped)},c=()=>{n("update:keyword",l.value)},d=()=>{n("update:favorite",u.value)};return(m,p)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,class:"x-mask-switch-bar__left",grow:""},{default:Vue.withCtx(()=>[r.value?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{key:0,modelValue:u.value,"onUpdate:modelValue":p[0]||(p[0]=f=>u.value=f),class:"x-mask-switch-bar__switch","active-icon":Vue.unref(VtjIcons.StarFilled),"inactive-icon":Vue.unref(VtjIcons.Menu),onChange:d},null,8,["modelValue","active-icon","inactive-icon"])),r.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{key:1,modelValue:l.value,"onUpdate:modelValue":p[1]||(p[1]=f=>l.value=f),class:"x-mask-switch-bar__input",size:"small",placeholder:"请输入查询关键字",onInput:c,"prefix-icon":Vue.unref(VtjIcons.Search)},{suffix:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ge),{icon:Vue.unref(VtjIcons.Close),onClick:i},null,8,["icon"])]),_:1},8,["modelValue","prefix-icon"])):Vue.createCommentVNode("",!0)]),_:1})),Vue.createVNode(Vue.unref($),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":t.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!r.value&&!t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Search),mode:"icon",background:"hover",size:"default",circle:"",onClick:a},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:1,icon:Vue.unref(VtjIcons.Expand),mode:"icon",size:"default",background:"hover",onClick:s,circle:""},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.Fold),mode:"icon",size:"default",background:"hover",circle:"",onClick:s},null,8,["icon"]))]),_:1},8,["class"])]),_:1}))}}),Vl=["src"],hl={key:0},gl=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,t=VueRouter.useRouter(),n=()=>{e.url&&t.push(e.url)};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:n},{default:Vue.withCtx(()=>[Vue.renderSlot(r.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,Vl)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref($),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",hl,[Vue.renderSlot(r.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),Bt="__favorites__",Pt="__search__",vl=Vue.defineComponent({__name:"Menu",props:{collapse:{type:Boolean,default:!1},keyword:{},favorite:{type:Boolean},favorites:{},flatMenus:{},menus:{},active:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=Vue.computed(()=>t.menus||[]),r=e,l=Vue.computed(()=>{var s;return String((s=t.active)==null?void 0:s.id)}),u=Vue.computed(()=>{var s;return[{id:Bt,title:"收藏",icon:VtjIcons.Star,children:(s=t.favorites)!=null&&s.length?t.favorites:[{id:Bt+"empty",disabled:!0,title:"暂无收藏菜单"}]}]}),a=Vue.computed(()=>{const s=(t.keyword||"").trim(),c=s?(t.flatMenus||[]).filter(d=>{var m;return(m=d.title)==null?void 0:m.includes(s)}):[];return[{id:Pt,title:"搜索",icon:VtjIcons.Search,children:c!=null&&c.length?c:[{id:Pt+"empty",disabled:!0,title:"查询匹配不到菜单项"}]}]}),i=s=>{r("select",s)};return(s,c)=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[Vue.withDirectives(Vue.createVNode(Vue.unref($),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,onSelect:i},null,8,["data","default-icon","default-active"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,onSelect:i},null,8,["data","default-icon","default-active"]),[[Vue.vShow,!t.collapse]]),n.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!t.favorite&&!t.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref($),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:u.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:u.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512),[[Vue.vShow,t.favorite&&!t.keyword]]),t.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Pt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Pt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512)),[[Vue.vShow,!!t.keyword]]):Vue.createCommentVNode("",!0)],64))}}),yl="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1711803009570'%20class='icon'%20viewBox='0%200%201280%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1500'%20width='320'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M557.85%201023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45%2017.4c3.6-12.8%2017-20%2029.8-16.4l122%2035.4c12.8%203.6%2020%2017%2016.4%2029.8L587.65%201006.6c-3.8%2012.8-17%2020.2-29.8%2016.4z%20m-228-224.4l87-92.8c9.2-9.8%208.6-25.4-1.6-34.4L234.05%20512l181.2-159.4c10.2-9%2011-24.6%201.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65%20494.4c-10.2%209.4-10.2%2025.6%200%2035l288.2%20270.2c9.8%209.2%2025%208.8%2034-1z%20m654.4%201.2l288.2-270.2c10.2-9.4%2010.2-25.6%200-35L984.25%20224.2c-9.6-9-24.8-8.6-34%201L863.25%20318c-9.2%209.8-8.6%2025.4%201.6%2034.4L1046.05%20512l-181.2%20159.4c-10.2%209-11%2024.6-1.6%2034.4l87%2092.8c9%209.8%2024.2%2010.2%2034%201.2z'%20fill='%230157fe'%20p-id='1501'%3e%3c/path%3e%3c/svg%3e",Vo=140,ho={logo:{type:String,default:yl},title:{type:String,default:"VTJ.PRO"},menus:{type:[Array,Function],default(){return[]}},favorites:{type:[Array,Function],default(){return[]}},menuAdapter:{type:Function},home:{type:[String,Object],default:"/"},tabs:{type:Number,default:20},actions:{type:Array},avatar:{type:String},theme:{type:Boolean},disabled:{type:Boolean},addFavorite:{type:Function},removeFavorite:{type:Function},userCardWidth:{type:Number,default:350},pure:{type:Boolean}},fn=Symbol(),pn="$mask",wl={class:"x-mask-tabs__trigger"},bl={key:1},Cl=["onDragstart","onDragend"],_l={key:1},kl=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const t=o,n=e,r=c=>{const d=!!t.favorites.find(m=>{var p;return m===c.menu||m.id===((p=c.menu)==null?void 0:p.id)});return[{icon:VtjIcons.Refresh,label:"刷新",name:"refresh",value:c},"|",{icon:d?VtjIcons.StarFilled:VtjIcons.Star,label:"收藏",name:"favorite",value:c.menu,disabled:!c.menu||!!c.menu.hidden},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:c}]},l=c=>{const d=c.paneName;if(d===t.home.id){n("click",t.home);return}const m=t.tabs.find(p=>p.id===d);m&&n("click",m)},u=c=>{const d=t.tabs.find(m=>m.id===c);d&&n("remove",d)},a=c=>{switch(c.name){case"refresh":n("refresh",c.value);break;case"favorite":n("toggleFavorite",c.value);break;case"dialog":n("dialog",c.value);break}},i=(c,d)=>{d.dataTransfer&&(d.dataTransfer.setData("tab",c.id),d.target&&d.target.classList.add("is-dagging"))},s=(c,d)=>{d.target&&d.target.classList.remove("is-dagging")};return(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{ref:"tabsRef",class:"x-mask-tabs",height:"100%",grow:"",flex:"",justify:"flex-end",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElTabs),{type:"card","model-value":t.value,onTabRemove:u,onTabClick:l},{default:Vue.withCtx(()=>[t.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:t.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",wl,[t.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Fe)(t.home.icon)),{key:0})):Vue.createCommentVNode("",!0),t.home.title?(Vue.openBlock(),Vue.createElementBlock("span",bl,Vue.toDisplayString(t.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.tabs,m=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:m.id,name:m.id,lazy:"",closable:""},{label:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElPopover),{"open-delay":500,placement:"bottom",trigger:"hover",width:"200px",disabled:m.id!==t.value},{reference:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:"x-mask-tabs__trigger",draggable:"true",onDragstart:p=>i(m,p),onDragend:p=>s(m,p)},[m.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Fe)(m.icon)),{key:0})):Vue.createCommentVNode("",!0),m.title?(Vue.openBlock(),Vue.createElementBlock("span",_l,Vue.toDisplayString(m.title),1)):Vue.createCommentVNode("",!0)],40,Cl)]),default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Oe),{items:r(m),mode:"text",size:"small",type:"info",onClick:a},null,8,["items"])]),_:2},1032,["disabled"])]),_:2},1032,["name"]))),128))]),_:1},8,["model-value"])]),_:1},512))}}),El=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark(),t=Vue.computed(()=>e.value?VtjIcons.Sunny:VtjIcons.Moon),n=()=>{e.value=!e.value};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{icon:t.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",type:"primary",onClick:n},null,8,["icon"]))}}),Sl={class:"x-mask-toolbar__menu-item"},xl=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>{const s=t.tabs.map((c,d)=>({divided:d===0,label:c.title,command:c}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...s]}),l=s=>{n("closeTab",s.command)},u=s=>{switch(s.command){case"all":n("closeAllTabs");break;case"other":n("closeOtherTabs");break;default:n("clickTab",s.command);break}},a=s=>{n("actionClick",s)},i=(s,c)=>{n("actionCommand",s,c)};return(s,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask-toolbar",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(te),{icon:Vue.unref(VtjIcons.MoreFilled),menus:r.value,dropdown:{size:"small"},type:"primary",mode:"icon",circle:"",background:"hover",onCommand:u},{item:Vue.withCtx(({item:d})=>[Vue.createElementVNode("span",Sl,[Vue.createTextVNode(Vue.toDisplayString(d.label)+" ",1),["other","all"].includes(d.command)?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,onClick:Vue.withModifiers(m=>l(d),["stop"]),icon:Vue.unref(VtjIcons.Close)},null,8,["onClick","icon"]))])]),_:1},8,["icon","menus"]),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),{direction:"vertical"}),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(Oe),{key:0,circle:"",mode:"icon",size:"default",background:"hover",type:"primary",items:s.actions,onClick:a,onCommand:i},null,8,["items"])):Vue.createCommentVNode("",!0),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(El,{key:2})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(s.$slots,"default")]),_:3}))}}),Bl=Vue.defineComponent({__name:"Avatar",props:{avatar:{},width:{default:350}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:e.width,"popper-class":"x-mask-avatar__popper",disabled:!t.$slots.default},{reference:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElAvatar),{class:"x-mask-avatar",shape:"circle",icon:Vue.unref(VtjIcons.UserFilled),src:e.avatar,size:26},null,8,["icon","src"])]),default:Vue.withCtx(()=>[t.$slots.default?Vue.renderSlot(t.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["width","disabled"]))}}),go=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{},pure:{type:Boolean}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask__content",overflow:"auto",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:Vue.normalizeClass(["x-mask__inner",{"is-pure":e.pure}])},[Vue.renderSlot(t.$slots,"default"),Vue.createVNode(Vue.unref(VueRouter.RouterView),null,{default:Vue.withCtx(({Component:r,route:l})=>[(Vue.openBlock(),Vue.createBlock(Vue.KeepAlive,{exclude:e.exclude},[r?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.createView(r,l)),{key:l.fullPath})):Vue.createCommentVNode("",!0)],1032,["exclude"]))]),_:1})],2)]),_:3}))}});function Pl(){const o=Vue.ref(!1),e=Vue.ref(""),t=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:t}}function Nl(o){const e=VtjUtils.uid();return Vue.computed(()=>{const t=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof t=="string"?{url:t}:t||{})})}function vo(o,e){let t=[];return o.forEach(n=>{n=e?e(n):n,n.children?t=t.concat(vo(n.children,e)):t.push(n)}),t}function Tl(o,e){const t=VueRouter.useRouter(),n=Vue.shallowRef([]),r=Vue.shallowRef([]),l=Vue.computed(()=>vo(n.value,o.menuAdapter)),u=Vue.computed(()=>VtjUtils.arrayToMap(l.value,"id")),a=Vue.ref(null),i=f=>{const V=typeof f=="object"?f.id:f,h=u.value.get(V);if(!h){console.warn("找不到菜单",f);return}const{type:y="route",url:g,title:w,icon:v}=h;if(!g){a.value=h,e("select",h);return}if(y==="route"){VtjUtils.isUrl(g)||g.startsWith("//")?window.open(g):(a.value=h,t.push(g).catch(C=>C));return}if(y==="window"){window.open(g);return}y==="dialog"&&xt({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:w,icon:v,src:g})},s=()=>P(this,null,function*(){var f,V;n.value=typeof o.menus=="function"?(yield o.menus())||[]:(f=o.menus)!=null?f:[],r.value=typeof o.favorites=="function"?(yield o.favorites())||[]:(V=o.favorites)!=null?V:[]}),c=f=>{r.value=[f,...r.value],o.addFavorite&&o.addFavorite(f)},d=f=>{r.value=r.value.filter(V=>V.id!==f.id),o.removeFavorite&&o.removeFavorite(f)},m=f=>!!r.value.find(V=>V===f||V.id===f.id),p=f=>{m(f)?d(f):c(f)};return Vue.watchEffect(s),{menus:n,favorites:r,flatMenus:l,active:a,select:i,toggleFavorite:p}}function Dl(o,e,t,n,r){const l=VueRouter.useRoute(),u=VueRouter.useRouter(),a={},i=Vue.ref([]),s=Vue.ref(),{width:c}=VueUse.useElementSize(s),d=Vue.computed(()=>Math.floor(c.value/Vo)),m=Vue.computed(()=>i.value.slice(0,d.value).filter(D=>!D.dialog)),p=Vue.computed(()=>i.value.slice(d.value)),f=D=>t.value.find(_=>_.url===D),V=D=>l.fullPath===D.url,h=D=>r.value.id===D.id,y=D=>r.value.id===D?r.value:i.value.find(_=>_.id===D),g=Vue.ref(""),w=Vue.computed(()=>y(g.value)),v=D=>{u.push(D.url).catch(_=>_)},C=D=>{g.value=D.id,l.fullPath!==D.url&&v(D)},S=()=>{v(r.value)},b=D=>{const _=i.value.find(k=>k.url===D.url||k.id===D.id);_?C(_):(i.value.unshift(D),C(D))},T=D=>P(this,null,function*(){var it;const{url:_=l.fullPath,icon:k,title:B}=D||{},U=a[_],W=VtjUtils.uid(),Ve=VtjUtils.upperFirstCamelCase(_);return N({id:W,name:Ve,url:_,icon:k,title:B||((it=f(l.path))==null?void 0:it.title)||"新建页签",closable:!0,menu:D},U?yield U():{})}),z=(D,_)=>P(this,null,function*(){if(!(!_&&!(yield ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)))){if(i.value=i.value.filter(k=>k.id!==D.id),g.value===D.id){const k=i.value[0];v(k||r.value)}return D}}),j=D=>{const _=i.value.findIndex(k=>k.id===D.id);if(_>=0){const k=i.value[_];i.value.splice(_,1,Object.assign(k,D))}},H=()=>P(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value;return i.value=[],C(r.value),_}),L=()=>P(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value.filter(k=>k.id!==g.value);return i.value=i.value.filter(k=>k.id===g.value),_}),F=D=>{const _=i.value.filter(k=>k.id!==D.id);i.value=[D,..._],C(D)},ne=D=>P(this,null,function*(){w.value&&w.value.closable&&(h(w.value)||(yield z(w.value,!0),yield VtjUtils.delay(0),D?u.push(D):u.push(r.value.url)))}),se=()=>P(this,null,function*(){yield Vue.nextTick();const D=r.value.url===l.path,_=f(l.fullPath);if(D)g.value=r.value.id;else{const k=yield T(_);b(k)}yield Vue.nextTick(),n.value=_||null});return Vue.watch(t,se),Vue.watch(l,se),Vue.provide(fn,a),{tabRef:s,tabs:i,showTabs:m,currentTab:w,changeTab:v,removeTab:z,updateTab:j,addTab:b,home:r,tabValue:g,isCurrentTab:V,activeHome:S,activeTab:C,dropdownTabs:p,removeAllTabs:H,removeOtherTabs:L,moveToShow:F,closeCurrnetTab:ne}}function zl(o,e){const t=new Map,n=Vue.ref([]),r=Vue.reactive({}),l=Vue.getCurrentInstance(),u={},{updateTab:a,isCurrentTab:i,activeHome:s,tabs:c}=o,d=(v,C)=>{const S=C.fullPath;if(t.has(S))return t.get(S);{const b=VtjUtils.upperFirstCamelCase(S),T={name:b,setup(){const z=Vue.computed(()=>r[S]||document.body),j=Vue.computed(()=>!r[S]),H=Vue.computed(()=>!n.value.includes(b));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw(N({},C))),()=>H.value?Vue.h(Vue.Teleport,{to:z.value,disabled:j.value},[Vue.h(v)]):null}};return t.set(S,T),T}},m=v=>{v.dialog=void 0,delete r[v.url];const C=u[v.id];C&&(C.destroy(),delete u[v.id],a(v))},p=(v=[])=>{v.forEach(C=>{m(C)})},f=v=>P(this,null,function*(){v.dialog=X(N({},v.dialog),{pure:e.pure,onMinimized:()=>{m(v)},onClose:()=>P(this,null,function*(){m(v),c.value=c.value.filter(S=>S.id!==v.id)})}),a(v);const C=xt(X(N({title:v.title,icon:v.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0},v.dialog),{onOpen(S){var b,T;r[v.url]=(T=(b=S.refs.panelRef)==null?void 0:b.bodyRef)==null?void 0:T.$el}}),l==null?void 0:l.appContext);return yield Vue.nextTick(),i(v)&&s(),u[v.id]=C,C}),V=v=>P(this,null,function*(){n.value=[v.name],yield Vue.nextTick(),n.value=[]}),h=v=>P(this,null,function*(){n.value=v.map(C=>C.name),yield Vue.nextTick(),n.value=[]}),y=v=>(v.preventDefault(),!1),g=v=>{if(v.dataTransfer){const C=v.dataTransfer.getData("tab"),S=c.value.find(b=>b.id===C);if(S){const{clientX:b,clientY:T}=v;S.dialog={left:b,top:T},f(S)}}},w=v=>!!r[v];return VueUse.useEventListener(document,"dragover",y),VueUse.useEventListener(document,"drop",g),{createView:d,openDialog:f,refresh:V,exclude:n,cleanCache:h,hasDialog:w,closeDialog:m,closeDialogs:p}}const yo=Vue.defineComponent({name:"XMask",__name:"Mask",props:ho,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,r=Nl(t),{collapsed:l,keyword:u,favorite:a}=Pl(),{menus:i,favorites:s,flatMenus:c,active:d,select:m,toggleFavorite:p}=Tl(t,n),{tabRef:f,showTabs:V,currentTab:h,changeTab:y,removeTab:g,tabs:w,updateTab:v,isCurrentTab:C,activeHome:S,removeAllTabs:b,removeOtherTabs:T,dropdownTabs:z,moveToShow:j,closeCurrnetTab:H}=Dl(t,n,c,d,r),{createView:L,openDialog:F,closeDialog:ne,refresh:se,exclude:D,cleanCache:_,closeDialogs:k}=zl({tabs:w,updateTab:v,isCurrentTab:C,activeHome:S},t),B=Y=>P(this,null,function*(){(yield g(Y))&&(yield _([Y]))}),U=()=>P(this,null,function*(){const Y=yield b();Y&&(k(Y),yield _(Y))}),W=()=>P(this,null,function*(){const Y=yield T();Y&&(k(Y),yield _(Y))}),Ve=Y=>{n("actionClick",Y)},it=(Y,ce)=>{n("actionCommand",Y,ce)},Xi=Y=>P(this,null,function*(){const ce=Vue.toValue(Y||h);ce&&(ce.dialog&&ne(ce),yield g(ce,!0),yield VtjUtils.delay(50))});return Vue.watch(h,Y=>{Y!=null&&Y.dialog&&ne(Y)}),Vue.provide(pn,{tabs:w,flatMenus:c,favorites:s,updateTab:v,active:d,currentTab:h,closeCurrnetTab:H,close:Xi}),(Y,ce)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask",{"is-disabled":t.disabled}]),fit:""},{default:Vue.withCtx(()=>[t.disabled?(Vue.openBlock(),Vue.createBlock(go,{key:1,createView:Vue.unref(L),exclude:Vue.unref(D),pure:t.pure},{default:Vue.withCtx(()=>[Y.$slots.default?Vue.renderSlot(Y.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude","pure"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(pl,{collapsed:Vue.unref(l)},{brand:Vue.withCtx(()=>[Vue.createVNode(gl,{logo:t.logo,title:t.title,url:Vue.unref(r).url,collapsed:Vue.unref(l)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(ml,{collasped:Vue.unref(l),"onUpdate:collasped":ce[0]||(ce[0]=Ae=>Vue.isRef(l)?l.value=Ae:null),favorite:Vue.unref(a),"onUpdate:favorite":ce[1]||(ce[1]=Ae=>Vue.isRef(a)?a.value=Ae:null),keyword:Vue.unref(u),"onUpdate:keyword":ce[2]||(ce[2]=Ae=>Vue.isRef(u)?u.value=Ae:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(vl,{collapse:Vue.unref(l),keyword:Vue.unref(u),favorite:Vue.unref(a),favorites:Vue.unref(s),flatMenus:Vue.unref(c),menus:Vue.unref(i),active:Vue.unref(d),onSelect:Vue.unref(m)},null,8,["collapse","keyword","favorite","favorites","flatMenus","menus","active","onSelect"])]),_:1},8,["collapsed"]),Vue.createVNode(Vue.unref($),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column",overflow:"hidden"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>{var Ae;return[Vue.createVNode(kl,{ref_key:"tabRef",ref:f,favorites:Vue.unref(s),tabs:Vue.unref(V),home:Vue.unref(r),value:(Ae=Vue.unref(h))==null?void 0:Ae.id,onClick:Vue.unref(y),onToggleFavorite:Vue.unref(p),onRemove:B,onDialog:Vue.unref(F),onRefresh:Vue.unref(se)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(xl,{tabs:Vue.unref(z),actions:t.actions,theme:t.theme,onCloseOtherTabs:W,onCloseAllTabs:U,onCloseTab:B,onClickTab:Vue.unref(j),onActionClick:Ve,onActionCommand:it},{default:Vue.withCtx(()=>[Vue.createVNode(Bl,{avatar:t.avatar,width:t.userCardWidth},Vue.createSlots({_:2},[Y.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(Y.$slots,"user")]),key:"0"}:void 0]),1032,["avatar","width"])]),_:3},8,["tabs","actions","theme","onClickTab"])]}),_:3}),Vue.createVNode(go,{createView:Vue.unref(L),exclude:Vue.unref(D),pure:t.pure},{default:Vue.withCtx(()=>[Y.$slots.default?Vue.renderSlot(Y.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude","pure"])]),_:3})],64))]),_:3},8,["class"]))}});function Il(o={}){const e=VueRouter.useRoute(),t=Vue.inject(fn,null),n=Vue.inject(pn,null);if(t){const l=typeof o=="function"?o:()=>P(this,null,function*(){return o});t[e.fullPath]=l}return{tab:Vue.computed(()=>n?n.tabs.value.find(l=>l.url===e.fullPath):null),mask:n}}const mn=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},emits:["change"],setup(o,{emit:e}){const t=o,n=e,r=l=>{const u=t.options.filter(a=>Array.isArray(l)?l.includes(a.value):l===a.value);n("change",l,u)};return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSelect),Vue.mergeProps(l.$attrs,{onChange:r}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.options,(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),Vue.mergeProps({key:`item_${i}_${a.value}`,ref_for:!0},a),Vue.createSlots({_:2},[l.$slots.option?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"option",{option:a})]),key:"0"}:void 0]),1040))),128))]),_:3},16))}}),Ml=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(n,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${u}_${l.value}`,ref_for:!0},l),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:2},1040))),128))]),_:1},16))}}),Al=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(n,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${u}_${l.value}`,ref_for:!0},l),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:2},1040))),128))]),_:1},16))}}),je={filterResetMethod(o){const{options:e,column:t}=o;if(t.filterResetMethod){t.filterResetMethod(o);return}e.forEach(n=>{n.value=""})},filterRecoverMethod(o){const{option:e,column:t}=o;if(t.filterRecoverMethod){t.filterRecoverMethod(o);return}e.value=""},filterMethod(o){const{option:e,row:t,column:n}=o;if(n.filterMethod)return n.filterMethod(o);const{value:r}=e,l=t[n.field];return VtjUtils.isString(l)?l.indexOf(String(r))>-1:l===r}},$l=Vue.defineComponent({name:"InputEdit",__name:"InputEdit",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:t,renderEvents:n,cellValue:r,onChange:l}=Ye(e.renderOpts,e.params);return(u,a)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),Vue.mergeProps({size:"small",clearable:"",modelValue:Vue.unref(r),"onUpdate:modelValue":a[0]||(a[0]=i=>Vue.isRef(r)?r.value=i:null),onInput:Vue.unref(l)},Vue.unref(t),Vue.toHandlers(Vue.unref(n))),null,16,["modelValue","onInput"]))}}),Rl={class:"x-grid__filter"},Vn=Vue.defineComponent({name:"InputFilter",__name:"InputFilter",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:t,renderEvents:n,state:r,load:l,onChange:u,onKeyup:a}=Xt(e.renderOpts,e.params);return l(),(i,s)=>(Vue.openBlock(),Vue.createElementBlock("div",Rl,[Vue.createVNode(Vue.unref(ElementPlus.ElInput),Vue.mergeProps({size:"small",placeholder:"输入关键字回车筛选",clearable:"",modelValue:Vue.unref(r).option.value,"onUpdate:modelValue":s[0]||(s[0]=c=>Vue.unref(r).option.value=c),onInput:Vue.unref(u),onKeyup:Vue.withKeys(Vue.withModifiers(Vue.unref(a),["stop"]),["enter"])},Vue.unref(t),Vue.toHandlers(Vue.unref(n))),null,16,["modelValue","onInput","onKeyup"])]))}}),Je={autofocus:".el-input__inner",renderDefault(o,e){var r;const{row:t,column:n}=e;return[Vue.createTextVNode((r=t[n.field])!=null?r:"")]},renderEdit(o,e){return[Vue.h($l,{params:e,renderOpts:o})]},renderCell(o,e){var r;const{row:t,column:n}=e;return[Vue.createTextVNode((r=t[n.field])!=null?r:"")]}},Fl=X(N(N({cellClassName:"x-grid__edit"},Je),je),{renderFilter(o,e){return[Vue.h(Vn,{params:e,renderOpts:o})]}});/**!
7
+ */const K="0.9.0-alpha.48",Q={default:14,small:12,large:18},Et={icon:{type:[String,Object]},color:{type:String},size:{type:[Number,String],default:"inherit"},src:{type:String},background:{type:String},padding:{type:Number},radius:{type:Number}};function de(o){return typeof o=="string"?o:`${o}px`}function $e(o=0,e){if(typeof o=="number")return o;if(/(%|vh|vw)$/i.test(o)){const n=Number.parseInt(o);return Math.floor(e*n/100)}return Number.parseInt(o)}function st(o,e={}){const t=N({},e);return typeof o=="boolean"?t:Object.assign(t,o||{})}const Re="__VTJ_UI_INSTALLED__",he=Symbol("ADAPTER_KEY");function Pe(){const o=Vue.getCurrentInstance(),e=o==null?void 0:o.appContext.config.globalProperties.$adapter;return e||Vue.inject(he,{})}const Or={getCustom:o=>P(this,null,function*(){return VtjUtils.storage.get(o,{type:"local"})}),saveCustom:o=>P(this,null,function*(){VtjUtils.storage.save(o.id,o,{type:"local"})})},jr={install(o,e={}){const t=Object.assign(Or,e),{components:n=[],fieldEditors:r={}}=t;Jo(r);for(const l of n)l.name&&o.component(l.name,l);[ElementPlus.ElMessage,ElementPlus.ElMessageBox,ElementPlus.ElNotification].forEach(l=>{o.use(l)}),o.config.globalProperties.$adapter=t,o.provide(he,t)}},eo=(o=[])=>({install:(t,n={})=>{t[Re]||(t[Re]=!0,o.forEach(r=>{r.name&&t.component(r.name,r)}),n.adapter&&t.provide(he,n.adapter))}});let Ke;const to=new RegExp(`\\<script.*src=["'](?<src>[^"']+)`,"gm");let Ur=1e4;function Lr(){return P(this,null,function*(){var n;const o=yield fetch("?t="+Date.now()).then(r=>r.text());to.lastIndex=0;let e=[],t;for(;t=to.exec(o);)(n=t.groups)!=null&&n.src&&e.push(t.groups.src);return e})}function Hr(){return P(this,null,function*(){const o=yield Lr();if(!Ke)return Ke=o,!1;let e=!1;Ke.length!==o.length&&(e=!0);for(let t=0;t<Ke.length;t++)if(Ke[t]!==o[t]){e=!0;break}return Ke=o,e})}function Xr(){return P(this,null,function*(){(yield ElementPlus.ElMessageBox.confirm("系统发现新版本,请确认是否需要更新。如果确定,系统将会重新登录,请注意存档。",{title:"系统更新",type:"warning",closeOnClickModal:!1}).catch(()=>!1))&&(top||window).location.reload()})}function no(){setTimeout(()=>P(this,null,function*(){(yield Hr())&&(yield Xr()),no()}),Ur)}function Yr(){no()}const Kr=["src"],ge=Vue.defineComponent({name:"XIcon",__name:"Icon",props:Et,setup(o){const e=o,t=Vue.useAttrs(),n=Vue.getCurrentInstance(),r=Vue.computed(()=>{if(!e.icon)return null;const i=n==null?void 0:n.appContext.app;return typeof e.icon=="object"?Vue.markRaw(e.icon):(i==null?void 0:i.component(e.icon))||e.icon}),l=Vue.computed(()=>{const i={"is-pointer":!!t.onClick};return!r.value&&e.icon&&(i[e.icon]=!0),i}),u=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?de(e.radius):void 0,padding:e.padding?de(e.padding):void 0})),a=Vue.computed(()=>{var i;return typeof e.size=="number"?e.size:(i=Q[e.size])!=null?i:void 0});return(i,s)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElIcon),{class:Vue.normalizeClass(["x-icon",l.value]),color:e.color,size:a.value,style:Vue.normalizeStyle(u.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(i.$slots,"default",{},()=>[r.value?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(r.value),{key:0})):Vue.createCommentVNode("",!0),e.src?(Vue.openBlock(),Vue.createElementBlock("img",{key:1,src:e.src},null,8,Kr)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),Gr={class:"x-menu__wrapper"},Wr={key:1,class:"x-menu__title"},qr={key:0,class:"x-menu__title"},oo=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,t=Vue.getCurrentInstance(),n=u=>{if(u){if(typeof u=="string"){const a=t==null?void 0:t.appContext.app;return(a==null?void 0:a.component(u))||e.defaultIcon||u}return u}},r=u=>typeof u=="object"?u:{value:u},l=(u=[])=>u.filter(a=>!a.hidden);return(u,a)=>e.item.children?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSubMenu),Vue.mergeProps({key:0,disabled:e.item.disabled},e.subMenu,{index:String(e.item.id)}),{title:Vue.withCtx(()=>[Vue.createElementVNode("div",Gr,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",Wr,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:2,class:"x-menu__badge"},r(e.item.badge)),{default:Vue.withCtx(()=>a[0]||(a[0]=[Vue.createElementVNode("i",null,null,-1)])),_:1},16)):Vue.createCommentVNode("",!0)])]),default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(l(e.item.children),i=>(Vue.openBlock(),Vue.createBlock(Vue.unref(oo),{key:i.id,item:i,subMenu:e.subMenu,defaultIcon:e.defaultIcon},null,8,["item","subMenu","defaultIcon"]))),128))]),_:1},16,["disabled","index"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenuItem),{key:1,index:String(e.item.id),disabled:e.item.disabled},{title:Vue.withCtx(()=>[e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",qr,Vue.toDisplayString(e.item.title),1)):Vue.createCommentVNode("",!0),e.item.badge?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElBadge),Vue.mergeProps({key:1,class:"x-menu__badge"},r(e.item.badge)),{default:Vue.withCtx(()=>a[1]||(a[1]=[Vue.createElementVNode("i",null,null,-1)])),_:1},16)):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:n(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0)]),_:1},8,["index","disabled"]))}}),Ne=Vue.defineComponent({inheritAttrs:!1,name:"XMenu",__name:"Menu",props:{data:{default:()=>[]},subMenu:{},defaultIcon:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>t.data.filter(a=>!a.hidden)),l=(a,i)=>{const s=(c,d=[])=>{var m;for(const p of d){if(p.id.toString()===c.toString())return p;if((m=p.children)!=null&&m.length){const f=s(c,p.children);if(f)return f}}};return s(i,a)},u=a=>{const i=l(r.value,a);i&&n("select",i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElMenu),Vue.mergeProps({class:"x-menu"},a.$attrs,{onSelect:u}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,s=>(Vue.openBlock(),Vue.createBlock(Vue.unref(oo),{item:X(N({},s),{icon:s.icon}),defaultIcon:t.defaultIcon,subMenu:t.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),ln={name:{type:String},label:{type:String},value:{type:[String,Number,Object,Array,Boolean]},icon:{type:[String,Object]},mode:{type:String,default:"button"},menus:{type:Array},tooltip:{type:[String,Object]},badge:{type:[String,Number,Object]},dropdown:{type:Object},button:{type:Object},disabled:{type:[Boolean,Function]},size:{type:String,default:"default"},type:{type:String},background:{type:String,default:"always"},circle:{type:Boolean},draggable:{type:Boolean}};function Jr(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function Qr(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function Zr(o){return Vue.computed(()=>{const{dropdown:e,menus:t}=o;if(t&&t.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function ro(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const t=Vue.unref(o);if(t)if(typeof t=="string"||t.setup||t.render||Vue.isVNode(t)){const n=e==null?void 0:e.appContext.app;return{icon:typeof t=="string"&&(n==null?void 0:n.component(t))||t}}else return t;return null})}function Fe(o){const e=ro(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(ge,e.value)})):void 0}function St(o,e){return Vue.computed(()=>{const t=Vue.unref(o);return typeof t=="function"?t(e):!!t})}function lo(o,e,t){const n=Vue.shallowRef(e),r=Vue.ref(!1),l=a=>P(this,null,function*(){const i=Vue.unref(o);return i?typeof i=="function"?yield i(a):i:e}),u=a=>P(this,null,function*(){return r.value=!0,yield l(a).then(i=>(n.value=i||e,r.value=!1,Vue.unref(n)))});return Vue.watch(()=>o,()=>{u(t)},{immediate:!0}),t&&Vue.watch(t,()=>{u(t)}),{data:n,loading:r,loader:u}}function el(o=1e3){const e=Vue.ref(0);let t;const n=()=>{t=VtjUtils.rAF(()=>{++e.value,e.value<o&&n()})};return Vue.onMounted(n),Vue.onUnmounted(()=>{t&&VtjUtils.cAF(t)}),r=>e.value>=r}function ao(o=[]){const e=Vue.useSlots();return Object.keys(e).filter(t=>!o.includes(t))}const tl={key:0},nl=Vue.defineComponent({__name:"Trigger",props:ln,emits:["click"],setup(o,{emit:e}){const t=o,n=e,r=Fe(Vue.toRef(t,"icon")),l=St(Vue.toRef(t,"disabled")),u=Vue.computed(()=>({[`is-${t.mode}`]:!!t.mode,[`is-${t.type}`]:!!t.type,[`is-${t.size}`]:!!t.size&&t.size!=="default",[`is-background-${t.background}`]:t.mode==="icon"&&!!t.background,"is-disabled":!!t.disabled,"is-circle":!!t.circle})),a=i=>{if(i.preventDefault(),!l.value)return n("click"),!1};return(i,s)=>t.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(r),type:t.type,size:t.size,disabled:Vue.unref(l)},t.button,{onClick:a}),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(i.label),1)]),_:1},16,["icon","type","size","disabled"])):(Vue.openBlock(),Vue.createElementBlock("div",{key:1,class:Vue.normalizeClass(["x-action__inner",u.value]),onClick:a},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(r)))),i.label?(Vue.openBlock(),Vue.createElementBlock("span",tl,Vue.toDisplayString(i.label),1)):Vue.createCommentVNode("",!0)],2))}}),ol=["draggable"],te=Vue.defineComponent({name:"XAction",__name:"Action",props:ln,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const t=o,n=Vue.useSlots(),r=e,l=Jr(t),u=Qr(t),a=Zr(t),i=St(Vue.toRef(t,"disabled")),s=Vue.computed(()=>!!t.draggable&&!i.value),c=Vue.computed(()=>({[`x-action--${t.mode}`]:!!t.mode})),d=()=>{i.value||r("click",Vue.toRaw(t))},m=w=>{var C;if(i.value)return;const v=(C=t.menus)==null?void 0:C.find(S=>S.command===w);v&&r("command",Vue.toRaw(v))},p=w=>{s&&r("dragstart",Vue.toRaw(t),w)},f=w=>{s&&r("dragend",Vue.toRaw(t),w)},V=w=>Vue.h(ElementPlus.ElBadge,u.value,()=>[].concat(w)),h=w=>Vue.h(ElementPlus.ElDropdown,X(N({},a.value),{disabled:i.value,onCommand:m}),{default:()=>[w],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(t.menus||[]).map((v,C)=>Vue.h(ElementPlus.ElDropdownItem,v,()=>n.item?n.item({item:v,index:C}):v.label)))]}),y=w=>Vue.h(ElementPlus.ElTooltip,X(N({},l.value),{disabled:i.value}),()=>[w]),g=Vue.computed(()=>{var C;let w=Vue.h(Vue.markRaw(nl),X(N({},t),{onClick:d}));const v=(C=n.default)==null?void 0:C.call(n);return v&&v.length&&(w=v[0]),u.value&&(w=V(w)),a.value&&(w=h(w)),l.value&&(w=y(w)),w});return(w,v)=>(Vue.openBlock(),Vue.createElementBlock("div",{class:Vue.normalizeClass(["x-action",c.value]),draggable:s.value,onDragstart:p,onDragend:f},[(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(g.value)))],42,ol))}}),uo={items:{type:Array},mode:{type:String,default:"button"},size:{type:String,default:"default"},type:{type:String},background:{type:String,default:"always"},circle:{type:Boolean},disabled:{type:[Boolean,Function]},tooltip:{type:Object},badge:{type:Object},dropdown:{type:Object},button:{type:Object}},Oe=Vue.defineComponent({name:"XActionBar",__name:"ActionBar",props:uo,emits:["click","command"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>(t.items||[]).map(a=>a==="|"?a:X(N({},a),{badge:a.badge?N(N({},t.badge),typeof a.badge=="object"?a.badge||{}:{value:a.badge}):void 0,tooltip:a.tooltip?N(N({},t.tooltip),typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}):void 0}))),l=a=>{n("click",a)},u=(a,i)=>{n("command",a,i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-action-bar",align:"center"},{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(r.value,s=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[s==="|"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:0,direction:"vertical",class:"x-action-bar__divider"})):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),Vue.mergeProps({key:1,mode:t.mode,size:t.size,type:t.type,circle:t.circle,background:t.background,button:t.button,dropdown:t.dropdown,disabled:Vue.unref(St)(t.disabled,s).value,ref_for:!0},s,{onClick:l,onCommand:c=>u(s,c)}),null,16,["mode","size","type","circle","background","button","dropdown","disabled","onCommand"]))],64))),256))]),_:1}))}}),io={tag:{type:String,default:"div"},fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},flex:{type:Boolean,default:!0},inline:{type:Boolean},direction:{type:String,default:"row"},wrap:{type:String,default:"nowrap"},justify:{type:String,default:"flex-start"},align:{type:String,default:"flex-start"},alignContent:{type:String,default:"stretch"},grow:{type:Boolean,default:!1},shrink:{type:Boolean,default:!1},alignSelf:{type:String,default:"auto"},overflow:{type:String},padding:{type:Boolean,default:!1},gap:{type:Boolean},autoPointer:{type:Boolean}},$=Vue.defineComponent({name:"XContainer",__name:"Container",props:io,setup(o,{expose:e}){const t=o,n=Vue.useAttrs(),r=Vue.getCurrentInstance(),l=Vue.ref(),u=Vue.computed(()=>{var c;return(c=l.value)==null?void 0:c.$el}),a=Vue.computed(()=>{const c=r==null?void 0:r.parent;if(!c)return!1;const d=c.proxy;return d.$options.name==="XContainer"||!!d.flex}),i=Vue.computed(()=>{var c;return{"is-fit":t.fit,"is-flex":t.flex&&!t.inline,"is-inline-flex":t.flex&&t.inline,[`is-direction-${t.direction}`]:t.flex&&t.direction!=="row",[`is-wrap-${t.wrap}`]:t.flex&&t.wrap!=="nowrap",[`is-justify-${t.justify}`]:t.flex&&t.justify!=="flex-start",[`is-align-${t.align}`]:t.flex&&t.align!=="flex-start",[`is-align-content-${t.alignContent}`]:t.flex&&t.alignContent!=="stretch","is-grow":(c=t.grow)!=null?c:a.value,"is-shrink":t.shrink,[`is-align-self-${t.alignSelf}`]:a.value&&t.alignSelf!=="auto",[`is-overflow-${t.overflow}`]:!!t.overflow,"is-padding":!!t.padding,"is-pointer":t.autoPointer&&!!n.onClick,"is-gap":!!t.gap}}),s=Vue.computed(()=>{const{width:c,height:d,fit:m}=t;return m?null:{width:c?de(c):void 0,height:d?de(d):void 0}});return e({$vtjEl:u}),(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.tag),{ref_key:"elRef",ref:l,class:Vue.normalizeClass(["x-container",i.value]),style:Vue.normalizeStyle(s.value)},{default:Vue.withCtx(()=>[Vue.renderSlot(c.$slots,"default")]),_:3},8,["class","style"]))}}),so={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},rl={class:"x-header__content"},ll={key:0,class:"x-header__actions"},an=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:so,setup(o){const e=o,t=Fe(Vue.toRef(e,"icon")),n=Vue.useAttrs(),r=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!n.onClick}));return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-header",r.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",r.value]),grow:"",onClick:Vue.unref(n).onClick},{default:Vue.withCtx(()=>[Vue.unref(t)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(t)),{key:0,class:"x-header__icon",onClick:Vue.unref(n).onClickIcon||Vue.unref(n).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",rl,[Vue.renderSlot(l.$slots,"default",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.content),1)])]),e.more?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:1,class:"x-header__more",icon:Vue.unref(VtjIcons.ArrowRight)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.subtitle||l.$slots.subtitle?(Vue.openBlock(),Vue.createElementBlock("span",{key:2,class:"x-header__subtitle",onClick:u[0]||(u[0]=(...a)=>Vue.unref(n).onClick&&Vue.unref(n).onClick(...a))},[Vue.renderSlot(l.$slots,"subtitle",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.subtitle),1)])])):Vue.createCommentVNode("",!0)]),_:3},8,["class","onClick"]),l.$slots.actions?(Vue.openBlock(),Vue.createElementBlock("div",ll,[Vue.renderSlot(l.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),co={fit:{type:Boolean,default:!1},width:{type:[String,Number]},height:{type:[String,Number]},border:{type:Boolean,default:!0},radius:{type:Boolean,default:!0},card:{type:Boolean},size:{type:String},shadow:{type:String},header:{type:[String,Object]},body:{type:Object},footer:{type:Object}},Ge=Vue.defineComponent({name:"XPanel",__name:"Panel",props:co,setup(o,{expose:e}){const t=o,n=Vue.ref(),r=Vue.computed(()=>({"x-panel--card":!!t.card,"x-panel--default":!t.card,[`is-${t.size}`]:!!t.size&&t.size!=="default","is-border":!!t.border,"is-radius":!!t.radius,[`is-shadow-${t.shadow}`]:!!t.shadow&&t.shadow!=="none"})),l=Vue.computed(()=>t.header===null?null:typeof t.header=="string"?{content:t.header,size:t.size}:X(N({},t.header),{size:t.size})),u=Vue.computed(()=>t.fit||t.height?"auto":void 0);return e({bodyRef:n}),(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-panel",r.value]),direction:"column",fit:t.fit,width:t.width,height:t.height},{default:Vue.withCtx(()=>[l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(an),Vue.normalizeProps(Vue.guardReactiveProps(l.value)),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"title")]),actions:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"actions")]),_:3},16)])]),_:3})):Vue.createCommentVNode("",!0),Vue.createVNode(Vue.unref($),Vue.mergeProps({ref_key:"bodyRef",ref:n,flex:!1,overflow:u.value,grow:"",padding:"",class:"x-panel__body"},t.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref($),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},t.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),fo="user-select-none";class un{constructor(e,t={}){Be(this,"scope");Be(this,"dragging",!1);this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}getHandle(){const{selector:e,handle:t}=this.options;return e?this.el.querySelector(e):t}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:t}=this,{disabled:n,delay:r=150,onStart:l,onEnd:u}=t;if(n)return;let a=null;const i=this.getHandle(),s=this.getTarget();let c=e.getBoundingClientRect(),d=null;const{x:m,y:p}=VueUse.useDraggable(e,X(N({initialValue:{x:c.x,y:c.y}},t),{handle:i,onStart:(f,V)=>{document.body.classList.add(fo),clearTimeout(a),a=setTimeout(()=>{this.dragging=!0,c=e.getBoundingClientRect(),d=s==null?void 0:s.getBoundingClientRect(),l&&l(f,V)},r)},onEnd:(f,V)=>{if(clearTimeout(a),document.body.classList.remove(fo),this.dragging&&d){this.dragging=!1;const{x:h,y}=f,g=this.getPosition(d,c,h,y);u&&u(g,V),d=null}}}));Vue.watch([m,p],()=>{if(this.dragging&&d){const f=this.getPosition(d,c,m.value,p.value);e.style.left=`${f.x}px`,e.style.top=`${f.y}px`}})}getPosition(e,t,n,r){const{edge:l=50}=this.options,u=-t.width+e.x+l,a=e.width+e.x-l,i=e.y,s=e.height+e.y-l,c=Math.min(a,Math.max(n,u)),d=Math.min(s,Math.max(r,i));return{x:c-e.x,y:d-e.y}}destory(){this.scope.stop()}}const po={mounted(o,e){const t=e.value||{},n=new un(o,t);o.__draggable__=n},updated(o,e){const t=e.value||{};let n=o.__draggable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__draggable__=new un(o,t))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},sn="user-select-none";class cn{constructor(e,t={}){Be(this,"scope");Be(this,"resizing",Vue.ref(!1));Be(this,"direction",Vue.ref(""));Be(this,"MIE",null);Be(this,"cleanMousedown");Be(this,"cleanMouseup");this.el=e,this.options=t,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}init(){const{el:e,options:t}=this,{disabled:n,onStart:r,onEnd:l}=t;if(n)return;this.MIE=VueUse.useMouseInElement(e),this.cleanMousedown=VueUse.useEventListener(document,"mousedown",()=>{var i;(i=this.direction)!=null&&i.value&&this.MIE&&(this.resizing.value=!0,e.classList.add("is-resizing",`is-${this.direction.value}-resizing`),r&&r(this.direction.value,this.MIE))}),this.cleanMouseup=VueUse.useEventListener(document,"mouseup",()=>{var i;this.resizing.value&&((i=this.direction)!=null&&i.value)&&this.MIE&&(e.classList.remove("is-resizing",`is-${this.direction.value}-resizing`),l&&l(this.direction.value,this.MIE)),this.resizing.value=!1}),Vue.watch(this.direction,i=>{const s=document.body;s.style.cursor=i?`${i}-resize`:"",i?s.classList.add(sn):s.classList.remove(sn)});const{x:u,y:a}=this.MIE;Vue.watch([u,a],()=>{this.resizing.value?this.resize():this.direction.value=this.getDirection()})}resize(){const{MIE:e,direction:t,resizing:n,options:r,el:l}=this,u=(t==null?void 0:t.value)||"";if(!e||!n.value||!u)return;const{x:a,y:i,elementX:s,elementY:c,elementHeight:d,elementWidth:m}=e,{onResizing:p}=r,{minWidth:f=0,minHeight:V=0,maxWidth:h=99999,maxHeight:y=99999}=r;if(u.includes("e")){const g=Math.min(Math.max(s.value,f),h);l.style.width=`${g}px`}if(u.includes("s")){const g=Math.min(Math.max(c.value,V),y);l.style.height=`${g}px`}if(u.includes("w")){const g=Math.min(Math.max(m.value-s.value,f),h);l.style.width=`${g}px`,l.style.left=`${a.value}px`}if(u.includes("n")){const g=Math.min(Math.max(d.value-c.value,V),y);this.el.style.height=`${g}px`,this.el.style.top=`${i.value}px`}p&&p(u,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:t,elementHeight:n,elementWidth:r,isOutside:l}=this.MIE;if(l.value)return"";const{dirs:u=["n","s","w","e"],edge:a=5}=this.options;let i="";return u.includes("n")&&t.value<=a?i+="n":u.includes("s")&&t.value>n.value-a&&(i+="s"),u.includes("w")&&e.value<=a?i+="w":u.includes("e")&&e.value>r.value-a&&(i+="e"),i}destory(){var t;const e=document.body;e.style.cursor="",e.classList.remove(sn),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),(t=this.MIE)==null||t.stop(),this.scope.stop()}}const dn={mounted(o,e){const t=e.value||{},n=new cn(o,t);o.__resizable__=n},updated(o,e){const t=e.value||{};let n=o.__resizable__;n&&!VtjUtils.isEqual(n.options,t)&&(n.destory(),o.__resizable__=new cn(o,t))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},mo={modelValue:{type:Boolean,default:!0},title:{type:String},subtitle:{type:String},icon:{type:[String,Object]},size:{type:String,default:"default"},width:{type:[Number,String],default:"70%"},height:{type:[Number,String],default:"70%"},left:{type:[Number,String]},top:{type:[Number,String]},modal:{type:Boolean,default:!0},draggable:{type:[Boolean,Object],default:!0},resizable:{type:[Boolean,Object]},closable:{type:Boolean,default:!0},maximizable:{type:Boolean,default:!1},minimizable:{type:Boolean,default:!1},mode:{type:String,default:"normal"},content:{type:Object},src:{type:String},componentInstance:{type:Object},beforeClose:{type:Function},submit:{type:[Boolean,String]},cancel:{type:[Boolean,String]},bodyPadding:{type:Boolean,default:!0},primary:{type:Boolean},pure:{type:Boolean}};let We=1e3;function al(o,e){const{width:t,height:n}=VueUse.useElementSize(e),r=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++We,dragging:!1,resizing:!1});return Vue.watch([t,n],([l,u])=>{r.wrapperWidth=l,r.wrapperHeight=u,r.width=$e(o.width,l),r.height=$e(o.height,u),r.left=o.left?$e(o.left,l)-r.width/2:Math.max(Math.floor((l-r.width)/2),0),r.top=o.top?$e(o.top,u):Math.max(Math.floor((u-r.height)/2),0)}),Vue.watch(r,l=>{We=Math.max(l.zIndex,We)}),{state:r,normal:Vue.computed(()=>r.mode==="normal"),maximized:Vue.computed(()=>r.mode==="maximized"),minimized:Vue.computed(()=>r.mode==="minimized")}}function ul(o,e){const t=Vue.computed(()=>{const{width:a,height:i,top:s,left:c,zIndex:d}=e;return{width:`${a}px`,height:`${i}px`,top:`${s}px`,left:`${c}px`,zIndex:d}}),n=Vue.computed(()=>{const{zIndex:a}=e;return{zIndex:a}}),r=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary,"is-pure":!!o.pure})),l=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),u=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:t,classes:r,wrapperClass:l,modalStyle:u,zIndexStyle:n}}function il(o,e,t){const n=c=>{e.mode=c,["maximized","minimized","normal"].includes(c)&&t(c),t("modeChange",c)},r=()=>P(this,null,function*(){(!o.beforeClose||(yield o.beforeClose()))&&(t("update:modelValue",!1),t("close"),t("destroy"))});return{close:r,changeMode:n,show:()=>n("normal"),hide:()=>n("minimized"),active:c=>{const d=c.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++We))},submit:()=>t("submit"),cancel:()=>{t("cancel"),r()}}}function sl(o,e,t,n){return Vue.computed(()=>{var l;const r=typeof o.draggable=="boolean"?!o.draggable:!!((l=o.draggable)!=null&&l.disabled);return X(N({},VtjUtils.isObject(o.draggable)?o.draggable:{}),{disabled:r,target:n,selector:".x-panel__header",onStart(u){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++We),t("dragStart",u)},onMove(u){t("dragging",u)},onEnd(u){if(e.mode==="maximized")return;const{x:a,y:i}=u;e.left=a,e.top=i,e.dragging=!1,t("dragEnd",u)}})})}function cl(o,e,t){return Vue.computed(()=>{var r;const n=typeof o.resizable=="boolean"?!o.resizable:!!((r=o.resizable)!=null&&r.disabled);return X(N({minWidth:200,minHeight:150},VtjUtils.isObject(o.resizable)?o.resizable:{}),{disabled:n,dirs:["e","s","w"],onStart(l,u){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++We),t("resizeStart",l,u)},onResizing(l,u){t("resizing",l,u)},onEnd(l,u){const a=document.body.getBoundingClientRect();e.left=u.elementPositionX.value-a.x,e.top=u.elementPositionY.value-a.y,e.width=u.elementWidth.value,e.height=u.elementHeight.value,e.resizing=!1,t("resizeEnd",l,u)}})})}function dl(o,e){const t=o.componentInstance;if(!t)return;let n=null;return Vue.onMounted(()=>{const r=Vue.unref(e),l=Vue.unref(r==null?void 0:r.bodyRef);n=t.$el,l&&l.$el&&l.$el.appendChild(n)}),Vue.onUnmounted(()=>{n&&n.parentNode&&n.parentNode.removeChild(n)}),{componentInstance:t}}const fl=["src"],qe=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:mo,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:t}){const n=o,r=t,l=Vue.getCurrentInstance(),u=Vue.ref(),a=Vue.ref(),{state:i,maximized:s,minimized:c,normal:d}=al(n,u),{styles:m,classes:p,wrapperClass:f,modalStyle:V,zIndexStyle:h}=ul(n,i),{changeMode:y,active:g,close:w,show:v,hide:C,submit:S,cancel:b}=il(n,i,r),T=sl(n,i,r,u),z=cl(n,i,r),j=dl(n,a);Vue.watchEffect(()=>P(this,null,function*(){n.modelValue?(yield Vue.nextTick(),l&&(r("open",l),document.body.classList.add("x-dialog-visible"))):document.body.classList.remove("x-dialog-visible")})),Vue.onUnmounted(()=>{document.body.classList.remove("x-dialog-visible")});const H=Vue.computed(()=>{var L;return(L=a.value)==null?void 0:L.$el});return e({$vtjEl:H,panelRef:a,state:i,maximized:s,minimized:c,changeMode:y,show:v,hide:C,submit:S,cancel:b,close:w,componentInstance:j}),(L,F)=>n.modelValue?(Vue.openBlock(),Vue.createBlock(Vue.Teleport,{key:0,to:"body"},[Vue.createElementVNode("div",{ref_key:"wrapper",ref:u,class:Vue.normalizeClass(["x-dialog__wrapper",Vue.unref(f)]),style:Vue.normalizeStyle(Vue.unref(h))},[n.modal?(Vue.openBlock(),Vue.createElementBlock("div",{key:0,class:"x-dialog__modal",style:Vue.normalizeStyle(Vue.unref(V))},null,4)):Vue.createCommentVNode("",!0),Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(Ge),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(p)],card:"",shadow:"always",header:{icon:n.icon,subtitle:n.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(m),size:n.size,body:{padding:n.bodyPadding},onClick:Vue.unref(g)},L.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(n.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"actions"),n.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[0]||(F[0]=ne=>Vue.unref(y)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),n.maximizable?(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:1},[Vue.unref(d)?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:1,icon:Vue.unref(VtjIcons.Maximize),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[2]||(F[2]=ne=>Vue.unref(y)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Popup),size:n.size,mode:"icon",type:"primary",background:"hover",onClick:F[1]||(F[1]=ne=>Vue.unref(y)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),n.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:n.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(w)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"default",{},()=>[n.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.content),{key:0})):Vue.createCommentVNode("",!0),n.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:n.src,class:"x-dialog__frame"},null,8,fl)):Vue.createCommentVNode("",!0)])]),_:2},[n.cancel||n.submit||L.$slots.footer||L.$slots.extra||L.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref($),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref($),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(L.$slots,"handle"),n.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:n.size,onClick:Vue.unref(b)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.cancel=="string"?n.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),n.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:n.size,onClick:Vue.unref(S)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof n.submit=="string"?n.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(po),Vue.unref(T)],[Vue.unref(dn),Vue.unref(z)]])],6)])):Vue.createCommentVNode("",!0)}});function xt(o,e){const t=document.createElement("div"),n=Vue.createVNode(qe,o);n.appContext=e!=null?e:xt._context,Vue.render(n,t);const r=()=>{var l;Vue.render(null,t),(l=t.parentNode)==null||l.removeChild(t)};return n.props.onDestroy=()=>{r()},document.body.appendChild(t),{vnode:n,destroy:r}}const pl=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(t,n)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"brand"),Vue.createVNode(Vue.unref($),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(t.$slots,"default"),n[0]||(n[0]=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1))]),_:3})]),_:3},8,["class"])),[[Vue.unref(dn),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),ml=Vue.defineComponent({__name:"SwitchBar",props:{collasped:{type:Boolean,default:!1},favorite:{type:Boolean,default:!1},keyword:{}},emits:["update:collasped","update:keyword","update:favorite"],setup(o,{emit:e}){const t=o,n=e,r=Vue.ref(!1),l=Vue.ref(""),u=Vue.ref(!1),a=()=>{r.value=!0},i=()=>{l.value="",r.value=!1,n("update:keyword",l.value)},s=()=>{n("update:collasped",!t.collasped)},c=()=>{n("update:keyword",l.value)},d=()=>{n("update:favorite",u.value)};return(m,p)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,class:"x-mask-switch-bar__left",grow:""},{default:Vue.withCtx(()=>[r.value?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSwitch),{key:0,modelValue:u.value,"onUpdate:modelValue":p[0]||(p[0]=f=>u.value=f),class:"x-mask-switch-bar__switch","active-icon":Vue.unref(VtjIcons.StarFilled),"inactive-icon":Vue.unref(VtjIcons.Menu),onChange:d},null,8,["modelValue","active-icon","inactive-icon"])),r.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),{key:1,modelValue:l.value,"onUpdate:modelValue":p[1]||(p[1]=f=>l.value=f),class:"x-mask-switch-bar__input",size:"small",placeholder:"请输入查询关键字",onInput:c,"prefix-icon":Vue.unref(VtjIcons.Search)},{suffix:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ge),{icon:Vue.unref(VtjIcons.Close),onClick:i},null,8,["icon"])]),_:1},8,["modelValue","prefix-icon"])):Vue.createCommentVNode("",!0)]),_:1})),Vue.createVNode(Vue.unref($),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":t.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!r.value&&!t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Search),mode:"icon",background:"hover",size:"default",circle:"",onClick:a},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:1,icon:Vue.unref(VtjIcons.Expand),mode:"icon",size:"default",background:"hover",onClick:s,circle:""},null,8,["icon"])):Vue.createCommentVNode("",!0),t.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.Fold),mode:"icon",size:"default",background:"hover",circle:"",onClick:s},null,8,["icon"]))]),_:1},8,["class"])]),_:1}))}}),Vl=["src"],hl={key:0},gl=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,t=VueRouter.useRouter(),n=()=>{e.url&&t.push(e.url)};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:n},{default:Vue.withCtx(()=>[Vue.renderSlot(r.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,Vl)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref($),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",hl,[Vue.renderSlot(r.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),Bt="__favorites__",Pt="__search__",vl=Vue.defineComponent({__name:"Menu",props:{collapse:{type:Boolean,default:!1},keyword:{},favorite:{type:Boolean},favorites:{},flatMenus:{},menus:{},active:{}},emits:["select"],setup(o,{emit:e}){const t=o,n=Vue.computed(()=>t.menus||[]),r=e,l=Vue.computed(()=>{var s;return String((s=t.active)==null?void 0:s.id)}),u=Vue.computed(()=>{var s;return[{id:Bt,title:"收藏",icon:VtjIcons.Star,children:(s=t.favorites)!=null&&s.length?t.favorites:[{id:Bt+"empty",disabled:!0,title:"暂无收藏菜单"}]}]}),a=Vue.computed(()=>{const s=(t.keyword||"").trim(),c=s?(t.flatMenus||[]).filter(d=>{var m;return(m=d.title)==null?void 0:m.includes(s)}):[];return[{id:Pt,title:"搜索",icon:VtjIcons.Search,children:c!=null&&c.length?c:[{id:Pt+"empty",disabled:!0,title:"查询匹配不到菜单项"}]}]}),i=s=>{r("select",s)};return(s,c)=>(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,null,[Vue.withDirectives(Vue.createVNode(Vue.unref($),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,onSelect:i},null,8,["data","default-icon","default-active"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:n.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,onSelect:i},null,8,["data","default-icon","default-active"]),[[Vue.vShow,!t.collapse]]),n.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!t.favorite&&!t.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref($),{class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:u.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__favorites",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:u.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512),[[Vue.vShow,t.favorite&&!t.keyword]]),t.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref($),{key:0,class:"x-mask-menu",grow:"",flex:!1,overflow:"auto"},{default:Vue.withCtx(()=>[Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!0,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Pt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,t.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{class:"x-mask-menu__search",subMenu:{popperClass:"x-mask-menu-popper",teleported:!0,showTimeout:200,hideTimeout:200},data:a.value,"default-icon":Vue.unref(VtjIcons.Document),collapse:!1,"collapse-transition":!1,"default-active":l.value,"default-openeds":[Pt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!t.collapse]])]),_:1},512)),[[Vue.vShow,!!t.keyword]]):Vue.createCommentVNode("",!0)],64))}}),yl="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1711803009570'%20class='icon'%20viewBox='0%200%201280%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1500'%20width='320'%20height='256'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M557.85%201023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45%2017.4c3.6-12.8%2017-20%2029.8-16.4l122%2035.4c12.8%203.6%2020%2017%2016.4%2029.8L587.65%201006.6c-3.8%2012.8-17%2020.2-29.8%2016.4z%20m-228-224.4l87-92.8c9.2-9.8%208.6-25.4-1.6-34.4L234.05%20512l181.2-159.4c10.2-9%2011-24.6%201.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65%20494.4c-10.2%209.4-10.2%2025.6%200%2035l288.2%20270.2c9.8%209.2%2025%208.8%2034-1z%20m654.4%201.2l288.2-270.2c10.2-9.4%2010.2-25.6%200-35L984.25%20224.2c-9.6-9-24.8-8.6-34%201L863.25%20318c-9.2%209.8-8.6%2025.4%201.6%2034.4L1046.05%20512l-181.2%20159.4c-10.2%209-11%2024.6-1.6%2034.4l87%2092.8c9%209.8%2024.2%2010.2%2034%201.2z'%20fill='%230157fe'%20p-id='1501'%3e%3c/path%3e%3c/svg%3e",Vo=140,ho={logo:{type:String,default:yl},title:{type:String,default:"VTJ.PRO"},menus:{type:[Array,Function],default(){return[]}},favorites:{type:[Array,Function],default(){return[]}},menuAdapter:{type:Function},home:{type:[String,Object],default:"/"},tabs:{type:Number,default:20},actions:{type:Array},avatar:{type:String},theme:{type:Boolean},disabled:{type:Boolean},addFavorite:{type:Function},removeFavorite:{type:Function},userCardWidth:{type:Number,default:350},pure:{type:Boolean}},fn=Symbol(),pn="$mask",wl={class:"x-mask-tabs__trigger"},bl={key:1},Cl=["onDragstart","onDragend"],_l={key:1},kl=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const t=o,n=e,r=c=>{const d=!!t.favorites.find(m=>{var p;return m===c.menu||m.id===((p=c.menu)==null?void 0:p.id)});return[{icon:VtjIcons.Refresh,label:"刷新",name:"refresh",value:c},"|",{icon:d?VtjIcons.StarFilled:VtjIcons.Star,label:"收藏",name:"favorite",value:c.menu,disabled:!c.menu||!!c.menu.hidden},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:c}]},l=c=>{const d=c.paneName;if(d===t.home.id){n("click",t.home);return}const m=t.tabs.find(p=>p.id===d);m&&n("click",m)},u=c=>{const d=t.tabs.find(m=>m.id===c);d&&n("remove",d)},a=c=>{switch(c.name){case"refresh":n("refresh",c.value);break;case"favorite":n("toggleFavorite",c.value);break;case"dialog":n("dialog",c.value);break}},i=(c,d)=>{d.dataTransfer&&(d.dataTransfer.setData("tab",c.id),d.target&&d.target.classList.add("is-dagging"))},s=(c,d)=>{d.target&&d.target.classList.remove("is-dagging")};return(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{ref:"tabsRef",class:"x-mask-tabs",height:"100%",grow:"",flex:"",justify:"flex-end",direction:"column"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElTabs),{type:"card","model-value":t.value,onTabRemove:u,onTabClick:l},{default:Vue.withCtx(()=>[t.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:t.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",wl,[t.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Fe)(t.home.icon)),{key:0})):Vue.createCommentVNode("",!0),t.home.title?(Vue.openBlock(),Vue.createElementBlock("span",bl,Vue.toDisplayString(t.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.tabs,m=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:m.id,name:m.id,lazy:"",closable:""},{label:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElPopover),{"open-delay":500,placement:"bottom",trigger:"hover",width:"200px",disabled:m.id!==t.value},{reference:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:"x-mask-tabs__trigger",draggable:"true",onDragstart:p=>i(m,p),onDragend:p=>s(m,p)},[m.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Fe)(m.icon)),{key:0})):Vue.createCommentVNode("",!0),m.title?(Vue.openBlock(),Vue.createElementBlock("span",_l,Vue.toDisplayString(m.title),1)):Vue.createCommentVNode("",!0)],40,Cl)]),default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(Oe),{items:r(m),mode:"text",size:"small",type:"info",onClick:a},null,8,["items"])]),_:2},1032,["disabled"])]),_:2},1032,["name"]))),128))]),_:1},8,["model-value"])]),_:1},512))}}),El=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark(),t=Vue.computed(()=>e.value?VtjIcons.Sunny:VtjIcons.Moon),n=()=>{e.value=!e.value};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{icon:t.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",type:"primary",onClick:n},null,8,["icon"]))}}),Sl={class:"x-mask-toolbar__menu-item"},xl=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,r=Vue.computed(()=>{const s=t.tabs.map((c,d)=>({divided:d===0,label:c.title,command:c}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...s]}),l=s=>{n("closeTab",s.command)},u=s=>{switch(s.command){case"all":n("closeAllTabs");break;case"other":n("closeOtherTabs");break;default:n("clickTab",s.command);break}},a=s=>{n("actionClick",s)},i=(s,c)=>{n("actionCommand",s,c)};return(s,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask-toolbar",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(te),{icon:Vue.unref(VtjIcons.MoreFilled),menus:r.value,dropdown:{size:"small"},type:"primary",mode:"icon",circle:"",background:"hover",onCommand:u},{item:Vue.withCtx(({item:d})=>[Vue.createElementVNode("span",Sl,[Vue.createTextVNode(Vue.toDisplayString(d.label)+" ",1),["other","all"].includes(d.command)?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,onClick:Vue.withModifiers(m=>l(d),["stop"]),icon:Vue.unref(VtjIcons.Close)},null,8,["onClick","icon"]))])]),_:1},8,["icon","menus"]),Vue.createVNode(Vue.unref(ElementPlus.ElDivider),{direction:"vertical"}),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(Oe),{key:0,circle:"",mode:"icon",size:"default",background:"hover",type:"primary",items:s.actions,onClick:a,onCommand:i},null,8,["items"])):Vue.createCommentVNode("",!0),t.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(El,{key:2})):Vue.createCommentVNode("",!0),t.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(s.$slots,"default")]),_:3}))}}),Bl=Vue.defineComponent({__name:"Avatar",props:{avatar:{},width:{default:350}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:e.width,"popper-class":"x-mask-avatar__popper",disabled:!t.$slots.default},{reference:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(ElementPlus.ElAvatar),{class:"x-mask-avatar",shape:"circle",icon:Vue.unref(VtjIcons.UserFilled),src:e.avatar,size:26},null,8,["icon","src"])]),default:Vue.withCtx(()=>[t.$slots.default?Vue.renderSlot(t.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["width","disabled"]))}}),go=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{},pure:{type:Boolean}},setup(o){const e=o;return(t,n)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:"x-mask__content",overflow:"auto",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",{class:Vue.normalizeClass(["x-mask__inner",{"is-pure":e.pure}])},[Vue.renderSlot(t.$slots,"default"),Vue.createVNode(Vue.unref(VueRouter.RouterView),null,{default:Vue.withCtx(({Component:r,route:l})=>[(Vue.openBlock(),Vue.createBlock(Vue.KeepAlive,{exclude:e.exclude},[r?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.createView(r,l)),{key:l.fullPath})):Vue.createCommentVNode("",!0)],1032,["exclude"]))]),_:1})],2)]),_:3}))}});function Pl(){const o=Vue.ref(!1),e=Vue.ref(""),t=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:t}}function Nl(o){const e=VtjUtils.uid();return Vue.computed(()=>{const t=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof t=="string"?{url:t}:t||{})})}function vo(o,e){let t=[];return o.forEach(n=>{n=e?e(n):n,n.children?t=t.concat(vo(n.children,e)):t.push(n)}),t}function Tl(o,e){const t=VueRouter.useRouter(),n=Vue.shallowRef([]),r=Vue.shallowRef([]),l=Vue.computed(()=>vo(n.value,o.menuAdapter)),u=Vue.computed(()=>VtjUtils.arrayToMap(l.value,"id")),a=Vue.ref(null),i=f=>{const V=typeof f=="object"?f.id:f,h=u.value.get(V);if(!h){console.warn("找不到菜单",f);return}const{type:y="route",url:g,title:w,icon:v}=h;if(!g){a.value=h,e("select",h);return}if(y==="route"){VtjUtils.isUrl(g)||g.startsWith("//")?window.open(g):(a.value=h,t.push(g).catch(C=>C));return}if(y==="window"){window.open(g);return}y==="dialog"&&xt({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:w,icon:v,src:g})},s=()=>P(this,null,function*(){var f,V;n.value=typeof o.menus=="function"?(yield o.menus())||[]:(f=o.menus)!=null?f:[],r.value=typeof o.favorites=="function"?(yield o.favorites())||[]:(V=o.favorites)!=null?V:[]}),c=f=>{r.value=[f,...r.value],o.addFavorite&&o.addFavorite(f)},d=f=>{r.value=r.value.filter(V=>V.id!==f.id),o.removeFavorite&&o.removeFavorite(f)},m=f=>!!r.value.find(V=>V===f||V.id===f.id),p=f=>{m(f)?d(f):c(f)};return Vue.watchEffect(s),{menus:n,favorites:r,flatMenus:l,active:a,select:i,toggleFavorite:p}}function Dl(o,e,t,n,r){const l=VueRouter.useRoute(),u=VueRouter.useRouter(),a={},i=Vue.ref([]),s=Vue.ref(),{width:c}=VueUse.useElementSize(s),d=Vue.computed(()=>Math.floor(c.value/Vo)),m=Vue.computed(()=>i.value.slice(0,d.value).filter(D=>!D.dialog)),p=Vue.computed(()=>i.value.slice(d.value)),f=D=>t.value.find(_=>_.url===D),V=D=>l.fullPath===D.url,h=D=>r.value.id===D.id,y=D=>r.value.id===D?r.value:i.value.find(_=>_.id===D),g=Vue.ref(""),w=Vue.computed(()=>y(g.value)),v=D=>{u.push(D.url).catch(_=>_)},C=D=>{g.value=D.id,l.fullPath!==D.url&&v(D)},S=()=>{v(r.value)},b=D=>{const _=i.value.find(k=>k.url===D.url||k.id===D.id);_?C(_):(i.value.unshift(D),C(D))},T=D=>P(this,null,function*(){var it;const{url:_=l.fullPath,icon:k,title:B}=D||{},U=a[_],W=VtjUtils.uid(),Ve=VtjUtils.upperFirstCamelCase(_);return N({id:W,name:Ve,url:_,icon:k,title:B||((it=f(l.path))==null?void 0:it.title)||"新建页签",closable:!0,menu:D},U?yield U():{})}),z=(D,_)=>P(this,null,function*(){if(!(!_&&!(yield ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)))){if(i.value=i.value.filter(k=>k.id!==D.id),g.value===D.id){const k=i.value[0];v(k||r.value)}return D}}),j=D=>{const _=i.value.findIndex(k=>k.id===D.id);if(_>=0){const k=i.value[_];i.value.splice(_,1,Object.assign(k,D))}},H=()=>P(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value;return i.value=[],C(r.value),_}),L=()=>P(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value.filter(k=>k.id!==g.value);return i.value=i.value.filter(k=>k.id===g.value),_}),F=D=>{const _=i.value.filter(k=>k.id!==D.id);i.value=[D,..._],C(D)},ne=D=>P(this,null,function*(){w.value&&w.value.closable&&(h(w.value)||(yield z(w.value,!0),yield VtjUtils.delay(0),D?u.push(D):u.push(r.value.url)))}),se=()=>P(this,null,function*(){yield Vue.nextTick();const D=r.value.url===l.path,_=f(l.fullPath);if(D)g.value=r.value.id;else{const k=yield T(_);b(k)}yield Vue.nextTick(),n.value=_||null});return Vue.watch(t,se),Vue.watch(l,se),Vue.provide(fn,a),{tabRef:s,tabs:i,showTabs:m,currentTab:w,changeTab:v,removeTab:z,updateTab:j,addTab:b,home:r,tabValue:g,isCurrentTab:V,activeHome:S,activeTab:C,dropdownTabs:p,removeAllTabs:H,removeOtherTabs:L,moveToShow:F,closeCurrnetTab:ne}}function zl(o,e){const t=new Map,n=Vue.ref([]),r=Vue.reactive({}),l=Vue.getCurrentInstance(),u={},{updateTab:a,isCurrentTab:i,activeHome:s,tabs:c}=o,d=(v,C)=>{const S=C.fullPath;if(t.has(S))return t.get(S);{const b=VtjUtils.upperFirstCamelCase(S),T={name:b,setup(){const z=Vue.computed(()=>r[S]||document.body),j=Vue.computed(()=>!r[S]),H=Vue.computed(()=>!n.value.includes(b));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw(N({},C))),()=>H.value?Vue.h(Vue.Teleport,{to:z.value,disabled:j.value},[Vue.h(v)]):null}};return t.set(S,T),T}},m=v=>{v.dialog=void 0,delete r[v.url];const C=u[v.id];C&&(C.destroy(),delete u[v.id],a(v))},p=(v=[])=>{v.forEach(C=>{m(C)})},f=v=>P(this,null,function*(){v.dialog=X(N({},v.dialog),{pure:e.pure,onMinimized:()=>{m(v)},onClose:()=>P(this,null,function*(){m(v),c.value=c.value.filter(S=>S.id!==v.id)})}),a(v);const C=xt(X(N({title:v.title,icon:v.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0},v.dialog),{onOpen(S){var b,T;r[v.url]=(T=(b=S.refs.panelRef)==null?void 0:b.bodyRef)==null?void 0:T.$el}}),l==null?void 0:l.appContext);return yield Vue.nextTick(),i(v)&&s(),u[v.id]=C,C}),V=v=>P(this,null,function*(){n.value=[v.name],yield Vue.nextTick(),n.value=[]}),h=v=>P(this,null,function*(){n.value=v.map(C=>C.name),yield Vue.nextTick(),n.value=[]}),y=v=>(v.preventDefault(),!1),g=v=>{if(v.dataTransfer){const C=v.dataTransfer.getData("tab"),S=c.value.find(b=>b.id===C);if(S){const{clientX:b,clientY:T}=v;S.dialog={left:b,top:T},f(S)}}},w=v=>!!r[v];return VueUse.useEventListener(document,"dragover",y),VueUse.useEventListener(document,"drop",g),{createView:d,openDialog:f,refresh:V,exclude:n,cleanCache:h,hasDialog:w,closeDialog:m,closeDialogs:p}}const yo=Vue.defineComponent({name:"XMask",__name:"Mask",props:ho,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const t=o,n=e,r=Nl(t),{collapsed:l,keyword:u,favorite:a}=Pl(),{menus:i,favorites:s,flatMenus:c,active:d,select:m,toggleFavorite:p}=Tl(t,n),{tabRef:f,showTabs:V,currentTab:h,changeTab:y,removeTab:g,tabs:w,updateTab:v,isCurrentTab:C,activeHome:S,removeAllTabs:b,removeOtherTabs:T,dropdownTabs:z,moveToShow:j,closeCurrnetTab:H}=Dl(t,n,c,d,r),{createView:L,openDialog:F,closeDialog:ne,refresh:se,exclude:D,cleanCache:_,closeDialogs:k}=zl({tabs:w,updateTab:v,isCurrentTab:C,activeHome:S},t),B=Y=>P(this,null,function*(){(yield g(Y))&&(yield _([Y]))}),U=()=>P(this,null,function*(){const Y=yield b();Y&&(k(Y),yield _(Y))}),W=()=>P(this,null,function*(){const Y=yield T();Y&&(k(Y),yield _(Y))}),Ve=Y=>{n("actionClick",Y)},it=(Y,ce)=>{n("actionCommand",Y,ce)},Xi=Y=>P(this,null,function*(){const ce=Vue.toValue(Y||h);ce&&(ce.dialog&&ne(ce),yield g(ce,!0),yield VtjUtils.delay(50))});return Vue.watch(h,Y=>{Y!=null&&Y.dialog&&ne(Y)}),Vue.provide(pn,{tabs:w,flatMenus:c,favorites:s,updateTab:v,active:d,currentTab:h,closeCurrnetTab:H,close:Xi}),(Y,ce)=>(Vue.openBlock(),Vue.createBlock(Vue.unref($),{class:Vue.normalizeClass(["x-mask",{"is-disabled":t.disabled}]),fit:""},{default:Vue.withCtx(()=>[t.disabled?(Vue.openBlock(),Vue.createBlock(go,{key:1,createView:Vue.unref(L),exclude:Vue.unref(D),pure:t.pure},{default:Vue.withCtx(()=>[Y.$slots.default?Vue.renderSlot(Y.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude","pure"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(pl,{collapsed:Vue.unref(l)},{brand:Vue.withCtx(()=>[Vue.createVNode(gl,{logo:t.logo,title:t.title,url:Vue.unref(r).url,collapsed:Vue.unref(l)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(ml,{collasped:Vue.unref(l),"onUpdate:collasped":ce[0]||(ce[0]=Ae=>Vue.isRef(l)?l.value=Ae:null),favorite:Vue.unref(a),"onUpdate:favorite":ce[1]||(ce[1]=Ae=>Vue.isRef(a)?a.value=Ae:null),keyword:Vue.unref(u),"onUpdate:keyword":ce[2]||(ce[2]=Ae=>Vue.isRef(u)?u.value=Ae:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(vl,{collapse:Vue.unref(l),keyword:Vue.unref(u),favorite:Vue.unref(a),favorites:Vue.unref(s),flatMenus:Vue.unref(c),menus:Vue.unref(i),active:Vue.unref(d),onSelect:Vue.unref(m)},null,8,["collapse","keyword","favorite","favorites","flatMenus","menus","active","onSelect"])]),_:1},8,["collapsed"]),Vue.createVNode(Vue.unref($),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column",overflow:"hidden"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref($),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>{var Ae;return[Vue.createVNode(kl,{ref_key:"tabRef",ref:f,favorites:Vue.unref(s),tabs:Vue.unref(V),home:Vue.unref(r),value:(Ae=Vue.unref(h))==null?void 0:Ae.id,onClick:Vue.unref(y),onToggleFavorite:Vue.unref(p),onRemove:B,onDialog:Vue.unref(F),onRefresh:Vue.unref(se)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(xl,{tabs:Vue.unref(z),actions:t.actions,theme:t.theme,onCloseOtherTabs:W,onCloseAllTabs:U,onCloseTab:B,onClickTab:Vue.unref(j),onActionClick:Ve,onActionCommand:it},{default:Vue.withCtx(()=>[Vue.createVNode(Bl,{avatar:t.avatar,width:t.userCardWidth},Vue.createSlots({_:2},[Y.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(Y.$slots,"user")]),key:"0"}:void 0]),1032,["avatar","width"])]),_:3},8,["tabs","actions","theme","onClickTab"])]}),_:3}),Vue.createVNode(go,{createView:Vue.unref(L),exclude:Vue.unref(D),pure:t.pure},{default:Vue.withCtx(()=>[Y.$slots.default?Vue.renderSlot(Y.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude","pure"])]),_:3})],64))]),_:3},8,["class"]))}});function Il(o={}){const e=VueRouter.useRoute(),t=Vue.inject(fn,null),n=Vue.inject(pn,null);if(t){const l=typeof o=="function"?o:()=>P(this,null,function*(){return o});t[e.fullPath]=l}return{tab:Vue.computed(()=>n?n.tabs.value.find(l=>l.url===e.fullPath):null),mask:n}}const mn=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},emits:["change"],setup(o,{emit:e}){const t=o,n=e,r=l=>{const u=t.options.filter(a=>Array.isArray(l)?l.includes(a.value):l===a.value);n("change",l,u)};return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElSelect),Vue.mergeProps(l.$attrs,{onChange:r}),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(t.options,(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElOption),Vue.mergeProps({key:`item_${i}_${a.value}`,ref_for:!0},a),Vue.createSlots({_:2},[l.$slots.option?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(l.$slots,"option",{option:a})]),key:"0"}:void 0]),1040))),128))]),_:3},16))}}),Ml=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(n,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${u}_${l.value}`,ref_for:!0},l),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:2},1040))),128))]),_:1},16))}}),Al=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,t=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(n,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(n.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.value),Vue.mergeProps({key:`item_${u}_${l.value}`,ref_for:!0},l),{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(l.label),1)]),_:2},1040))),128))]),_:1},16))}}),je={filterResetMethod(o){const{options:e,column:t}=o;if(t.filterResetMethod){t.filterResetMethod(o);return}e.forEach(n=>{n.value=""})},filterRecoverMethod(o){const{option:e,column:t}=o;if(t.filterRecoverMethod){t.filterRecoverMethod(o);return}e.value=""},filterMethod(o){const{option:e,row:t,column:n}=o;if(n.filterMethod)return n.filterMethod(o);const{value:r}=e,l=t[n.field];return VtjUtils.isString(l)?l.indexOf(String(r))>-1:l===r}},$l=Vue.defineComponent({name:"InputEdit",__name:"InputEdit",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:t,renderEvents:n,cellValue:r,onChange:l}=Ye(e.renderOpts,e.params);return(u,a)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElInput),Vue.mergeProps({size:"small",clearable:"",modelValue:Vue.unref(r),"onUpdate:modelValue":a[0]||(a[0]=i=>Vue.isRef(r)?r.value=i:null),onInput:Vue.unref(l)},Vue.unref(t),Vue.toHandlers(Vue.unref(n))),null,16,["modelValue","onInput"]))}}),Rl={class:"x-grid__filter"},Vn=Vue.defineComponent({name:"InputFilter",__name:"InputFilter",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:t,renderEvents:n,state:r,load:l,onChange:u,onKeyup:a}=Xt(e.renderOpts,e.params);return l(),(i,s)=>(Vue.openBlock(),Vue.createElementBlock("div",Rl,[Vue.createVNode(Vue.unref(ElementPlus.ElInput),Vue.mergeProps({size:"small",placeholder:"输入关键字回车筛选",clearable:"",modelValue:Vue.unref(r).option.value,"onUpdate:modelValue":s[0]||(s[0]=c=>Vue.unref(r).option.value=c),onInput:Vue.unref(u),onKeyup:Vue.withKeys(Vue.withModifiers(Vue.unref(a),["stop"]),["enter"])},Vue.unref(t),Vue.toHandlers(Vue.unref(n))),null,16,["modelValue","onInput","onKeyup"])]))}}),Je={autofocus:".el-input__inner",renderDefault(o,e){var r;const{row:t,column:n}=e;return[Vue.createTextVNode((r=t[n.field])!=null?r:"")]},renderEdit(o,e){return[Vue.h($l,{params:e,renderOpts:o})]},renderCell(o,e){var r;const{row:t,column:n}=e;return[Vue.createTextVNode((r=t[n.field])!=null?r:"")]}},Fl=X(N(N({cellClassName:"x-grid__edit"},Je),je),{renderFilter(o,e){return[Vue.h(Vn,{params:e,renderOpts:o})]}});/**!
8
8
  * Sortable 1.15.6
9
9
  * @author RubaXa <trash@rubaxa.org>
10
10
  * @author owenm <owen23355@gmail.com>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/ui",
3
3
  "private": false,
4
- "version": "0.9.0-alpha.46",
4
+ "version": "0.9.0-alpha.48",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"
@@ -12,8 +12,8 @@
12
12
  "sortablejs": "~1.15.6",
13
13
  "vxe-table": "~4.6.17",
14
14
  "vxe-table-plugin-menus": "~4.0.3",
15
- "@vtj/icons": "~0.9.0-alpha.46",
16
- "@vtj/utils": "~0.9.0-alpha.46"
15
+ "@vtj/utils": "~0.9.0-alpha.48",
16
+ "@vtj/icons": "~0.9.0-alpha.48"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/qrcode": "^1.5.5",
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/ui
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.9.0-alpha.45
5
+ * @version 0.9.0-alpha.47
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.9.0-alpha.45";
8
+ export declare const version = "0.9.0-alpha.47";