@vtj/ui 0.8.159 → 0.8.160

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 Rt, VxeGrid as nr, VxeTableFilterModule as tl, 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.8.159
12
+ * @version 0.8.160
13
13
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
14
14
  */
15
- const Q2 = "0.8.159", dl = {
15
+ const Q2 = "0.8.160", dl = {
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.8.159
5
+ * @version 0.8.160
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
- */const K="0.8.159",Q={default:14,small:12,large:18},kt={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 ce(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 t=Number.parseInt(o);return Math.floor(e*t/100)}return Number.parseInt(o)}function it(o,e={}){const n=P({},e);return typeof o=="boolean"?n:Object.assign(n,o||{})}const Fe="__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 $r={getCustom:o=>N(this,null,function*(){return VtjUtils.storage.get(o,{type:"local"})}),saveCustom:o=>N(this,null,function*(){VtjUtils.storage.save(o.id,o,{type:"local"})})},Fr={install(o,e={}){const n=Object.assign($r,e),{components:t=[],fieldEditors:r={}}=n;Go(r);for(const l of t)l.name&&o.component(l.name,l);[ElementPlus.ElMessage,ElementPlus.ElMessageBox,ElementPlus.ElNotification].forEach(l=>{o.use(l)}),o.config.globalProperties.$adapter=n,o.provide(he,n)}},Qn=(o=[])=>({install:(n,t={})=>{n[Fe]||(n[Fe]=!0,o.forEach(r=>{r.name&&n.component(r.name,r)}),t.adapter&&n.provide(he,t.adapter))}}),Rr=["src"],ge=Vue.defineComponent({name:"XIcon",__name:"Icon",props:kt,setup(o){const e=o,n=Vue.useAttrs(),t=Vue.getCurrentInstance(),r=Vue.computed(()=>{if(!e.icon)return null;const i=t==null?void 0:t.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":!!n.onClick};return!r.value&&e.icon&&(i[e.icon]=!0),i}),u=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?ce(e.radius):void 0,padding:e.padding?ce(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,Rr)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),Or={class:"x-menu__wrapper"},jr={key:1,class:"x-menu__title"},Ur={key:0,class:"x-menu__title"},Zn=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,n=Vue.getCurrentInstance(),t=u=>{if(u){if(typeof u=="string"){const a=n==null?void 0:n.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",Or,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:t(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",jr,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(Zn),{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",Ur,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:t(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 n=o,t=e,r=Vue.computed(()=>n.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&&t("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(Zn),{item:H(P({},s),{icon:s.icon}),defaultIcon:n.defaultIcon,subMenu:n.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),rn={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 Lr(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function Hr(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function Xr(o){return Vue.computed(()=>{const{dropdown:e,menus:n}=o;if(n&&n.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function eo(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const n=Vue.unref(o);if(n)if(typeof n=="string"||n.setup||n.render||Vue.isVNode(n)){const t=e==null?void 0:e.appContext.app;return{icon:typeof n=="string"&&(t==null?void 0:t.component(n))||n}}else return n;return null})}function Re(o){const e=eo(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(ge,e.value)})):void 0}function Et(o,e){return Vue.computed(()=>{const n=Vue.unref(o);return typeof n=="function"?n(e):!!n})}function to(o,e,n){const t=Vue.shallowRef(e),r=Vue.ref(!1),l=a=>N(this,null,function*(){const i=Vue.unref(o);return i?typeof i=="function"?yield i(a):i:e}),u=a=>N(this,null,function*(){return r.value=!0,yield l(a).then(i=>(t.value=i||e,r.value=!1,Vue.unref(t)))});return Vue.watch(()=>o,()=>{u(n)},{immediate:!0}),n&&Vue.watch(n,()=>{u(n)}),{data:t,loading:r,loader:u}}function Yr(o=1e3){const e=Vue.ref(0);let n;const t=()=>{n=VtjUtils.rAF(()=>{++e.value,e.value<o&&t()})};return Vue.onMounted(t),Vue.onUnmounted(()=>{n&&VtjUtils.cAF(n)}),r=>e.value>=r}function no(o=[]){const e=Vue.useSlots();return Object.keys(e).filter(n=>!o.includes(n))}const Kr={key:0},Gr=Vue.defineComponent({__name:"Trigger",props:rn,emits:["click"],setup(o,{emit:e}){const n=o,t=e,r=Re(Vue.toRef(n,"icon")),l=Et(Vue.toRef(n,"disabled")),u=Vue.computed(()=>({[`is-${n.mode}`]:!!n.mode,[`is-${n.type}`]:!!n.type,[`is-${n.size}`]:!!n.size&&n.size!=="default",[`is-background-${n.background}`]:n.mode==="icon"&&!!n.background,"is-disabled":!!n.disabled,"is-circle":!!n.circle})),a=i=>{if(i.preventDefault(),!l.value)return t("click"),!1};return(i,s)=>n.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(r),type:n.type,size:n.size,disabled:Vue.unref(l)},n.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",Kr,Vue.toDisplayString(i.label),1)):Vue.createCommentVNode("",!0)],2))}}),Wr=["draggable"],te=Vue.defineComponent({name:"XAction",__name:"Action",props:rn,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const n=o,t=Vue.useSlots(),r=e,l=Lr(n),u=Hr(n),a=Xr(n),i=Et(Vue.toRef(n,"disabled")),s=Vue.computed(()=>!!n.draggable&&!i.value),c=Vue.computed(()=>({[`x-action--${n.mode}`]:!!n.mode})),d=()=>{i.value||r("click",Vue.toRaw(n))},m=h=>{var w;if(i.value)return;const C=(w=n.menus)==null?void 0:w.find(S=>S.command===h);C&&r("command",Vue.toRaw(C))},p=h=>{s&&r("dragstart",Vue.toRaw(n),h)},f=h=>{s&&r("dragend",Vue.toRaw(n),h)},V=h=>Vue.h(ElementPlus.ElBadge,u.value,()=>[].concat(h)),g=h=>Vue.h(ElementPlus.ElDropdown,H(P({},a.value),{disabled:i.value,onCommand:m}),{default:()=>[h],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(n.menus||[]).map((C,w)=>Vue.h(ElementPlus.ElDropdownItem,C,()=>t.item?t.item({item:C,index:w}):C.label)))]}),y=h=>Vue.h(ElementPlus.ElTooltip,H(P({},l.value),{disabled:i.value}),()=>[h]),v=Vue.computed(()=>{var w;let h=Vue.h(Vue.markRaw(Gr),H(P({},n),{onClick:d}));const C=(w=t.default)==null?void 0:w.call(t);return C&&C.length&&(h=C[0]),u.value&&(h=V(h)),a.value&&(h=g(h)),l.value&&(h=y(h)),h});return(h,C)=>(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(v.value)))],42,Wr))}}),oo={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:oo,emits:["click","command"],setup(o,{emit:e}){const n=o,t=e,r=Vue.computed(()=>(n.items||[]).map(a=>a==="|"?a:H(P({},a),{badge:a.badge?P(P({},n.badge),typeof a.badge=="object"?a.badge||{}:{value:a.badge}):void 0,tooltip:a.tooltip?P(P({},n.tooltip),typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}):void 0}))),l=a=>{t("click",a)},u=(a,i)=>{t("command",a,i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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:n.mode,size:n.size,type:n.type,circle:n.circle,background:n.background,button:n.button,dropdown:n.dropdown,disabled:Vue.unref(Et)(n.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}))}}),ro={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}},F=Vue.defineComponent({name:"XContainer",__name:"Container",props:ro,setup(o,{expose:e}){const n=o,t=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":n.fit,"is-flex":n.flex&&!n.inline,"is-inline-flex":n.flex&&n.inline,[`is-direction-${n.direction}`]:n.flex&&n.direction!=="row",[`is-wrap-${n.wrap}`]:n.flex&&n.wrap!=="nowrap",[`is-justify-${n.justify}`]:n.flex&&n.justify!=="flex-start",[`is-align-${n.align}`]:n.flex&&n.align!=="flex-start",[`is-align-content-${n.alignContent}`]:n.flex&&n.alignContent!=="stretch","is-grow":(c=n.grow)!=null?c:a.value,"is-shrink":n.shrink,[`is-align-self-${n.alignSelf}`]:a.value&&n.alignSelf!=="auto",[`is-overflow-${n.overflow}`]:!!n.overflow,"is-padding":!!n.padding,"is-pointer":n.autoPointer&&!!t.onClick,"is-gap":!!n.gap}}),s=Vue.computed(()=>{const{width:c,height:d,fit:m}=n;return m?null:{width:c?ce(c):void 0,height:d?ce(d):void 0}});return e({$vtjEl:u}),(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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"]))}}),lo={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},qr={class:"x-header__content"},Jr={key:0,class:"x-header__actions"},ln=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:lo,setup(o){const e=o,n=Re(Vue.toRef(e,"icon")),t=Vue.useAttrs(),r=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!t.onClick}));return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-header",r.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",r.value]),grow:"",onClick:Vue.unref(t).onClick},{default:Vue.withCtx(()=>[Vue.unref(n)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(n)),{key:0,class:"x-header__icon",onClick:Vue.unref(t).onClickIcon||Vue.unref(t).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",qr,[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(t).onClick&&Vue.unref(t).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",Jr,[Vue.renderSlot(l.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),ao={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}},Ke=Vue.defineComponent({name:"XPanel",__name:"Panel",props:ao,setup(o,{expose:e}){const n=o,t=Vue.ref(),r=Vue.computed(()=>({"x-panel--card":!!n.card,"x-panel--default":!n.card,[`is-${n.size}`]:!!n.size&&n.size!=="default","is-border":!!n.border,"is-radius":!!n.radius,[`is-shadow-${n.shadow}`]:!!n.shadow&&n.shadow!=="none"})),l=Vue.computed(()=>n.header===null?null:typeof n.header=="string"?{content:n.header,size:n.size}:H(P({},n.header),{size:n.size})),u=Vue.computed(()=>n.fit||n.height?"auto":void 0);return e({bodyRef:t}),(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-panel",r.value]),direction:"column",fit:n.fit,width:n.width,height:n.height},{default:Vue.withCtx(()=>[l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(ln),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(F),Vue.mergeProps({ref_key:"bodyRef",ref:t,flex:!1,overflow:u.value,grow:"",padding:"",class:"x-panel__body"},n.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(F),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},n.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),uo="user-select-none";class an{constructor(e,n={}){Be(this,"scope");Be(this,"dragging",!1);this.el=e,this.options=n,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}getHandle(){const{selector:e,handle:n}=this.options;return e?this.el.querySelector(e):n}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:n}=this,{disabled:t,delay:r=150,onStart:l,onEnd:u}=n;if(t)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,H(P({initialValue:{x:c.x,y:c.y}},n),{handle:i,onStart:(f,V)=>{document.body.classList.add(uo),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(uo),this.dragging&&d){this.dragging=!1;const{x:g,y}=f,v=this.getPosition(d,c,g,y);u&&u(v,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,n,t,r){const{edge:l=50}=this.options,u=-n.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(t,u)),d=Math.min(s,Math.max(r,i));return{x:c-e.x,y:d-e.y}}destory(){this.scope.stop()}}const io={mounted(o,e){const n=e.value||{},t=new an(o,n);o.__draggable__=t},updated(o,e){const n=e.value||{};let t=o.__draggable__;t&&!VtjUtils.isEqual(t.options,n)&&(t.destory(),o.__draggable__=new an(o,n))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},un="user-select-none";class sn{constructor(e,n={}){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=n,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}init(){const{el:e,options:n}=this,{disabled:t,onStart:r,onEnd:l}=n;if(t)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(un):s.classList.remove(un)});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:n,resizing:t,options:r,el:l}=this,u=(n==null?void 0:n.value)||"";if(!e||!t.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:g=99999,maxHeight:y=99999}=r;if(u.includes("e")){const v=Math.min(Math.max(s.value,f),g);l.style.width=`${v}px`}if(u.includes("s")){const v=Math.min(Math.max(c.value,V),y);l.style.height=`${v}px`}if(u.includes("w")){const v=Math.min(Math.max(m.value-s.value,f),g);l.style.width=`${v}px`,l.style.left=`${a.value}px`}if(u.includes("n")){const v=Math.min(Math.max(d.value-c.value,V),y);this.el.style.height=`${v}px`,this.el.style.top=`${i.value}px`}p&&p(u,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:n,elementHeight:t,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")&&n.value<=a?i+="n":u.includes("s")&&n.value>t.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 n;const e=document.body;e.style.cursor="",e.classList.remove(un),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),(n=this.MIE)==null||n.stop(),this.scope.stop()}}const cn={mounted(o,e){const n=e.value||{},t=new sn(o,n);o.__resizable__=t},updated(o,e){const n=e.value||{};let t=o.__resizable__;t&&!VtjUtils.isEqual(t.options,n)&&(t.destory(),o.__resizable__=new sn(o,n))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},so={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}};let Ge=1e3;function Qr(o,e){const{width:n,height:t}=VueUse.useElementSize(e),r=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++Ge,dragging:!1,resizing:!1});return Vue.watch([n,t],([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=>{Ge=Math.max(l.zIndex,Ge)}),{state:r,normal:Vue.computed(()=>r.mode==="normal"),maximized:Vue.computed(()=>r.mode==="maximized"),minimized:Vue.computed(()=>r.mode==="minimized")}}function Zr(o,e){const n=Vue.computed(()=>{const{width:u,height:a,top:i,left:s,zIndex:c}=e;return{width:`${u}px`,height:`${a}px`,top:`${i}px`,left:`${s}px`,zIndex:c}}),t=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary})),r=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),l=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:n,classes:t,wrapperClass:r,modalStyle:l}}function el(o,e,n){const t=c=>{e.mode=c,["maximized","minimized","normal"].includes(c)&&n(c),n("modeChange",c)},r=()=>N(this,null,function*(){(!o.beforeClose||(yield o.beforeClose()))&&(n("update:modelValue",!1),n("close"),n("destroy"))});return{close:r,changeMode:t,show:()=>t("normal"),hide:()=>t("minimized"),active:c=>{const d=c.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++Ge))},submit:()=>n("submit"),cancel:()=>{n("cancel"),r()}}}function tl(o,e,n,t){return Vue.computed(()=>{var l;const r=typeof o.draggable=="boolean"?!o.draggable:!!((l=o.draggable)!=null&&l.disabled);return H(P({},VtjUtils.isObject(o.draggable)?o.draggable:{}),{disabled:r,target:t,selector:".x-panel__header",onStart(u){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++Ge),n("dragStart",u)},onMove(u){n("dragging",u)},onEnd(u){if(e.mode==="maximized")return;const{x:a,y:i}=u;e.left=a,e.top=i,e.dragging=!1,n("dragEnd",u)}})})}function nl(o,e,n){return Vue.computed(()=>{var r;const t=typeof o.resizable=="boolean"?!o.resizable:!!((r=o.resizable)!=null&&r.disabled);return H(P({minWidth:200,minHeight:150},VtjUtils.isObject(o.resizable)?o.resizable:{}),{disabled:t,dirs:["e","s","w"],onStart(l,u){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++Ge),n("resizeStart",l,u)},onResizing(l,u){n("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,n("resizeEnd",l,u)}})})}function ol(o,e){const n=o.componentInstance;if(!n)return;let t=null;return Vue.onMounted(()=>{const r=Vue.unref(e),l=Vue.unref(r==null?void 0:r.bodyRef);t=n.$el,l&&l.$el&&l.$el.appendChild(t)}),Vue.onUnmounted(()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),{componentInstance:n}}const rl=["src"],We=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:so,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:n}){const t=o,r=n,l=Vue.getCurrentInstance(),u=Vue.ref(),a=Vue.ref(),{state:i,maximized:s,minimized:c,normal:d}=Qr(t,u),{styles:m,classes:p,wrapperClass:f,modalStyle:V}=Zr(t,i),{changeMode:g,active:y,close:v,show:h,hide:C,submit:w,cancel:S}=el(t,i,r),b=tl(t,i,r,u),z=nl(t,i,r),D=ol(t,a);Vue.watchEffect(()=>N(this,null,function*(){t.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 R=Vue.computed(()=>{var $;return($=a.value)==null?void 0:$.$el});return e({$vtjEl:R,panelRef:a,state:i,maximized:s,minimized:c,changeMode:g,show:h,hide:C,submit:w,cancel:S,close:v,componentInstance:D}),($,Y)=>t.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)])},[t.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(Ke),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(p)],card:"",shadow:"always",header:{icon:t.icon,subtitle:t.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(m),size:t.size,body:{padding:t.bodyPadding},onClick:Vue.unref(y)},$.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(t.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"actions"),t.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[0]||(Y[0]=U=>Vue.unref(g)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),t.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:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[2]||(Y[2]=U=>Vue.unref(g)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Popup),size:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[1]||(Y[1]=U=>Vue.unref(g)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),t.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:t.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(v)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"default",{},()=>[t.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.content),{key:0})):Vue.createCommentVNode("",!0),t.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:t.src,class:"x-dialog__frame"},null,8,rl)):Vue.createCommentVNode("",!0)])]),_:2},[t.cancel||t.submit||$.$slots.footer||$.$slots.extra||$.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref(F),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref(F),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"handle"),t.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:t.size,onClick:Vue.unref(S)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof t.cancel=="string"?t.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),t.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:t.size,onClick:Vue.unref(w)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof t.submit=="string"?t.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(io),Vue.unref(b)],[Vue.unref(cn),Vue.unref(z)]])],2)])):Vue.createCommentVNode("",!0)}});function St(o,e){const n=document.createElement("div"),t=Vue.createVNode(We,o);t.appContext=e!=null?e:St._context,Vue.render(t,n);const r=()=>{var l;Vue.render(null,n),(l=n.parentNode)==null||l.removeChild(n)};return t.props.onDestroy=()=>{r()},document.body.appendChild(n),{vnode:t,destroy:r}}const ll=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(n,t)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(n.$slots,"brand"),Vue.createVNode(Vue.unref(F),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(n.$slots,"default"),t[0]||(t[0]=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1))]),_:3})]),_:3},8,["class"])),[[Vue.unref(cn),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),al=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 n=o,t=e,r=Vue.ref(!1),l=Vue.ref(""),u=Vue.ref(!1),a=()=>{r.value=!0},i=()=>{l.value="",r.value=!1,t("update:keyword",l.value)},s=()=>{t("update:collasped",!n.collasped)},c=()=>{t("update:keyword",l.value)},d=()=>{t("update:favorite",u.value)};return(m,p)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[n.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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(F),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":n.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!r.value&&!n.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),n.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),n.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}))}}),ul=["src"],il={key:0},sl=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,n=VueRouter.useRouter(),t=()=>{e.url&&n.push(e.url)};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:t},{default:Vue.withCtx(()=>[Vue.renderSlot(r.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,ul)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref(F),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",il,[Vue.renderSlot(r.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),xt="__favorites__",Bt="__search__",cl=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 n=o,t=Vue.computed(()=>n.menus||[]),r=e,l=Vue.computed(()=>{var s;return String((s=n.active)==null?void 0:s.id)}),u=Vue.computed(()=>{var s;return[{id:xt,title:"收藏",icon:VtjIcons.Star,children:(s=n.favorites)!=null&&s.length?n.favorites:[{id:xt+"empty",disabled:!0,title:"暂无收藏菜单"}]}]}),a=Vue.computed(()=>{const s=(n.keyword||"").trim(),c=s?(n.flatMenus||[]).filter(d=>{var m;return(m=d.title)==null?void 0:m.includes(s)}):[];return[{id:Bt,title:"搜索",icon:VtjIcons.Search,children:c!=null&&c.length?c:[{id:Bt+"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(F),{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:t.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,n.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:t.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,!n.collapse]]),t.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!n.favorite&&!n.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref(F),{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":[xt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,n.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":[xt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!n.collapse]])]),_:1},512),[[Vue.vShow,n.favorite&&!n.keyword]]),n.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,n.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":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!n.collapse]])]),_:1},512)),[[Vue.vShow,!!n.keyword]]):Vue.createCommentVNode("",!0)],64))}}),dl="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",co=140,fo={logo:{type:String,default:dl},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}},dn=Symbol(),fn="$mask",fl={class:"x-mask-tabs__trigger"},pl={key:1},ml=["onDragstart","onDragend"],Vl={key:1},hl=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const n=o,t=e,r=c=>{const d=!!n.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},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:c}]},l=c=>{const d=c.paneName;if(d===n.home.id){t("click",n.home);return}const m=n.tabs.find(p=>p.id===d);m&&t("click",m)},u=c=>{const d=n.tabs.find(m=>m.id===c);d&&t("remove",d)},a=c=>{switch(c.name){case"refresh":t("refresh",c.value);break;case"favorite":t("toggleFavorite",c.value);break;case"dialog":t("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(F),{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":n.value,onTabRemove:u,onTabClick:l},{default:Vue.withCtx(()=>[n.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:n.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",fl,[n.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Re)(n.home.icon)),{key:0})):Vue.createCommentVNode("",!0),n.home.title?(Vue.openBlock(),Vue.createElementBlock("span",pl,Vue.toDisplayString(n.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(n.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!==n.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(Re)(m.icon)),{key:0})):Vue.createCommentVNode("",!0),m.title?(Vue.openBlock(),Vue.createElementBlock("span",Vl,Vue.toDisplayString(m.title),1)):Vue.createCommentVNode("",!0)],40,ml)]),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))}}),gl=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark(),n=Vue.computed(()=>e.value?VtjIcons.Sunny:VtjIcons.Moon),t=()=>{e.value=!e.value};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{icon:n.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",type:"primary",onClick:t},null,8,["icon"]))}}),vl={class:"x-mask-toolbar__menu-item"},yl=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const n=o,t=e,r=Vue.computed(()=>{const s=n.tabs.map((c,d)=>({divided:d===0,label:c.title,command:c}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...s]}),l=s=>{t("closeTab",s.command)},u=s=>{switch(s.command){case"all":t("closeAllTabs");break;case"other":t("closeOtherTabs");break;default:t("clickTab",s.command);break}},a=s=>{t("actionClick",s)},i=(s,c)=>{t("actionCommand",s,c)};return(s,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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",vl,[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"}),n.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),n.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),n.theme?(Vue.openBlock(),Vue.createBlock(gl,{key:2})):Vue.createCommentVNode("",!0),n.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(s.$slots,"default")]),_:3}))}}),wl=Vue.defineComponent({__name:"Avatar",props:{avatar:{}},setup(o){const e=o;return(n,t)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:200,"popper-class":"x-mask-avatar__popper",disabled:!n.$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(()=>[n.$slots.default?Vue.renderSlot(n.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["disabled"]))}}),bl={class:"x-mask__inner"},po=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{}},setup(o){const e=o;return(n,t)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:"x-mask__content",overflow:"auto",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",bl,[Vue.renderSlot(n.$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})])]),_:3}))}});function Cl(){const o=Vue.ref(!1),e=Vue.ref(""),n=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:n}}function _l(o){const e=VtjUtils.uid();return Vue.computed(()=>{const n=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof n=="string"?{url:n}:n||{})})}function mo(o,e){let n=[];return o.forEach(t=>{t=e?e(t):t,t.children?n=n.concat(mo(t.children,e)):n.push(t)}),n}function kl(o,e){const n=VueRouter.useRouter(),t=Vue.shallowRef([]),r=Vue.shallowRef([]),l=Vue.computed(()=>mo(t.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,g=u.value.get(V);if(!g){console.warn("找不到菜单",f);return}const{type:y="route",url:v,title:h,icon:C}=g;if(!v){a.value=g,e("select",g);return}if(y==="route"){VtjUtils.isUrl(v)||v.startsWith("//")?window.open(v):(a.value=g,n.push(v).catch(w=>w));return}if(y==="window"){window.open(v);return}y==="dialog"&&St({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:h,icon:C,src:v})},s=()=>N(this,null,function*(){var f,V;t.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:t,favorites:r,flatMenus:l,active:a,select:i,toggleFavorite:p}}function El(o,e,n,t,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/co)),m=Vue.computed(()=>i.value.slice(0,d.value).filter(T=>!T.dialog)),p=Vue.computed(()=>i.value.slice(d.value)),f=T=>n.value.find(_=>_.url===T),V=T=>l.fullPath===T.url,g=T=>r.value.id===T.id,y=T=>r.value.id===T?r.value:i.value.find(_=>_.id===T),v=Vue.ref(""),h=Vue.computed(()=>y(v.value)),C=T=>{u.push(T.url).catch(_=>_)},w=T=>{v.value=T.id,l.fullPath!==T.url&&C(T)},S=()=>{C(r.value)},b=T=>{const _=i.value.find(k=>k.url===T.url||k.id===T.id);_?w(_):(i.value.unshift(T),w(T))},z=T=>N(this,null,function*(){var ut;const{url:_=l.fullPath,icon:k,title:B}=T||{},O=a[_],W=VtjUtils.uid(),Ve=VtjUtils.upperFirstCamelCase(_);return P({id:W,name:Ve,url:_,icon:k,title:B||((ut=f(l.path))==null?void 0:ut.title)||"新建页签",closable:!0,menu:T},O?yield O():{})}),D=(T,_)=>N(this,null,function*(){if(!(!_&&!(yield ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)))){if(i.value=i.value.filter(k=>k.id!==T.id),v.value===T.id){const k=i.value[0];C(k||r.value)}return T}}),R=T=>{const _=i.value.findIndex(k=>k.id===T.id);if(_>=0){const k=i.value[_];i.value.splice(_,1,Object.assign(k,T))}},$=()=>N(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value;return i.value=[],w(r.value),_}),Y=()=>N(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value.filter(k=>k.id!==v.value);return i.value=i.value.filter(k=>k.id===v.value),_}),U=T=>{const _=i.value.filter(k=>k.id!==T.id);i.value=[T,..._],w(T)},ae=T=>N(this,null,function*(){h.value&&h.value.closable&&(g(h.value)||(yield D(h.value,!0),yield VtjUtils.delay(0),T?u.push(T):u.push(r.value.url)))}),me=()=>N(this,null,function*(){yield Vue.nextTick();const T=r.value.url===l.path,_=f(l.fullPath);if(T)v.value=r.value.id;else{const k=yield z(_);b(k)}yield Vue.nextTick(),t.value=_||null});return Vue.watch(n,me),Vue.watch(l,me),Vue.provide(dn,a),{tabRef:s,tabs:i,showTabs:m,currentTab:h,changeTab:C,removeTab:D,updateTab:R,addTab:b,home:r,tabValue:v,isCurrentTab:V,activeHome:S,activeTab:w,dropdownTabs:p,removeAllTabs:$,removeOtherTabs:Y,moveToShow:U,closeCurrnetTab:ae}}function Sl(o){const e=new Map,n=Vue.ref([]),t=Vue.reactive({}),r=Vue.getCurrentInstance(),l={},{updateTab:u,isCurrentTab:a,activeHome:i,tabs:s}=o,c=(h,C)=>{const w=C.fullPath;if(e.has(w))return e.get(w);{const S=VtjUtils.upperFirstCamelCase(w),b={name:S,setup(){const z=Vue.computed(()=>t[w]||document.body),D=Vue.computed(()=>!t[w]),R=Vue.computed(()=>!n.value.includes(S));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw(P({},C))),()=>R.value?Vue.h(Vue.Teleport,{to:z.value,disabled:D.value},[Vue.h(h)]):null}};return e.set(w,b),b}},d=h=>{h.dialog=void 0,delete t[h.url];const C=l[h.id];C&&(C.destroy(),delete l[h.id],u(h))},m=(h=[])=>{h.forEach(C=>{d(C)})},p=h=>N(this,null,function*(){h.dialog=H(P({},h.dialog),{onMinimized:()=>{d(h)},onClose:()=>N(this,null,function*(){d(h),s.value=s.value.filter(w=>w.id!==h.id)})}),u(h);const C=St(H(P({title:h.title,icon:h.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0},h.dialog),{onOpen(w){var S,b;t[h.url]=(b=(S=w.refs.panelRef)==null?void 0:S.bodyRef)==null?void 0:b.$el}}),r==null?void 0:r.appContext);return yield Vue.nextTick(),a(h)&&i(),l[h.id]=C,C}),f=h=>N(this,null,function*(){n.value=[h.name],yield Vue.nextTick(),n.value=[]}),V=h=>N(this,null,function*(){n.value=h.map(C=>C.name),yield Vue.nextTick(),n.value=[]}),g=h=>(h.preventDefault(),!1),y=h=>{if(h.dataTransfer){const C=h.dataTransfer.getData("tab"),w=s.value.find(S=>S.id===C);if(w){const{clientX:S,clientY:b}=h;w.dialog={left:S,top:b},p(w)}}},v=h=>!!t[h];return VueUse.useEventListener(document,"dragover",g),VueUse.useEventListener(document,"drop",y),{createView:c,openDialog:p,refresh:f,exclude:n,cleanCache:V,hasDialog:v,closeDialog:d,closeDialogs:m}}const Vo=Vue.defineComponent({name:"XMask",__name:"Mask",props:fo,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const n=o,t=e,r=_l(n),{collapsed:l,keyword:u,favorite:a}=Cl(),{menus:i,favorites:s,flatMenus:c,active:d,select:m,toggleFavorite:p}=kl(n,t),{tabRef:f,showTabs:V,currentTab:g,changeTab:y,removeTab:v,tabs:h,updateTab:C,isCurrentTab:w,activeHome:S,removeAllTabs:b,removeOtherTabs:z,dropdownTabs:D,moveToShow:R,closeCurrnetTab:$}=El(n,t,c,d,r),{createView:Y,openDialog:U,closeDialog:ae,refresh:me,exclude:T,cleanCache:_,closeDialogs:k}=Sl({tabs:h,updateTab:C,isCurrentTab:w,activeHome:S}),B=X=>N(this,null,function*(){(yield v(X))&&(yield _([X]))}),O=()=>N(this,null,function*(){const X=yield b();X&&(k(X),yield _(X))}),W=()=>N(this,null,function*(){const X=yield z();X&&(k(X),yield _(X))}),Ve=X=>{t("actionClick",X)},ut=(X,se)=>{t("actionCommand",X,se)},Fi=X=>N(this,null,function*(){const se=Vue.toValue(X||g);se&&(se.dialog&&ae(se),yield v(se,!0),yield VtjUtils.delay(50))});return Vue.watch(g,X=>{X!=null&&X.dialog&&ae(X)}),Vue.provide(fn,{tabs:h,flatMenus:c,favorites:s,updateTab:C,active:d,currentTab:g,closeCurrnetTab:$,close:Fi}),(X,se)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask",{"is-disabled":n.disabled}]),fit:""},{default:Vue.withCtx(()=>[n.disabled?(Vue.openBlock(),Vue.createBlock(po,{key:1,createView:Vue.unref(Y),exclude:Vue.unref(T)},{default:Vue.withCtx(()=>[X.$slots.default?Vue.renderSlot(X.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(ll,{collapsed:Vue.unref(l)},{brand:Vue.withCtx(()=>[Vue.createVNode(sl,{logo:n.logo,title:n.title,url:Vue.unref(r).url,collapsed:Vue.unref(l)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(al,{collasped:Vue.unref(l),"onUpdate:collasped":se[0]||(se[0]=Ae=>Vue.isRef(l)?l.value=Ae:null),favorite:Vue.unref(a),"onUpdate:favorite":se[1]||(se[1]=Ae=>Vue.isRef(a)?a.value=Ae:null),keyword:Vue.unref(u),"onUpdate:keyword":se[2]||(se[2]=Ae=>Vue.isRef(u)?u.value=Ae:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(cl,{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(F),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column",overflow:"hidden"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>{var Ae;return[Vue.createVNode(hl,{ref_key:"tabRef",ref:f,favorites:Vue.unref(s),tabs:Vue.unref(V),home:Vue.unref(r),value:(Ae=Vue.unref(g))==null?void 0:Ae.id,onClick:Vue.unref(y),onToggleFavorite:Vue.unref(p),onRemove:B,onDialog:Vue.unref(U),onRefresh:Vue.unref(me)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(yl,{tabs:Vue.unref(D),actions:n.actions,theme:n.theme,onCloseOtherTabs:W,onCloseAllTabs:O,onCloseTab:B,onClickTab:Vue.unref(R),onActionClick:Ve,onActionCommand:ut},{default:Vue.withCtx(()=>[Vue.createVNode(wl,{avatar:n.avatar},Vue.createSlots({_:2},[X.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(X.$slots,"user")]),key:"0"}:void 0]),1032,["avatar"])]),_:3},8,["tabs","actions","theme","onClickTab"])]}),_:3}),Vue.createVNode(po,{createView:Vue.unref(Y),exclude:Vue.unref(T)},{default:Vue.withCtx(()=>[X.$slots.default?Vue.renderSlot(X.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])]),_:3})],64))]),_:3},8,["class"]))}});function xl(o={}){const e=VueRouter.useRoute(),n=Vue.inject(dn,null),t=Vue.inject(fn,null);if(n){const l=typeof o=="function"?o:()=>N(this,null,function*(){return o});n[e.fullPath]=l}return{tab:Vue.computed(()=>t?t.tabs.value.find(l=>l.url===e.fullPath):null),mask:t}}const pn=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},emits:["change"],setup(o,{emit:e}){const n=o,t=e,r=l=>{const u=n.options.filter(a=>Array.isArray(l)?l.includes(a.value):l===a.value);t("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(n.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))}}),Bl=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,n=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(t,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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))}}),Pl=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,n=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(t,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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:n}=o;if(n.filterResetMethod){n.filterResetMethod(o);return}e.forEach(t=>{t.value=""})},filterRecoverMethod(o){const{option:e,column:n}=o;if(n.filterRecoverMethod){n.filterRecoverMethod(o);return}e.value=""},filterMethod(o){const{option:e,row:n,column:t}=o;if(t.filterMethod)return t.filterMethod(o);const{value:r}=e,l=n[t.field];return VtjUtils.isString(l)?l.indexOf(String(r))>-1:l===r}},Nl=Vue.defineComponent({name:"InputEdit",__name:"InputEdit",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:n,renderEvents:t,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(n),Vue.toHandlers(Vue.unref(t))),null,16,["modelValue","onInput"]))}}),Tl={class:"x-grid__filter"},mn=Vue.defineComponent({name:"InputFilter",__name:"InputFilter",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:n,renderEvents:t,state:r,load:l,onChange:u,onKeyup:a}=Ht(e.renderOpts,e.params);return l(),(i,s)=>(Vue.openBlock(),Vue.createElementBlock("div",Tl,[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(n),Vue.toHandlers(Vue.unref(t))),null,16,["modelValue","onInput","onKeyup"])]))}}),qe={autofocus:".el-input__inner",renderDefault(o,e){var r;const{row:n,column:t}=e;return[Vue.createTextVNode((r=n[t.field])!=null?r:"")]},renderEdit(o,e){return[Vue.h(Nl,{params:e,renderOpts:o})]},renderCell(o,e){var r;const{row:n,column:t}=e;return[Vue.createTextVNode((r=n[t.field])!=null?r:"")]}},Dl=H(P(P({cellClassName:"x-grid__edit"},qe),je),{renderFilter(o,e){return[Vue.h(mn,{params:e,renderOpts:o})]}});/**!
7
+ */const K="0.8.160",Q={default:14,small:12,large:18},kt={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 ce(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 t=Number.parseInt(o);return Math.floor(e*t/100)}return Number.parseInt(o)}function it(o,e={}){const n=P({},e);return typeof o=="boolean"?n:Object.assign(n,o||{})}const Fe="__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 $r={getCustom:o=>N(this,null,function*(){return VtjUtils.storage.get(o,{type:"local"})}),saveCustom:o=>N(this,null,function*(){VtjUtils.storage.save(o.id,o,{type:"local"})})},Fr={install(o,e={}){const n=Object.assign($r,e),{components:t=[],fieldEditors:r={}}=n;Go(r);for(const l of t)l.name&&o.component(l.name,l);[ElementPlus.ElMessage,ElementPlus.ElMessageBox,ElementPlus.ElNotification].forEach(l=>{o.use(l)}),o.config.globalProperties.$adapter=n,o.provide(he,n)}},Qn=(o=[])=>({install:(n,t={})=>{n[Fe]||(n[Fe]=!0,o.forEach(r=>{r.name&&n.component(r.name,r)}),t.adapter&&n.provide(he,t.adapter))}}),Rr=["src"],ge=Vue.defineComponent({name:"XIcon",__name:"Icon",props:kt,setup(o){const e=o,n=Vue.useAttrs(),t=Vue.getCurrentInstance(),r=Vue.computed(()=>{if(!e.icon)return null;const i=t==null?void 0:t.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":!!n.onClick};return!r.value&&e.icon&&(i[e.icon]=!0),i}),u=Vue.computed(()=>({"background-color":e.background,"border-radius":e.radius?ce(e.radius):void 0,padding:e.padding?ce(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,Rr)):Vue.createCommentVNode("",!0)])]),_:3},8,["class","color","size","style"]))}}),Or={class:"x-menu__wrapper"},jr={key:1,class:"x-menu__title"},Ur={key:0,class:"x-menu__title"},Zn=Vue.defineComponent({inheritAttrs:!1,name:"XMenuItem",__name:"MenuItem",props:{item:{},subMenu:{},defaultIcon:{}},setup(o){const e=o,n=Vue.getCurrentInstance(),t=u=>{if(u){if(typeof u=="string"){const a=n==null?void 0:n.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",Or,[e.item.icon?(Vue.openBlock(),Vue.createBlock(Vue.unref(ge),{key:0,icon:t(e.item.icon)},null,8,["icon"])):Vue.createCommentVNode("",!0),e.item.title?(Vue.openBlock(),Vue.createElementBlock("span",jr,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(Zn),{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",Ur,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:t(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 n=o,t=e,r=Vue.computed(()=>n.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&&t("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(Zn),{item:H(P({},s),{icon:s.icon}),defaultIcon:n.defaultIcon,subMenu:n.subMenu},null,8,["item","defaultIcon","subMenu"]))),256))]),_:1},16))}}),rn={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 Lr(o){return Vue.computed(()=>{const e=o.tooltip;if(e)return typeof e=="string"?{content:e}:e})}function Hr(o){return Vue.computed(()=>{const e=o.badge;if(e)return typeof e=="object"?e:{value:e}})}function Xr(o){return Vue.computed(()=>{const{dropdown:e,menus:n}=o;if(n&&n.length>0)return Object.assign({popperClass:"x-action__menus",size:o.size},e||{})})}function eo(o){const e=Vue.getCurrentInstance();return Vue.computed(()=>{const n=Vue.unref(o);if(n)if(typeof n=="string"||n.setup||n.render||Vue.isVNode(n)){const t=e==null?void 0:e.appContext.app;return{icon:typeof n=="string"&&(t==null?void 0:t.component(n))||n}}else return n;return null})}function Re(o){const e=eo(o);return e.value?Vue.markRaw(Vue.defineComponent({render:()=>Vue.h(ge,e.value)})):void 0}function Et(o,e){return Vue.computed(()=>{const n=Vue.unref(o);return typeof n=="function"?n(e):!!n})}function to(o,e,n){const t=Vue.shallowRef(e),r=Vue.ref(!1),l=a=>N(this,null,function*(){const i=Vue.unref(o);return i?typeof i=="function"?yield i(a):i:e}),u=a=>N(this,null,function*(){return r.value=!0,yield l(a).then(i=>(t.value=i||e,r.value=!1,Vue.unref(t)))});return Vue.watch(()=>o,()=>{u(n)},{immediate:!0}),n&&Vue.watch(n,()=>{u(n)}),{data:t,loading:r,loader:u}}function Yr(o=1e3){const e=Vue.ref(0);let n;const t=()=>{n=VtjUtils.rAF(()=>{++e.value,e.value<o&&t()})};return Vue.onMounted(t),Vue.onUnmounted(()=>{n&&VtjUtils.cAF(n)}),r=>e.value>=r}function no(o=[]){const e=Vue.useSlots();return Object.keys(e).filter(n=>!o.includes(n))}const Kr={key:0},Gr=Vue.defineComponent({__name:"Trigger",props:rn,emits:["click"],setup(o,{emit:e}){const n=o,t=e,r=Re(Vue.toRef(n,"icon")),l=Et(Vue.toRef(n,"disabled")),u=Vue.computed(()=>({[`is-${n.mode}`]:!!n.mode,[`is-${n.type}`]:!!n.type,[`is-${n.size}`]:!!n.size&&n.size!=="default",[`is-background-${n.background}`]:n.mode==="icon"&&!!n.background,"is-disabled":!!n.disabled,"is-circle":!!n.circle})),a=i=>{if(i.preventDefault(),!l.value)return t("click"),!1};return(i,s)=>n.mode==="button"?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),Vue.mergeProps({key:0,icon:Vue.unref(r),type:n.type,size:n.size,disabled:Vue.unref(l)},n.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",Kr,Vue.toDisplayString(i.label),1)):Vue.createCommentVNode("",!0)],2))}}),Wr=["draggable"],te=Vue.defineComponent({name:"XAction",__name:"Action",props:rn,emits:["click","command","dragstart","dragend"],setup(o,{emit:e}){const n=o,t=Vue.useSlots(),r=e,l=Lr(n),u=Hr(n),a=Xr(n),i=Et(Vue.toRef(n,"disabled")),s=Vue.computed(()=>!!n.draggable&&!i.value),c=Vue.computed(()=>({[`x-action--${n.mode}`]:!!n.mode})),d=()=>{i.value||r("click",Vue.toRaw(n))},m=h=>{var w;if(i.value)return;const C=(w=n.menus)==null?void 0:w.find(S=>S.command===h);C&&r("command",Vue.toRaw(C))},p=h=>{s&&r("dragstart",Vue.toRaw(n),h)},f=h=>{s&&r("dragend",Vue.toRaw(n),h)},V=h=>Vue.h(ElementPlus.ElBadge,u.value,()=>[].concat(h)),g=h=>Vue.h(ElementPlus.ElDropdown,H(P({},a.value),{disabled:i.value,onCommand:m}),{default:()=>[h],dropdown:()=>[Vue.h(ElementPlus.ElDropdownMenu,()=>(n.menus||[]).map((C,w)=>Vue.h(ElementPlus.ElDropdownItem,C,()=>t.item?t.item({item:C,index:w}):C.label)))]}),y=h=>Vue.h(ElementPlus.ElTooltip,H(P({},l.value),{disabled:i.value}),()=>[h]),v=Vue.computed(()=>{var w;let h=Vue.h(Vue.markRaw(Gr),H(P({},n),{onClick:d}));const C=(w=t.default)==null?void 0:w.call(t);return C&&C.length&&(h=C[0]),u.value&&(h=V(h)),a.value&&(h=g(h)),l.value&&(h=y(h)),h});return(h,C)=>(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(v.value)))],42,Wr))}}),oo={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:oo,emits:["click","command"],setup(o,{emit:e}){const n=o,t=e,r=Vue.computed(()=>(n.items||[]).map(a=>a==="|"?a:H(P({},a),{badge:a.badge?P(P({},n.badge),typeof a.badge=="object"?a.badge||{}:{value:a.badge}):void 0,tooltip:a.tooltip?P(P({},n.tooltip),typeof a.tooltip=="object"?a.tooltip||{}:{content:a.tooltip}):void 0}))),l=a=>{t("click",a)},u=(a,i)=>{t("command",a,i)};return(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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:n.mode,size:n.size,type:n.type,circle:n.circle,background:n.background,button:n.button,dropdown:n.dropdown,disabled:Vue.unref(Et)(n.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}))}}),ro={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}},F=Vue.defineComponent({name:"XContainer",__name:"Container",props:ro,setup(o,{expose:e}){const n=o,t=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":n.fit,"is-flex":n.flex&&!n.inline,"is-inline-flex":n.flex&&n.inline,[`is-direction-${n.direction}`]:n.flex&&n.direction!=="row",[`is-wrap-${n.wrap}`]:n.flex&&n.wrap!=="nowrap",[`is-justify-${n.justify}`]:n.flex&&n.justify!=="flex-start",[`is-align-${n.align}`]:n.flex&&n.align!=="flex-start",[`is-align-content-${n.alignContent}`]:n.flex&&n.alignContent!=="stretch","is-grow":(c=n.grow)!=null?c:a.value,"is-shrink":n.shrink,[`is-align-self-${n.alignSelf}`]:a.value&&n.alignSelf!=="auto",[`is-overflow-${n.overflow}`]:!!n.overflow,"is-padding":!!n.padding,"is-pointer":n.autoPointer&&!!t.onClick,"is-gap":!!n.gap}}),s=Vue.computed(()=>{const{width:c,height:d,fit:m}=n;return m?null:{width:c?ce(c):void 0,height:d?ce(d):void 0}});return e({$vtjEl:u}),(c,d)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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"]))}}),lo={size:{type:String,default:"default"},content:{type:String,default:""},subtitle:{type:String},icon:{type:[String,Object]},border:{type:Boolean},more:{type:Boolean}},qr={class:"x-header__content"},Jr={key:0,class:"x-header__actions"},ln=Vue.defineComponent({name:"XHeader",inheritAttrs:!1,__name:"Header",props:lo,setup(o){const e=o,n=Re(Vue.toRef(e,"icon")),t=Vue.useAttrs(),r=Vue.computed(()=>({[`is-size-${e.size}`]:!!e.size&&e.size!=="default","is-border":e.border,"is-pointer":!!t.onClick}));return(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-header",r.value]),justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{align:"center",class:Vue.normalizeClass(["x-header__wrapper",r.value]),grow:"",onClick:Vue.unref(t).onClick},{default:Vue.withCtx(()=>[Vue.unref(n)?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(n)),{key:0,class:"x-header__icon",onClick:Vue.unref(t).onClickIcon||Vue.unref(t).onClick},null,8,["onClick"])):Vue.createCommentVNode("",!0),Vue.createElementVNode("span",qr,[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(t).onClick&&Vue.unref(t).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",Jr,[Vue.renderSlot(l.$slots,"actions")])):Vue.createCommentVNode("",!0)]),_:3},8,["class"]))}}),ao={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}},Ke=Vue.defineComponent({name:"XPanel",__name:"Panel",props:ao,setup(o,{expose:e}){const n=o,t=Vue.ref(),r=Vue.computed(()=>({"x-panel--card":!!n.card,"x-panel--default":!n.card,[`is-${n.size}`]:!!n.size&&n.size!=="default","is-border":!!n.border,"is-radius":!!n.radius,[`is-shadow-${n.shadow}`]:!!n.shadow&&n.shadow!=="none"})),l=Vue.computed(()=>n.header===null?null:typeof n.header=="string"?{content:n.header,size:n.size}:H(P({},n.header),{size:n.size})),u=Vue.computed(()=>n.fit||n.height?"auto":void 0);return e({bodyRef:t}),(a,i)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-panel",r.value]),direction:"column",fit:n.fit,width:n.width,height:n.height},{default:Vue.withCtx(()=>[l.value?(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{key:0,flex:!1,class:"x-panel__header"},{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"header",{},()=>[Vue.createVNode(Vue.unref(ln),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(F),Vue.mergeProps({ref_key:"bodyRef",ref:t,flex:!1,overflow:u.value,grow:"",padding:"",class:"x-panel__body"},n.body),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"default")]),_:3},16,["overflow"]),a.$slots.footer?(Vue.openBlock(),Vue.createBlock(Vue.unref(F),Vue.mergeProps({key:1,flex:!1,padding:"",class:"x-panel__footer"},n.footer),{default:Vue.withCtx(()=>[Vue.renderSlot(a.$slots,"footer")]),_:3},16)):Vue.createCommentVNode("",!0)]),_:3},8,["class","fit","width","height"]))}}),uo="user-select-none";class an{constructor(e,n={}){Be(this,"scope");Be(this,"dragging",!1);this.el=e,this.options=n,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}getHandle(){const{selector:e,handle:n}=this.options;return e?this.el.querySelector(e):n}getTarget(){const{target:e="body"}=this.options;return typeof e=="string"?document.querySelector(e):Vue.unref(e)||document.body}init(){const{el:e,options:n}=this,{disabled:t,delay:r=150,onStart:l,onEnd:u}=n;if(t)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,H(P({initialValue:{x:c.x,y:c.y}},n),{handle:i,onStart:(f,V)=>{document.body.classList.add(uo),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(uo),this.dragging&&d){this.dragging=!1;const{x:g,y}=f,v=this.getPosition(d,c,g,y);u&&u(v,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,n,t,r){const{edge:l=50}=this.options,u=-n.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(t,u)),d=Math.min(s,Math.max(r,i));return{x:c-e.x,y:d-e.y}}destory(){this.scope.stop()}}const io={mounted(o,e){const n=e.value||{},t=new an(o,n);o.__draggable__=t},updated(o,e){const n=e.value||{};let t=o.__draggable__;t&&!VtjUtils.isEqual(t.options,n)&&(t.destory(),o.__draggable__=new an(o,n))},unmounted(o){const e=o.__draggable__;e&&(e.destory(),o.__draggable__=null)}},un="user-select-none";class sn{constructor(e,n={}){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=n,this.scope=Vue.effectScope(),this.scope.run(()=>{this.init()})}init(){const{el:e,options:n}=this,{disabled:t,onStart:r,onEnd:l}=n;if(t)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(un):s.classList.remove(un)});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:n,resizing:t,options:r,el:l}=this,u=(n==null?void 0:n.value)||"";if(!e||!t.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:g=99999,maxHeight:y=99999}=r;if(u.includes("e")){const v=Math.min(Math.max(s.value,f),g);l.style.width=`${v}px`}if(u.includes("s")){const v=Math.min(Math.max(c.value,V),y);l.style.height=`${v}px`}if(u.includes("w")){const v=Math.min(Math.max(m.value-s.value,f),g);l.style.width=`${v}px`,l.style.left=`${a.value}px`}if(u.includes("n")){const v=Math.min(Math.max(d.value-c.value,V),y);this.el.style.height=`${v}px`,this.el.style.top=`${i.value}px`}p&&p(u,e)}getDirection(){if(!this.MIE)return"";const{elementX:e,elementY:n,elementHeight:t,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")&&n.value<=a?i+="n":u.includes("s")&&n.value>t.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 n;const e=document.body;e.style.cursor="",e.classList.remove(un),this.cleanMousedown&&this.cleanMousedown(),this.cleanMouseup&&this.cleanMouseup(),(n=this.MIE)==null||n.stop(),this.scope.stop()}}const cn={mounted(o,e){const n=e.value||{},t=new sn(o,n);o.__resizable__=t},updated(o,e){const n=e.value||{};let t=o.__resizable__;t&&!VtjUtils.isEqual(t.options,n)&&(t.destory(),o.__resizable__=new sn(o,n))},unmounted(o){const e=o.__resizable__;e&&(e.destory(),o.__resizable__=null)}},so={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}};let Ge=1e3;function Qr(o,e){const{width:n,height:t}=VueUse.useElementSize(e),r=Vue.reactive({mode:o.mode||"normal",wrapperWidth:0,wrapperHeight:0,width:0,height:0,top:0,left:0,zIndex:++Ge,dragging:!1,resizing:!1});return Vue.watch([n,t],([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=>{Ge=Math.max(l.zIndex,Ge)}),{state:r,normal:Vue.computed(()=>r.mode==="normal"),maximized:Vue.computed(()=>r.mode==="maximized"),minimized:Vue.computed(()=>r.mode==="minimized")}}function Zr(o,e){const n=Vue.computed(()=>{const{width:u,height:a,top:i,left:s,zIndex:c}=e;return{width:`${u}px`,height:`${a}px`,top:`${i}px`,left:`${s}px`,zIndex:c}}),t=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-draggable":!!o.draggable,"is-resizable":!!o.resizable,"is-primary":!!o.primary})),r=Vue.computed(()=>({[`is-${e.mode}`]:!!e.mode,"is-dragging":e.dragging,"is-resizing":e.resizing})),l=Vue.computed(()=>({zIndex:e.zIndex}));return{styles:n,classes:t,wrapperClass:r,modalStyle:l}}function el(o,e,n){const t=c=>{e.mode=c,["maximized","minimized","normal"].includes(c)&&n(c),n("modeChange",c)},r=()=>N(this,null,function*(){(!o.beforeClose||(yield o.beforeClose()))&&(n("update:modelValue",!1),n("close"),n("destroy"))});return{close:r,changeMode:t,show:()=>t("normal"),hide:()=>t("minimized"),active:c=>{const d=c.target.nodeName||"";["INPUT","TEXTAREA","RADIO","CHECKBOX"].includes(d.toUpperCase())||(e.zIndex=Math.max(e.zIndex,++Ge))},submit:()=>n("submit"),cancel:()=>{n("cancel"),r()}}}function tl(o,e,n,t){return Vue.computed(()=>{var l;const r=typeof o.draggable=="boolean"?!o.draggable:!!((l=o.draggable)!=null&&l.disabled);return H(P({},VtjUtils.isObject(o.draggable)?o.draggable:{}),{disabled:r,target:t,selector:".x-panel__header",onStart(u){e.dragging=!0,e.zIndex=Math.max(e.zIndex,++Ge),n("dragStart",u)},onMove(u){n("dragging",u)},onEnd(u){if(e.mode==="maximized")return;const{x:a,y:i}=u;e.left=a,e.top=i,e.dragging=!1,n("dragEnd",u)}})})}function nl(o,e,n){return Vue.computed(()=>{var r;const t=typeof o.resizable=="boolean"?!o.resizable:!!((r=o.resizable)!=null&&r.disabled);return H(P({minWidth:200,minHeight:150},VtjUtils.isObject(o.resizable)?o.resizable:{}),{disabled:t,dirs:["e","s","w"],onStart(l,u){e.resizing=!0,e.zIndex=Math.max(e.zIndex,++Ge),n("resizeStart",l,u)},onResizing(l,u){n("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,n("resizeEnd",l,u)}})})}function ol(o,e){const n=o.componentInstance;if(!n)return;let t=null;return Vue.onMounted(()=>{const r=Vue.unref(e),l=Vue.unref(r==null?void 0:r.bodyRef);t=n.$el,l&&l.$el&&l.$el.appendChild(t)}),Vue.onUnmounted(()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),{componentInstance:n}}const rl=["src"],We=Vue.defineComponent({name:"XDialog",__name:"Dialog",props:so,emits:["update:modelValue","open","close","destroy","maximized","minimized","normal","modeChange","dragStart","dragging","dragEnd","resizeStart","resizeEnd","resizing","submit","cancel"],setup(o,{expose:e,emit:n}){const t=o,r=n,l=Vue.getCurrentInstance(),u=Vue.ref(),a=Vue.ref(),{state:i,maximized:s,minimized:c,normal:d}=Qr(t,u),{styles:m,classes:p,wrapperClass:f,modalStyle:V}=Zr(t,i),{changeMode:g,active:y,close:v,show:h,hide:C,submit:w,cancel:S}=el(t,i,r),b=tl(t,i,r,u),z=nl(t,i,r),D=ol(t,a);Vue.watchEffect(()=>N(this,null,function*(){t.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 R=Vue.computed(()=>{var $;return($=a.value)==null?void 0:$.$el});return e({$vtjEl:R,panelRef:a,state:i,maximized:s,minimized:c,changeMode:g,show:h,hide:C,submit:w,cancel:S,close:v,componentInstance:D}),($,Y)=>t.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)])},[t.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(Ke),Vue.mergeProps({ref_key:"panelRef",ref:a,class:["x-dialog",Vue.unref(p)],card:"",shadow:"always",header:{icon:t.icon,subtitle:t.subtitle},width:"800px",height:"600px",footer:{justify:"space-between",flex:!0,align:"center"},style:Vue.unref(m),size:t.size,body:{padding:t.bodyPadding},onClick:Vue.unref(y)},$.$attrs),Vue.createSlots({title:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(t.title),1)]),actions:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"actions"),t.minimizable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Minimize),size:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[0]||(Y[0]=U=>Vue.unref(g)("minimized"))},null,8,["icon","size"])):Vue.createCommentVNode("",!0),t.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:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[2]||(Y[2]=U=>Vue.unref(g)("maximized"))},null,8,["icon","size"])):(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:0,icon:Vue.unref(VtjIcons.Popup),size:t.size,mode:"icon",type:"primary",background:"hover",onClick:Y[1]||(Y[1]=U=>Vue.unref(g)("normal"))},null,8,["icon","size"]))],64)):Vue.createCommentVNode("",!0),t.closable?(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{key:2,icon:Vue.unref(VtjIcons.RawClose),size:t.size,mode:"icon",type:"danger",background:"hover",onClick:Vue.unref(v)},null,8,["icon","size","onClick"])):Vue.createCommentVNode("",!0)]),default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"default",{},()=>[t.content?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(t.content),{key:0})):Vue.createCommentVNode("",!0),t.src?(Vue.openBlock(),Vue.createElementBlock("iframe",{key:1,src:t.src,class:"x-dialog__frame"},null,8,rl)):Vue.createCommentVNode("",!0)])]),_:2},[t.cancel||t.submit||$.$slots.footer||$.$slots.extra||$.$slots.handle?{name:"footer",fn:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"footer",{},()=>[Vue.createVNode(Vue.unref(F),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"extra")]),_:3}),Vue.createVNode(Vue.unref(F),{align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot($.$slots,"handle"),t.cancel?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:0,type:"default",size:t.size,onClick:Vue.unref(S)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof t.cancel=="string"?t.cancel:"取消"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0),t.submit?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElButton),{key:1,type:"primary",size:t.size,onClick:Vue.unref(w)},{default:Vue.withCtx(()=>[Vue.createTextVNode(Vue.toDisplayString(typeof t.submit=="string"?t.submit:"确定"),1)]),_:1},8,["size","onClick"])):Vue.createCommentVNode("",!0)]),_:3})])]),key:"0"}:void 0]),1040,["header","class","style","size","body","onClick"])),[[Vue.unref(io),Vue.unref(b)],[Vue.unref(cn),Vue.unref(z)]])],2)])):Vue.createCommentVNode("",!0)}});function St(o,e){const n=document.createElement("div"),t=Vue.createVNode(We,o);t.appContext=e!=null?e:St._context,Vue.render(t,n);const r=()=>{var l;Vue.render(null,n),(l=n.parentNode)==null||l.removeChild(n)};return t.props.onDestroy=()=>{r()},document.body.appendChild(n),{vnode:t,destroy:r}}const ll=Vue.defineComponent({__name:"Sidebar",props:{collapsed:{type:Boolean}},setup(o){const e=o;return(n,t)=>Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask-sidebar",{"is-collapsed":e.collapsed}]),grow:!1,flex:"",direction:"column"},{default:Vue.withCtx(()=>[Vue.renderSlot(n.$slots,"brand"),Vue.createVNode(Vue.unref(F),{class:"x-mask-sidebar__wrapper",flex:"",grow:"",direction:"column",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[Vue.renderSlot(n.$slots,"default"),t[0]||(t[0]=Vue.createElementVNode("div",{class:"x-mask-sidebar__helper"},null,-1))]),_:3})]),_:3},8,["class"])),[[Vue.unref(cn),{dirs:["e"],disabled:e.collapsed,maxWidth:500,minWidth:200}]])}}),al=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 n=o,t=e,r=Vue.ref(!1),l=Vue.ref(""),u=Vue.ref(!1),a=()=>{r.value=!0},i=()=>{l.value="",r.value=!1,t("update:keyword",l.value)},s=()=>{t("update:collasped",!n.collasped)},c=()=>{t("update:keyword",l.value)},d=()=>{t("update:favorite",u.value)};return(m,p)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:"x-mask-switch-bar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>[n.collasped?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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(F),{class:Vue.normalizeClass(["x-mask-switch-bar__right",{"is-collasped":n.collasped}]),flex:"",align:"center",justify:"center"},{default:Vue.withCtx(()=>[!r.value&&!n.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),n.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),n.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}))}}),ul=["src"],il={key:0},sl=Vue.defineComponent({__name:"Brand",props:{collapsed:{type:Boolean,default:!1},logo:{},title:{},url:{}},setup(o){const e=o,n=VueRouter.useRouter(),t=()=>{e.url&&n.push(e.url)};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask-brand",{"is-collapsed":e.collapsed}]),align:"center"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{class:"x-mask-brand__logo",flex:"",justify:"center",align:"center",onClick:t},{default:Vue.withCtx(()=>[Vue.renderSlot(r.$slots,"logo",{},()=>[e.logo?(Vue.openBlock(),Vue.createElementBlock("img",{key:0,src:e.logo},null,8,ul)):Vue.createCommentVNode("",!0)])]),_:3}),Vue.createVNode(Vue.unref(F),{class:"x-mask-brand__title",flex:"",align:"center"},{default:Vue.withCtx(()=>[e.title?(Vue.openBlock(),Vue.createElementBlock("span",il,[Vue.renderSlot(r.$slots,"title",{},()=>[Vue.createTextVNode(Vue.toDisplayString(e.title),1)])])):Vue.createCommentVNode("",!0)]),_:3})]),_:3},8,["class"]))}}),xt="__favorites__",Bt="__search__",cl=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 n=o,t=Vue.computed(()=>n.menus||[]),r=e,l=Vue.computed(()=>{var s;return String((s=n.active)==null?void 0:s.id)}),u=Vue.computed(()=>{var s;return[{id:xt,title:"收藏",icon:VtjIcons.Star,children:(s=n.favorites)!=null&&s.length?n.favorites:[{id:xt+"empty",disabled:!0,title:"暂无收藏菜单"}]}]}),a=Vue.computed(()=>{const s=(n.keyword||"").trim(),c=s?(n.flatMenus||[]).filter(d=>{var m;return(m=d.title)==null?void 0:m.includes(s)}):[];return[{id:Bt,title:"搜索",icon:VtjIcons.Search,children:c!=null&&c.length?c:[{id:Bt+"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(F),{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:t.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,n.collapse]]),Vue.withDirectives(Vue.createVNode(Vue.unref(Ne),{subMenu:{popperClass:"x-mask-menu-popper",teleported:!0},data:t.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,!n.collapse]]),t.value.length?Vue.createCommentVNode("",!0):(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElEmpty),{key:0,description:"暂无菜单数据"}))]),_:1},512),[[Vue.vShow,!n.favorite&&!n.keyword]]),Vue.withDirectives(Vue.createVNode(Vue.unref(F),{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":[xt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,n.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":[xt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!n.collapse]])]),_:1},512),[[Vue.vShow,n.favorite&&!n.keyword]]),n.keyword?Vue.withDirectives((Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,n.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":[Bt],onSelect:i},null,8,["data","default-icon","default-active","default-openeds"]),[[Vue.vShow,!n.collapse]])]),_:1},512)),[[Vue.vShow,!!n.keyword]]):Vue.createCommentVNode("",!0)],64))}}),dl="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",co=140,fo={logo:{type:String,default:dl},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}},dn=Symbol(),fn="$mask",fl={class:"x-mask-tabs__trigger"},pl={key:1},ml=["onDragstart","onDragend"],Vl={key:1},hl=Vue.defineComponent({__name:"Tabs",props:{tabs:{},home:{},isActiveTab:{type:Function},value:{},favorites:{}},emits:["click","remove","refresh","toggleFavorite","dialog"],setup(o,{emit:e}){const n=o,t=e,r=c=>{const d=!!n.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},"|",{icon:VtjIcons.CopyDocument,label:"弹窗",name:"dialog",value:c}]},l=c=>{const d=c.paneName;if(d===n.home.id){t("click",n.home);return}const m=n.tabs.find(p=>p.id===d);m&&t("click",m)},u=c=>{const d=n.tabs.find(m=>m.id===c);d&&t("remove",d)},a=c=>{switch(c.name){case"refresh":t("refresh",c.value);break;case"favorite":t("toggleFavorite",c.value);break;case"dialog":t("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(F),{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":n.value,onTabRemove:u,onTabClick:l},{default:Vue.withCtx(()=>[n.home?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElTabPane),{key:0,name:n.home.id},{label:Vue.withCtx(()=>[Vue.createElementVNode("div",fl,[n.home.icon?(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(Vue.unref(Re)(n.home.icon)),{key:0})):Vue.createCommentVNode("",!0),n.home.title?(Vue.openBlock(),Vue.createElementBlock("span",pl,Vue.toDisplayString(n.home.title),1)):Vue.createCommentVNode("",!0)])]),_:1},8,["name"])):Vue.createCommentVNode("",!0),(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(n.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!==n.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(Re)(m.icon)),{key:0})):Vue.createCommentVNode("",!0),m.title?(Vue.openBlock(),Vue.createElementBlock("span",Vl,Vue.toDisplayString(m.title),1)):Vue.createCommentVNode("",!0)],40,ml)]),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))}}),gl=Vue.defineComponent({__name:"ThemeSwitch",setup(o){const e=VueUse.useDark(),n=Vue.computed(()=>e.value?VtjIcons.Sunny:VtjIcons.Moon),t=()=>{e.value=!e.value};return(r,l)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(te),{icon:n.value,dropdown:{size:"small"},mode:"icon",circle:"",background:"hover",type:"primary",onClick:t},null,8,["icon"]))}}),vl={class:"x-mask-toolbar__menu-item"},yl=Vue.defineComponent({__name:"Toolbar",props:{tabs:{default:()=>[]},actions:{},theme:{type:Boolean}},emits:["closeOtherTabs","closeAllTabs","closeTab","clickTab","actionClick","actionCommand"],setup(o,{emit:e}){const n=o,t=e,r=Vue.computed(()=>{const s=n.tabs.map((c,d)=>({divided:d===0,label:c.title,command:c}));return[{label:"关闭其他",command:"other"},{label:"关闭全部",command:"all"},...s]}),l=s=>{t("closeTab",s.command)},u=s=>{switch(s.command){case"all":t("closeAllTabs");break;case"other":t("closeOtherTabs");break;default:t("clickTab",s.command);break}},a=s=>{t("actionClick",s)},i=(s,c)=>{t("actionCommand",s,c)};return(s,c)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{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",vl,[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"}),n.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),n.actions?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:1,direction:"vertical"})):Vue.createCommentVNode("",!0),n.theme?(Vue.openBlock(),Vue.createBlock(gl,{key:2})):Vue.createCommentVNode("",!0),n.theme?(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElDivider),{key:3,direction:"vertical"})):Vue.createCommentVNode("",!0),Vue.renderSlot(s.$slots,"default")]),_:3}))}}),wl=Vue.defineComponent({__name:"Avatar",props:{avatar:{}},setup(o){const e=o;return(n,t)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElPopover),{width:200,"popper-class":"x-mask-avatar__popper",disabled:!n.$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(()=>[n.$slots.default?Vue.renderSlot(n.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["disabled"]))}}),bl={class:"x-mask__inner"},po=Vue.defineComponent({__name:"Content",props:{createView:{type:Function},exclude:{}},setup(o){const e=o;return(n,t)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:"x-mask__content",overflow:"auto",flex:!1,grow:"",padding:!1},{default:Vue.withCtx(()=>[Vue.createElementVNode("div",bl,[Vue.renderSlot(n.$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})])]),_:3}))}});function Cl(){const o=Vue.ref(!1),e=Vue.ref(""),n=Vue.ref(!1);return{collapsed:o,keyword:e,favorite:n}}function _l(o){const e=VtjUtils.uid();return Vue.computed(()=>{const n=o.home;return Object.assign({id:e,url:"/",name:"MaskHome",icon:VtjIcons.HomeFilled,closable:!1},typeof n=="string"?{url:n}:n||{})})}function mo(o,e){let n=[];return o.forEach(t=>{t=e?e(t):t,t.children?n=n.concat(mo(t.children,e)):n.push(t)}),n}function kl(o,e){const n=VueRouter.useRouter(),t=Vue.shallowRef([]),r=Vue.shallowRef([]),l=Vue.computed(()=>mo(t.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,g=u.value.get(V);if(!g){console.warn("找不到菜单",f);return}const{type:y="route",url:v,title:h,icon:C}=g;if(!v){a.value=g,e("select",g);return}if(y==="route"){VtjUtils.isUrl(v)||v.startsWith("//")?window.open(v):(a.value=g,n.push(v).catch(w=>w));return}if(y==="window"){window.open(v);return}y==="dialog"&&St({resizable:!0,bodyPadding:!1,width:"80%",height:"80%",title:h,icon:C,src:v})},s=()=>N(this,null,function*(){var f,V;t.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:t,favorites:r,flatMenus:l,active:a,select:i,toggleFavorite:p}}function El(o,e,n,t,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/co)),m=Vue.computed(()=>i.value.slice(0,d.value).filter(T=>!T.dialog)),p=Vue.computed(()=>i.value.slice(d.value)),f=T=>n.value.find(_=>_.url===T),V=T=>l.fullPath===T.url,g=T=>r.value.id===T.id,y=T=>r.value.id===T?r.value:i.value.find(_=>_.id===T),v=Vue.ref(""),h=Vue.computed(()=>y(v.value)),C=T=>{u.push(T.url).catch(_=>_)},w=T=>{v.value=T.id,l.fullPath!==T.url&&C(T)},S=()=>{C(r.value)},b=T=>{const _=i.value.find(k=>k.url===T.url||k.id===T.id);_?w(_):(i.value.unshift(T),w(T))},z=T=>N(this,null,function*(){var ut;const{url:_=l.fullPath,icon:k,title:B}=T||{},O=a[_],W=VtjUtils.uid(),Ve=VtjUtils.upperFirstCamelCase(_);return P({id:W,name:Ve,url:_,icon:k,title:B||((ut=f(l.path))==null?void 0:ut.title)||"新建页签",closable:!0,menu:T},O?yield O():{})}),D=(T,_)=>N(this,null,function*(){if(!(!_&&!(yield ElementPlus.ElMessageBox.confirm("是否关闭页签","提示",{type:"warning"}).catch(()=>!1)))){if(i.value=i.value.filter(k=>k.id!==T.id),v.value===T.id){const k=i.value[0];C(k||r.value)}return T}}),R=T=>{const _=i.value.findIndex(k=>k.id===T.id);if(_>=0){const k=i.value[_];i.value.splice(_,1,Object.assign(k,T))}},$=()=>N(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭全部页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value;return i.value=[],w(r.value),_}),Y=()=>N(this,null,function*(){if(!(yield ElementPlus.ElMessageBox.confirm("是否关闭其他页签","提示",{type:"warning"}).catch(()=>!1)))return;const _=i.value.filter(k=>k.id!==v.value);return i.value=i.value.filter(k=>k.id===v.value),_}),U=T=>{const _=i.value.filter(k=>k.id!==T.id);i.value=[T,..._],w(T)},ae=T=>N(this,null,function*(){h.value&&h.value.closable&&(g(h.value)||(yield D(h.value,!0),yield VtjUtils.delay(0),T?u.push(T):u.push(r.value.url)))}),me=()=>N(this,null,function*(){yield Vue.nextTick();const T=r.value.url===l.path,_=f(l.fullPath);if(T)v.value=r.value.id;else{const k=yield z(_);b(k)}yield Vue.nextTick(),t.value=_||null});return Vue.watch(n,me),Vue.watch(l,me),Vue.provide(dn,a),{tabRef:s,tabs:i,showTabs:m,currentTab:h,changeTab:C,removeTab:D,updateTab:R,addTab:b,home:r,tabValue:v,isCurrentTab:V,activeHome:S,activeTab:w,dropdownTabs:p,removeAllTabs:$,removeOtherTabs:Y,moveToShow:U,closeCurrnetTab:ae}}function Sl(o){const e=new Map,n=Vue.ref([]),t=Vue.reactive({}),r=Vue.getCurrentInstance(),l={},{updateTab:u,isCurrentTab:a,activeHome:i,tabs:s}=o,c=(h,C)=>{const w=C.fullPath;if(e.has(w))return e.get(w);{const S=VtjUtils.upperFirstCamelCase(w),b={name:S,setup(){const z=Vue.computed(()=>t[w]||document.body),D=Vue.computed(()=>!t[w]),R=Vue.computed(()=>!n.value.includes(S));return Vue.provide(VueRouter.routeLocationKey,Vue.toRaw(P({},C))),()=>R.value?Vue.h(Vue.Teleport,{to:z.value,disabled:D.value},[Vue.h(h)]):null}};return e.set(w,b),b}},d=h=>{h.dialog=void 0,delete t[h.url];const C=l[h.id];C&&(C.destroy(),delete l[h.id],u(h))},m=(h=[])=>{h.forEach(C=>{d(C)})},p=h=>N(this,null,function*(){h.dialog=H(P({},h.dialog),{onMinimized:()=>{d(h)},onClose:()=>N(this,null,function*(){d(h),s.value=s.value.filter(w=>w.id!==h.id)})}),u(h);const C=St(H(P({title:h.title,icon:h.icon,modal:!1,resizable:!0,draggable:!0,maximizable:!0,minimizable:!0},h.dialog),{onOpen(w){var S,b;t[h.url]=(b=(S=w.refs.panelRef)==null?void 0:S.bodyRef)==null?void 0:b.$el}}),r==null?void 0:r.appContext);return yield Vue.nextTick(),a(h)&&i(),l[h.id]=C,C}),f=h=>N(this,null,function*(){n.value=[h.name],yield Vue.nextTick(),n.value=[]}),V=h=>N(this,null,function*(){n.value=h.map(C=>C.name),yield Vue.nextTick(),n.value=[]}),g=h=>(h.preventDefault(),!1),y=h=>{if(h.dataTransfer){const C=h.dataTransfer.getData("tab"),w=s.value.find(S=>S.id===C);if(w){const{clientX:S,clientY:b}=h;w.dialog={left:S,top:b},p(w)}}},v=h=>!!t[h];return VueUse.useEventListener(document,"dragover",g),VueUse.useEventListener(document,"drop",y),{createView:c,openDialog:p,refresh:f,exclude:n,cleanCache:V,hasDialog:v,closeDialog:d,closeDialogs:m}}const Vo=Vue.defineComponent({name:"XMask",__name:"Mask",props:fo,emits:["select","actionClick","actionCommand"],setup(o,{emit:e}){const n=o,t=e,r=_l(n),{collapsed:l,keyword:u,favorite:a}=Cl(),{menus:i,favorites:s,flatMenus:c,active:d,select:m,toggleFavorite:p}=kl(n,t),{tabRef:f,showTabs:V,currentTab:g,changeTab:y,removeTab:v,tabs:h,updateTab:C,isCurrentTab:w,activeHome:S,removeAllTabs:b,removeOtherTabs:z,dropdownTabs:D,moveToShow:R,closeCurrnetTab:$}=El(n,t,c,d,r),{createView:Y,openDialog:U,closeDialog:ae,refresh:me,exclude:T,cleanCache:_,closeDialogs:k}=Sl({tabs:h,updateTab:C,isCurrentTab:w,activeHome:S}),B=X=>N(this,null,function*(){(yield v(X))&&(yield _([X]))}),O=()=>N(this,null,function*(){const X=yield b();X&&(k(X),yield _(X))}),W=()=>N(this,null,function*(){const X=yield z();X&&(k(X),yield _(X))}),Ve=X=>{t("actionClick",X)},ut=(X,se)=>{t("actionCommand",X,se)},Fi=X=>N(this,null,function*(){const se=Vue.toValue(X||g);se&&(se.dialog&&ae(se),yield v(se,!0),yield VtjUtils.delay(50))});return Vue.watch(g,X=>{X!=null&&X.dialog&&ae(X)}),Vue.provide(fn,{tabs:h,flatMenus:c,favorites:s,updateTab:C,active:d,currentTab:g,closeCurrnetTab:$,close:Fi}),(X,se)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(F),{class:Vue.normalizeClass(["x-mask",{"is-disabled":n.disabled}]),fit:""},{default:Vue.withCtx(()=>[n.disabled?(Vue.openBlock(),Vue.createBlock(po,{key:1,createView:Vue.unref(Y),exclude:Vue.unref(T)},{default:Vue.withCtx(()=>[X.$slots.default?Vue.renderSlot(X.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])):(Vue.openBlock(),Vue.createElementBlock(Vue.Fragment,{key:0},[Vue.createVNode(ll,{collapsed:Vue.unref(l)},{brand:Vue.withCtx(()=>[Vue.createVNode(sl,{logo:n.logo,title:n.title,url:Vue.unref(r).url,collapsed:Vue.unref(l)},null,8,["logo","title","url","collapsed"])]),default:Vue.withCtx(()=>[Vue.createVNode(al,{collasped:Vue.unref(l),"onUpdate:collasped":se[0]||(se[0]=Ae=>Vue.isRef(l)?l.value=Ae:null),favorite:Vue.unref(a),"onUpdate:favorite":se[1]||(se[1]=Ae=>Vue.isRef(a)?a.value=Ae:null),keyword:Vue.unref(u),"onUpdate:keyword":se[2]||(se[2]=Ae=>Vue.isRef(u)?u.value=Ae:null)},null,8,["collasped","favorite","keyword"]),Vue.createVNode(cl,{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(F),{class:"x-mask__main",grow:"",shrink:"",flex:"",direction:"column",overflow:"hidden"},{default:Vue.withCtx(()=>[Vue.createVNode(Vue.unref(F),{class:"x-mask-topbar",justify:"space-between",align:"center"},{default:Vue.withCtx(()=>{var Ae;return[Vue.createVNode(hl,{ref_key:"tabRef",ref:f,favorites:Vue.unref(s),tabs:Vue.unref(V),home:Vue.unref(r),value:(Ae=Vue.unref(g))==null?void 0:Ae.id,onClick:Vue.unref(y),onToggleFavorite:Vue.unref(p),onRemove:B,onDialog:Vue.unref(U),onRefresh:Vue.unref(me)},null,8,["favorites","tabs","home","value","onClick","onToggleFavorite","onDialog","onRefresh"]),Vue.createVNode(yl,{tabs:Vue.unref(D),actions:n.actions,theme:n.theme,onCloseOtherTabs:W,onCloseAllTabs:O,onCloseTab:B,onClickTab:Vue.unref(R),onActionClick:Ve,onActionCommand:ut},{default:Vue.withCtx(()=>[Vue.createVNode(wl,{avatar:n.avatar},Vue.createSlots({_:2},[X.$slots.user?{name:"default",fn:Vue.withCtx(()=>[Vue.renderSlot(X.$slots,"user")]),key:"0"}:void 0]),1032,["avatar"])]),_:3},8,["tabs","actions","theme","onClickTab"])]}),_:3}),Vue.createVNode(po,{createView:Vue.unref(Y),exclude:Vue.unref(T)},{default:Vue.withCtx(()=>[X.$slots.default?Vue.renderSlot(X.$slots,"default",{key:0}):Vue.createCommentVNode("",!0)]),_:3},8,["createView","exclude"])]),_:3})],64))]),_:3},8,["class"]))}});function xl(o={}){const e=VueRouter.useRoute(),n=Vue.inject(dn,null),t=Vue.inject(fn,null);if(n){const l=typeof o=="function"?o:()=>N(this,null,function*(){return o});n[e.fullPath]=l}return{tab:Vue.computed(()=>t?t.tabs.value.find(l=>l.url===e.fullPath):null),mask:t}}const pn=Vue.defineComponent({__name:"SelectEditor",props:{options:{default:()=>[]}},emits:["change"],setup(o,{emit:e}){const n=o,t=e,r=l=>{const u=n.options.filter(a=>Array.isArray(l)?l.includes(a.value):l===a.value);t("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(n.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))}}),Bl=Vue.defineComponent({__name:"CheckboxEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,n=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElCheckboxButton:ElementPlus.ElCheckbox));return(t,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElCheckboxGroup),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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))}}),Pl=Vue.defineComponent({__name:"RadioEditor",props:{options:{default:()=>[]},button:{type:Boolean,default:!1}},setup(o){const e=o,n=Vue.computed(()=>Vue.markRaw(e.button?ElementPlus.ElRadioButton:ElementPlus.ElRadio));return(t,r)=>(Vue.openBlock(),Vue.createBlock(Vue.unref(ElementPlus.ElRadioGroup),Vue.normalizeProps(Vue.guardReactiveProps(t.$attrs)),{default:Vue.withCtx(()=>[(Vue.openBlock(!0),Vue.createElementBlock(Vue.Fragment,null,Vue.renderList(e.options,(l,u)=>(Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(n.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:n}=o;if(n.filterResetMethod){n.filterResetMethod(o);return}e.forEach(t=>{t.value=""})},filterRecoverMethod(o){const{option:e,column:n}=o;if(n.filterRecoverMethod){n.filterRecoverMethod(o);return}e.value=""},filterMethod(o){const{option:e,row:n,column:t}=o;if(t.filterMethod)return t.filterMethod(o);const{value:r}=e,l=n[t.field];return VtjUtils.isString(l)?l.indexOf(String(r))>-1:l===r}},Nl=Vue.defineComponent({name:"InputEdit",__name:"InputEdit",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:n,renderEvents:t,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(n),Vue.toHandlers(Vue.unref(t))),null,16,["modelValue","onInput"]))}}),Tl={class:"x-grid__filter"},mn=Vue.defineComponent({name:"InputFilter",__name:"InputFilter",props:{params:{},renderOpts:{}},setup(o){const e=o,{renderProps:n,renderEvents:t,state:r,load:l,onChange:u,onKeyup:a}=Ht(e.renderOpts,e.params);return l(),(i,s)=>(Vue.openBlock(),Vue.createElementBlock("div",Tl,[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(n),Vue.toHandlers(Vue.unref(t))),null,16,["modelValue","onInput","onKeyup"])]))}}),qe={autofocus:".el-input__inner",renderDefault(o,e){var r;const{row:n,column:t}=e;return[Vue.createTextVNode((r=n[t.field])!=null?r:"")]},renderEdit(o,e){return[Vue.h(Nl,{params:e,renderOpts:o})]},renderCell(o,e){var r;const{row:n,column:t}=e;return[Vue.createTextVNode((r=n[t.field])!=null?r:"")]}},Dl=H(P(P({cellClassName:"x-grid__edit"},qe),je),{renderFilter(o,e){return[Vue.h(mn,{params:e,renderOpts:o})]}});/**!
8
8
  * Sortable 1.15.3
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.8.159",
4
+ "version": "0.8.160",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=16.0.0"
@@ -12,8 +12,8 @@
12
12
  "sortablejs": "~1.15.2",
13
13
  "vxe-table": "~4.6.17",
14
14
  "vxe-table-plugin-menus": "~4.0.3",
15
- "@vtj/utils": "~0.8.159",
16
- "@vtj/icons": "~0.8.159"
15
+ "@vtj/utils": "~0.8.160",
16
+ "@vtj/icons": "~0.8.160"
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.8.158
5
+ * @version 0.8.160
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.158";
8
+ export declare const version = "0.8.160";