@cghbcf/xp-ui 1.1.0 → 1.2.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 +19 -1
- package/dist/cghbcf-xp-ui.cjs.js +4 -4
- package/dist/cghbcf-xp-ui.es.js +677 -677
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,7 +76,25 @@ initTheme()
|
|
|
76
76
|
|
|
77
77
|
图标文件统一存放在 `src/components/icon/icons/` 目录下,组件在构建时通过 `import.meta.glob` 自动扫描该目录,**新增图标只需放入 `.svg` 文件**,即可用同名 `name` 直接引用(例如 `jiantou.svg` 对应 `name="jiantou"`)。
|
|
78
78
|
|
|
79
|
-
图标内部硬编码的 `fill` / `stroke` 颜色(除 `none` 外)会被自动替换为 `currentColor`,因此 `color`
|
|
79
|
+
图标内部硬编码的 `fill` / `stroke` 颜色(除 `none` 外)会被自动替换为 `currentColor`,因此 `color` 属性始终生效。**未指定 `color` 时图标默认继承当前文字颜色,便于通过父元素着色(如按钮 hover 高亮)。** 当 `name` 不存在时,会展示占位符(`?`)便于排查。
|
|
80
|
+
|
|
81
|
+
#### 内置图标
|
|
82
|
+
|
|
83
|
+
下表为当前内置的 18 个图标(不含占位符):
|
|
84
|
+
|
|
85
|
+
| name | 视觉 | name | 视觉 |
|
|
86
|
+
|------|------|------|------|
|
|
87
|
+
| `back` 返回 | ← | `forward` 前进 | → |
|
|
88
|
+
| `up` 上一级 | ↑ | `arrow-right` 右箭头 | →▸ |
|
|
89
|
+
| `refresh` 刷新 | ⟳ | `chevron-up` 上箭头 | ∧ |
|
|
90
|
+
| `chevron-down` 下箭头 | ∨ | `close` 关闭 | ✕ |
|
|
91
|
+
| `folder` 文件夹 | 📁 | `folder-add` 新建文件夹 | 📁+ |
|
|
92
|
+
| `list` 列表视图 | ☰ | `grid` 网格视图 | ▦ |
|
|
93
|
+
| `settings` 设置 | ⚙ | `star` 星标 | ☆ |
|
|
94
|
+
| `star-fill` 星标实心 | ★ | `upload` 上传 | ⇧ |
|
|
95
|
+
| `home` 首页 | ⌂ | `jiantou` 箭头 | ◀ |
|
|
96
|
+
|
|
97
|
+
> 图标总览见演示站 `Icon 图标` 页,点击图标可复制 `XpIcon` 代码。新增图标只需放入 `icons/` 目录即可自动出现。
|
|
80
98
|
|
|
81
99
|
#### 基础用法
|
|
82
100
|
|
package/dist/cghbcf-xp-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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(`
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=(t,n)=>{const o=t.__vccOpts||t;for(const[l,r]of n)o[l]=r;return o},Ce={class:"xp-alert__icon"},Ve={class:"xp-alert__content"},Ne={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),r={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",Ce,e.toDisplayString(r[t.type]),1),e.createElementVNode("div",Ve,[e.createElementVNode("span",Ne,[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}))}},H=x(Se,[["__scopeId","data-v-91d792bd"]]),ze=["src","alt"],Me={key:1,class:"xp-avatar__slot"},Te={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,r=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=()=>{r.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&&!r.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",Me,[e.renderSlot(f.$slots,"default",{},void 0,!0)])):(e.openBlock(),e.createElementBlock("span",Te,e.toDisplayString(t.alt||"A"),1))],6))}},U=x(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(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-badge",{"xp-badge--dot":t.isDot,"xp-badge--hidden":t.hidden}])},[e.renderSlot(r.$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))}},W=x(Fe,[["__scopeId","data-v-207db6dd"]]),je=["disabled"],Xe={key:0,class:"xp-button__loading"},Ae={class:"xp-button__text"},Le={__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,r=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:r},[t.loading?(e.openBlock(),e.createElementBlock("span",Xe)):e.createCommentVNode("",!0),e.createElementVNode("span",Ae,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],10,je))}},T=x(Le,[["__scopeId","data-v-9c6bc634"]]),Re={key:0,class:"xp-card__header"},Oe={class:"xp-card__title"},Pe={key:0,class:"xp-card__extra"},He={class:"xp-card__body"},Ue={key:1,class:"xp-card__footer"},We={__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",Re,[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",He,[e.renderSlot(n.$slots,"default",{},void 0,!0)]),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(n.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},J=x(We,[["__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,r=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:r,".indeterminate":t.indeterminate},null,40,qe)]),e.createElementVNode("span",Ge,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},q=x(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 r=e.computed(()=>{const u=Math.min(o.items.filter(m=>!m.divider).length,12)*32+12;let a=o.x,c=o.y;return a+220>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-220-8)),c+u>window.innerHeight-8&&(c=Math.max(8,window.innerHeight-u-8)),{left:`${a}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(r.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,(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c},[a.divider?(e.openBlock(),e.createElementBlock("div",Ke)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["xp-menu__item",{"xp-menu__item--danger":a.danger,"xp-menu__item--disabled":a.disabled}]),role:"menuitem",disabled:a.disabled,onClick:m=>s(a)},[a.icon?(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(a.icon),1)):e.createCommentVNode("",!0),e.createElementVNode("span",et,e.toDisplayString(a.label),1)],10,Ze))],64))),128))],36)],32)):e.createCommentVNode("",!0)]),_:1})]))}},G=x(tt,[["__scopeId","data-v-7477a575"]]),ot={class:"xp-dialog__header"},nt={class:"xp-dialog__title"},lt={class:"xp-dialog__body"},rt={key:0,class:"xp-dialog__footer"},at={__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,r=()=>{l("update:visible",!1),l("close")},i=()=>{o.closeOnClickModal&&r()},s=()=>{l("confirm"),r()},f=()=>{l("cancel"),r()};function p(u){u.key==="Escape"&&o.visible&&r()}return e.watch(()=>o.visible,u=>{u?window.addEventListener("keydown",p):window.removeEventListener("keydown",p)}),e.onUnmounted(()=>window.removeEventListener("keydown",p)),(u,a)=>(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"])},[a[0]||(a[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:r},"×")]),e.createElementVNode("div",lt,[e.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer||t.showDefaultFooter?(e.openBlock(),e.createElementBlock("div",rt,[e.renderSlot(u.$slots,"footer",{},()=>[e.createVNode(T,{onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelButtonText),1)]),_:1}),e.createVNode(T,{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=x(at,[["__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,r=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 v=m.bottom+6,_=m.left;_+k.width>window.innerWidth-10&&(_=window.innerWidth-k.width-10),v+k.height>window.innerHeight-10&&(v=m.top-k.height-6),i.value={top:`${v+window.scrollY}px`,left:`${_+window.scrollX}px`}})},u=()=>{o.disabled||(r.value=!r.value,r.value?(p(),l("open")):l("close"))},a=m=>{m.disabled||m.divider||(l("select",m),m.command!==void 0&&l("command",m.command,m),r.value=!1,l("close"))},c=m=>{var k;r.value&&s.value&&!s.value.contains(m.target)&&!((k=f.value)!=null&&k.contains(m.target))&&(r.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(()=>[r.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,(v,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:e.normalizeClass(["xp-dropdown__item",{"xp-dropdown__item--disabled":v.disabled,"xp-dropdown__item--divider":v.divider}]),onClick:X=>a(v)},[v.divider?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",it,e.toDisplayString(v.label),1)),v.divider?(e.openBlock(),e.createElementBlock("span",ct)):e.createCommentVNode("",!0)],10,st))),128))],4)):e.createCommentVNode("",!0)]),_:1})]))],512))}},K=x(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=x(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=x(kt,[["__scopeId","data-v-c598c294"]]),vt='<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>',xt='<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>',yt='<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>',_t='<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>',bt='<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>',Bt='<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>',Et='<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>',Ct='<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>',Vt='<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>',Nt='<?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>',$t='<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>',St='<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>',zt='<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>',Mt='<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>',Tt='<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>',Dt='<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>',It='<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>',Ft=["viewBox","innerHTML"],jt={key:2,class:"xp-icon__fallback"},Xt={__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/arrow-right.svg":vt,"./icons/back.svg":xt,"./icons/chevron-down.svg":yt,"./icons/chevron-up.svg":_t,"./icons/close.svg":bt,"./icons/folder-add.svg":wt,"./icons/folder.svg":Bt,"./icons/forward.svg":Et,"./icons/grid.svg":Ct,"./icons/home.svg":Vt,"./icons/jiantou.svg":Nt,"./icons/list.svg":$t,"./icons/refresh.svg":St,"./icons/settings.svg":zt,"./icons/star-fill.svg":Mt,"./icons/star.svg":Tt,"./icons/up.svg":Dt,"./icons/upload.svg":It}),r=a=>a&&a.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 a=`./icons/${o.name}.svg`,c=l[a];if(!c)return null;const m=c.match(/<svg[^>]*>([\s\S]*)<\/svg>/i),k=r(m?m[1]:c),v=c.match(/viewBox\s*=\s*["']([^"']+)["']/i);return{inner:k,viewBox:v?v[1]:"0 0 24 24"}}),s=e.computed(()=>n.includes(String(o.size))),f=e.computed(()=>{if(s.value)return null;const a=o.size;return typeof a=="number"?`${a}px`:typeof a=="string"&&a.trim()?/^\d+(\.\d+)?$/.test(a.trim())?`${a}px`:a.trim():null}),p=e.computed(()=>{const a=[];return s.value&&a.push(`xp-icon--${o.size}`),o.spin&&a.push("xp-icon--spin"),a}),u=e.computed(()=>{const a={};return o.color&&(a.color=o.color),o.rotate&&(a.transform=`rotate(${o.rotate}deg)`),f.value&&(a.width=f.value,a.height=f.value,a.fontSize=f.value),a});return(a,c)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["xp-icon",p.value]),style:e.normalizeStyle(u.value)},[a.$slots.default?e.renderSlot(a.$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,Ft)):(e.openBlock(),e.createElementBlock("span",jt,"?"))],6))}},ee=x(Xt,[["__scopeId","data-v-9ed9f36d"]]),At={key:0,class:"xp-input__prefix"},Lt=["id","type","value","placeholder","disabled","maxlength"],Rt={key:2,class:"xp-input__suffix"},Ot={__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,r=e.ref(null),i=e.ref(!1),s=a=>{l("update:modelValue",a.target.value)},f=a=>{i.value=!0,l("focus",a)},p=a=>{i.value=!1,l("blur",a)},u=()=>{l("update:modelValue",""),l("clear"),r.value&&r.value.focus()};return n({focus:()=>r.value&&r.value.focus(),select:()=>r.value&&r.value.select(),blur:()=>r.value&&r.value.blur()}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["xp-input",[`xp-input--${t.size}`,{"xp-input--disabled":t.disabled,"xp-input--prefix":a.$slots.prefix,"xp-input--suffix":a.$slots.suffix||t.showClear,"xp-input--focus":i.value}]])},[a.$slots.prefix?(e.openBlock(),e.createElementBlock("span",At,[e.renderSlot(a.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"inputRef",ref:r,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,Lt),t.showClear&&t.modelValue&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"xp-input__clear",onClick:u},"×")):e.createCommentVNode("",!0),a.$slots.suffix&&!t.showClear?(e.openBlock(),e.createElementBlock("span",Rt,[e.renderSlot(a.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}},te=x(Ot,[["__scopeId","data-v-46247483"]]),Pt={key:0,class:"xp-progress__text"},Ht={__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(r,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",Pt,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.percentage)+"%",1)],!0)])):e.createCommentVNode("",!0)],2))}},oe=x(Ht,[["__scopeId","data-v-244dca2c"]]),Ut={class:"xp-radio__input"},Wt=["checked","disabled"],Jt={class:"xp-radio__label"},qt={__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,r=()=>{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",Ut,[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:r},null,40,Wt)]),e.createElementVNode("span",Jt,[e.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}},ne=x(qt,[["__scopeId","data-v-02a0d80d"]]),Gt={class:"xp-rate"},Yt=["onClick","onMouseenter"],Kt={class:"xp-rate__star"},Zt={key:0,class:"xp-rate__text"},Qt={__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,r=e.ref(0),i=e.computed(()=>r.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",Gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max,a=>(e.openBlock(),e.createElementBlock("span",{key:a,class:e.normalizeClass(["xp-rate__item",{"xp-rate__item--disabled":t.disabled}]),style:e.normalizeStyle({cursor:t.disabled?"default":"pointer"}),onClick:c=>f(a),onMouseenter:c=>r.value=a,onMouseleave:u[0]||(u[0]=c=>r.value=0)},[e.createElementVNode("span",Kt,[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(a)+"%",color:t.color})}," ★ ",4)])],46,Yt))),128)),t.showText&&!t.disabled?(e.openBlock(),e.createElementBlock("span",Zt,e.toDisplayString(t.modelValue)+" / "+e.toDisplayString(t.max),1)):e.createCommentVNode("",!0)]))}},le=x(Qt,[["__scopeId","data-v-214323a3"]]),eo=["aria-checked"],to={key:0,class:"xp-switch__label"},oo={__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,r=()=>{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:r},[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",to,[e.renderSlot(i.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],10,eo))}},re=x(oo,[["__scopeId","data-v-5a5e33c5"]]),no={key:0,class:"xp-tab-pane"},lo={__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)}),(r,i)=>l.value?(e.openBlock(),e.createElementBlock("div",no,[e.renderSlot(r.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)}},ae=x(lo,[["__scopeId","data-v-6fe7943a"]]),ro={class:"xp-tabs"},ao={class:"xp-tabs__nav",role:"tablist"},so=["onClick"],io={class:"xp-tabs__content"},co={__name:"Tabs",props:{modelValue:{type:[String,Number],default:null}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,l=n,r=e.ref([]),i=e.computed(()=>{var a;return o.modelValue!==null&&o.modelValue!==void 0&&o.modelValue!==""?o.modelValue:((a=r.value[0])==null?void 0:a.name)??null}),s=e.computed(()=>{const a=r.value.findIndex(m=>m.name===i.value);return{transform:`translateX(${(a>=0?a:0)*100}%)`,width:`${r.value.length?100/r.value.length:0}%`}}),f=a=>{a.disabled||(l("update:modelValue",a.name),l("change",a.name))},p=a=>{r.value.find(c=>c.name===a.name)||r.value.push(a)},u=a=>{const c=r.value.findIndex(m=>m.name===a);c>=0&&r.value.splice(c,1)};return e.provide("xpTabs",{addTab:p,removeTab:u,currentValue:i}),(a,c)=>(e.openBlock(),e.createElementBlock("div",ro,[e.createElementVNode("div",ao,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.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:v=>f(m)},e.toDisplayString(m.title),11,so))),128)),e.createElementVNode("div",{class:"xp-tabs__active-bar",style:e.normalizeStyle(s.value)},null,4)]),e.createElementVNode("div",io,[e.renderSlot(a.$slots,"default",{},void 0,!0)])]))}},se=x(co,[["__scopeId","data-v-3e658dba"]]),uo={__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,r=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(r.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=x(uo,[["__scopeId","data-v-903813de"]]),po=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,mo=/^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(po);if(o){let r=o[1];r.length===3&&(r=r.split("").map(p=>p+p).join(""));const i=parseInt(r.slice(0,2),16),s=parseInt(r.slice(2,4),16),f=parseInt(r.slice(4,6),16);return{r:i,g:s,b:f,a:1}}const l=n.match(mo);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 fo(t){return Math.max(0,Math.min(255,Math.round(t)))}function ce(t,n,o){const l=r=>fo(r).toString(16).padStart(2,"0");return"#"+l(t)+l(n)+l(o)}function I(t,n,o=.5){const l=z(t),r=z(n);if(!l||!r)return"#000000";const i=Math.max(0,Math.min(1,o)),s=l.r*(1-i)+r.r*i,f=l.g*(1-i)+r.g*i,p=l.b*(1-i)+r.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 ho(t){return $(t,.3)}function go(t){return S(t,.2)}function ko(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 vo(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),r=n==="dark"?S(t,.85):$(t,.9),i=n==="dark"?S(t,.7):$(t,.7);return{base:t,light:o,dark:l,bg:r,border:i}}const b={primary:"#409eff",success:"#67c23a",warning:"#e6a23c",danger:"#f56c6c",info:"#909399"},V={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 w(){return{primary:{...b},light:R(V.light),dark:R(V.dark)}}function R(t){return JSON.parse(JSON.stringify(t))}function O(t,n){const o=["primary","success","warning","danger","info"],l=[];for(const r of o){const i=t[r]||b[r],s=de(i,n);l.push(` --xp-color-${r}: ${i};`),l.push(` --xp-color-${r}-light: ${s.light};`),l.push(` --xp-color-${r}-dark: ${s.dark};`),l.push(` --xp-color-${r}-bg: ${s.bg};`),l.push(` --xp-color-${r}-border: ${s.border};`)}return l.join(`
|
|
2
2
|
`)}function P(t){const n=[];for(const o of Object.keys(t.text))n.push(` --xp-text-color-${o}: ${t.text[o]};`);n.push(` --xp-border-color: ${t.border.base};`),n.push(` --xp-border-color-light: ${t.border.light};`),n.push(` --xp-border-color-lighter: ${t.border.lighter};`);for(const o of Object.keys(t.bg)){const l=o==="base"?"":`-${o}`;n.push(` --xp-bg-color${l}: ${t.bg[o]};`)}for(const o of Object.keys(t.fill)){const l=o==="base"?"":`-${o}`;n.push(` --xp-fill-color${l}: ${t.fill[o]};`)}for(const o of Object.keys(t.shadow))n.push(` --xp-shadow-${o}: ${t.shadow[o]};`);return n.join(`
|
|
3
|
-
`)}function ue(t,n){const o={},l=t.primary||
|
|
4
|
-
`)}let
|
|
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;
|
|
3
|
+
`)}function ue(t,n){const o={},l=t.primary||b,r=["primary","success","warning","danger","info"];for(const s of r){const f=l[s]||b[s],p=de(f,n);o[`--xp-color-${s}`]=f,o[`--xp-color-${s}-light`]=p.light,o[`--xp-color-${s}-dark`]=p.dark,o[`--xp-color-${s}-bg`]=p.bg,o[`--xp-color-${s}-border`]=p.border}const i=t[n]||V[n];for(const s of Object.keys(i.text))o[`--xp-text-color-${s}`]=i.text[s];o["--xp-border-color"]=i.border.base,o["--xp-border-color-light"]=i.border.light,o["--xp-border-color-lighter"]=i.border.lighter;for(const s of Object.keys(i.bg))o[`--xp-bg-color${s==="base"?"":"-"+s}`]=i.bg[s];for(const s of Object.keys(i.fill))o[`--xp-fill-color${s==="base"?"":"-"+s}`]=i.fill[s];for(const s of Object.keys(i.shadow))o[`--xp-shadow-${s}`]=i.shadow[s];return o}function F(t){return[':root, [data-theme="light"] {',O(t.primary||b,"light"),P(t.light||V.light),"}","",'[data-theme="dark"] {',O(t.primary||b,"dark"),P(t.dark||V.dark),"}"].join(`
|
|
4
|
+
`)}let M=null;function xo(){if(typeof document>"u")return null;if(M&&document.contains(M))return M;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)),M=t,t}function yo(t){const n=xo();n&&(n.textContent=F(t))}const j=e.ref("light"),pe=e.ref(w());function E(t){if(["light","dark"].includes(t)&&(j.value=t,typeof document<"u")){document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("xp-ui-theme",t)}catch{}}}function me(){E(j.value==="light"?"dark":"light")}function C(t){if(!t)return;const n=w();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,yo(n);try{localStorage.setItem("xp-ui-theme-config",JSON.stringify(n))}catch{}}function fe(){C(w())}function he(){if(typeof document>"u")return;let t=null;try{t=localStorage.getItem("xp-ui-theme")}catch{}t==="light"||t==="dark"?E(t):typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?E("dark"):E("light");let n=null;try{n=localStorage.getItem("xp-ui-theme-config")}catch{}if(n)try{C(JSON.parse(n))}catch{C(w())}else C(w())}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:j,themeConfig:pe,setTheme:E,toggleTheme:me,initTheme:he,applyThemeConfig:C,resetThemeConfig:fe,getDefaultThemeConfig:w,buildCssString:F,buildCssVars:ue}}const _o=["data-theme"],bo={class:"xp-theme-customizer__header"},wo={class:"xp-theme-customizer__body"},Bo={class:"xp-theme-customizer__section"},Eo={class:"xp-theme-customizer__modes"},Co=["onClick"],Vo={class:"xp-theme-customizer__section"},No={class:"xp-theme-customizer__grid"},$o={class:"xp-theme-customizer__label"},So={class:"xp-theme-customizer__input"},zo=["value","onInput"],Mo=["value","onChange"],To={class:"xp-theme-customizer__section"},Do={class:"xp-theme-customizer__grid"},Io={class:"xp-theme-customizer__label"},Fo={class:"xp-theme-customizer__input"},jo=["value","onInput"],Xo=["value","onChange"],Ao={class:"xp-theme-customizer__section"},Lo={class:"xp-theme-customizer__grid"},Ro={class:"xp-theme-customizer__label"},Oo={class:"xp-theme-customizer__input"},Po=["value","onInput"],Ho=["value","onChange"],Uo={class:"xp-theme-customizer__section"},Wo={class:"xp-theme-customizer__grid"},Jo={class:"xp-theme-customizer__label"},qo={class:"xp-theme-customizer__input"},Go=["value","onInput"],Yo=["value","onChange"],Ko={class:"xp-theme-customizer__label"},Zo={class:"xp-theme-customizer__input"},Qo=["value","onInput"],en=["value","onChange"],ke={__name:"ThemeCustomizer",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const{theme:o,applyThemeConfig:l,resetThemeConfig:r,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"),a=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 v(y,h){c.primary[y]=h,l(c)}function _(y,h,d){c[u.value][y][h]=d,l(c)}function X(){r()}function be(){A("xp-ui-theme.json",JSON.stringify(c,null,2),"application/json")}function we(){A("xp-ui-theme.css",s(c),"text/css")}function Be(){a.value&&a.value.click()}function Ee(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 A(y,h,d){const g=new Blob([h],{type:d+";charset=utf-8"}),L=URL.createObjectURL(g),N=document.createElement("a");N.href=L,N.download=y,document.body.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(L),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",bo,[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",wo,[e.createElementVNode("section",Bo,[h[3]||(h[3]=e.createElementVNode("p",{class:"xp-theme-customizer__desc"}," 修改下方颜色即可改变整个示例/库的外观。导出后可直接放进你自己的项目中应用。 ",-1)),e.createElementVNode("div",Eo,[(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,Co)),64))])]),e.createElementVNode("section",Vo,[h[4]||(h[4]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"主色",-1)),e.createElementVNode("div",No,[(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",$o,e.toDisplayString(p[d]),1),e.createElementVNode("div",So,[e.createElementVNode("input",{type:"color",value:c.primary[d],onInput:g=>v(d,g.target.value)},null,40,zo),e.createElementVNode("input",{type:"text",value:c.primary[d],onChange:g=>v(d,g.target.value)},null,40,Mo)])])),64))])]),e.createElementVNode("section",To,[h[5]||(h[5]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"文本",-1)),e.createElementVNode("div",Do,[(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",Io,e.toDisplayString(p[d]),1),e.createElementVNode("div",Fo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].text[d]),onInput:g=>_("text",d,g.target.value)},null,40,jo),e.createElementVNode("input",{type:"text",value:c[u.value].text[d],onChange:g=>_("text",d,g.target.value)},null,40,Xo)])])),64))])]),e.createElementVNode("section",Ao,[h[6]||(h[6]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"背景",-1)),e.createElementVNode("div",Lo,[(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",Ro,e.toDisplayString(p[d]),1),e.createElementVNode("div",Oo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].bg[d]),onInput:g=>_("bg",d,g.target.value)},null,40,Po),e.createElementVNode("input",{type:"text",value:c[u.value].bg[d],onChange:g=>_("bg",d,g.target.value)},null,40,Ho)])])),64))])]),e.createElementVNode("section",Uo,[h[7]||(h[7]=e.createElementVNode("h3",{class:"xp-theme-customizer__h"},"边框 / 填充",-1)),e.createElementVNode("div",Wo,[(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",Jo,"边框 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",qo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].border[d]),onInput:g=>_("border",d,g.target.value)},null,40,Go),e.createElementVNode("input",{type:"text",value:c[u.value].border[d],onChange:g=>_("border",d,g.target.value)},null,40,Yo)])])),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",Ko,"填充 - "+e.toDisplayString(p[d]),1),e.createElementVNode("div",Zo,[e.createElementVNode("input",{type:"color",value:k(c[u.value].fill[d]),onInput:g=>_("fill",d,g.target.value)},null,40,Qo),e.createElementVNode("input",{type:"text",value:c[u.value].fill[d],onChange:g=>_("fill",d,g.target.value)},null,40,en)])])),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:X},"恢复默认"),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:be},"导出 JSON"),e.createElementVNode("button",{class:"xp-theme-customizer__action xp-theme-customizer__action--primary",onClick:we},"导出 CSS")]),e.createElementVNode("input",{ref_key:"importFileInput",ref:a,type:"file",accept:"application/json,.json,.txt",class:"xp-theme-customizer__hidden",onChange:Ee},null,544)],8,_o)):e.createCommentVNode("",!0)]),_:1})],64))}},B=e.ref([]);let tn=0;function on(){function t(n,o="info",l=2600){const r=++tn;B.value.push({id:r,message:n,type:o}),setTimeout(()=>{const i=B.value.findIndex(s=>s.id===r);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 nn={class:"xp-toast-wrap","aria-live":"polite"},ln={class:"xp-toast__msg"},rn={__name:"Toast",setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",nn,[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",ln,e.toDisplayString(l.message),1)],2))),128))]),_:1})])]))}},ve=x(rn,[["__scopeId","data-v-b564201c"]]),an={class:"xp-tooltip__content"},sn={__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({}),r=e.ref(null),i=e.ref(null);let s=null;const f=()=>{e.nextTick(()=>{if(!r.value||!i.value)return;const c=r.value.getBoundingClientRect(),m=i.value.getBoundingClientRect();let k=0,v=0;switch(n.placement){case"top":k=c.top-m.height-8,v=c.left+c.width/2-m.width/2;break;case"bottom":k=c.bottom+8,v=c.left+c.width/2-m.width/2;break;case"left":k=c.top+c.height/2-m.height/2,v=c.left-m.width-8;break;case"right":k=c.top+c.height/2-m.height/2,v=c.right+8;break}l.value={top:`${k+window.scrollY}px`,left:`${v+window.scrollX}px`}})},p=()=>{n.disabled||(clearTimeout(s),s=setTimeout(()=>{o.value=!0,f()},100))},u=()=>{clearTimeout(s),s=setTimeout(()=>{o.value=!1},150)},a=()=>{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:r},[e.createElementVNode("div",{class:"xp-tooltip__trigger",onMouseenter:p,onMouseleave:u,onClick:a},[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",an,[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))}},xe=x(sn,[["__scopeId","data-v-6d9af40b"]]),ye={XpAlert:H,XpAvatar:U,XpBadge:W,XpButton:T,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:re,XpTabPane:ae,XpTabs:se,XpTag:ie,XpThemeCustomizer:ke,XpToast:ve,XpTooltip:xe},_e=t=>{Object.entries(ye).forEach(([n,o])=>{t.component(n,o)})},cn={install:_e,...ye};exports.DEFAULT_PRIMARY=b;exports.DEFAULT_TOKENS=V;exports.XpAlert=H;exports.XpAvatar=U;exports.XpBadge=W;exports.XpButton=T;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=re;exports.XpTabPane=ae;exports.XpTabs=se;exports.XpTag=ie;exports.XpThemeCustomizer=ke;exports.XpToast=ve;exports.XpTooltip=xe;exports.applyThemeConfig=C;exports.buildCssString=F;exports.buildCssVars=ue;exports.darken=S;exports.default=cn;exports.deriveDark=go;exports.deriveLight=ho;exports.getDefaultThemeConfig=w;exports.initTheme=he;exports.install=_e;exports.isDark=vo;exports.lighten=$;exports.mix=I;exports.parseColor=z;exports.resetThemeConfig=fe;exports.setTheme=E;exports.toHex=ce;exports.toasts=B;exports.toggleTheme=me;exports.useTheme=ge;exports.useToast=on;exports.withAlpha=ko;
|