@cghbcf/xp-ui 1.1.0 → 1.3.0
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/README.md +441 -2
- package/dist/cghbcf-xp-ui.cjs.js +8 -5
- package/dist/cghbcf-xp-ui.es.js +1745 -820
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/cghbcf-xp-ui.cjs.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=(t,n)=>{const o=t.__vccOpts||t;for(const[l,a]of n)o[l]=a;return o},we={class:"xp-alert__icon"},Ne={class:"xp-alert__content"},Ce={class:"xp-alert__title"},$e={key:0,class:"xp-alert__description"},Se={__name:"Alert",props:{title:{type:String,default:""},type:{type:String,default:"info",validator:t=>["success","warning","danger","info"].includes(t)},effect:{type:String,default:"light",validator:t=>["light","dark","plain"].includes(t)},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:n}){const o=n,l=e.ref(!0),a={success:"✓",warning:"!",danger:"×",info:"i"},i=()=>{l.value=!1,o("close")};return(s,f)=>(e.openBlock(),e.createBlock(e.Transition,{name:"xp-alert-fade"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-alert",[`xp-alert--${t.type}`,`xp-alert--${t.effect}`,{"xp-alert--plain":t.effect==="plain"}]]),role:"alert"},[e.createElementVNode("span",we,e.toDisplayString(a[t.type]),1),e.createElementVNode("div",Ne,[e.createElementVNode("span",Ce,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)]),s.$slots.default?(e.openBlock(),e.createElementBlock("p",$e,[e.renderSlot(s.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),t.closable?(e.openBlock(),e.createElementBlock("i",{key:0,class:"xp-alert__close-btn",onClick:i},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},U=v(Se,[["__scopeId","data-v-91d792bd"]]),ze=["src","alt"],Te={key:1,class:"xp-avatar__slot"},Me={key:2,class:"xp-avatar__text"},De={__name:"Avatar",props:{src:{type:String,default:""},alt:{type:String,default:""},shape:{type:String,default:"circle",validator:t=>["circle","square"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},icon:{type:String,default:""}},emits:["error"],setup(t,{emit:n}){const o=t,l=n,a=e.ref(!1),i=e.computed(()=>({backgroundColor:o.src?"transparent":"var(--xp-color-primary-bg)",color:o.src?void 0:"var(--xp-color-primary)"})),s=()=>{a.value=!0,l("error")};return(f,p)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-avatar",[`xp-avatar--${t.shape}`,`xp-avatar--${t.size}`,{"xp-avatar--fit":t.src}]]),style:e.normalizeStyle(i.value)},[t.src&&!a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,onError:s},null,40,ze)):f.$slots.default?(e.openBlock(),e.createElementBlock("span",Te,[e.renderSlot(f.$slots,"default",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("span",Me,e.toDisplayString(t.alt||"A"),1))],6))}},W=v(De,[["__scopeId","data-v-a9a54bc5"]]),Ie={key:0},Fe={__name:"Badge",props:{value:{type:[String,Number],default:0},max:{type:Number,default:99},type:{type:String,default:"danger",validator:t=>["primary","success","warning","danger","info"].includes(t)},isDot:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(t){const n=t,o=e.computed(()=>typeof n.value=="number"&&n.value>n.max?`${n.max}+`:n.value),l=e.computed(()=>n.value!==0&&n.value!==""&&n.value!==null&&n.value!==void 0);return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-badge",{"xp-badge--dot":t.isDot,"xp-badge--hidden":t.hidden}])},[e.renderSlot(a.$slots,"default",{},void 0,!0),!t.hidden&&(t.isDot||l.value)?(e.openBlock(),e.createElementBlock("sup",{key:0,class:e.normalizeClass(["xp-badge__content",[`xp-badge__content--${t.type}`,{"xp-badge__content--dot":t.isDot}]])},[t.isDot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ie,e.toDisplayString(o.value),1))],2)):e.createCommentVNode("",!0)],2))}},H=v(Fe,[["__scopeId","data-v-207db6dd"]]),Xe=["disabled"],Ae={key:0,class:"xp-button__loading"},je={class:"xp-button__text"},Re={__name:"Button",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info","ghost"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},text:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const o=t,l=n,a=i=>{!o.disabled&&!o.loading&&l("click",i)};return(i,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["xp-button",[`xp-button--${t.type}`,`xp-button--${t.size}`,{"xp-button--disabled":t.disabled,"xp-button--loading":t.loading,"xp-button--plain":t.plain,"xp-button--text":t.text}]]),disabled:t.disabled||t.loading,onClick:a},[t.loading?(e.openBlock(),e.createElementBlock("span",Ae)):e.createCommentVNode("",!0),e.createElementVNode("span",je,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],10,Xe))}},M=v(Re,[["__scopeId","data-v-9c6bc634"]]),Le={key:0,class:"xp-card__header"},Oe={class:"xp-card__title"},Pe={key:0,class:"xp-card__extra"},Ue={class:"xp-card__body"},We={key:1,class:"xp-card__footer"},He={__name:"Card",props:{title:{type:String,default:""},shadow:{type:String,default:"always",validator:t=>["always","hover","never"].includes(t)},bordered:{type:Boolean,default:!0},hover:{type:Boolean,default:!1}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-card",[`xp-card--${t.shadow}`,{"xp-card--bordered":t.bordered,"xp-card--hover":t.hover}]])},[t.title||n.$slots.header?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(n.$slots,"header",{},()=>[e.createElementVNode("h3",Oe,e.toDisplayString(t.title),1)],!0),n.$slots.extra?(e.openBlock(),e.createElementBlock("div",Pe,[e.renderSlot(n.$slots,"extra",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ue,[e.renderSlot(n.$slots,"default",{},void 0,!0)]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},J=v(He,[["__scopeId","data-v-e65cbe05"]]),Je={class:"xp-checkbox__input"},qe=["checked","disabled",".indeterminate"],Ge={class:"xp-checkbox__label"},Ye={__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,a=i=>{if(o.disabled)return;const s=i.target.checked;l("update:modelValue",s),l("change",s)};return(i,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-checkbox",[{"xp-checkbox--checked":t.modelValue,"xp-checkbox--disabled":t.disabled,"xp-checkbox--indeterminate":t.indeterminate}]])},[e.createElementVNode("span",Je,[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-checkbox__inner"},null,-1)),e.createElementVNode("input",{type:"checkbox",class:"xp-checkbox__original",checked:t.modelValue,disabled:t.disabled,onChange:a,".indeterminate":t.indeterminate},null,40,qe)]),e.createElementVNode("span",Ge,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},q=v(Ye,[["__scopeId","data-v-7c078f46"]]),Ke={key:0,class:"xp-menu__divider"},Ze=["disabled","onClick"],Qe={key:0,class:"xp-menu__icon","aria-hidden":"true"},et={class:"xp-menu__label"},tt={__name:"ContextMenu",props:{visible:{type:Boolean,default:!1},x:{type:Number,default:0},y:{type:Number,default:0},items:{type:Array,default:()=>[]}},emits:["close","select","command"],setup(t,{emit:n}){const o=t,l=n;e.ref(null);const a=e.computed(()=>{const u=Math.min(o.items.filter(m=>!m.divider).length,12)*32+12;let r=o.x,c=o.y;return r+220>window.innerWidth-8&&(r=Math.max(8,window.innerWidth-220-8)),c+u>window.innerHeight-8&&(c=Math.max(8,window.innerHeight-u-8)),{left:`${r}px`,top:`${c}px`}});function i(){l("close")}function s(p){p.disabled||(l("close"),l("select",p),l("command",p.command),p.onClick&&p.onClick())}function f(p){p.key==="Escape"&&o.visible&&l("close")}return e.onUnmounted(()=>window.removeEventListener("keydown",f)),(p,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-menu"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-menu-mask",onMousedown:i,onContextmenu:u[2]||(u[2]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"xp-menu",style:e.normalizeStyle(a.value),role:"menu",onMousedown:u[0]||(u[0]=e.withModifiers(()=>{},["stop"])),onMouseup:u[1]||(u[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(r,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[r.divider?(e.openBlock(),e.createElementBlock("div",Ke)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["xp-menu__item",{"xp-menu__item--danger":r.danger,"xp-menu__item--disabled":r.disabled}]),role:"menuitem",disabled:r.disabled,onClick:m=>s(r)},[r.icon?(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(r.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",et,e.toDisplayString(r.label),1)],10,Ze))],64))),128))],36)],32)):e.createCommentVNode("",!0)]),_:1})]))}},G=v(tt,[["__scopeId","data-v-7477a575"]]),ot={class:"xp-dialog__header"},nt={class:"xp-dialog__title"},lt={class:"xp-dialog__body"},at={key:0,class:"xp-dialog__footer"},rt={__name:"Dialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},confirmButtonText:{type:String,default:"确定"},cancelButtonText:{type:String,default:"取消"},closeOnClickModal:{type:Boolean,default:!0},showDefaultFooter:{type:Boolean,default:!0}},emits:["confirm","cancel","update:visible","close"],setup(t,{emit:n}){const o=t,l=n,a=()=>{l("update:visible",!1),l("close")},i=()=>{o.closeOnClickModal&&a()},s=()=>{l("confirm"),a()},f=()=>{l("cancel"),a()};function p(u){u.key==="Escape"&&o.visible&&a()}return e.watch(()=>o.visible,u=>{u?window.addEventListener("keydown",p):window.removeEventListener("keydown",p)}),e.onUnmounted(()=>window.removeEventListener("keydown",p)),(u,r)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dialog-fade"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog__wrapper",onClick:e.withModifiers(i,["self"])},[r[0]||(r[0]=e.createElementVNode("div",{class:"xp-dialog__mask"},null,-1)),e.createVNode(e.Transition,{name:"xp-dialog-slide",appear:""},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",ot,[e.createElementVNode("h3",nt,e.toDisplayString(t.title),1),e.createElementVNode("button",{class:"xp-dialog__close",onClick:a},"×")]),e.createElementVNode("div",lt,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer||t.showDefaultFooter?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(u.$slots,"footer",{},()=>[e.createVNode(M,{onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(M,{type:"primary",onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText),1)]),_:1})],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}},Y=v(rt,[["__scopeId","data-v-f85c5a46"]]),st=["onClick"],it={key:0},ct={key:1,class:"xp-dropdown__divider"},dt={__name:"Dropdown",props:{items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["select","command","open","close"],setup(t,{emit:n}){const o=t,l=n,a=e.ref(!1),i=e.ref({}),s=e.ref(null),f=e.ref(null),p=()=>{e.nextTick(()=>{if(!s.value||!f.value)return;const m=s.value.getBoundingClientRect(),k=f.value.getBoundingClientRect();let x=m.bottom+6,b=m.left;b+k.width>window.innerWidth-10&&(b=window.innerWidth-k.width-10),x+k.height>window.innerHeight-10&&(x=m.top-k.height-6),i.value={top:`${x+window.scrollY}px`,left:`${b+window.scrollX}px`}})},u=()=>{o.disabled||(a.value=!a.value,a.value?(p(),l("open")):l("close"))},r=m=>{m.disabled||m.divider||(l("select",m),m.command!==void 0&&l("command",m.command,m),a.value=!1,l("close"))},c=m=>{var k;a.value&&s.value&&!s.value.contains(m.target)&&!((k=f.value)!=null&&k.contains(m.target))&&(a.value=!1,l("close"))};return e.onMounted(()=>{document.addEventListener("click",c)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",c)}),(m,k)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-dropdown",ref_key:"dropdownRef",ref:s},[e.createElementVNode("div",{class:"xp-dropdown__trigger",onClick:u},[e.renderSlot(m.$slots,"default",{},void 0,!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dropdown-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dropdown__menu",style:e.normalizeStyle(i.value),ref_key:"menuRef",ref:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(x,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:e.normalizeClass(["xp-dropdown__item",{"xp-dropdown__item--disabled":x.disabled,"xp-dropdown__item--divider":x.divider}]),onClick:A=>r(x)},[x.divider?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(x.label),1)),x.divider?(e.openBlock(),e.createElementBlock("span",ct)):e.createCommentVNode("",!0)],10,st))),128))],4)):e.createCommentVNode("",!0)]),_:1})]))],512))}},K=v(dt,[["__scopeId","data-v-ad741cd8"]]),ut={class:"xp-empty"},pt={class:"xp-empty__title"},mt={key:0,class:"xp-empty__hint"},ft={key:1,class:"xp-empty__action"},ht={__name:"Empty",props:{title:{type:String,default:"暂无内容"},hint:{type:String,default:""}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(n.$slots,"icon",{},()=>[o[0]||(o[0]=e.createElementVNode("div",{class:"xp-empty__icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"46",height:"46",viewBox:"0 0 24 24",fill:"none"},[e.createElementVNode("path",{d:"M4 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z",stroke:"var(--xp-border-color)","stroke-width":"1.5","stroke-linejoin":"round"})])],-1))],!0),e.createElementVNode("p",pt,e.toDisplayString(t.title),1),t.hint?(e.openBlock(),e.createElementBlock("p",mt,e.toDisplayString(t.hint),1)):e.createCommentVNode("",!0),n.$slots.default?(e.openBlock(),e.createElementBlock("div",ft,[e.renderSlot(n.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]))}},Z=v(ht,[["__scopeId","data-v-93d5e1e9"]]),gt=["width","height"],kt={__name:"FileIcon",props:{type:{type:String,default:"file"},size:{type:Number,default:20}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("span",{class:"xp-file-icon",style:e.normalizeStyle({width:t.size+"px",height:t.size+"px"}),"aria-hidden":"true"},[(e.openBlock(),e.createElementBlock("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none"},[t.type==="folder"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o[0]||(o[0]=e.createElementVNode("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4h4l2 2h7A2.5 2.5 0 0 1 21 8.5v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#E8B64E","fill-opacity":"0.9"},null,-1)),o[1]||(o[1]=e.createElementVNode("path",{d:"M3 8.5h18v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#F3CE78"},null,-1))],64)):t.type==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o[2]||(o[2]=e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.4",fill:"#4FA8C9","fill-opacity":"0.16",stroke:"#3D8EAD","stroke-width":"1.4"},null,-1)),o[3]||(o[3]=e.createElementVNode("circle",{cx:"9",cy:"10",r:"1.8",fill:"#3D8EAD"},null,-1)),o[4]||(o[4]=e.createElementVNode("path",{d:"M4.4 17.4l4.6-4.4 3 2.8 3.2-3.2 4.4 4.2",stroke:"#3D8EAD","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="video"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[o[5]||(o[5]=e.createElementVNode("rect",{x:"3",y:"5",width:"13",height:"14",rx:"2.4",fill:"#9B5FD1","fill-opacity":"0.14",stroke:"#8A48C4","stroke-width":"1.4"},null,-1)),o[6]||(o[6]=e.createElementVNode("path",{d:"M16 10.5l5-3v9l-5-3z",fill:"#8A48C4"},null,-1))],64)):t.type==="audio"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[o[7]||(o[7]=e.createElementVNode("path",{d:"M9 18V6l10-2v11",stroke:"#C2569B","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),o[8]||(o[8]=e.createElementVNode("circle",{cx:"6.6",cy:"18",r:"2.4",fill:"#C2569B"},null,-1)),o[9]||(o[9]=e.createElementVNode("circle",{cx:"16.6",cy:"15",r:"2.4",fill:"#C2569B"},null,-1))],64)):t.type==="pdf"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[o[10]||(o[10]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2.4",fill:"#D9504A","fill-opacity":"0.14",stroke:"#C24842","stroke-width":"1.4"},null,-1)),o[11]||(o[11]=e.createElementVNode("text",{x:"12",y:"16.2","text-anchor":"middle","font-size":"9.5","font-weight":"700",fill:"#C24842","font-family":"Arial, sans-serif"},"PDF",-1))],64)):t.type==="doc"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[o[12]||(o[12]=e.createElementVNode("path",{d:"M5 3.5h9l5 5v12h-14z",fill:"#3B7FD6","fill-opacity":"0.14",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[13]||(o[13]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[14]||(o[14]=e.createElementVNode("path",{d:"M7.5 12v5M7.5 14.5h3",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),o[15]||(o[15]=e.createElementVNode("path",{d:"M13.5 12h3M13.5 14.5h3M13.5 17h2",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1))],64)):t.type==="sheet"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[o[16]||(o[16]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#3E9C5E","fill-opacity":"0.14",stroke:"#33854F","stroke-width":"1.4"},null,-1)),o[17]||(o[17]=e.createElementVNode("path",{d:"M4 9h16M4 14h16M10 9v11.5M14.5 9v11.5",stroke:"#33854F","stroke-width":"1.2","stroke-linecap":"round"},null,-1))],64)):t.type==="slide"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[o[18]||(o[18]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"12",rx:"2.4",fill:"#E09A2F","fill-opacity":"0.16",stroke:"#CC8420","stroke-width":"1.4"},null,-1)),o[19]||(o[19]=e.createElementVNode("path",{d:"M12 17v3M9.5 20h5",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),o[20]||(o[20]=e.createElementVNode("circle",{cx:"9",cy:"10.4",r:"1.3",fill:"#CC8420"},null,-1)),o[21]||(o[21]=e.createElementVNode("path",{d:"M6 14.4l2.8-2.8 2 1.8L14 9.6l4 4.4",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="archive"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[o[22]||(o[22]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#A97D4E","fill-opacity":"0.16",stroke:"#8F6539","stroke-width":"1.4"},null,-1)),o[23]||(o[23]=e.createElementVNode("path",{d:"M9.5 4v16M14.5 4v16M4 12h16",stroke:"#8F6539","stroke-width":"1.3"},null,-1))],64)):t.type==="code"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[o[24]||(o[24]=e.createElementVNode("path",{d:"M8.5 8l-4.5 4 4.5 4M15.5 8l4.5 4-4.5 4",stroke:"#6B62E0","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),o[25]||(o[25]=e.createElementVNode("path",{d:"M13.6 5.8l-3.2 12.4",stroke:"#6B62E0","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):t.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[o[26]||(o[26]=e.createElementVNode("path",{d:"M4 6.2C4 5 4.9 4 6.5 4h11C19 4 20 5 20 6.2v11.6C20 19 19 20 17.5 20h-11C4.9 20 4 19 4 17.8z",fill:"#7D8894","fill-opacity":"0.12",stroke:"#5F6B78","stroke-width":"1.4"},null,-1)),o[27]||(o[27]=e.createElementVNode("path",{d:"M7.5 8.5h9M7.5 12h6.5",stroke:"#5F6B78","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[o[28]||(o[28]=e.createElementVNode("path",{d:"M6 3.5h8l5 5v12h-13z",fill:"#A2AAB4","fill-opacity":"0.16",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[29]||(o[29]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),o[30]||(o[30]=e.createElementVNode("path",{d:"M8 12.5h8M8 15.5h8M8 18.5h5",stroke:"#7C8590","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))],8,gt))],4))}},Q=v(kt,[["__scopeId","data-v-c598c294"]]),xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M330.666667 512c0-14.933333 4.266667-29.866667 14.933333-40.533333l234.666667-277.33333399c23.466667-27.733333 64-29.866667 89.6-8.53333301 27.733333 23.466667 29.866667 64 8.53333299 89.6L477.866667 512l200.53333299 236.8c23.466667 27.733333 19.19999999 68.266667-8.53333299 89.6-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333301l-234.666667-277.33333399c-10.666667-10.666667-14.933333-25.6-14.933333-40.533333z" /></svg>',vt=["viewBox","innerHTML"],yt={key:2,class:"xp-icon__fallback"},bt={__name:"Icon",props:{name:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""},spin:{type:Boolean,default:!1},rotate:{type:Number,default:0}},setup(t){const n=["small","medium","large"],o=t,l=Object.assign({"./icons/jiantou.svg":xt}),a=r=>r&&r.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi,'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi,'stroke="currentColor"'),i=e.computed(()=>{if(!o.name)return null;const r=`./icons/${o.name}.svg`,c=l[r];if(!c)return null;const m=c.match(/<svg[^>]*>([\s\S]*)<\/svg>/i),k=a(m?m[1]:c),x=c.match(/viewBox\s*=\s*["']([^"']+)["']/i);return{inner:k,viewBox:x?x[1]:"0 0 24 24"}}),s=e.computed(()=>n.includes(String(o.size))),f=e.computed(()=>{if(s.value)return null;const r=o.size;return typeof r=="number"?`${r}px`:typeof r=="string"&&r.trim()?/^\d+(\.\d+)?$/.test(r.trim())?`${r}px`:r.trim():null}),p=e.computed(()=>{const r=[];return s.value&&r.push(`xp-icon--${o.size}`),o.spin&&r.push("xp-icon--spin"),r}),u=e.computed(()=>{const r={};return o.color&&(r.color=o.color),o.rotate&&(r.transform=`rotate(${o.rotate}deg)`),f.value&&(r.width=f.value,r.height=f.value,r.fontSize=f.value),r});return(r,c)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["xp-icon",p.value]),style:e.normalizeStyle(u.value)},[r.$slots.default?e.renderSlot(r.$slots,"default",{key:0},void 0,!0):i.value?(e.openBlock(),e.createElementBlock("svg",{key:1,viewBox:i.value.viewBox,innerHTML:i.value.inner},null,8,vt)):(e.openBlock(),e.createElementBlock("span",yt,"?"))],6))}},ee=v(bt,[["__scopeId","data-v-14319319"]]),_t={key:0,class:"xp-input__prefix"},Et=["id","type","value","placeholder","disabled","maxlength"],Bt={key:2,class:"xp-input__suffix"},Vt={__name:"Input",props:{modelValue:{type:[String,Number],default:""},id:{type:String,default:""},type:{type:String,default:"text",validator:t=>["text","password","number","email","tel","url"].includes(t)},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},maxlength:{type:[String,Number],default:null},showClear:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","clear"],setup(t,{expose:n,emit:o}){const l=o,a=e.ref(null),i=e.ref(!1),s=r=>{l("update:modelValue",r.target.value)},f=r=>{i.value=!0,l("focus",r)},p=r=>{i.value=!1,l("blur",r)},u=()=>{l("update:modelValue",""),l("clear"),a.value&&a.value.focus()};return n({focus:()=>a.value&&a.value.focus(),select:()=>a.value&&a.value.select(),blur:()=>a.value&&a.value.blur()}),(r,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":r.$slots.prefix,"xp-input--suffix":r.$slots.suffix||t.showClear,"xp-input--focus":i.value}]])},[r.$slots.prefix?(e.openBlock(),e.createElementBlock("span",_t,[e.renderSlot(r.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:a,class:"xp-input__inner",id:t.id||void 0,type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,maxlength:t.maxlength,onInput:s,onFocus:f,onBlur:p},null,40,Et),t.showClear&&t.modelValue&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"xp-input__clear",onClick:u},"×")):e.createCommentVNode("",!0),r.$slots.suffix&&!t.showClear?(e.openBlock(),e.createElementBlock("span",Bt,[e.renderSlot(r.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},te=v(Vt,[["__scopeId","data-v-46247483"]]),wt={key:0,class:"xp-progress__text"},Nt={__name:"Progress",props:{percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:String,default:""},showText:{type:Boolean,default:!0},type:{type:String,default:"line",validator:t=>["line","circle"].includes(t)},status:{type:String,default:"",validator:t=>["","success","warning","exception"].includes(t)},strokeWidth:{type:Number,default:8}},setup(t){const n=t,o=e.computed(()=>n.type==="line"?{height:`${n.strokeWidth}px`}:{}),l=e.computed(()=>n.color?n.color:n.status==="success"?"var(--xp-color-success)":n.status==="warning"?"var(--xp-color-warning)":n.status==="exception"?"var(--xp-color-danger)":"var(--xp-color-primary)");return(a,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-progress",[`xp-progress--${t.type}`]])},[e.createElementVNode("div",{class:"xp-progress__bar",style:e.normalizeStyle(o.value)},[e.createElementVNode("div",{class:"xp-progress__inner",style:e.normalizeStyle({width:`${t.percentage}%`,backgroundColor:l.value})},null,4)],4),t.showText?(e.openBlock(),e.createElementBlock("span",wt,[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)],!0)])):e.createCommentVNode("",!0)],2))}},oe=v(Nt,[["__scopeId","data-v-244dca2c"]]),Ct={class:"xp-radio__input"},$t=["checked","disabled"],St={class:"xp-radio__label"},zt={__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:""},value:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,a=()=>{o.disabled||(l("update:modelValue",o.value),l("change",o.value))};return(i,s)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-radio",[{"xp-radio--checked":t.modelValue===t.value,"xp-radio--disabled":t.disabled}]])},[e.createElementVNode("span",Ct,[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-radio__inner"},null,-1)),e.createElementVNode("input",{type:"radio",class:"xp-radio__original",checked:t.modelValue===t.value,disabled:t.disabled,onChange:a},null,40,$t)]),e.createElementVNode("span",St,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},ne=v(zt,[["__scopeId","data-v-02a0d80d"]]),Tt={class:"xp-rate"},Mt=["onClick","onMouseenter"],Dt={class:"xp-rate__star"},It={key:0,class:"xp-rate__text"},Ft={__name:"Rate",props:{modelValue:{type:Number,default:0},max:{type:Number,default:5},color:{type:String,default:"#f7ba2a"},disabled:{type:Boolean,default:!1},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,a=e.ref(0),i=e.computed(()=>a.value||o.modelValue),s=p=>{const u=i.value-p+1;return u>=1?100:u>0?u*100:0},f=p=>{o.disabled||(l("update:modelValue",p),l("change",p))};return(p,u)=>(e.openBlock(),e.createElementBlock("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max,r=>(e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass(["xp-rate__item",{"xp-rate__item--disabled":t.disabled}]),style:e.normalizeStyle({cursor:t.disabled?"default":"pointer"}),onClick:c=>f(r),onMouseenter:c=>a.value=r,onMouseleave:u[0]||(u[0]=c=>a.value=0)},[e.createElementVNode("span",Dt,[u[1]||(u[1]=e.createElementVNode("span",{class:"xp-rate__star-outer"},"★",-1)),e.createElementVNode("span",{class:"xp-rate__star-inner",style:e.normalizeStyle({width:s(r)+"%",color:t.color})}," ★ ",4)])],46,Mt))),128)),t.showText&&!t.disabled?(e.openBlock(),e.createElementBlock("span",It,e.toDisplayString(t.modelValue)+" / "+e.toDisplayString(t.max),1)):e.createCommentVNode("",!0)]))}},le=v(Ft,[["__scopeId","data-v-214323a3"]]),Xt=["aria-checked"],At={key:0,class:"xp-switch__label"},jt={__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,a=()=>{if(o.disabled)return;const i=!o.modelValue;l("update:modelValue",i),l("change",i)};return(i,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-switch",[`xp-switch--${t.size}`,{"xp-switch--checked":t.modelValue,"xp-switch--disabled":t.disabled}]]),role:"switch","aria-checked":t.modelValue,onClick:a},[s[0]||(s[0]=e.createElementVNode("span",{class:"xp-switch__core"},[e.createElementVNode("span",{class:"xp-switch__action"})],-1)),i.$slots.default?(e.openBlock(),e.createElementBlock("span",At,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,Xt))}},ae=v(jt,[["__scopeId","data-v-5a5e33c5"]]),Rt={key:0,class:"xp-tab-pane"},Lt={__name:"TabPane",props:{name:{type:[String,Number],required:!0},title:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(t){const n=t,o=e.inject("xpTabs",null),l=e.computed(()=>o?o.currentValue.value===n.name:!0);return e.onMounted(()=>{o&&o.addTab&&o.addTab({name:n.name,title:n.title,disabled:n.disabled})}),e.onBeforeUnmount(()=>{o&&o.removeTab&&o.removeTab(n.name)}),(a,i)=>l.value?(e.openBlock(),e.createElementBlock("div",Rt,[e.renderSlot(a.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)}},re=v(Lt,[["__scopeId","data-v-6fe7943a"]]),Ot={class:"xp-tabs"},Pt={class:"xp-tabs__nav",role:"tablist"},Ut=["onClick"],Wt={class:"xp-tabs__content"},Ht={__name:"Tabs",props:{modelValue:{type:[String,Number],default:null}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,a=e.ref([]),i=e.computed(()=>{var r;return o.modelValue!==null&&o.modelValue!==void 0&&o.modelValue!==""?o.modelValue:((r=a.value[0])==null?void 0:r.name)??null}),s=e.computed(()=>{const r=a.value.findIndex(m=>m.name===i.value);return{transform:`translateX(${(r>=0?r:0)*100}%)`,width:`${a.value.length?100/a.value.length:0}%`}}),f=r=>{r.disabled||(l("update:modelValue",r.name),l("change",r.name))},p=r=>{a.value.find(c=>c.name===r.name)||a.value.push(r)},u=r=>{const c=a.value.findIndex(m=>m.name===r);c>=0&&a.value.splice(c,1)};return e.provide("xpTabs",{addTab:p,removeTab:u,currentValue:i}),(r,c)=>(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("div",Pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,k)=>(e.openBlock(),e.createElementBlock("div",{key:m.name||k,class:e.normalizeClass(["xp-tabs__item",[{"xp-tabs__item--active":i.value===m.name,"xp-tabs__item--disabled":m.disabled}]]),role:"tab",onClick:x=>f(m)},e.toDisplayString(m.title),11,Ut))),128)),e.createElementVNode("div",{class:"xp-tabs__active-bar",style:e.normalizeStyle(s.value)},null,4)]),e.createElementVNode("div",Wt,[e.renderSlot(r.$slots,"default",{},void 0,!0)])]))}},se=v(Ht,[["__scopeId","data-v-3e658dba"]]),Jt={__name:"Tag",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},color:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:["click","close"],setup(t,{emit:n}){const o=t,l=n,a=e.computed(()=>o.color?o.color.startsWith("#")||o.color.startsWith("rgb")?{backgroundColor:o.color,borderColor:o.color,color:"#fff"}:{}:{}),i=f=>{l("click",f)},s=f=>{l("close",f)};return(f,p)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-tag",[`xp-tag--${t.type}`,`xp-tag--${t.size}`,{"xp-tag--plain":t.plain,"xp-tag--round":t.round,"xp-tag--closable":t.closable}]]),style:e.normalizeStyle(a.value),onClick:i},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-tag__close",onClick:e.withModifiers(s,["stop"])},"×")):e.createCommentVNode("",!0)],6))}},ie=v(Jt,[["__scopeId","data-v-903813de"]]),qt=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,Gt=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;function z(t){if(typeof t!="string")return null;const n=t.trim(),o=n.match(qt);if(o){let a=o[1];a.length===3&&(a=a.split("").map(p=>p+p).join(""));const i=parseInt(a.slice(0,2),16),s=parseInt(a.slice(2,4),16),f=parseInt(a.slice(4,6),16);return{r:i,g:s,b:f,a:1}}const l=n.match(Gt);return l?{r:parseInt(l[1],10),g:parseInt(l[2],10),b:parseInt(l[3],10),a:l[4]?parseFloat(l[4]):1}:null}function Yt(t){return Math.max(0,Math.min(255,Math.round(t)))}function ce(t,n,o){const l=a=>Yt(a).toString(16).padStart(2,"0");return"#"+l(t)+l(n)+l(o)}function I(t,n,o=.5){const l=z(t),a=z(n);if(!l||!a)return"#000000";const i=Math.max(0,Math.min(1,o)),s=l.r*(1-i)+a.r*i,f=l.g*(1-i)+a.g*i,p=l.b*(1-i)+a.b*i;return ce(s,f,p)}function $(t,n){return I(t,"#ffffff",n)}function S(t,n){return I(t,"#000000",n)}function Kt(t){return $(t,.3)}function Zt(t){return S(t,.2)}function Qt(t,n){const o=z(t);if(!o)return t;const l=Math.max(0,Math.min(1,n));return`rgba(${o.r}, ${o.g}, ${o.b}, ${l})`}function eo(t){const n=z(t);return n?(n.r*299+n.g*587+n.b*114)/1e3<128:!1}function de(t,n){const o=$(t,.3),l=S(t,.2),a=n==="dark"?S(t,.85):$(t,.9),i=n==="dark"?S(t,.7):$(t,.7);return{base:t,light:o,dark:l,bg:a,border:i}}const _={primary:"#409eff",success:"#67c23a",warning:"#e6a23c",danger:"#f56c6c",info:"#909399"},N={light:{text:{primary:"#303133",regular:"#606266",secondary:"#909399",placeholder:"#c0c4cc"},border:{base:"#dcdfe6",light:"#ebeef5",lighter:"#f2f6fc"},bg:{base:"#ffffff",page:"#f2f3f5",soft:"#f5f7fa",overlay:"rgba(0, 0, 0, 0.5)"},fill:{base:"#f0f2f5",light:"#f5f7fa",lighter:"#fafafa"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.1)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.15)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.2)"}},dark:{text:{primary:"#e5eaf3",regular:"#cfd3dc",secondary:"#a3a6ad",placeholder:"#8d9095"},border:{base:"#4c4d4f",light:"#414243",lighter:"#363637"},bg:{base:"#1d1e1f",page:"#141414",soft:"#2a2b2c",overlay:"rgba(0, 0, 0, 0.7)"},fill:{base:"#303030",light:"#262727",lighter:"#1d1d1d"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.4)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.45)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.5)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.6)"}}};function E(){return{primary:{..._},light:L(N.light),dark:L(N.dark)}}function L(t){return JSON.parse(JSON.stringify(t))}function O(t,n){const o=["primary","success","warning","danger","info"],l=[];for(const a of o){const i=t[a]||_[a],s=de(i,n);l.push(` --xp-color-${a}: ${i};`),l.push(` --xp-color-${a}-light: ${s.light};`),l.push(` --xp-color-${a}-dark: ${s.dark};`),l.push(` --xp-color-${a}-bg: ${s.bg};`),l.push(` --xp-color-${a}-border: ${s.border};`)}return l.join(`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`)}let T=null;function to(){if(typeof document>"u")return null;if(T&&document.contains(T))return T;let t=document.querySelector("style[data-xp-ui-theme]");return t||(t=document.createElement("style"),t.setAttribute("data-xp-ui-theme","true"),document.head.appendChild(t)),T=t,t}function oo(t){const n=to();n&&(n.textContent=F(t))}const X=e.ref("light"),pe=e.ref(E());function V(t){if(["light","dark"].includes(t)&&(X.value=t,typeof document<"u")){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("xp-ui-theme",t)}catch{}}}function me(){V(X.value==="light"?"dark":"light")}function w(t){if(!t)return;const n=E();t.primary&&(n.primary={...n.primary,...t.primary}),t.light&&(n.light=D(n.light,t.light)),t.dark&&(n.dark=D(n.dark,t.dark)),pe.value=n,oo(n);try{localStorage.setItem("xp-ui-theme-config",JSON.stringify(n))}catch{}}function fe(){w(E())}function he(){if(typeof document>"u")return;let t=null;try{t=localStorage.getItem("xp-ui-theme")}catch{}t==="light"||t==="dark"?V(t):typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light");let n=null;try{n=localStorage.getItem("xp-ui-theme-config")}catch{}if(n)try{w(JSON.parse(n))}catch{w(E())}else w(E())}function D(t,n){if(!n||typeof n!="object")return t;const o=Array.isArray(t)?[...t]:{...t};for(const l of Object.keys(n))n[l]&&typeof n[l]=="object"&&!Array.isArray(n[l])?o[l]=D(t[l]||{},n[l]):o[l]=n[l];return o}function ge(){return{theme:X,themeConfig:pe,setTheme:V,toggleTheme:me,initTheme:he,applyThemeConfig:w,resetThemeConfig:fe,getDefaultThemeConfig:E,buildCssString:F,buildCssVars:ue}}const no=["data-theme"],lo={class:"xp-theme-customizer__header"},ao={class:"xp-theme-customizer__body"},ro={class:"xp-theme-customizer__section"},so={class:"xp-theme-customizer__modes"},io=["onClick"],co={class:"xp-theme-customizer__section"},uo={class:"xp-theme-customizer__grid"},po={class:"xp-theme-customizer__label"},mo={class:"xp-theme-customizer__input"},fo=["value","onInput"],ho=["value","onChange"],go={class:"xp-theme-customizer__section"},ko={class:"xp-theme-customizer__grid"},xo={class:"xp-theme-customizer__label"},vo={class:"xp-theme-customizer__input"},yo=["value","onInput"],bo=["value","onChange"],_o={class:"xp-theme-customizer__section"},Eo={class:"xp-theme-customizer__grid"},Bo={class:"xp-theme-customizer__label"},Vo={class:"xp-theme-customizer__input"},wo=["value","onInput"],No=["value","onChange"],Co={class:"xp-theme-customizer__section"},$o={class:"xp-theme-customizer__grid"},So={class:"xp-theme-customizer__label"},zo={class:"xp-theme-customizer__input"},To=["value","onInput"],Mo=["value","onChange"],Do={class:"xp-theme-customizer__label"},Io={class:"xp-theme-customizer__input"},Fo=["value","onInput"],Xo=["value","onChange"],ke={__name:"ThemeCustomizer",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const{theme:o,applyThemeConfig:l,resetThemeConfig:a,getDefaultThemeConfig:i,buildCssString:s,themeConfig:f}=ge(),p={primary:"主色",success:"成功",warning:"警告",danger:"危险",info:"信息",regular:"常规",secondary:"次要",placeholder:"占位",base:"基础",page:"页面",soft:"柔和",light:"亮",lighter:"更亮"},u=e.ref("light"),r=e.ref(null),c=e.reactive(m(f.value));e.watch(f,y=>Object.assign(c,m(y)),{deep:!0});function m(y){return JSON.parse(JSON.stringify(y))}function k(y){if(!y)return"#ffffff";if(/^#([0-9a-f]{6})$/i.test(y))return y.toLowerCase();const h=y.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);return h?"#"+[h[1],h[2],h[3]].map(d=>Number(d).toString(16).padStart(2,"0")).join(""):"#ffffff"}function x(y,h){c.primary[y]=h,l(c)}function b(y,h,d){c[u.value][y][h]=d,l(c)}function A(){a()}function _e(){j("xp-ui-theme.json",JSON.stringify(c,null,2),"application/json")}function Ee(){j("xp-ui-theme.css",s(c),"text/css")}function Be(){r.value&&r.value.click()}function Ve(y){const h=y.target.files&&y.target.files[0];if(!h)return;const d=new FileReader;d.onload=()=>{try{const g=JSON.parse(d.result);l(g)}catch(g){alert(`主题配置解析失败:
|
|
5
|
-
`+g.message)}finally{y.target.value=""}},d.readAsText(h)}function j(y,h,d){const g=new Blob([h],{type:d+";charset=utf-8"}),R=URL.createObjectURL(g),C=document.createElement("a");C.href=R,C.download=y,document.body.appendChild(C),C.click(),C.remove(),setTimeout(()=>URL.revokeObjectURL(R),0)}return(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"xp-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-theme-customizer-backdrop",onClick:h[0]||(h[0]=e.withModifiers(d=>y.$emit("update:modelValue",!1),["self"]))})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"xp-slide"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("aside",{key:0,class:"xp-theme-customizer","data-theme":e.unref(o)},[e.createElementVNode("header",lo,[h[2]||(h[2]=e.createElementVNode("div",{class:"xp-theme-customizer__title"},"🎨 主题定制",-1)),e.createElementVNode("button",{class:"xp-theme-customizer__close",onClick:h[1]||(h[1]=d=>y.$emit("update:modelValue",!1)),"aria-label":"关闭"},"✕")]),e.createElementVNode("div",ao,[e.createElementVNode("section",ro,[h[3]||(h[3]=e.createElementVNode("p",{class:"xp-theme-customizer__desc"}," 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ",-1)),e.createElementVNode("div",so,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["light","dark"],d=>e.createElementVNode("button",{key:d,class:e.normalizeClass(["xp-theme-customizer__mode-btn",{"is-active":u.value===d}]),onClick:g=>u.value=d},e.toDisplayString(d==="light"?"浅色":"暗黑"),11,io)),64))])]),e.createElementVNode("section",co,[h[4]||(h[4]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"主色",-1)),e.createElementVNode("div",uo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","success","warning","danger","info"],d=>e.createElementVNode("div",{key:d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",po,e.toDisplayString(p[d]),1),e.createElementVNode("div",mo,[e.createElementVNode("input",{type:"color",value:c.primary[d],onInput:g=>x(d,g.target.value)},null,40,fo),e.createElementVNode("input",{type:"text",value:c.primary[d],onChange:g=>x(d,g.target.value)},null,40,ho)])])),64))])]),e.createElementVNode("section",go,[h[5]||(h[5]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"文本",-1)),e.createElementVNode("div",ko,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","regular","secondary","placeholder"],d=>e.createElementVNode("div",{key:"t-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",xo,e.toDisplayString(p[d]),1),e.createElementVNode("div",vo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].text[d]),onInput:g=>b("text",d,g.target.value)},null,40,yo),e.createElementVNode("input",{type:"text",value:c[u.value].text[d],onChange:g=>b("text",d,g.target.value)},null,40,bo)])])),64))])]),e.createElementVNode("section",_o,[h[6]||(h[6]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"背景",-1)),e.createElementVNode("div",Eo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","page","soft"],d=>e.createElementVNode("div",{key:"bg-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Bo,e.toDisplayString(p[d]),1),e.createElementVNode("div",Vo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].bg[d]),onInput:g=>b("bg",d,g.target.value)},null,40,wo),e.createElementVNode("input",{type:"text",value:c[u.value].bg[d],onChange:g=>b("bg",d,g.target.value)},null,40,No)])])),64))])]),e.createElementVNode("section",Co,[h[7]||(h[7]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"边框 / 填充",-1)),e.createElementVNode("div",$o,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],d=>e.createElementVNode("div",{key:"bd-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",So,"边框 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",zo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].border[d]),onInput:g=>b("border",d,g.target.value)},null,40,To),e.createElementVNode("input",{type:"text",value:c[u.value].border[d],onChange:g=>b("border",d,g.target.value)},null,40,Mo)])])),64)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],d=>e.createElementVNode("div",{key:"fl-"+d,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Do,"填充 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",Io,[e.createElementVNode("input",{type:"color",value:k(c[u.value].fill[d]),onInput:g=>b("fill",d,g.target.value)},null,40,Fo),e.createElementVNode("input",{type:"text",value:c[u.value].fill[d],onChange:g=>b("fill",d,g.target.value)},null,40,Xo)])])),64))])]),h[8]||(h[8]=e.createElementVNode("section",{class:"xp-theme-customizer__section"},[e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"实时预览"),e.createElementVNode("div",{class:"xp-theme-customizer__preview"},[e.createElementVNode("div",{class:"xp-preview-row"},[e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--primary"},"Primary"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--success"},"Success"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--warning"},"Warning"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--danger"},"Danger")]),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--primary"},"主标题文本"),e.createElementVNode("div",{class:"xp-preview-text"},"正文内容样例 Regular text"),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--secondary"},"次要提示")])],-1))]),e.createElementVNode("footer",{class:"xp-theme-customizer__footer"},[e.createElementVNode("button",{class:"xp-theme-customizer__action",onClick:A},"恢复默认"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--secondary",onClick:Be},"导入 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:_e},"导出 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:Ee},"导出 CSS")]),e.createElementVNode("input",{ref_key:"importFileInput",ref:r,type:"file",accept:"application/json,.json,.txt",class:"xp-theme-customizer__hidden",onChange:Ve},null,544)],8,no)):e.createCommentVNode("",!0)]),_:1})],64))}},B=e.ref([]);let Ao=0;function jo(){function t(n,o="info",l=2600){const a=++Ao;B.value.push({id:a,message:n,type:o}),setTimeout(()=>{const i=B.value.findIndex(s=>s.id===a);i>=0&&B.value.splice(i,1)},l)}return{toasts:B,toast:t,success:n=>t(n,"success",2200),error:n=>t(n,"error",3600),info:n=>t(n,"info"),warn:n=>t(n,"warn",2800)}}const Ro={class:"xp-toast-wrap","aria-live":"polite"},Lo={class:"xp-toast__msg"},Oo={__name:"Toast",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",Ro,[e.createVNode(e.TransitionGroup,{name:"xp-toast"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(B),l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:e.normalizeClass(["xp-toast",`xp-toast--${l.type}`])},[o[0]||(o[0]=e.createElementVNode("span",{class:"xp-toast__dot","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Lo,e.toDisplayString(l.message),1)],2))),128))]),_:1})])]))}},xe=v(Oo,[["__scopeId","data-v-b564201c"]]),Po={class:"xp-tooltip__content"},Uo={__name:"Tooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},trigger:{type:String,default:"hover",validator:t=>["hover","click","manual"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const n=t,o=e.ref(!1),l=e.ref({}),a=e.ref(null),i=e.ref(null);let s=null;const f=()=>{e.nextTick(()=>{if(!a.value||!i.value)return;const c=a.value.getBoundingClientRect(),m=i.value.getBoundingClientRect();let k=0,x=0;switch(n.placement){case"top":k=c.top-m.height-8,x=c.left+c.width/2-m.width/2;break;case"bottom":k=c.bottom+8,x=c.left+c.width/2-m.width/2;break;case"left":k=c.top+c.height/2-m.height/2,x=c.left-m.width-8;break;case"right":k=c.top+c.height/2-m.height/2,x=c.right+8;break}l.value={top:`${k+window.scrollY}px`,left:`${x+window.scrollX}px`}})},p=()=>{n.disabled||(clearTimeout(s),s=setTimeout(()=>{o.value=!0,f()},100))},u=()=>{clearTimeout(s),s=setTimeout(()=>{o.value=!1},150)},r=()=>{n.trigger!=="click"||n.disabled||(o.value=!o.value,o.value&&f())};return e.onBeforeUnmount(()=>{clearTimeout(s)}),(c,m)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-tooltip",ref_key:"tooltipRef",ref:a},[e.createElementVNode("div",{class:"xp-tooltip__trigger",onMouseenter:p,onMouseleave:u,onClick:r},[e.renderSlot(c.$slots,"default",{},void 0,!0)],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-tooltip-fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-tooltip__popper",[`xp-tooltip__popper--${t.placement}`]]),style:e.normalizeStyle(l.value),ref_key:"popperRef",ref:i},[e.createElementVNode("div",Po,[e.renderSlot(c.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)],!0)]),m[0]||(m[0]=e.createElementVNode("div",{class:"xp-tooltip__arrow"},null,-1))],6)):e.createCommentVNode("",!0)]),_:3})]))],512))}},ve=v(Uo,[["__scopeId","data-v-6d9af40b"]]),ye={XpAlert:U,XpAvatar:W,XpBadge:H,XpButton:M,XpCard:J,XpCheckbox:q,XpContextMenu:G,XpDialog:Y,XpDropdown:K,XpEmpty:Z,XpFileIcon:Q,XpIcon:ee,XpInput:te,XpProgress:oe,XpRadio:ne,XpRate:le,XpSwitch:ae,XpTabPane:re,XpTabs:se,XpTag:ie,XpThemeCustomizer:ke,XpToast:xe,XpTooltip:ve},be=t=>{Object.entries(ye).forEach(([n,o])=>{t.component(n,o)})},Wo={install:be,...ye};exports.DEFAULT_PRIMARY=_;exports.DEFAULT_TOKENS=N;exports.XpAlert=U;exports.XpAvatar=W;exports.XpBadge=H;exports.XpButton=M;exports.XpCard=J;exports.XpCheckbox=q;exports.XpContextMenu=G;exports.XpDialog=Y;exports.XpDropdown=K;exports.XpEmpty=Z;exports.XpFileIcon=Q;exports.XpIcon=ee;exports.XpInput=te;exports.XpProgress=oe;exports.XpRadio=ne;exports.XpRate=le;exports.XpSwitch=ae;exports.XpTabPane=re;exports.XpTabs=se;exports.XpTag=ie;exports.XpThemeCustomizer=ke;exports.XpToast=xe;exports.XpTooltip=ve;exports.applyThemeConfig=w;exports.buildCssString=F;exports.buildCssVars=ue;exports.darken=S;exports.default=Wo;exports.deriveDark=Zt;exports.deriveLight=Kt;exports.getDefaultThemeConfig=E;exports.initTheme=he;exports.install=be;exports.isDark=eo;exports.lighten=$;exports.mix=I;exports.parseColor=z;exports.resetThemeConfig=fe;exports.setTheme=V;exports.toHex=ce;exports.toasts=B;exports.toggleTheme=me;exports.useTheme=ge;exports.useToast=jo;exports.withAlpha=Qt;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=(t,l)=>{const n=t.__vccOpts||t;for(const[o,a]of l)n[o]=a;return n},Je={class:"xp-alert__icon"},Ke={class:"xp-alert__content"},Ge={class:"xp-alert__title"},Ye={key:0,class:"xp-alert__description"},Ze={__name:"Alert",props:{title:{type:String,default:""},type:{type:String,default:"info",validator:t=>["success","warning","danger","info"].includes(t)},effect:{type:String,default:"light",validator:t=>["light","dark","plain"].includes(t)},closable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:l}){const n=l,o=e.ref(!0),a={success:"✓",warning:"!",danger:"×",info:"i"},r=()=>{o.value=!1,n("close")};return(i,v)=>(e.openBlock(),e.createBlock(e.Transition,{name:"xp-alert-fade"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-alert",[`xp-alert--${t.type}`,`xp-alert--${t.effect}`,{"xp-alert--plain":t.effect==="plain"}]]),role:"alert"},[e.createElementVNode("span",Je,e.toDisplayString(a[t.type]),1),e.createElementVNode("div",Ke,[e.createElementVNode("span",Ge,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)]),i.$slots.default?(e.openBlock(),e.createElementBlock("p",Ye,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]),t.closable?(e.openBlock(),e.createElementBlock("i",{key:0,class:"xp-alert__close-btn",onClick:r},"×")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:3}))}},ie=C(Ze,[["__scopeId","data-v-91d792bd"]]),Qe=["src","alt"],et={key:1,class:"xp-avatar__slot"},tt={key:2,class:"xp-avatar__text"},nt={__name:"Avatar",props:{src:{type:String,default:""},alt:{type:String,default:""},shape:{type:String,default:"circle",validator:t=>["circle","square"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},icon:{type:String,default:""},colorful:{type:Boolean,default:!1}},emits:["error"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(!1),r=["primary","success","warning","danger"];function i(c){let s=0;for(let d=0;d<c.length;d++)s=s*31+c.charCodeAt(d)>>>0;return s}const v=e.computed(()=>{if(n.src)return{backgroundColor:"transparent",color:void 0};if(n.colorful){const c=r[i(n.alt||"A")%r.length];return{backgroundColor:`color-mix(in srgb, var(--xp-color-${c}) 16%, transparent)`,color:`var(--xp-color-${c})`}}return{backgroundColor:"var(--xp-color-primary-bg)",color:"var(--xp-color-primary)"}}),h=()=>{a.value=!0,o("error")};return(c,s)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-avatar",[`xp-avatar--${t.shape}`,`xp-avatar--${t.size}`,{"xp-avatar--fit":t.src}]]),style:e.normalizeStyle(v.value)},[t.src&&!a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,onError:h},null,40,Qe)):c.$slots.default?(e.openBlock(),e.createElementBlock("span",et,[e.renderSlot(c.$slots,"default",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("span",tt,e.toDisplayString(t.alt||"A"),1))],6))}},ce=C(nt,[["__scopeId","data-v-0dca9296"]]),lt={key:0},ot={__name:"Badge",props:{value:{type:[String,Number],default:0},max:{type:Number,default:99},type:{type:String,default:"danger",validator:t=>["primary","success","warning","danger","info"].includes(t)},isDot:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1}},setup(t){const l=t,n=e.computed(()=>typeof l.value=="number"&&l.value>l.max?`${l.max}+`:l.value),o=e.computed(()=>l.value!==0&&l.value!==""&&l.value!==null&&l.value!==void 0);return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-badge",{"xp-badge--dot":t.isDot,"xp-badge--hidden":t.hidden}])},[e.renderSlot(a.$slots,"default",{},void 0,!0),!t.hidden&&(t.isDot||o.value)?(e.openBlock(),e.createElementBlock("sup",{key:0,class:e.normalizeClass(["xp-badge__content",[`xp-badge__content--${t.type}`,{"xp-badge__content--dot":t.isDot}]])},[t.isDot?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",lt,e.toDisplayString(n.value),1))],2)):e.createCommentVNode("",!0)],2))}},de=C(ot,[["__scopeId","data-v-207db6dd"]]),at=["disabled"],rt={key:0,class:"xp-button__loading"},st={class:"xp-button__text"},it={__name:"Button",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info","ghost"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},text:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,a=r=>{!n.disabled&&!n.loading&&o("click",r)};return(r,i)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["xp-button",[`xp-button--${t.type}`,`xp-button--${t.size}`,{"xp-button--disabled":t.disabled,"xp-button--loading":t.loading,"xp-button--plain":t.plain,"xp-button--text":t.text}]]),disabled:t.disabled||t.loading,onClick:a},[t.loading?(e.openBlock(),e.createElementBlock("span",rt)):e.createCommentVNode("",!0),e.createElementVNode("span",st,[e.renderSlot(r.$slots,"default",{},void 0,!0)])],10,at))}},q=C(it,[["__scopeId","data-v-bee0ae1e"]]),ct={key:0,class:"xp-card__header"},dt={class:"xp-card__title"},ut={key:0,class:"xp-card__extra"},pt={class:"xp-card__body"},mt={key:1,class:"xp-card__footer"},ft={__name:"Card",props:{title:{type:String,default:""},shadow:{type:String,default:"always",validator:t=>["always","hover","never"].includes(t)},bordered:{type:Boolean,default:!0},hover:{type:Boolean,default:!1}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-card",[`xp-card--${t.shadow}`,{"xp-card--bordered":t.bordered,"xp-card--hover":t.hover}]])},[t.title||l.$slots.header?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(l.$slots,"header",{},()=>[e.createElementVNode("h3",dt,e.toDisplayString(t.title),1)],!0),l.$slots.extra?(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(l.$slots,"extra",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,[e.renderSlot(l.$slots,"default",{},void 0,!0)]),l.$slots.footer?(e.openBlock(),e.createElementBlock("div",mt,[e.renderSlot(l.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},ue=C(ft,[["__scopeId","data-v-7cf22e01"]]),ht={class:"xp-checkbox__input"},gt=["checked","disabled",".indeterminate"],vt={class:"xp-checkbox__label"},kt={__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=r=>{if(n.disabled)return;const i=r.target.checked;o("update:modelValue",i),o("change",i)};return(r,i)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-checkbox",[{"xp-checkbox--checked":t.modelValue,"xp-checkbox--disabled":t.disabled,"xp-checkbox--indeterminate":t.indeterminate}]])},[e.createElementVNode("span",ht,[i[0]||(i[0]=e.createElementVNode("span",{class:"xp-checkbox__inner"},null,-1)),e.createElementVNode("input",{type:"checkbox",class:"xp-checkbox__original",checked:t.modelValue,disabled:t.disabled,onChange:a,".indeterminate":t.indeterminate},null,40,gt)]),e.createElementVNode("span",vt,[e.renderSlot(r.$slots,"default",{},void 0,!0)])],2))}},J=C(kt,[["__scopeId","data-v-7c078f46"]]),xt={key:0,class:"xp-menu__divider"},yt=["disabled","onClick"],_t={key:0,class:"xp-menu__icon","aria-hidden":"true"},bt={class:"xp-menu__label"},wt={__name:"ContextMenu",props:{visible:{type:Boolean,default:!1},x:{type:Number,default:0},y:{type:Number,default:0},items:{type:Array,default:()=>[]}},emits:["close","select","command"],setup(t,{emit:l}){const n=t,o=l;e.ref(null);const a=e.computed(()=>{const c=Math.min(n.items.filter(f=>!f.divider).length,12)*32+12;let s=n.x,d=n.y;return s+220>window.innerWidth-8&&(s=Math.max(8,window.innerWidth-220-8)),d+c>window.innerHeight-8&&(d=Math.max(8,window.innerHeight-c-8)),{left:`${s}px`,top:`${d}px`}});function r(){o("close")}function i(h){h.disabled||(o("close"),o("select",h),o("command",h.command),h.onClick&&h.onClick())}function v(h){h.key==="Escape"&&n.visible&&o("close")}return e.onUnmounted(()=>window.removeEventListener("keydown",v)),(h,c)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-menu"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-menu-mask",onMousedown:r,onContextmenu:c[2]||(c[2]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",{class:"xp-menu",style:e.normalizeStyle(a.value),role:"menu",onMousedown:c[0]||(c[0]=e.withModifiers(()=>{},["stop"])),onMouseup:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[s.divider?(e.openBlock(),e.createElementBlock("div",xt)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["xp-menu__item",{"xp-menu__item--danger":s.danger,"xp-menu__item--disabled":s.disabled}]),role:"menuitem",disabled:s.disabled,onClick:f=>i(s)},[s.icon?(e.openBlock(),e.createElementBlock("span",_t,e.toDisplayString(s.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",bt,e.toDisplayString(s.label),1)],10,yt))],64))),128))],36)],32)):e.createCommentVNode("",!0)]),_:1})]))}},pe=C(wt,[["__scopeId","data-v-7477a575"]]),Bt={class:"xp-dialog__header"},Et={class:"xp-dialog__title"},Ct={class:"xp-dialog__body"},Vt={key:0,class:"xp-dialog__footer"},$t={__name:"Dialog",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},width:{type:String,default:"500px"},confirmButtonText:{type:String,default:"确定"},cancelButtonText:{type:String,default:"取消"},closeOnClickModal:{type:Boolean,default:!0},showDefaultFooter:{type:Boolean,default:!0}},emits:["confirm","cancel","update:visible","close"],setup(t,{emit:l}){const n=t,o=l,a=()=>{o("update:visible",!1),o("close")},r=()=>{n.closeOnClickModal&&a()},i=()=>{o("confirm"),a()},v=()=>{o("cancel"),a()};function h(c){c.key==="Escape"&&n.visible&&a()}return e.watch(()=>n.visible,c=>{c?window.addEventListener("keydown",h):window.removeEventListener("keydown",h)}),e.onUnmounted(()=>window.removeEventListener("keydown",h)),(c,s)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dialog-fade"},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog__wrapper",onClick:e.withModifiers(r,["self"])},[s[0]||(s[0]=e.createElementVNode("div",{class:"xp-dialog__mask"},null,-1)),e.createVNode(e.Transition,{name:"xp-dialog-slide",appear:""},{default:e.withCtx(()=>[t.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dialog",style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",Bt,[e.createElementVNode("h3",Et,e.toDisplayString(t.title),1),e.createElementVNode("button",{class:"xp-dialog__close",onClick:a},"×")]),e.createElementVNode("div",Ct,[e.renderSlot(c.$slots,"default",{},void 0,!0)]),c.$slots.footer||t.showDefaultFooter?(e.openBlock(),e.createElementBlock("div",Vt,[e.renderSlot(c.$slots,"footer",{},()=>[e.createVNode(q,{onClick:v},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(q,{type:"primary",onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmButtonText),1)]),_:1})],!0)])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]),_:3})]))}},me=C($t,[["__scopeId","data-v-9769570e"]]),Nt=["onClick"],St={key:0},Mt={key:1,class:"xp-dropdown__divider"},zt={__name:"Dropdown",props:{items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},emits:["select","command","open","close"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(!1),r=e.ref({}),i=e.ref(null),v=e.ref(null),h=()=>{e.nextTick(()=>{if(!i.value||!v.value)return;const f=i.value.getBoundingClientRect(),b=v.value.getBoundingClientRect();let _=f.bottom+6,B=f.left;B+b.width>window.innerWidth-10&&(B=window.innerWidth-b.width-10),_+b.height>window.innerHeight-10&&(_=f.top-b.height-6),r.value={top:`${_+window.scrollY}px`,left:`${B+window.scrollX}px`}})},c=()=>{n.disabled||(a.value=!a.value,a.value?(h(),o("open")):o("close"))},s=f=>{f.disabled||f.divider||(o("select",f),f.command!==void 0&&o("command",f.command,f),a.value=!1,o("close"))},d=f=>{var b;a.value&&i.value&&!i.value.contains(f.target)&&!((b=v.value)!=null&&b.contains(f.target))&&(a.value=!1,o("close"))};return e.onMounted(()=>{document.addEventListener("click",d)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",d)}),(f,b)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-dropdown",ref_key:"dropdownRef",ref:i},[e.createElementVNode("div",{class:"xp-dropdown__trigger",onClick:c},[e.renderSlot(f.$slots,"default",{},void 0,!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-dropdown-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-dropdown__menu",style:e.normalizeStyle(r.value),ref_key:"menuRef",ref:v},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["xp-dropdown__item",{"xp-dropdown__item--disabled":_.disabled,"xp-dropdown__item--divider":_.divider}]),onClick:x=>s(_)},[_.divider?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",St,e.toDisplayString(_.label),1)),_.divider?(e.openBlock(),e.createElementBlock("span",Mt)):e.createCommentVNode("",!0)],10,Nt))),128))],4)):e.createCommentVNode("",!0)]),_:1})]))],512))}},fe=C(zt,[["__scopeId","data-v-7f40eb7f"]]),Tt={class:"xp-empty"},It={class:"xp-empty__title"},Dt={key:0,class:"xp-empty__hint"},Ft={key:1,class:"xp-empty__action"},Xt={__name:"Empty",props:{title:{type:String,default:"暂无内容"},hint:{type:String,default:""}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("div",Tt,[e.renderSlot(l.$slots,"icon",{},()=>[n[0]||(n[0]=e.createElementVNode("div",{class:"xp-empty__icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"46",height:"46",viewBox:"0 0 24 24",fill:"none"},[e.createElementVNode("path",{d:"M4 7a2 2 0 0 1 2-2h4l2 2h6a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round"})])],-1))],!0),e.createElementVNode("p",It,e.toDisplayString(t.title),1),t.hint?(e.openBlock(),e.createElementBlock("p",Dt,e.toDisplayString(t.hint),1)):e.createCommentVNode("",!0),l.$slots.default?(e.openBlock(),e.createElementBlock("div",Ft,[e.renderSlot(l.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)]))}},Z=C(Xt,[["__scopeId","data-v-dd1a0f29"]]),jt=["width","height"],At={__name:"FileIcon",props:{type:{type:String,default:"file"},size:{type:Number,default:20}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("span",{class:"xp-file-icon",style:e.normalizeStyle({width:t.size+"px",height:t.size+"px"}),"aria-hidden":"true"},[(e.openBlock(),e.createElementBlock("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none"},[t.type==="folder"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4h4l2 2h7A2.5 2.5 0 0 1 21 8.5v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#E8B64E","fill-opacity":"0.9"},null,-1)),n[1]||(n[1]=e.createElementVNode("path",{d:"M3 8.5h18v9A2.5 2.5 0 0 1 18.5 20h-13A2.5 2.5 0 0 1 3 17.5z",fill:"#F3CE78"},null,-1))],64)):t.type==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[2]||(n[2]=e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2.4",fill:"#4FA8C9","fill-opacity":"0.16",stroke:"#3D8EAD","stroke-width":"1.4"},null,-1)),n[3]||(n[3]=e.createElementVNode("circle",{cx:"9",cy:"10",r:"1.8",fill:"#3D8EAD"},null,-1)),n[4]||(n[4]=e.createElementVNode("path",{d:"M4.4 17.4l4.6-4.4 3 2.8 3.2-3.2 4.4 4.2",stroke:"#3D8EAD","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="video"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createElementVNode("rect",{x:"3",y:"5",width:"13",height:"14",rx:"2.4",fill:"#9B5FD1","fill-opacity":"0.14",stroke:"#8A48C4","stroke-width":"1.4"},null,-1)),n[6]||(n[6]=e.createElementVNode("path",{d:"M16 10.5l5-3v9l-5-3z",fill:"#8A48C4"},null,-1))],64)):t.type==="audio"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[7]||(n[7]=e.createElementVNode("path",{d:"M9 18V6l10-2v11",stroke:"#C2569B","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),n[8]||(n[8]=e.createElementVNode("circle",{cx:"6.6",cy:"18",r:"2.4",fill:"#C2569B"},null,-1)),n[9]||(n[9]=e.createElementVNode("circle",{cx:"16.6",cy:"15",r:"2.4",fill:"#C2569B"},null,-1))],64)):t.type==="pdf"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[n[10]||(n[10]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2.4",fill:"#D9504A","fill-opacity":"0.14",stroke:"#C24842","stroke-width":"1.4"},null,-1)),n[11]||(n[11]=e.createElementVNode("text",{x:"12",y:"16.2","text-anchor":"middle","font-size":"9.5","font-weight":"700",fill:"#C24842","font-family":"Arial, sans-serif"},"PDF",-1))],64)):t.type==="doc"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[n[12]||(n[12]=e.createElementVNode("path",{d:"M5 3.5h9l5 5v12h-14z",fill:"#3B7FD6","fill-opacity":"0.14",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),n[13]||(n[13]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),n[14]||(n[14]=e.createElementVNode("path",{d:"M7.5 12v5M7.5 14.5h3",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),n[15]||(n[15]=e.createElementVNode("path",{d:"M13.5 12h3M13.5 14.5h3M13.5 17h2",stroke:"#2F6DC0","stroke-width":"1.4","stroke-linecap":"round"},null,-1))],64)):t.type==="sheet"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[16]||(n[16]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#3E9C5E","fill-opacity":"0.14",stroke:"#33854F","stroke-width":"1.4"},null,-1)),n[17]||(n[17]=e.createElementVNode("path",{d:"M4 9h16M4 14h16M10 9v11.5M14.5 9v11.5",stroke:"#33854F","stroke-width":"1.2","stroke-linecap":"round"},null,-1))],64)):t.type==="slide"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[18]||(n[18]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"12",rx:"2.4",fill:"#E09A2F","fill-opacity":"0.16",stroke:"#CC8420","stroke-width":"1.4"},null,-1)),n[19]||(n[19]=e.createElementVNode("path",{d:"M12 17v3M9.5 20h5",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round"},null,-1)),n[20]||(n[20]=e.createElementVNode("circle",{cx:"9",cy:"10.4",r:"1.3",fill:"#CC8420"},null,-1)),n[21]||(n[21]=e.createElementVNode("path",{d:"M6 14.4l2.8-2.8 2 1.8L14 9.6l4 4.4",stroke:"#CC8420","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1))],64)):t.type==="archive"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[22]||(n[22]=e.createElementVNode("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2.4",fill:"#A97D4E","fill-opacity":"0.16",stroke:"#8F6539","stroke-width":"1.4"},null,-1)),n[23]||(n[23]=e.createElementVNode("path",{d:"M9.5 4v16M14.5 4v16M4 12h16",stroke:"#8F6539","stroke-width":"1.3"},null,-1))],64)):t.type==="code"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[24]||(n[24]=e.createElementVNode("path",{d:"M8.5 8l-4.5 4 4.5 4M15.5 8l4.5 4-4.5 4",stroke:"#6B62E0","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M13.6 5.8l-3.2 12.4",stroke:"#6B62E0","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):t.type==="text"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[26]||(n[26]=e.createElementVNode("path",{d:"M4 6.2C4 5 4.9 4 6.5 4h11C19 4 20 5 20 6.2v11.6C20 19 19 20 17.5 20h-11C4.9 20 4 19 4 17.8z",fill:"#7D8894","fill-opacity":"0.12",stroke:"#5F6B78","stroke-width":"1.4"},null,-1)),n[27]||(n[27]=e.createElementVNode("path",{d:"M7.5 8.5h9M7.5 12h6.5",stroke:"#5F6B78","stroke-width":"1.5","stroke-linecap":"round"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[28]||(n[28]=e.createElementVNode("path",{d:"M6 3.5h8l5 5v12h-13z",fill:"#A2AAB4","fill-opacity":"0.16",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M14 3.5v5h5",fill:"none",stroke:"#7C8590","stroke-width":"1.4","stroke-linejoin":"round"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M8 12.5h8M8 15.5h8M8 18.5h5",stroke:"#7C8590","stroke-width":"1.3","stroke-linecap":"round"},null,-1))],64))],8,jt))],4))}},he=C(At,[["__scopeId","data-v-c598c294"]]),Lt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 12h10M10 8l4 4-4 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Rt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M15 5l-7 7 7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Ot='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Pt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 14l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Ht='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M6 6l12 12M18 6L6 18" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',Wt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M12 11v5M9.5 13.5h5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',Ut='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',qt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M9 5l7 7-7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',Jt=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none">
|
|
2
|
+
<circle cx="12" cy="12" r="8.5" stroke="currentColor" stroke-width="1.8" />
|
|
3
|
+
<path d="M3.5 12h17M12 3.5c2.5 2 3.8 5 3.8 8.5s-1.3 6.5-3.8 8.5c-2.5-2-3.8-5-3.8-8.5s1.3-6.5 3.8-8.5z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" />
|
|
4
|
+
</svg>`,Kt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><rect x="4" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="4" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="4" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/><rect x="14" y="14" width="6" height="6" rx="1.2" stroke="currentColor" stroke-width="1.8"/></svg>',Gt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 11l8-7 8 7v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2z" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/><path d="M10 21v-6h4v6" stroke="currentColor" stroke-width="1.7" stroke-linejoin="round"/></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M330.666667 512c0-14.933333 4.266667-29.866667 14.933333-40.533333l234.666667-277.33333399c23.466667-27.733333 64-29.866667 89.6-8.53333301 27.733333 23.466667 29.866667 64 8.53333299 89.6L477.866667 512l200.53333299 236.8c23.466667 27.733333 19.19999999 68.266667-8.53333299 89.6-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333301l-234.666667-277.33333399c-10.666667-10.666667-14.933333-25.6-14.933333-40.533333z" /></svg>',Zt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M4 6h16M4 12h16M4 18h16" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',Qt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M20 12a8 8 0 1 1-2.34-5.66M20 4v5h-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',en='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><circle cx="12" cy="12" r="3.2" stroke="currentColor" stroke-width="1.8"/><path d="M12 2.8v2.6M12 18.6v2.6M2.8 12h2.6M18.6 12h2.6M5.5 5.5l1.8 1.8M16.7 16.7l1.8 1.8M18.5 5.5l-1.8 1.8M7.3 16.7l-1.8 1.8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',tn='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" fill="currentColor" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>',nn='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"/></svg>',ln='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 19V6M6 12l6-6 6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',on='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path d="M12 16V5M7.5 9.5L12 5l4.5 4.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',an=["viewBox","innerHTML"],rn={key:2,class:"xp-icon__fallback"},sn={__name:"Icon",props:{name:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""},spin:{type:Boolean,default:!1},rotate:{type:Number,default:0}},setup(t){const l=["small","medium","large"],n=t,o=Object.assign({"./icons/arrow-right.svg":Lt,"./icons/back.svg":Rt,"./icons/chevron-down.svg":Ot,"./icons/chevron-up.svg":Pt,"./icons/close.svg":Ht,"./icons/folder-add.svg":Wt,"./icons/folder.svg":Ut,"./icons/forward.svg":qt,"./icons/globe.svg":Jt,"./icons/grid.svg":Kt,"./icons/home.svg":Gt,"./icons/jiantou.svg":Yt,"./icons/list.svg":Zt,"./icons/refresh.svg":Qt,"./icons/settings.svg":en,"./icons/star-fill.svg":tn,"./icons/star.svg":nn,"./icons/up.svg":ln,"./icons/upload.svg":on}),a=s=>s&&s.replace(/\bfill\s*=\s*["'](?!none["'])[^"']+["']/gi,'fill="currentColor"').replace(/\bstroke\s*=\s*["'](?!none["'])[^"']+["']/gi,'stroke="currentColor"'),r=e.computed(()=>{if(!n.name)return null;const s=`./icons/${n.name}.svg`,d=o[s];if(!d)return null;const f=d.match(/<svg[^>]*>([\s\S]*)<\/svg>/i),b=a(f?f[1]:d),_=d.match(/viewBox\s*=\s*["']([^"']+)["']/i);return{inner:b,viewBox:_?_[1]:"0 0 24 24"}}),i=e.computed(()=>l.includes(String(n.size))),v=e.computed(()=>{if(i.value)return null;const s=n.size;return typeof s=="number"?`${s}px`:typeof s=="string"&&s.trim()?/^\d+(\.\d+)?$/.test(s.trim())?`${s}px`:s.trim():null}),h=e.computed(()=>{const s=[];return i.value&&s.push(`xp-icon--${n.size}`),n.spin&&s.push("xp-icon--spin"),s}),c=e.computed(()=>{const s={};return n.color&&(s.color=n.color),n.rotate&&(s.transform=`rotate(${n.rotate}deg)`),v.value&&(s.width=v.value,s.height=v.value,s.fontSize=v.value),s});return(s,d)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["xp-icon",h.value]),style:e.normalizeStyle(c.value)},[s.$slots.default?e.renderSlot(s.$slots,"default",{key:0},void 0,!0):r.value?(e.openBlock(),e.createElementBlock("svg",{key:1,viewBox:r.value.viewBox,innerHTML:r.value.inner},null,8,an)):(e.openBlock(),e.createElementBlock("span",rn,"?"))],6))}},ge=C(sn,[["__scopeId","data-v-9ed9f36d"]]),cn={key:0,class:"xp-input__prefix"},dn=["id","type","value","placeholder","disabled","maxlength"],un={key:2,class:"xp-input__suffix"},pn={__name:"Input",props:{modelValue:{type:[String,Number],default:""},id:{type:String,default:""},type:{type:String,default:"text",validator:t=>["text","password","number","email","tel","url"].includes(t)},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},maxlength:{type:[String,Number],default:null},showClear:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","clear"],setup(t,{expose:l,emit:n}){const o=n,a=e.ref(null),r=e.ref(!1),i=s=>{o("update:modelValue",s.target.value)},v=s=>{r.value=!0,o("focus",s)},h=s=>{r.value=!1,o("blur",s)},c=()=>{o("update:modelValue",""),o("clear"),a.value&&a.value.focus()};return l({focus:()=>a.value&&a.value.focus(),select:()=>a.value&&a.value.select(),blur:()=>a.value&&a.value.blur()}),(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":s.$slots.prefix,"xp-input--suffix":s.$slots.suffix||t.showClear,"xp-input--focus":r.value}]])},[s.$slots.prefix?(e.openBlock(),e.createElementBlock("span",cn,[e.renderSlot(s.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:a,class:"xp-input__inner",id:t.id||void 0,type:t.type,value:t.modelValue,placeholder:t.placeholder,disabled:t.disabled,maxlength:t.maxlength,onInput:i,onFocus:v,onBlur:h},null,40,dn),t.showClear&&t.modelValue&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"xp-input__clear",onClick:c},"×")):e.createCommentVNode("",!0),s.$slots.suffix&&!t.showClear?(e.openBlock(),e.createElementBlock("span",un,[e.renderSlot(s.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},ve=C(pn,[["__scopeId","data-v-c63d4925"]]),mn=["innerHTML"],fn={class:"xp-menu__label"},hn=["innerHTML"],gn={class:"xp-menu__label"},oe=".",vn={__name:"Menu",props:{modelValue:{type:[String,Number],default:""},mode:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)},items:{type:Array,default:()=>[]},collapse:{type:Boolean,default:!1},uniqueOpen:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","select","open","close"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(null),r=e.computed(()=>n.mode==="vertical"),i=(x,N)=>(x||[]).map(S=>{const z=N?`${N}${oe}${S.index}`:String(S.index??""),$=Array.isArray(S.children)&&S.children.length?i(S.children,z):void 0;return{...S,_idx:z,children:$}}),v=e.computed(()=>i(n.items,"")),h=x=>Array.isArray(x.children)&&x.children.length>0,c=e.computed(()=>String(n.modelValue??"")),s=e.ref([]),d=x=>s.value.includes(x),f=x=>{s.value=s.value.filter(N=>N!==x),o("close",x)},b=x=>{s.value.includes(x)||s.value.push(x),o("open",x)},_=x=>{if(!n.disabled){if(d(x)){f(x);return}n.uniqueOpen&&(s.value=s.value.filter(N=>x.startsWith(`${N}${oe}`))),b(x)}},B=(x,N)=>{n.disabled||(o("select",x,N),String(n.modelValue)!==String(x)&&o("update:modelValue",x))};return e.provide("xp-menu",{mode:n.mode,isVertical:r,collapse:n.collapse,uniqueOpen:n.uniqueOpen,activeIndex:c,menuRef:a,isSubMenuOpen:d,toggleSubMenu:_,openSubMenu:b,closeSubMenu:f,selectMenuItem:B}),(x,N)=>{const S=e.resolveComponent("XpSubMenu"),z=e.resolveComponent("XpMenuItem");return e.openBlock(),e.createElementBlock("ul",{class:e.normalizeClass(["xp-menu",[`xp-menu--${t.mode}`,{"xp-menu--collapse":r.value&&t.collapse}]]),role:"menubar",ref_key:"menuRef",ref:a},[v.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(v.value,$=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:$._idx},[h($)?(e.openBlock(),e.createBlock(S,{key:0,index:$._idx,label:$.label,icon:$.icon,items:$.children,disabled:$.disabled},{title:e.withCtx(()=>[$.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-menu__icon",innerHTML:$.icon},null,8,mn)):e.createCommentVNode("",!0),e.createElementVNode("span",fn,e.toDisplayString($.label),1)]),_:2},1032,["index","label","icon","items","disabled"])):(e.openBlock(),e.createBlock(z,{key:1,index:$._idx,item:$,disabled:$.disabled},{default:e.withCtx(()=>[$.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-menu__icon",innerHTML:$.icon},null,8,hn)):e.createCommentVNode("",!0),e.createElementVNode("span",gn,e.toDisplayString($.label),1)]),_:2},1032,["index","item","disabled"]))],64))),128)):e.renderSlot(x.$slots,"default",{key:1},void 0,!0)],2)}}},ke=C(vn,[["__scopeId","data-v-dc164e3e"]]),kn={class:"xp-menu-group"},xn={class:"xp-menu-group__title"},yn={class:"xp-menu-group__items"},_n={__name:"MenuGroup",props:{title:{type:String,default:""}},setup(t){return(l,n)=>(e.openBlock(),e.createElementBlock("li",kn,[e.createElementVNode("div",xn,e.toDisplayString(t.title),1),e.createElementVNode("ul",yn,[e.renderSlot(l.$slots,"default",{},void 0,!0)])]))}},xe=C(_n,[["__scopeId","data-v-3c5dace0"]]),bn=["tabindex"],ye={__name:"MenuItem",props:{index:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},item:{type:Object,default:null}},setup(t){const l=t,n=e.inject("xp-menu",null),o=e.computed(()=>!!n&&String(n.activeIndex.value)===String(l.index)),a=()=>{l.disabled||!n||n.selectMenuItem(String(l.index),l.item)};return(r,i)=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["xp-menu-item",{"xp-menu-item--active":o.value,"xp-menu-item--disabled":t.disabled}]),role:"menuitem",tabindex:t.disabled?-1:0,onClick:a},[e.renderSlot(r.$slots,"default")],10,bn))}},wn=["tabindex"],Bn=["innerHTML"],En={class:"xp-menu__label"},Cn={class:"xp-sub-menu__panel",role:"menu"},Vn=["innerHTML"],$n={class:"xp-menu__label"},Nn=".",_e={__name:"SubMenu",props:{index:{type:[String,Number],required:!0},label:{type:String,default:""},icon:{type:String,default:""},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},setup(t){const l=t,n=e.inject("xp-menu",null),o=f=>Array.isArray(f.children)&&f.children.length>0,a=e.computed(()=>String(l.index)),r=e.computed(()=>!!n&&(n.mode==="horizontal"||!!n.collapse)),i=e.ref(!1),v=e.computed(()=>!!n&&(n.activeIndex.value===a.value||n.activeIndex.value.startsWith(`${a.value}${Nn}`))),h=e.computed(()=>r.value?i.value:v.value||!!(n!=null&&n.isSubMenuOpen(a.value))),c=()=>{r.value&&!l.disabled&&(i.value=!0)},s=()=>{r.value&&(i.value=!1)},d=()=>{l.disabled||!n||(r.value?i.value=!i.value:n.toggleSubMenu(a.value))};return(f,b)=>{const _=e.resolveComponent("XpSubMenu"),B=e.resolveComponent("XpMenuItem");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["xp-sub-menu",{"is-opened":h.value,"is-active":v.value,"is-disabled":t.disabled,"is-popup-open":i.value}]),role:"menuitem",onMouseleave:s},[e.createElementVNode("div",{class:"xp-sub-menu__title",role:"menuitem",tabindex:t.disabled?-1:0,onClick:d,onMouseenter:c},[e.renderSlot(f.$slots,"title",{},()=>[t.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-menu__icon",innerHTML:t.icon},null,8,Bn)):e.createCommentVNode("",!0),e.createElementVNode("span",En,e.toDisplayString(t.label),1)]),b[0]||(b[0]=e.createElementVNode("span",{class:"xp-sub-menu__arrow","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none"},[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})])],-1))],40,wn),e.withDirectives(e.createElementVNode("ul",Cn,[t.items.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.items,x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x._idx},[o(x)?(e.openBlock(),e.createBlock(_,{key:0,index:x._idx,label:x.label,icon:x.icon,items:x.children,disabled:x.disabled},null,8,["index","label","icon","items","disabled"])):(e.openBlock(),e.createBlock(B,{key:1,index:x._idx,item:x,disabled:x.disabled},{default:e.withCtx(()=>[x.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-menu__icon",innerHTML:x.icon},null,8,Vn)):e.createCommentVNode("",!0),e.createElementVNode("span",$n,e.toDisplayString(x.label),1)]),_:2},1032,["index","item","disabled"]))],64))),128)):e.renderSlot(f.$slots,"default",{key:0})],512),[[e.vShow,h.value]])],34)}}},Sn=["aria-expanded","aria-disabled","tabindex"],Mn=["aria-selected","onClick","onMouseenter"],zn={class:"xp-select__option-label"},Tn={key:0,class:"xp-select__check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},In={key:0,class:"xp-select__empty"},Dn={__name:"Select",props:{modelValue:{type:[String,Number,Boolean],default:""},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"请选择"},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear","visible-change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(!1),r=e.ref(-1),i=e.ref({}),v=e.ref(null),h=e.ref(null),c=e.computed(()=>n.options.map(g=>g!==null&&typeof g=="object"?{label:String(g.label??g.value??""),value:g.value,disabled:!!g.disabled}:{label:String(g),value:g,disabled:!1})),s=e.computed(()=>n.modelValue!==""&&n.modelValue!==null&&n.modelValue!==void 0),d=e.computed(()=>c.value.find(g=>g.value===n.modelValue)),f=e.computed(()=>{var g;return((g=d.value)==null?void 0:g.label)??n.placeholder}),b=g=>g.value===n.modelValue,_=()=>{e.nextTick(()=>{if(!v.value||!h.value)return;const g=v.value.getBoundingClientRect(),k=h.value.getBoundingClientRect().height;let m=g.bottom+6;m+k>window.innerHeight-10&&(m=Math.max(10,g.top-k-6)),i.value={width:`${g.width}px`,top:`${m+window.scrollY}px`,left:`${g.left+window.scrollX}px`}})},B=()=>{if(n.disabled)return;a.value=!0;const g=c.value.findIndex(k=>b(k));r.value=g,_(),o("visible-change",!0)},x=()=>{a.value=!1,o("visible-change",!1)},N=()=>a.value?x():B(),S=g=>{g.disabled||(o("update:modelValue",g.value),o("change",g.value),x())},z=()=>{o("update:modelValue",""),o("change",""),o("clear")},$=g=>{if(n.disabled)return;const k=c.value.length-1;switch(g.key){case"Enter":case" ":g.preventDefault(),a.value?r.value>=0&&S(c.value[r.value]):B();break;case"ArrowDown":g.preventDefault(),a.value?k>=0&&(r.value=Math.min(r.value+1,k)):B();break;case"ArrowUp":g.preventDefault(),a.value&&k>=0&&(r.value=Math.max(r.value-1,0));break;case"Escape":a.value&&(g.preventDefault(),x());break}},T=g=>{var k,m;a.value&&((k=v.value)!=null&&k.contains(g.target)||(m=h.value)!=null&&m.contains(g.target)||x())};return e.watch(()=>n.disabled,g=>{g&&a.value&&x()}),e.onMounted(()=>{document.addEventListener("click",T)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",T)}),(g,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-select",[`xp-select--${t.size}`,{"xp-select--disabled":t.disabled}]]),ref_key:"selectRef",ref:v},[e.createElementVNode("div",{class:e.normalizeClass(["xp-select__trigger",{"is-open":a.value}]),role:"combobox","aria-expanded":a.value,"aria-disabled":t.disabled,tabindex:t.disabled?-1:0,onClick:N,onKeydown:$},[e.createElementVNode("span",{class:e.normalizeClass(["xp-select__value",{"is-placeholder":!s.value}])},e.toDisplayString(f.value),3),t.clearable&&s.value&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-select__clear","aria-label":"清空",onClick:e.withModifiers(z,["stop"])},[...k[0]||(k[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"})],-1)])])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["xp-select__arrow",{"is-open":a.value}]),"aria-hidden":"true"},[...k[1]||(k[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},[e.createElementVNode("path",{d:"M6 9l6 6 6-6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2))],42,Sn),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-select-fade"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-select__panel",style:e.normalizeStyle(i.value),ref_key:"panelRef",ref:h,role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(m,w)=>(e.openBlock(),e.createElementBlock("div",{key:m.value,class:e.normalizeClass(["xp-select__option",{"is-selected":b(m),"is-disabled":m.disabled,"is-active":w===r.value}]),role:"option","aria-selected":b(m),onClick:X=>S(m),onMouseenter:X=>r.value=w},[e.createElementVNode("span",zn,e.toDisplayString(m.label),1),b(m)?(e.openBlock(),e.createElementBlock("svg",Tn,[...k[2]||(k[2]=[e.createElementVNode("path",{d:"M5 12.5l4.5 4.5L19 7",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],42,Mn))),128)),c.value.length===0?(e.openBlock(),e.createElementBlock("div",In,"暂无选项")):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)]),_:1})]))],2))}},Q=C(Dn,[["__scopeId","data-v-e7f9bc35"]]),Fn={key:0,class:"xp-pagination"},Xn={class:"xp-pagination__total"},jn={class:"xp-pagination__right"},An={class:"xp-pagination__btns"},Ln=["disabled"],Rn=["disabled","onClick"],On=["disabled"],Pn={__name:"Pagination",props:{total:{type:Number,default:0},page:{type:Number,default:1},pageSize:{type:Number,default:10},pageSizes:{type:Array,default:()=>[]}},emits:["update:page","update:pageSize","change","size-change"],setup(t,{emit:l}){const n=t,o=l,a=e.computed(()=>Math.max(1,Math.ceil(n.total/n.pageSize))),r=e.computed(()=>n.pageSizes.map(c=>({label:`${c} 条/页`,value:c}))),i=e.computed(()=>{const c=a.value,s=n.page,d=[];for(let _=1;_<=c;_++)(_===1||_===c||Math.abs(_-s)<=2)&&d.push(_);const f=[];let b=0;for(const _ of d)_-b>1&&f.push("..."),f.push(_),b=_;return f});function v(c){typeof c!="number"||c<1||c>a.value||c===n.page||(o("update:page",c),o("change",c))}function h(c){o("update:pageSize",c),o("size-change",c)}return(c,s)=>t.total>0?(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("span",Xn,"共 "+e.toDisplayString(t.total)+" 条",1),e.createElementVNode("div",jn,[t.pageSizes.length>0?(e.openBlock(),e.createBlock(Q,{key:0,class:"xp-pagination__sizes","model-value":t.pageSize,options:r.value,size:"small",onChange:h},null,8,["model-value","options"])):e.createCommentVNode("",!0),e.createElementVNode("div",An,[e.createElementVNode("button",{type:"button",class:"xp-pagination__btn xp-pagination__btn--nav",disabled:t.page<=1,"aria-label":"上一页",onClick:s[0]||(s[0]=d=>v(t.page-1))}," 上一页 ",8,Ln),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(d,f)=>(e.openBlock(),e.createElementBlock("button",{key:`${d}-${f}`,type:"button",class:e.normalizeClass(["xp-pagination__btn",{"is-active":d===t.page}]),disabled:d==="...",onClick:b=>v(d)},e.toDisplayString(d),11,Rn))),128)),e.createElementVNode("button",{type:"button",class:"xp-pagination__btn xp-pagination__btn--nav",disabled:t.page>=a.value,"aria-label":"下一页",onClick:s[1]||(s[1]=d=>v(t.page+1))}," 下一页 ",8,On)])])])):e.createCommentVNode("",!0)}},be=C(Pn,[["__scopeId","data-v-401d0dbd"]]),Hn={key:0,class:"xp-progress__text"},Wn={__name:"Progress",props:{percentage:{type:Number,default:0,validator:t=>t>=0&&t<=100},color:{type:String,default:""},showText:{type:Boolean,default:!0},type:{type:String,default:"line",validator:t=>["line","circle"].includes(t)},status:{type:String,default:"",validator:t=>["","success","warning","exception"].includes(t)},strokeWidth:{type:Number,default:8}},setup(t){const l=t,n=e.computed(()=>l.type==="line"?{height:`${l.strokeWidth}px`}:{}),o=e.computed(()=>l.color?l.color:l.status==="success"?"var(--xp-color-success)":l.status==="warning"?"var(--xp-color-warning)":l.status==="exception"?"var(--xp-color-danger)":"var(--xp-color-primary)");return(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-progress",[`xp-progress--${t.type}`]])},[e.createElementVNode("div",{class:"xp-progress__bar",style:e.normalizeStyle(n.value)},[e.createElementVNode("div",{class:"xp-progress__inner",style:e.normalizeStyle({width:`${t.percentage}%`,backgroundColor:o.value})},null,4)],4),t.showText?(e.openBlock(),e.createElementBlock("span",Hn,[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)],!0)])):e.createCommentVNode("",!0)],2))}},we=C(Wn,[["__scopeId","data-v-244dca2c"]]),Un={class:"xp-radio__input"},qn=["checked","disabled"],Jn={class:"xp-radio__label"},Kn={__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:""},value:{type:[String,Number,Boolean],default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=()=>{n.disabled||(o("update:modelValue",n.value),o("change",n.value))};return(r,i)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["xp-radio",[{"xp-radio--checked":t.modelValue===t.value,"xp-radio--disabled":t.disabled}]])},[e.createElementVNode("span",Un,[i[0]||(i[0]=e.createElementVNode("span",{class:"xp-radio__inner"},null,-1)),e.createElementVNode("input",{type:"radio",class:"xp-radio__original",checked:t.modelValue===t.value,disabled:t.disabled,onChange:a},null,40,qn)]),e.createElementVNode("span",Jn,[e.renderSlot(r.$slots,"default",{},void 0,!0)])],2))}},Be=C(Kn,[["__scopeId","data-v-02a0d80d"]]),Gn={class:"xp-rate"},Yn=["onClick","onMouseenter"],Zn={class:"xp-rate__star"},Qn={key:0,class:"xp-rate__text"},el={__name:"Rate",props:{modelValue:{type:Number,default:0},max:{type:Number,default:5},color:{type:String,default:"#f7ba2a"},disabled:{type:Boolean,default:!1},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref(0),r=e.computed(()=>a.value||n.modelValue),i=h=>{const c=r.value-h+1;return c>=1?100:c>0?c*100:0},v=h=>{n.disabled||(o("update:modelValue",h),o("change",h))};return(h,c)=>(e.openBlock(),e.createElementBlock("div",Gn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max,s=>(e.openBlock(),e.createElementBlock("span",{key:s,class:e.normalizeClass(["xp-rate__item",{"xp-rate__item--disabled":t.disabled}]),style:e.normalizeStyle({cursor:t.disabled?"default":"pointer"}),onClick:d=>v(s),onMouseenter:d=>a.value=s,onMouseleave:c[0]||(c[0]=d=>a.value=0)},[e.createElementVNode("span",Zn,[c[1]||(c[1]=e.createElementVNode("span",{class:"xp-rate__star-outer"},"★",-1)),e.createElementVNode("span",{class:"xp-rate__star-inner",style:e.normalizeStyle({width:i(s)+"%",color:t.color})}," ★ ",4)])],46,Yn))),128)),t.showText&&!t.disabled?(e.openBlock(),e.createElementBlock("span",Qn,e.toDisplayString(t.modelValue)+" / "+e.toDisplayString(t.max),1)):e.createCommentVNode("",!0)]))}},Ee=C(el,[["__scopeId","data-v-214323a3"]]),tl=["aria-checked","tabindex"],nl={key:0,class:"xp-switch__label"},ll={__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=()=>{if(n.disabled)return;const i=!n.modelValue;o("update:modelValue",i),o("change",i)},r=i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),a())};return(i,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-switch",[`xp-switch--${t.size}`,{"xp-switch--checked":t.modelValue,"xp-switch--disabled":t.disabled}]]),role:"switch","aria-checked":t.modelValue,tabindex:t.disabled?-1:0,onClick:a,onKeydown:r},[v[0]||(v[0]=e.createElementVNode("span",{class:"xp-switch__core"},[e.createElementVNode("span",{class:"xp-switch__action"})],-1)),i.$slots.default?(e.openBlock(),e.createElementBlock("span",nl,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],42,tl))}},Ce=C(ll,[["__scopeId","data-v-936844f2"]]),ol={class:"xp-table__wrap"},al={class:"xp-table__columns"},rl={class:"xp-table__inner"},sl={key:0},il=["onClick"],cl={key:2,class:"xp-table__cell-inner"},dl={class:"xp-table__label"},ul={key:1},pl=["onClick"],ml={key:0,class:"xp-table__empty"},fl={key:0,class:"xp-table__loading"},hl={__name:"Table",props:{data:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},emptyTitle:{type:String,default:"暂无数据"},emptyHint:{type:String,default:""},rowKey:{type:String,default:"id"},stripe:{type:Boolean,default:!1},border:{type:Boolean,default:!1}},emits:["sort-change","selection-change","select","row-click"],setup(t,{expose:l,emit:n}){const o=t,a=n,r=e.ref([]),i=u=>{r.value.push(u)},v=u=>{const p=r.value.findIndex(y=>y.id===u);p>=0&&r.value.splice(p,1)};e.provide("xpTable",{addColumn:i,removeColumn:v});function h(u,p,y){if(u.formatter)return String(u.formatter(p,u,p[u.prop],y));const V=p&&p[u.prop];return V==null?"":String(V)}function c(u,p){return(u&&u[o.rowKey])??p}const s={name:"XpRenderCell",props:{slotFn:{type:Function,default:null},ctx:{type:Object,default:()=>({})},fallback:{type:[String,Number],default:""}},render(){return this.slotFn?this.slotFn(this.ctx):this.fallback}},d=e.ref({prop:"",order:null}),f=e.computed(()=>{const{prop:u,order:p}=d.value;if(!u||!p)return o.data;const y=r.value.find(M=>M.prop===u);if(!y||y.sortable!==!0)return o.data;const V=p==="ascending"?1:-1,E=o.data.map((M,j)=>({row:M,i:j}));return E.sort((M,j)=>{const K=M.row[u],G=j.row[u];return K===G?M.i-j.i:K==null?-V:G==null?V:(K>G?1:-1)*V}),E.map(M=>M.row)});function b(u){if(!u.sortable)return;let p;d.value.prop!==u.prop?p="ascending":p={null:"ascending",ascending:"descending",descending:null}[d.value.order],d.value={prop:u.prop,order:p},a("sort-change",{column:u,prop:u.prop,order:p})}function _(u){const p=d.value.prop===u.prop;return{"is-ascending":p&&d.value.order==="ascending","is-descending":p&&d.value.order==="descending"}}const B=e.ref(new Set),x=(u,p)=>B.value.has(c(u,p)),N=e.computed(()=>o.data.length>0&&o.data.every((u,p)=>x(u,p))),S=e.computed(()=>o.data.some((u,p)=>x(u,p))&&!N.value);function z(){const u=B.value;return o.data.filter((p,y)=>u.has(c(p,y)))}function $(u){const p=new Set(B.value);for(const[y,V]of o.data.entries()){const E=c(V,y);u?p.add(E):p.delete(E)}B.value=p,a("selection-change",z())}function T(u,p,y){const V=c(u,y),E=new Set(B.value);p?E.add(V):E.delete(V),B.value=E,a("select",u,p),a("selection-change",z())}l({clearSelection(){B.value=new Set,a("selection-change",z())},toggleRowSelection(u,p){const y=o.data.findIndex(V=>V===u);y!==-1&&T(u,p??!x(u,y),y)}});function g(u){const p=u.width;if(p==null||p==="")return 0;const y=typeof p=="number"?p:parseFloat(p);return Number.isFinite(y)?y:0}function k(u){return typeof u=="number"||/^\d+$/.test(String(u))?`${u}px`:u}const m=e.computed(()=>{const u={},p={};let y=0;for(const E of r.value)E.fixed==="left"&&(u[E.id]=y,y+=g(E));let V=0;for(let E=r.value.length-1;E>=0;E--){const M=r.value[E];M.fixed==="right"&&(p[M.id]=V,V+=g(M))}return{left:u,right:p}});function w(u){const p={};return u.width!==""&&(p.width=k(u.width)),u.minWidth!==""&&(p.minWidth=k(u.minWidth)),u.fixed==="left"&&(p.left=`${m.value.left[u.id]||0}px`),u.fixed==="right"&&(p.right=`${m.value.right[u.id]||0}px`),p}function X(u,p){if(u.fixed!=="left")return!1;const y=r.value[p+1];return!y||y.fixed!=="left"}function I(u,p){if(u.fixed!=="right")return!1;const y=r.value[p-1];return!y||y.fixed!=="right"}function le(u,p,{header:y}){return{"xp-table__cell":!0,"xp-table__cell--selection":u.type==="selection","is-center":u.align==="center","is-right":u.align==="right","xp-table__cell--fixed-left":u.fixed==="left","xp-table__cell--fixed-right":u.fixed==="right","is-last-fixed-left":y?X(u,p):!1,"is-first-fixed-right":y?I(u,p):!1,[u.className]:!!u.className}}function We(u,p){return{...le(u,p,{header:!0}),"xp-table__cell--sortable":!!u.sortable}}function Ue(u,p){return le(u,p,{header:!1})}function qe(u,p){a("row-click",u,p)}return(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-table",{"xp-table--stripe":t.stripe,"xp-table--border":t.border}])},[e.createElementVNode("div",ol,[e.createElementVNode("div",al,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),e.createElementVNode("table",rl,[r.value.length>0?(e.openBlock(),e.createElementBlock("thead",sl,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(y,V)=>(e.openBlock(),e.createElementBlock("th",{key:y.id,class:e.normalizeClass(We(y,V)),style:e.normalizeStyle(w(y)),onClick:E=>b(y)},[y.type==="selection"?(e.openBlock(),e.createBlock(J,{key:0,class:"xp-table__checkbox","model-value":N.value,indeterminate:S.value,onClick:p[0]||(p[0]=e.withModifiers(()=>{},["stop"])),onChange:$},null,8,["model-value","indeterminate"])):y.slots.header?(e.openBlock(),e.createBlock(s,{key:1,"slot-fn":y.slots.header,ctx:{column:y}},null,8,["slot-fn","ctx"])):(e.openBlock(),e.createElementBlock("span",cl,[e.createElementVNode("span",dl,e.toDisplayString(y.label),1),y.sortable?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["xp-table__sort",_(y)]),"aria-hidden":"true"},[...p[2]||(p[2]=[e.createElementVNode("span",{class:"xp-table__sort-asc"},null,-1),e.createElementVNode("span",{class:"xp-table__sort-desc"},null,-1)])],2)):e.createCommentVNode("",!0)]))],14,il))),128))])])):e.createCommentVNode("",!0),f.value.length>0?(e.openBlock(),e.createElementBlock("tbody",ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(y,V)=>(e.openBlock(),e.createElementBlock("tr",{key:c(y,V),onClick:E=>qe(y,V)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(E,M)=>(e.openBlock(),e.createElementBlock("td",{key:E.id,class:e.normalizeClass(Ue(E,M)),style:e.normalizeStyle(w(E))},[E.type==="selection"?(e.openBlock(),e.createBlock(J,{key:0,class:"xp-table__checkbox","model-value":x(y,V),onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"])),onChange:j=>T(y,j,V)},null,8,["model-value","onChange"])):E.slots.default?(e.openBlock(),e.createBlock(s,{key:1,"slot-fn":E.slots.default,ctx:{row:y,index:V},fallback:h(E,y,V)},null,8,["slot-fn","ctx","fallback"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(h(E,y,V)),1)],64))],6))),128))],8,pl))),128))])):e.createCommentVNode("",!0)]),!t.loading&&(r.value.length===0||t.data.length===0)?(e.openBlock(),e.createElementBlock("div",ml,[e.renderSlot(u.$slots,"empty",{},()=>[e.createVNode(Z,{title:t.emptyTitle,hint:t.emptyHint},null,8,["title","hint"])],!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"xp-fade"},{default:e.withCtx(()=>[t.loading?(e.openBlock(),e.createElementBlock("div",fl,[...p[3]||(p[3]=[e.createElementVNode("span",{class:"xp-table__spinner"},null,-1),e.createElementVNode("span",null,"加载中…",-1)])])):e.createCommentVNode("",!0)]),_:1})])],2))}},Ve=C(hl,[["__scopeId","data-v-589f6c9c"]]),$e={__name:"TableColumn",props:{prop:{type:String,default:""},label:{type:String,default:""},type:{type:String,default:"default",validator:t=>["default","selection"].includes(t)},width:{type:[Number,String],default:""},minWidth:{type:[Number,String],default:""},align:{type:String,default:"left",validator:t=>["left","center","right"].includes(t)},sortable:{type:[Boolean,String],default:!1,validator:t=>t===!0||t==="custom"||t===!1},fixed:{type:String,default:"",validator:t=>["","left","right"].includes(t)},formatter:{type:Function,default:null},className:{type:String,default:""}},setup(t){const l=t,n=e.inject("xpTable",null),o=e.useSlots(),a=e.getCurrentInstance();return e.onMounted(()=>{!n||typeof n.addColumn!="function"||n.addColumn({id:a.uid,...l,slots:{default:o.default?r=>o.default(r):null,header:o.header?r=>o.header(r):null}})}),e.onBeforeUnmount(()=>{!n||typeof n.removeColumn!="function"||n.removeColumn(a.uid)}),(r,i)=>null}},gl={key:0,class:"xp-tab-pane"},vl={__name:"TabPane",props:{name:{type:[String,Number],required:!0},title:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(t){const l=t,n=e.inject("xpTabs",null),o=e.computed(()=>n?n.currentValue.value===l.name:!0);return e.onMounted(()=>{n&&n.addTab&&n.addTab({name:l.name,title:l.title,disabled:l.disabled})}),e.onBeforeUnmount(()=>{n&&n.removeTab&&n.removeTab(l.name)}),(a,r)=>o.value?(e.openBlock(),e.createElementBlock("div",gl,[e.renderSlot(a.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)}},Ne=C(vl,[["__scopeId","data-v-6fe7943a"]]),kl={class:"xp-tabs"},xl={class:"xp-tabs__nav",role:"tablist"},yl=["onClick"],_l={class:"xp-tabs__content"},bl={__name:"Tabs",props:{modelValue:{type:[String,Number],default:null}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,a=e.ref([]),r=e.computed(()=>{var s;return n.modelValue!==null&&n.modelValue!==void 0&&n.modelValue!==""?n.modelValue:((s=a.value[0])==null?void 0:s.name)??null}),i=e.computed(()=>{const s=a.value.findIndex(f=>f.name===r.value);return{transform:`translateX(${(s>=0?s:0)*100}%)`,width:`${a.value.length?100/a.value.length:0}%`}}),v=s=>{s.disabled||(o("update:modelValue",s.name),o("change",s.name))},h=s=>{a.value.find(d=>d.name===s.name)||a.value.push(s)},c=s=>{const d=a.value.findIndex(f=>f.name===s);d>=0&&a.value.splice(d,1)};return e.provide("xpTabs",{addTab:h,removeTab:c,currentValue:r}),(s,d)=>(e.openBlock(),e.createElementBlock("div",kl,[e.createElementVNode("div",xl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:f.name||b,class:e.normalizeClass(["xp-tabs__item",[{"xp-tabs__item--active":r.value===f.name,"xp-tabs__item--disabled":f.disabled}]]),role:"tab",onClick:_=>v(f)},e.toDisplayString(f.title),11,yl))),128)),e.createElementVNode("div",{class:"xp-tabs__active-bar",style:e.normalizeStyle(i.value)},null,4)]),e.createElementVNode("div",_l,[e.renderSlot(s.$slots,"default",{},void 0,!0)])]))}},Se=C(bl,[["__scopeId","data-v-3e658dba"]]),wl={__name:"Tag",props:{type:{type:String,default:"default",validator:t=>["primary","default","success","warning","danger","info"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},color:{type:String,default:""},plain:{type:Boolean,default:!1},round:{type:Boolean,default:!1},closable:{type:Boolean,default:!1}},emits:["click","close"],setup(t,{emit:l}){const n=t,o=l,a=e.computed(()=>n.color?n.color.startsWith("#")||n.color.startsWith("rgb")?{backgroundColor:n.color,borderColor:n.color,color:"#fff"}:{}:{}),r=v=>{o("click",v)},i=v=>{o("close",v)};return(v,h)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["xp-tag",[`xp-tag--${t.type}`,`xp-tag--${t.size}`,{"xp-tag--plain":t.plain,"xp-tag--round":t.round,"xp-tag--closable":t.closable}]]),style:e.normalizeStyle(a.value),onClick:r},[e.renderSlot(v.$slots,"default",{},void 0,!0),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"xp-tag__close",onClick:e.withModifiers(i,["stop"])},"×")):e.createCommentVNode("",!0)],6))}},Me=C(wl,[["__scopeId","data-v-855e2fd7"]]),Bl=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,El=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*([\d.]+))?\s*\)$/;function W(t){if(typeof t!="string")return null;const l=t.trim(),n=l.match(Bl);if(n){let a=n[1];a.length===3&&(a=a.split("").map(h=>h+h).join(""));const r=parseInt(a.slice(0,2),16),i=parseInt(a.slice(2,4),16),v=parseInt(a.slice(4,6),16);return{r,g:i,b:v,a:1}}const o=l.match(El);return o?{r:parseInt(o[1],10),g:parseInt(o[2],10),b:parseInt(o[3],10),a:o[4]?parseFloat(o[4]):1}:null}function Cl(t){return Math.max(0,Math.min(255,Math.round(t)))}function ze(t,l,n){const o=a=>Cl(a).toString(16).padStart(2,"0");return"#"+o(t)+o(l)+o(n)}function ee(t,l,n=.5){const o=W(t),a=W(l);if(!o||!a)return"#000000";const r=Math.max(0,Math.min(1,n)),i=o.r*(1-r)+a.r*r,v=o.g*(1-r)+a.g*r,h=o.b*(1-r)+a.b*r;return ze(i,v,h)}function P(t,l){return ee(t,"#ffffff",l)}function H(t,l){return ee(t,"#000000",l)}function Vl(t){return P(t,.3)}function $l(t){return H(t,.2)}function Nl(t,l){const n=W(t);if(!n)return t;const o=Math.max(0,Math.min(1,l));return`rgba(${n.r}, ${n.g}, ${n.b}, ${o})`}function Sl(t){const l=W(t);return l?(l.r*299+l.g*587+l.b*114)/1e3<128:!1}function Te(t,l){const n=P(t,.3),o=H(t,.2),a=l==="dark"?H(t,.85):P(t,.9),r=l==="dark"?H(t,.7):P(t,.7);return{base:t,light:n,dark:o,bg:a,border:r}}const D={primary:"#409eff",success:"#67c23a",warning:"#e6a23c",danger:"#f56c6c",info:"#909399"},O={light:{text:{primary:"#303133",regular:"#606266",secondary:"#909399",placeholder:"#c0c4cc"},border:{base:"#dcdfe6",light:"#ebeef5",lighter:"#f2f6fc"},bg:{base:"#ffffff",page:"#f2f3f5",soft:"#f5f7fa",overlay:"rgba(0, 0, 0, 0.5)"},fill:{base:"#f0f2f5",light:"#f5f7fa",lighter:"#fafafa"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.1)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.15)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.2)"}},dark:{text:{primary:"#e5eaf3",regular:"#cfd3dc",secondary:"#a3a6ad",placeholder:"#8d9095"},border:{base:"#4c4d4f",light:"#414243",lighter:"#363637"},bg:{base:"#1d1e1f",page:"#141414",soft:"#2a2b2c",overlay:"rgba(0, 0, 0, 0.7)"},fill:{base:"#303030",light:"#262727",lighter:"#1d1d1d"},shadow:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.4)",md:"0 2px 12px 0 rgba(0, 0, 0, 0.45)",lg:"0 4px 20px 0 rgba(0, 0, 0, 0.5)",overlay:"0 8px 24px 0 rgba(0, 0, 0, 0.6)"}}};function F(){return{primary:{...D},light:ae(O.light),dark:ae(O.dark)}}function ae(t){return JSON.parse(JSON.stringify(t))}function re(t,l){const n=["primary","success","warning","danger","info"],o=[];for(const a of n){const r=t[a]||D[a],i=Te(r,l);o.push(` --xp-color-${a}: ${r};`),o.push(` --xp-color-${a}-light: ${i.light};`),o.push(` --xp-color-${a}-dark: ${i.dark};`),o.push(` --xp-color-${a}-bg: ${i.bg};`),o.push(` --xp-color-${a}-border: ${i.border};`)}return o.join(`
|
|
5
|
+
`)}function se(t){const l=[];for(const n of Object.keys(t.text))l.push(` --xp-text-color-${n}: ${t.text[n]};`);l.push(` --xp-border-color: ${t.border.base};`),l.push(` --xp-border-color-light: ${t.border.light};`),l.push(` --xp-border-color-lighter: ${t.border.lighter};`);for(const n of Object.keys(t.bg)){const o=n==="base"?"":`-${n}`;l.push(` --xp-bg-color${o}: ${t.bg[n]};`)}for(const n of Object.keys(t.fill)){const o=n==="base"?"":`-${n}`;l.push(` --xp-fill-color${o}: ${t.fill[n]};`)}for(const n of Object.keys(t.shadow))l.push(` --xp-shadow-${n}: ${t.shadow[n]};`);return l.join(`
|
|
6
|
+
`)}function Ie(t,l){const n={},o=t.primary||D,a=["primary","success","warning","danger","info"];for(const i of a){const v=o[i]||D[i],h=Te(v,l);n[`--xp-color-${i}`]=v,n[`--xp-color-${i}-light`]=h.light,n[`--xp-color-${i}-dark`]=h.dark,n[`--xp-color-${i}-bg`]=h.bg,n[`--xp-color-${i}-border`]=h.border}const r=t[l]||O[l];for(const i of Object.keys(r.text))n[`--xp-text-color-${i}`]=r.text[i];n["--xp-border-color"]=r.border.base,n["--xp-border-color-light"]=r.border.light,n["--xp-border-color-lighter"]=r.border.lighter;for(const i of Object.keys(r.bg))n[`--xp-bg-color${i==="base"?"":"-"+i}`]=r.bg[i];for(const i of Object.keys(r.fill))n[`--xp-fill-color${i==="base"?"":"-"+i}`]=r.fill[i];for(const i of Object.keys(r.shadow))n[`--xp-shadow-${i}`]=r.shadow[i];return n}function te(t){return[':root, [data-theme="light"] {',re(t.primary||D,"light"),se(t.light||O.light),"}","",'[data-theme="dark"] {',re(t.primary||D,"dark"),se(t.dark||O.dark),"}"].join(`
|
|
7
|
+
`)}let U=null;function Ml(){if(typeof document>"u")return null;if(U&&document.contains(U))return U;let t=document.querySelector("style[data-xp-ui-theme]");return t||(t=document.createElement("style"),t.setAttribute("data-xp-ui-theme","true"),document.head.appendChild(t)),U=t,t}function zl(t){const l=Ml();l&&(l.textContent=te(t))}const ne=e.ref("light"),De=e.ref(F());function L(t){if(["light","dark"].includes(t)&&(ne.value=t,typeof document<"u")){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("xp-ui-theme",t)}catch{}}}function Fe(){L(ne.value==="light"?"dark":"light")}function R(t){if(!t)return;const l=F();t.primary&&(l.primary={...l.primary,...t.primary}),t.light&&(l.light=Y(l.light,t.light)),t.dark&&(l.dark=Y(l.dark,t.dark)),De.value=l,zl(l);try{localStorage.setItem("xp-ui-theme-config",JSON.stringify(l))}catch{}}function Xe(){R(F())}function je(){if(typeof document>"u")return;let t=null;try{t=localStorage.getItem("xp-ui-theme")}catch{}t==="light"||t==="dark"?L(t):typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light");let l=null;try{l=localStorage.getItem("xp-ui-theme-config")}catch{}if(l)try{R(JSON.parse(l))}catch{R(F())}else R(F())}function Y(t,l){if(!l||typeof l!="object")return t;const n=Array.isArray(t)?[...t]:{...t};for(const o of Object.keys(l))l[o]&&typeof l[o]=="object"&&!Array.isArray(l[o])?n[o]=Y(t[o]||{},l[o]):n[o]=l[o];return n}function Ae(){return{theme:ne,themeConfig:De,setTheme:L,toggleTheme:Fe,initTheme:je,applyThemeConfig:R,resetThemeConfig:Xe,getDefaultThemeConfig:F,buildCssString:te,buildCssVars:Ie}}const Tl=["data-theme"],Il={class:"xp-theme-customizer__header"},Dl={class:"xp-theme-customizer__body"},Fl={class:"xp-theme-customizer__section"},Xl={class:"xp-theme-customizer__modes"},jl=["onClick"],Al={class:"xp-theme-customizer__section"},Ll={class:"xp-theme-customizer__grid"},Rl={class:"xp-theme-customizer__label"},Ol={class:"xp-theme-customizer__input"},Pl=["value","onInput"],Hl=["value","onChange"],Wl={class:"xp-theme-customizer__section"},Ul={class:"xp-theme-customizer__grid"},ql={class:"xp-theme-customizer__label"},Jl={class:"xp-theme-customizer__input"},Kl=["value","onInput"],Gl=["value","onChange"],Yl={class:"xp-theme-customizer__section"},Zl={class:"xp-theme-customizer__grid"},Ql={class:"xp-theme-customizer__label"},eo={class:"xp-theme-customizer__input"},to=["value","onInput"],no=["value","onChange"],lo={class:"xp-theme-customizer__section"},oo={class:"xp-theme-customizer__grid"},ao={class:"xp-theme-customizer__label"},ro={class:"xp-theme-customizer__input"},so=["value","onInput"],io=["value","onChange"],co={class:"xp-theme-customizer__label"},uo={class:"xp-theme-customizer__input"},po=["value","onInput"],mo=["value","onChange"],Le={__name:"ThemeCustomizer",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:l}){const{theme:n,applyThemeConfig:o,resetThemeConfig:a,getDefaultThemeConfig:r,buildCssString:i,themeConfig:v}=Ae(),h={primary:"主色",success:"成功",warning:"警告",danger:"危险",info:"信息",regular:"常规",secondary:"次要",placeholder:"占位",base:"基础",page:"页面",soft:"柔和",light:"亮",lighter:"更亮"},c=e.ref("light"),s=e.ref(null),d=e.reactive(f(v.value));e.watch(v,g=>Object.assign(d,f(g)),{deep:!0});function f(g){return JSON.parse(JSON.stringify(g))}function b(g){if(!g)return"#ffffff";if(/^#([0-9a-f]{6})$/i.test(g))return g.toLowerCase();const k=g.match(/rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})/);return k?"#"+[k[1],k[2],k[3]].map(m=>Number(m).toString(16).padStart(2,"0")).join(""):"#ffffff"}function _(g,k){d.primary[g]=k,o(d)}function B(g,k,m){d[c.value][g][k]=m,o(d)}function x(){a()}function N(){T("xp-ui-theme.json",JSON.stringify(d,null,2),"application/json")}function S(){T("xp-ui-theme.css",i(d),"text/css")}function z(){s.value&&s.value.click()}function $(g){const k=g.target.files&&g.target.files[0];if(!k)return;const m=new FileReader;m.onload=()=>{try{const w=JSON.parse(m.result);o(w)}catch(w){alert(`主题配置解析失败:
|
|
8
|
+
`+w.message)}finally{g.target.value=""}},m.readAsText(k)}function T(g,k,m){const w=new Blob([k],{type:m+";charset=utf-8"}),X=URL.createObjectURL(w),I=document.createElement("a");I.href=X,I.download=g,document.body.appendChild(I),I.click(),I.remove(),setTimeout(()=>URL.revokeObjectURL(X),0)}return(g,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.Transition,{name:"xp-fade"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:"xp-theme-customizer-backdrop",onClick:k[0]||(k[0]=e.withModifiers(m=>g.$emit("update:modelValue",!1),["self"]))})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"xp-slide"},{default:e.withCtx(()=>[t.modelValue?(e.openBlock(),e.createElementBlock("aside",{key:0,class:"xp-theme-customizer","data-theme":e.unref(n)},[e.createElementVNode("header",Il,[k[2]||(k[2]=e.createElementVNode("div",{class:"xp-theme-customizer__title"},"🎨 主题定制",-1)),e.createElementVNode("button",{class:"xp-theme-customizer__close",onClick:k[1]||(k[1]=m=>g.$emit("update:modelValue",!1)),"aria-label":"关闭"},"✕")]),e.createElementVNode("div",Dl,[e.createElementVNode("section",Fl,[k[3]||(k[3]=e.createElementVNode("p",{class:"xp-theme-customizer__desc"}," 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ",-1)),e.createElementVNode("div",Xl,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["light","dark"],m=>e.createElementVNode("button",{key:m,class:e.normalizeClass(["xp-theme-customizer__mode-btn",{"is-active":c.value===m}]),onClick:w=>c.value=m},e.toDisplayString(m==="light"?"浅色":"暗黑"),11,jl)),64))])]),e.createElementVNode("section",Al,[k[4]||(k[4]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"主色",-1)),e.createElementVNode("div",Ll,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","success","warning","danger","info"],m=>e.createElementVNode("div",{key:m,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Rl,e.toDisplayString(h[m]),1),e.createElementVNode("div",Ol,[e.createElementVNode("input",{type:"color",value:d.primary[m],onInput:w=>_(m,w.target.value)},null,40,Pl),e.createElementVNode("input",{type:"text",value:d.primary[m],onChange:w=>_(m,w.target.value)},null,40,Hl)])])),64))])]),e.createElementVNode("section",Wl,[k[5]||(k[5]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"文本",-1)),e.createElementVNode("div",Ul,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["primary","regular","secondary","placeholder"],m=>e.createElementVNode("div",{key:"t-"+m,class:"xp-theme-customizer__item"},[e.createElementVNode("div",ql,e.toDisplayString(h[m]),1),e.createElementVNode("div",Jl,[e.createElementVNode("input",{type:"color",value:b(d[c.value].text[m]),onInput:w=>B("text",m,w.target.value)},null,40,Kl),e.createElementVNode("input",{type:"text",value:d[c.value].text[m],onChange:w=>B("text",m,w.target.value)},null,40,Gl)])])),64))])]),e.createElementVNode("section",Yl,[k[6]||(k[6]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"背景",-1)),e.createElementVNode("div",Zl,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","page","soft"],m=>e.createElementVNode("div",{key:"bg-"+m,class:"xp-theme-customizer__item"},[e.createElementVNode("div",Ql,e.toDisplayString(h[m]),1),e.createElementVNode("div",eo,[e.createElementVNode("input",{type:"color",value:b(d[c.value].bg[m]),onInput:w=>B("bg",m,w.target.value)},null,40,to),e.createElementVNode("input",{type:"text",value:d[c.value].bg[m],onChange:w=>B("bg",m,w.target.value)},null,40,no)])])),64))])]),e.createElementVNode("section",lo,[k[7]||(k[7]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"边框 / 填充",-1)),e.createElementVNode("div",oo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],m=>e.createElementVNode("div",{key:"bd-"+m,class:"xp-theme-customizer__item"},[e.createElementVNode("div",ao,"边框 - "+e.toDisplayString(h[m]),1),e.createElementVNode("div",ro,[e.createElementVNode("input",{type:"color",value:b(d[c.value].border[m]),onInput:w=>B("border",m,w.target.value)},null,40,so),e.createElementVNode("input",{type:"text",value:d[c.value].border[m],onChange:w=>B("border",m,w.target.value)},null,40,io)])])),64)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["base","light","lighter"],m=>e.createElementVNode("div",{key:"fl-"+m,class:"xp-theme-customizer__item"},[e.createElementVNode("div",co,"填充 - "+e.toDisplayString(h[m]),1),e.createElementVNode("div",uo,[e.createElementVNode("input",{type:"color",value:b(d[c.value].fill[m]),onInput:w=>B("fill",m,w.target.value)},null,40,po),e.createElementVNode("input",{type:"text",value:d[c.value].fill[m],onChange:w=>B("fill",m,w.target.value)},null,40,mo)])])),64))])]),k[8]||(k[8]=e.createElementVNode("section",{class:"xp-theme-customizer__section"},[e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"实时预览"),e.createElementVNode("div",{class:"xp-theme-customizer__preview"},[e.createElementVNode("div",{class:"xp-preview-row"},[e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--primary"},"Primary"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--success"},"Success"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--warning"},"Warning"),e.createElementVNode("button",{class:"xp-preview-btn xp-preview-btn--danger"},"Danger")]),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--primary"},"主标题文本"),e.createElementVNode("div",{class:"xp-preview-text"},"正文内容样例 Regular text"),e.createElementVNode("div",{class:"xp-preview-text xp-preview-text--secondary"},"次要提示")])],-1))]),e.createElementVNode("footer",{class:"xp-theme-customizer__footer"},[e.createElementVNode("button",{class:"xp-theme-customizer__action",onClick:x},"恢复默认"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--secondary",onClick:z},"导入 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:N},"导出 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:S},"导出 CSS")]),e.createElementVNode("input",{ref_key:"importFileInput",ref:s,type:"file",accept:"application/json,.json,.txt",class:"xp-theme-customizer__hidden",onChange:$},null,544)],8,Tl)):e.createCommentVNode("",!0)]),_:1})],64))}},A=e.ref([]);let fo=0;function ho(){function t(l,n="info",o=2600){const a=++fo;A.value.push({id:a,message:l,type:n}),setTimeout(()=>{const r=A.value.findIndex(i=>i.id===a);r>=0&&A.value.splice(r,1)},o)}return{toasts:A,toast:t,success:l=>t(l,"success",2200),error:l=>t(l,"error",3600),info:l=>t(l,"info"),warn:l=>t(l,"warn",2800)}}const go={class:"xp-toast-wrap","aria-live":"polite"},vo={class:"xp-toast__msg"},ko={__name:"Toast",setup(t){return(l,n)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",go,[e.createVNode(e.TransitionGroup,{name:"xp-toast"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:e.normalizeClass(["xp-toast",`xp-toast--${o.type}`])},[n[0]||(n[0]=e.createElementVNode("span",{class:"xp-toast__dot","aria-hidden":"true"},null,-1)),e.createElementVNode("span",vo,e.toDisplayString(o.message),1)],2))),128))]),_:1})])]))}},Re=C(ko,[["__scopeId","data-v-b564201c"]]),xo={class:"xp-tooltip__content"},yo={__name:"Tooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},trigger:{type:String,default:"hover",validator:t=>["hover","click","manual"].includes(t)},disabled:{type:Boolean,default:!1}},setup(t){const l=t,n=e.ref(!1),o=e.ref({}),a=e.ref(null),r=e.ref(null);let i=null;const v=()=>{e.nextTick(()=>{if(!a.value||!r.value)return;const d=a.value.getBoundingClientRect(),f=r.value.getBoundingClientRect();let b=0,_=0;switch(l.placement){case"top":b=d.top-f.height-8,_=d.left+d.width/2-f.width/2;break;case"bottom":b=d.bottom+8,_=d.left+d.width/2-f.width/2;break;case"left":b=d.top+d.height/2-f.height/2,_=d.left-f.width-8;break;case"right":b=d.top+d.height/2-f.height/2,_=d.right+8;break}o.value={top:`${b+window.scrollY}px`,left:`${_+window.scrollX}px`}})},h=()=>{l.disabled||(clearTimeout(i),i=setTimeout(()=>{n.value=!0,v()},100))},c=()=>{clearTimeout(i),i=setTimeout(()=>{n.value=!1},150)},s=()=>{l.trigger!=="click"||l.disabled||(n.value=!n.value,n.value&&v())};return e.onBeforeUnmount(()=>{clearTimeout(i)}),(d,f)=>(e.openBlock(),e.createElementBlock("div",{class:"xp-tooltip",ref_key:"tooltipRef",ref:a},[e.createElementVNode("div",{class:"xp-tooltip__trigger",onMouseenter:h,onMouseleave:c,onClick:s},[e.renderSlot(d.$slots,"default",{},void 0,!0)],32),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"xp-tooltip-fade"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["xp-tooltip__popper",[`xp-tooltip__popper--${t.placement}`]]),style:e.normalizeStyle(o.value),ref_key:"popperRef",ref:r},[e.createElementVNode("div",xo,[e.renderSlot(d.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)],!0)]),f[0]||(f[0]=e.createElementVNode("div",{class:"xp-tooltip__arrow"},null,-1))],6)):e.createCommentVNode("",!0)]),_:3})]))],512))}},Oe=C(yo,[["__scopeId","data-v-6d9af40b"]]),Pe={XpAlert:ie,XpAvatar:ce,XpBadge:de,XpButton:q,XpCard:ue,XpCheckbox:J,XpContextMenu:pe,XpDialog:me,XpDropdown:fe,XpEmpty:Z,XpFileIcon:he,XpIcon:ge,XpInput:ve,XpMenu:ke,XpMenuGroup:xe,XpMenuItem:ye,XpSubMenu:_e,XpPagination:be,XpProgress:we,XpRadio:Be,XpRate:Ee,XpSelect:Q,XpSwitch:Ce,XpTable:Ve,XpTableColumn:$e,XpTabPane:Ne,XpTabs:Se,XpTag:Me,XpThemeCustomizer:Le,XpToast:Re,XpTooltip:Oe},He=t=>{Object.entries(Pe).forEach(([l,n])=>{t.component(l,n)})},_o={install:He,...Pe};exports.DEFAULT_PRIMARY=D;exports.DEFAULT_TOKENS=O;exports.XpAlert=ie;exports.XpAvatar=ce;exports.XpBadge=de;exports.XpButton=q;exports.XpCard=ue;exports.XpCheckbox=J;exports.XpContextMenu=pe;exports.XpDialog=me;exports.XpDropdown=fe;exports.XpEmpty=Z;exports.XpFileIcon=he;exports.XpIcon=ge;exports.XpInput=ve;exports.XpMenu=ke;exports.XpMenuGroup=xe;exports.XpMenuItem=ye;exports.XpPagination=be;exports.XpProgress=we;exports.XpRadio=Be;exports.XpRate=Ee;exports.XpSelect=Q;exports.XpSubMenu=_e;exports.XpSwitch=Ce;exports.XpTabPane=Ne;exports.XpTable=Ve;exports.XpTableColumn=$e;exports.XpTabs=Se;exports.XpTag=Me;exports.XpThemeCustomizer=Le;exports.XpToast=Re;exports.XpTooltip=Oe;exports.applyThemeConfig=R;exports.buildCssString=te;exports.buildCssVars=Ie;exports.darken=H;exports.default=_o;exports.deriveDark=$l;exports.deriveLight=Vl;exports.getDefaultThemeConfig=F;exports.initTheme=je;exports.install=He;exports.isDark=Sl;exports.lighten=P;exports.mix=ee;exports.parseColor=W;exports.resetThemeConfig=Xe;exports.setTheme=L;exports.toHex=ze;exports.toasts=A;exports.toggleTheme=Fe;exports.useTheme=Ae;exports.useToast=ho;exports.withAlpha=Nl;
|