@nhdropshipping/y-components 1.0.99 → 1.0.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +127 -127
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Bt=["type","disabled","aria-busy","aria-disabled"],Nt={class:"content"},Vt={key:1,class:"y-btn-group",role:"group"},St=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Dt={class:"content"},Tt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},$t={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Mt={key:2},It=e.defineComponent({__name:"ybutton",props:{htmlType:{default:"button"},variant:{default:"primary"},size:{default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1},groupPosition:{default:"single"},groupItems:{default:void 0}},emits:["click","group-click"],setup(n,{emit:c}){const t=n,l=c;function p(B){if(t.disabled||t.loading){B.preventDefault(),B.stopPropagation();return}l("click",B)}const m=e.computed(()=>{switch(t.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),r=e.computed(()=>Array.isArray(t.groupItems)&&t.groupItems.length>0);function N(B,S){if(t.disabled||t.loading||B.disabled||B.loading){S.preventDefault(),S.stopPropagation();return}l("group-click",B.value,S)}return(B,S)=>r.value?(e.openBlock(),e.createElementBlock("div",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groupItems,(C,f)=>{var u;return e.openBlock(),e.createElementBlock("button",{key:C.value??f,class:e.normalizeClass(["y-btn",[`y-btn--${C.variant??n.variant}`,`y-btn--${C.size??n.size}`,"is-grouped",f===0?"group-pos-start":f===(((u=n.groupItems)==null?void 0:u.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":C.loading||n.loading}]]),type:n.htmlType,disabled:(C.disabled??!1)||n.disabled||n.loading||C.loading,"aria-busy":C.loading||n.loading?"true":"false","aria-disabled":(C.disabled??!1)||n.disabled||n.loading||C.loading?"true":"false","aria-label":C.ariaLabel||C.label,onClick:x=>N(C,x)},[e.createElementVNode("span",Dt,[C.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",Tt,[...S[0]||(S[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z","clip-rule":"evenodd"},null,-1)])])):C.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",$t,[...S[1]||(S[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),C.label&&!C.onlyIcon?(e.openBlock(),e.createElementBlock("span",Mt,e.toDisplayString(C.label),1)):e.createCommentVNode("",!0)])],10,St)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${n.variant}`,`y-btn--${n.size}`,{"is-block":n.block,"is-loading":n.loading},n.groupPosition!=="single"?"is-grouped":"",m.value]]),type:n.htmlType,disabled:n.disabled||n.loading,"aria-busy":n.loading?"true":"false","aria-disabled":n.disabled||n.loading?"true":"false",onClick:p},[e.createElementVNode("span",Nt,[e.renderSlot(B.$slots,"default",{},void 0,!0)])],10,Bt))}}),pe=(n,c)=>{const t=n.__vccOpts||n;for(const[l,p]of c)t[l]=p;return t},Me=pe(It,[["__scopeId","data-v-53157673"]]),Lt=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],zt={key:0,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ht={key:1,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Rt=e.defineComponent({__name:"yinput",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},autocomplete:{default:"off"},inputmode:{default:void 0},id:{default:void 0},name:{default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},size:{default:"medium"},width:{default:"200px"},min:{default:void 0},max:{default:void 0},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue","enter","paste"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(null),m=e.ref(""),r=e.ref(!1),N=e.ref(!1),B=e.ref(t.placeholder||""),S=e.ref(!1),C=e.computed(()=>t.type==="password"),f=e.computed(()=>t.type==="password"&&S.value?"text":t.type);function u(){S.value=!S.value}e.watch(()=>t.placeholder,D=>{N.value||(B.value=D||"")});function x(D){const Y=D.target;r.value=!0,l("update:modelValue",Y.value)}function M(){N.value=!0,t.clearOnFocus&&(m.value=t.modelValue||"",r.value=!1,B.value=m.value||t.placeholder||"",l("update:modelValue",""))}function R(){if(N.value=!1,t.clearOnFocus&&!r.value&&(!t.modelValue||t.modelValue==="")&&l("update:modelValue",m.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const D=Number(t.modelValue),Y=Number(t.min);!Number.isNaN(D)&&!Number.isNaN(Y)&&D<Y&&l("update:modelValue",String(Y))}B.value=t.placeholder||""}function I(D){const Y=D.target;l("enter",Y.value)}function E(D){const Y=D.target;requestAnimationFrame(()=>{l("paste",Y.value)})}return(D,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":n.block,"has-password-toggle":C.value}]),style:e.normalizeStyle({width:n.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:p,class:e.normalizeClass(["y-input",`y-input--${n.size}`]),id:n.id,name:n.name,type:f.value,placeholder:B.value,autocomplete:n.autocomplete,inputmode:n.inputmode,min:n.min,max:n.max,disabled:n.disabled,required:n.required,value:n.modelValue,onInput:x,onFocus:M,onBlur:R,onKeyup:e.withKeys(I,["enter"]),onPaste:E},null,42,Lt),C.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["y-input-password-toggle",`y-input-password-toggle--${n.size}`]),onClick:u,tabindex:"-1"},[S.value?(e.openBlock(),e.createElementBlock("svg",zt,[...Y[0]||(Y[0]=[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ht,[...Y[1]||(Y[1]=[e.createElementVNode("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),e.createElementVNode("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))],2)):e.createCommentVNode("",!0)],6))}}),Je=pe(Rt,[["__scopeId","data-v-e954aa01"]]),_t={key:0,class:"bulk-bar"},Kt={class:"bulk-left"},Wt={class:"bulk-actions"},At={key:0,class:"table-header-actions"},Pt=["title"],Ft={key:0,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Yt={key:1,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Ot={key:1,class:"selected-header-floating"},jt={class:"table"},Ut={key:0,style:{width:"34px","min-width":"34px"}},qt={key:1,style:{width:"60px","min-width":"60px"}},Gt={key:0,class:"col-expand"},Zt={key:1,class:"col-select"},Qt={class:"select-header"},Jt=["checked","indeterminate","disabled"],Xt={key:0,class:"select-count"},en=["colspan"],tn={class:"selected-header-wrapper"},nn={key:0,class:"loading-overlay",style:{"z-index":"100"}},ln={key:1,class:"empty-overlay"},on={key:0,style:{width:"34px","min-width":"34px"}},an={key:1,style:{width:"60px","min-width":"60px"}},rn={key:0},sn=["colspan"],cn=["onClick"],dn={key:0,class:"col-expand"},un=["onClick"],fn=["value","checked","disabled","onChange"],mn=["colspan"],vn={key:1},hn=["colspan"],pn=e.defineComponent({__name:"ytable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},showBulkActions:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},pageSize:{default:10},currentPage:{},total:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},showTotal:{type:Boolean,default:!0},rowKey:{type:[String,Function],default:"id"},emptyText:{default:"无数据"},searchKeyword:{default:""},searchFields:{default:()=>[]},stickyHeader:{type:Boolean,default:!1},expandable:{type:Boolean},rowDisabled:{type:Function,default:void 0},selectedItems:{default:void 0},rowSelectable:{type:Boolean,default:!1},requireDeselectBeforeSelect:{type:Boolean,default:!0},selectedHeaderFloat:{type:Boolean,default:!1},virtualScroll:{type:Boolean,default:!1},virtualRowHeight:{default:36},virtualBuffer:{default:5},size:{default:"default"}},emits:["edit","select","update:selectedItems","page-change","page-size-change","row-click"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(t.currentPage||1),m=e.ref(t.pageSize),r=e.ref(t.selectedItems||[]),N=e.ref([]),B=e.ref(new Set),S=e.ref("none"),C=e.ref(),f=e.ref(),u=e.ref(),x=e.ref(),M=e.ref([]),R=e.ref({}),I=e.ref(35),E=e.ref(new Set),D=e.computed(()=>E.value.size>0),Y=e.computed(()=>{if(ae.value,E.value.size===0)return!1;let a=0;return E.value.forEach(v=>{v&&v.isExpanded&&a++}),a===E.value.size});e.computed(()=>{if(ae.value,E.value.size===0)return!0;let a=0;return E.value.forEach(v=>{v&&!v.isExpanded&&a++}),a===E.value.size});function se(a){E.value.add(a)}function X(a){E.value.delete(a)}function L(){E.value.forEach(a=>{a&&typeof a.collapse=="function"&&a.collapse()})}function K(){E.value.forEach(a=>{a&&typeof a.expand=="function"&&a.expand()})}function oe(){Y.value?L():K()}const ae=e.ref(0);function le(){ae.value++}e.provide("registerHintTag",se),e.provide("unregisterHintTag",X),e.provide("notifyHintTagStateChange",le);const te=e.computed(()=>t.columns.filter(a=>!w(a.width)).map(a=>a.key));function F(){return`${(100/(te.value.length||1)).toFixed(6)}%`}const G=e.ref(),W=e.ref({show:!1,thumbHeight:40,thumbTop:0});let U=!1,Q=0,O=0;const ee=e.ref(0);function w(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const v=String(a).trim();if(v)return/^\d+(\.\d+)?$/.test(v)?`${v}px`:v}function s(a){const v=w(a);if(!v)return null;const y=parseFloat(v);return Number.isFinite(y)?y:null}const o=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),i=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(v=>t.searchFields.some(y=>{const k=V(v,y);return String(k).toLowerCase().includes(a)}))}),g=e.computed(()=>(t.pagination,i.value)),$=e.computed(()=>!!t.virtualScroll),T=e.computed(()=>{const a=Number(t.virtualRowHeight);return Number.isFinite(a)&&a>0?a:36}),z=e.computed(()=>{const a=Number(t.virtualBuffer);return Number.isFinite(a)&&a>=0?Math.floor(a):5}),A=e.ref(0),P=e.ref(0),ne=e.computed(()=>$.value?g.value.length*T.value:0),J=e.computed(()=>$.value?A.value*T.value:0),me=e.computed(()=>{if(!$.value)return 0;const a=ne.value-J.value-(P.value-A.value)*T.value;return a>0?a:0}),j=e.computed(()=>{if(!$.value)return g.value.map((k,b)=>({item:k,index:b}));if(g.value.length===0)return[];const a=Math.max(0,Math.min(A.value,g.value.length)),v=Math.max(a,Math.min(g.value.length,P.value)),y=[];for(let k=a;k<v;k++)g.value[k]&&y.push({item:g.value[k],index:k});return y}),q=e.computed(()=>{if(!t.selectable)return!1;const v=j.value.map(({item:y,index:k})=>({key:ge(y,k),item:y,index:k})).filter(({item:y,index:k})=>!xe(y,k)).map(({key:y})=>y);return v.length>0&&v.every(y=>r.value.includes(y))}),Z=e.computed(()=>{if(!t.selectable||q.value)return!1;const v=j.value.map(({item:k,index:b})=>({key:ge(k,b),item:k,index:b})).filter(({item:k,index:b})=>!xe(k,b)).map(({key:k})=>k);if(v.length===0)return!1;const y=v.filter(k=>r.value.includes(k)).length;return y>0&&y<v.length}),ce=e.computed(()=>{if(!t.selectable)return!1;const a=j.value.map(({item:v,index:y})=>({item:v,index:y}));return a.length>0&&a.every(({item:v,index:y})=>xe(v,y))}),ue=e.computed(()=>t.pagination?g.value.length<m.value:!1),ve=e.computed(()=>{const a=[];let v=t.selectable?60:0;for(let y=0;y<t.columns.length;y++){const k=t.columns[y];if(k.fixed==="left"){let b=80;const _=s(k.width);_!==null?b=_:M.value[y]&&(b=s(M.value[y])??b),a.push(v),v+=b}}return a}),ye=e.computed(()=>{const a=[];let v=0;const y=[];for(let k=t.columns.length-1;k>=0;k--){const b=t.columns[k];if(b.fixed==="right"){let _=80;const re=s(b.width);re!==null?_=re:M.value[k]&&(_=s(M.value[k])??_),y.push({index:k,width:_})}}for(let k=0;k<y.length;k++)a.push(v),v+=y[k].width;return a});function Te(a,v){if(v==="left"){let y=0;for(let k=0;k<a;k++)t.columns[k].fixed==="left"&&y++;return y}else{let y=0;for(let k=t.columns.length-1;k>a;k--)t.columns[k].fixed==="right"&&y++;return y}}function ge(a,v){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||v}function xe(a,v){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,v):!1}function d(a){return B.value.has(a)}function h(a){B.value.has(a)?B.value.delete(a):B.value.add(a)}function V(a,v){return v.split(".").reduce((y,k)=>y==null?void 0:y[k],a)}function H(a,v=!1){const y=[];return a.align&&y.push(`text-${a.align}`),a.fixed==="right"&&(y.push("col-fixed-right"),v&&y.push("col-fixed-right-header")),a.fixed==="left"&&(y.push("col-fixed-left"),v&&y.push("col-fixed-left-header")),y.join(" ")}function ie(a,v,y){const k={},b=w(a.width);if(b)k.width=b,k.minWidth=b,k.maxWidth=b;else{const _=F();k.width=_,k.minWidth=_,k.maxWidth=_}if(a.fixed==="left"){const _=Te(v,"left"),re=ve.value[_]||0;k.left=`${re}px`,k.zIndex=y?`${10+_}`:`${5+_}`}else if(a.fixed==="right"){const _=Te(v,"right"),re=ye.value[_]||0;y?k.right=`${re-3}px`:k.right=`${re}px`,k.zIndex=y?`${10+_}`:`${5+_}`}return k}function de(a,v){const y=V(a,v.key);return v.formatter?v.formatter(y,a):y||""}function fe(a){const v=g.value.find((k,b)=>ge(k,b)===a),y=g.value.findIndex((k,b)=>ge(k,b)===a);v&&y>=0&&xe(v,y)||(r.value.includes(a)?r.value=r.value.filter(k=>k!==a):r.value=[...r.value,a],l("select",r.value),l("update:selectedItems",r.value))}function Ce(){const a=g.value.map((v,y)=>({key:ge(v,y),item:v,index:y})).filter(({item:v,index:y})=>!xe(v,y)).map(({key:v})=>v);if(a.length!==0){if(a.every(v=>r.value.includes(v)))r.value=r.value.filter(v=>!a.includes(v));else{const v=new Set([...r.value,...a]);r.value=Array.from(v)}l("select",r.value),l("update:selectedItems",r.value)}}function Ne(){r.value=[],l("select",r.value),l("update:selectedItems",r.value)}function je(a,v){if(!t.rowSelectable)return;const y=ge(a,v);xe(a,v)||(t.requireDeselectBeforeSelect?N.value.includes(y)?(N.value=N.value.filter(k=>k!==y),l("row-click",a,null)):(N.value=[...N.value,y],l("row-click",a,y)):N.value.includes(y)?(N.value=[],l("row-click",a,null)):(N.value=[y],l("row-click",a,y)))}function Ue(a,v){if(!t.rowSelectable)return!1;const y=ge(a,v);return N.value.includes(y)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const v=new Set(r.value),y=new Set(a);(v.size!==y.size||![...v].every(k=>y.has(k)))&&(r.value=[...a])}else a===void 0&&r.value.length>0&&(r.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{p.value=1}),e.watch(()=>t.data,()=>{t.total||(p.value=1),t.rowSelectable&&(N.value=[]),e.nextTick(()=>{requestAnimationFrame(()=>{if($.value&&u.value){const a=u.value.clientHeight;if(a>0){const v=T.value,y=z.value,k=Math.ceil(a/v)+y*2;A.value=0,P.value=Math.min(g.value.length,k)}else setTimeout(()=>{if(u.value){const v=u.value.clientHeight;if(v>0){const y=T.value,k=z.value,b=Math.ceil(v/y)+k*2;A.value=0,P.value=Math.min(g.value.length,b)}}},100)}else A.value=0,P.value=g.value.length})})},{deep:!0});function ze(a){p.value=a,t.rowSelectable&&(N.value=[]),l("page-change",a)}function he(a){m.value=a,p.value=1,t.rowSelectable&&(N.value=[]),l("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const v=typeof a=="number"&&a>0?a:1;p.value!==v&&(p.value=v)}),e.watch(()=>t.pageSize,a=>{const v=typeof a=="number"&&a>0?a:10;m.value!==v&&(m.value=v)});function ke(){C.value&&e.nextTick(()=>{const a=C.value.getBoundingClientRect(),v=window.innerHeight,y=a.top,k=C.value.querySelector(".table-header"),b=k?k.offsetHeight:40;let _=0;if(t.pagination){const De=C.value.querySelector(".ypagination");_=De?De.offsetHeight:60}const re=C.value.querySelector(".bulk-bar"),we=re?re.offsetHeight:0,Ke=b+_+we+20,We=v-y-Ke,Ae=Math.max(200,We),Pe=C.value.querySelector(".table-body-wrap .table");Pe&&(Pe.offsetHeight>We?S.value=`${Ae}px`:S.value="none")})}let Ve=!1;function Se(){!f.value||!u.value||Ve||f.value.scrollLeft!==u.value.scrollLeft&&(Ve=!0,f.value.scrollLeft=u.value.scrollLeft,requestAnimationFrame(()=>{Ve=!1}))}function lt(){!f.value||!u.value||Ve||u.value.scrollLeft!==f.value.scrollLeft&&(Ve=!0,u.value.scrollLeft=f.value.scrollLeft,requestAnimationFrame(()=>{Ve=!1}))}function He(){e.nextTick(()=>{if(!u.value)return;const a=u.value,v=a.scrollHeight,y=a.clientHeight,k=a.scrollTop,b=v>y+1;if(W.value.show=b,!b)return;const _=24,re=y/v,we=G.value?G.value.clientHeight:y,be=Math.max(_,Math.floor(we*re));W.value.thumbHeight=be;const Ke=Math.max(0,we-be),We=Math.max(1,v-y);if(W.value.thumbTop=Math.min(Ke,Math.floor(k/We*Ke)),$.value&&y>0){const qe=T.value,Ae=z.value,Pe=g.value.length,De=Math.floor(k/qe)-Ae,xt=Math.ceil(y/qe)+Ae*2,Et=De+xt;A.value=Math.max(0,De),P.value=Math.min(Pe,Et)}})}function ot(a){if(!U||!u.value||!G.value)return;a.preventDefault();const v=G.value.clientHeight,y=Math.max(0,v-W.value.thumbHeight),k=u.value,b=k.scrollHeight,_=k.clientHeight,re=Math.max(1,b-_),be=(a.clientY-Q)/Math.max(1,y)*re;k.scrollTop=Math.min(re,Math.max(0,O+be)),He()}function at(){U=!1,window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",at)}function it(){e.nextTick(()=>{var y,k;if(M.value.length===t.columns.length&&M.value.every(b=>!!b))return;const a=[];t.columns.forEach((b,_)=>{const re=w(b.width);if(re)a.push(re),R.value[b.key]=re;else if(R.value[b.key])a.push(R.value[b.key]);else{const we=M.value[_];if(we)a.push(we),R.value[b.key]=we;else{const be=F();a.push(be),R.value[b.key]=be}}});const v=(y=x.value)==null?void 0:y.querySelector("tbody tr");if(v){const b=t.selectable?1:0,_=Array.from(v.children);for(let re=0;re<t.columns.length;re++)if(!a[re]){const we=_[b+re];if(we&&we.clientWidth>0){const be=`${we.clientWidth}px`;a[re]=be,R.value[t.columns[re].key]=be}else{const be=F();a[re]=be,R.value[t.columns[re].key]=be}}}else for(let b=0;b<a.length;b++)if(!a[b]){const _=R.value[((k=t.columns[b])==null?void 0:k.key)||""];a[b]=_||M.value[b]||"80px",t.columns[b]&&(R.value[t.columns[b].key]=a[b])}M.value=a})}function Re(){ke(),Ee(),_e()}e.watch(()=>t.data,()=>{e.nextTick(()=>{ke(),Se(),Ee(),B.value.clear()})},{deep:!0}),e.watch([p,m],()=>{e.nextTick(()=>{ke(),Se(),Ee()})}),e.watch(()=>t.columns,()=>{const a=[],v={...R.value};t.columns.forEach((k,b)=>{const _=w(k.width);_?(a.push(_),v[k.key]=_):v[k.key]?a.push(v[k.key]):M.value[b]?(a.push(M.value[b]),v[k.key]=M.value[b]):a.push("")});const y=new Set(t.columns.map(k=>k.key));Object.keys(v).forEach(k=>{y.has(k)||delete v[k]}),R.value=v,M.value=a,e.nextTick(()=>{it(),Se(),Ee(),_e()})},{deep:!0});function rt(){e.nextTick(()=>{if(!f.value)return;const a=f.value.querySelector(".table");if(a&&r.value.length===0){const v=a.querySelector("thead th:not(.col-select):not(.col-expand)");v&&v.offsetHeight>0&&(I.value=v.offsetHeight)}})}function _e(){e.nextTick(()=>{if(!f.value)return;const a=f.value.querySelector(".table");if(!a)return;const v=a.querySelector(".col-selected-header");if(v){const y=v.querySelector(".selected-header-wrapper");y&&(y.style.height=`${I.value}px`)}else rt()})}e.watch(()=>r.value,()=>{e.nextTick(()=>{ke(),Ee(),_e()})},{deep:!0}),e.watch(()=>t.loading,(a,v)=>{e.nextTick(()=>{Ee(),v===!0&&a===!1&&$.value&&requestAnimationFrame(()=>{if(u.value){const y=u.value.clientHeight,k=T.value,b=z.value,_=Math.ceil(y/k)+b*2;A.value=0,P.value=Math.min(g.value.length,_),He()}})})}),e.onMounted(()=>{var a,v;e.nextTick(()=>{ke(),it(),Ee(),He(),$.value&&u.value&&requestAnimationFrame(()=>{if(u.value){const y=u.value.clientHeight;if(y>0){const k=T.value,b=z.value,_=Math.ceil(y/k)+b*2;A.value=0,P.value=Math.min(g.value.length,_)}else setTimeout(()=>{if(u.value){const k=u.value.clientHeight;if(k>0){const b=T.value,_=z.value,re=Math.ceil(k/b)+_*2;A.value=0,P.value=Math.min(g.value.length,re)}}},100)}}),rt(),_e()}),window.addEventListener("resize",Re),window.addEventListener("scroll",Re,!0),(a=u.value)==null||a.addEventListener("scroll",()=>{Se(),He(),Ee()},{passive:!0}),(v=f.value)==null||v.addEventListener("scroll",()=>{lt()},{passive:!0}),e.nextTick(()=>Se()),u.value&&typeof ResizeObserver<"u"&&($e=new ResizeObserver(()=>{Ee()}),$e.observe(u.value))}),e.onUnmounted(()=>{var a,v;window.removeEventListener("resize",Re),window.removeEventListener("scroll",Re,!0),(a=u.value)==null||a.removeEventListener("scroll",Se),(v=f.value)==null||v.removeEventListener("scroll",lt),window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",at),$e&&($e.disconnect(),$e=null)});let st=-1;function Ee(){!f.value||!u.value||requestAnimationFrame(()=>{if(!f.value||!u.value)return;const a=u.value,v=Math.ceil(a.offsetWidth-a.clientWidth);if(ee.value=v,v!==st){st=v;const y=f.value.querySelector(".table"),k=x.value;y&&k&&(f.value.style.paddingRight="0px",y.style.width="",y.style.marginRight="",v>0?(f.value.style.paddingRight=`${v}px`,y.style.width="100%",y.style.marginRight=`-${v}px`):(f.value.style.paddingRight="0px",y.style.width="100%",y.style.marginRight="0px"))}})}let $e=null;return e.onUnmounted(()=>{E.value.clear()}),(a,v)=>{const y=e.resolveComponent("YButton"),k=e.resolveComponent("ypaginationY");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:C},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[r.value.length&&n.showBulkActions?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("div",Kt,"已选择 "+e.toDisplayString(r.value.length)+" 项",1),e.createElementVNode("div",Wt,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:r.value,clearSelection:Ne},()=>[e.createVNode(y,{size:"small",class:"btn",onClick:Ne},{default:e.withCtx(()=>[...v[3]||(v[3]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",{class:e.normalizeClass(["card",`ytable-size-${n.size}`])},[D.value?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-all-hints-btn",{"is-expanded":Y.value}]),onClick:oe,title:Y.value?"收起所有提示标签":"展开所有提示标签"},[Y.value?(e.openBlock(),e.createElementBlock("svg",Ft,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M15 18L9 12L15 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Yt,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],10,Pt)])):e.createCommentVNode("",!0),n.selectedHeaderFloat&&r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:Ne},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:f},[e.createElementVNode("table",jt,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",Ut)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",qt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("col",{key:b.key,style:e.normalizeStyle({width:M.value[_]||void 0,minWidth:M.value[_]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",Gt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("th",Zt,[e.createElementVNode("div",Qt,[e.createElementVNode("input",{type:"checkbox",checked:q.value,indeterminate:Z.value,disabled:ce.value,onChange:Ce},null,40,Jt),r.value.length>0?(e.openBlock(),e.createElementBlock("span",Xt,e.toDisplayString(r.value.length),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),!n.selectedHeaderFloat&&r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("th",{key:2,colspan:n.columns.length,class:"col-selected-header",style:{width:"100%"}},[e.createElementVNode("div",tn,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:Ne},void 0,!0)])],8,en)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("th",{key:b.key,class:e.normalizeClass(H(b,!0)),style:e.normalizeStyle(ie(b,_,!0))},e.toDisplayString(b.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":n.loading,"is-empty":!g.value.length&&!n.loading}]),ref_key:"bodyWrapRef",ref:u,style:e.normalizeStyle({maxHeight:S.value})},[n.loading?(e.openBlock(),e.createElementBlock("div",nn,[...v[6]||(v[6]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!g.value.length&&!n.loading?(e.openBlock(),e.createElementBlock("div",ln,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":n.loading}]),ref_key:"bodyTableRef",ref:x},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",on)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",an)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("col",{key:b.key,style:e.normalizeStyle({width:M.value[_]||void 0,minWidth:M.value[_]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[$.value&&J.value>0?(e.openBlock(),e.createElementBlock("tr",rn,[e.createElementVNode("td",{colspan:o.value,style:e.normalizeStyle({height:J.value+"px",borderBottom:"none",padding:0})},null,12,sn)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,b=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ge(b.item,b.index)},[e.createElementVNode("tr",{class:e.normalizeClass({"row-selected":Ue(b.item,b.index)}),onClick:_=>je(b.item,b.index)},[t.expandable?(e.openBlock(),e.createElementBlock("td",dn,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:e.withModifiers(_=>h(ge(b.item,b.index)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":d(ge(b.item,b.index))}])},null,2)],8,un)])):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("td",{key:1,class:"col-select",onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("input",{type:"checkbox",value:ge(b.item,b.index),checked:r.value.includes(ge(b.item,b.index)),disabled:xe(b.item,b.index),onChange:e.withModifiers(_=>fe(ge(b.item,b.index)),["stop"])},null,40,fn)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(_,re)=>(e.openBlock(),e.createElementBlock("td",{key:_.key,class:e.normalizeClass(H(_)),style:e.normalizeStyle(ie(_,re,!1))},[e.renderSlot(a.$slots,`cell-${_.key}`,{item:b.item,value:V(b.item,_.key),index:b.index},()=>[e.createTextVNode(e.toDisplayString(de(b.item,_)),1)],!0)],6))),128))],10,cn),t.expandable&&d(ge(b.item,b.index))?(e.openBlock(),e.createElementBlock("tr",{key:`${ge(b.item,b.index)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:o.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:b.item,index:b.index},void 0,!0)],8,mn)])):e.createCommentVNode("",!0)],64))),128)),$.value&&me.value>0?(e.openBlock(),e.createElementBlock("tr",vn,[e.createElementVNode("td",{colspan:o.value,style:e.normalizeStyle({height:me.value+"px",borderBottom:"none",padding:0})},null,12,hn)])):e.createCommentVNode("",!0)])],2)],6),n.pagination?(e.openBlock(),e.createBlock(k,{key:2,class:"align-right","current-page":p.value,"onUpdate:currentPage":v[1]||(v[1]=b=>p.value=b),"page-size":m.value,"onUpdate:pageSize":v[2]||(v[2]=b=>m.value=b),loading:t.loading,"disable-next":ue.value,"page-size-options":n.pageSizeOptions,total:t.total,"show-total":t.showTotal,onPageChange:ze,onPageSizeChange:he},null,8,["current-page","page-size","loading","disable-next","page-size-options","total","show-total"])):e.createCommentVNode("",!0)],2)],512)}}}),ft=pe(pn,[["__scopeId","data-v-1417e4c8"]]),gn=["onKeydown","aria-expanded"],yn={key:0,class:"yselect__tags"},kn=["src"],wn={class:"yselect__tag-text"},bn=["onClick"],Cn={key:1,class:"yselect__placeholder-text"},xn=["src"],En=["placeholder","onKeydown"],Bn=["onClick","onMouseenter"],Nn={key:0,class:"yselect__option-check"},Vn={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},Sn=["src"],Dn=e.defineComponent({__name:"yselect",props:{modelValue:{},options:{},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},clearTo:{default:void 0},filterable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(-1),r=e.ref(),N=e.ref(),B=e.ref(),S=e.ref(!1),C=e.ref(),f=e.ref(""),u=e.computed(()=>t.multiple?null:t.options.find(w=>D(w)===t.modelValue)||null),x=e.computed(()=>{if(!t.multiple)return[];const w=Array.isArray(t.modelValue)?t.modelValue:[];return t.options.filter(s=>w.includes(D(s)))}),M=e.computed(()=>{if(t.multiple){const w=x.value.length;return w===0?"":`已选择 ${w} 项`}return u.value?Y(u.value):""}),R=e.computed(()=>{if(!t.filterable)return t.options;const w=f.value.trim().toLowerCase();return w?t.options.filter(s=>{const o=Y(s);return String(o).toLowerCase().includes(w)}):t.options}),I=e.computed(()=>{var g;const w={position:"fixed",zIndex:"100001"},s=N.value;if(!s)return w;const o=s.getBoundingClientRect(),i=((g=B.value)==null?void 0:g.getBoundingClientRect().width)||o.width;return w.left=`${o.left}px`,w.width=`${i}px`,S.value?(w.bottom=`${window.innerHeight-o.top+4}px`,w.top="auto"):w.top=`${o.bottom+4}px`,w});function E(){!p.value||!N.value||e.nextTick(()=>{const w=N.value;if(!w)return;const s=w.getBoundingClientRect(),o=window.innerHeight,i=200,g=s.bottom+i+4,$=s.top-i-4,T=g<=o-20,z=$>=20;S.value=!T&&z})}function D(w){return typeof w=="object"&&w!==null?w[t.valueKey]:w}function Y(w){return typeof w=="object"&&w!==null?w[t.labelKey]||String(w[t.valueKey]):String(w)}function se(w,s){return typeof w=="object"&&w!==null&&w.id!==void 0?w.id:D(w)||s}function X(w){return t.multiple?(Array.isArray(t.modelValue)?t.modelValue:[]).includes(D(w)):D(w)===t.modelValue}function L(w){return typeof w=="object"&&w!==null?w[t.disabledKey]===!0:!1}function K(){t.disabled||(p.value?ae():oe())}function oe(){t.disabled||(p.value=!0,e.nextTick(()=>{E(),U(),t.filterable&&C.value&&(C.value.focus(),f.value="")}))}function ae(){p.value=!1,m.value=-1,S.value=!1,t.filterable&&(f.value="")}function le(w,s){if(L(w))return;const o=D(w);if(t.multiple){const i=Array.isArray(t.modelValue)?[...t.modelValue]:[],g=D(w),$=i.indexOf(g);$>-1?i.splice($,1):i.push(g),l("update:modelValue",i),l("change",i,x.value)}else l("update:modelValue",o),l("change",o,w),ae()}function te(){if(!t.clearable||t.disabled)return;const w=t.multiple?t.clearTo!==void 0?t.clearTo:[]:t.clearTo;l("update:modelValue",w),l("change",w,t.multiple?[]:null),l("clear"),t.multiple||ae()}function F(w,s){if(s.stopPropagation(),t.disabled||!t.multiple)return;const o=Array.isArray(t.modelValue)?[...t.modelValue]:[],i=D(w),g=o.indexOf(i);g>-1&&(o.splice(g,1),l("update:modelValue",o),l("change",o,x.value))}function G(w){if(!R.value||R.value.length===0){m.value=-1;return}let s=m.value;const o=R.value.length;s===-1?s=w>0?0:o-1:s=(s+w+o)%o;let i=0;for(;i<o&&L(R.value[s]);)s=(s+w+o)%o,i++;m.value=i>=o?-1:s,Q()}function W(){if(m.value<0)return;const w=R.value[m.value];!w||L(w)||le(w,m.value)}function U(){if(!r.value)return;const w=r.value.querySelector(".yselect__option--selected");w&&w.scrollIntoView({block:"nearest"})}function Q(){if(!r.value||m.value<0)return;const s=r.value.querySelectorAll(".yselect__option")[m.value];s&&s.scrollIntoView({block:"nearest"})}function O(w){const s=w.target;(!B.value||!B.value.contains(s))&&ae()}e.watch(()=>t.modelValue,()=>{m.value=-1});function ee(){p.value&&E()}return e.onMounted(()=>{document.addEventListener("click",O),window.addEventListener("resize",ee),window.addEventListener("scroll",ee,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",O),window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee,!0)}),(w,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":n.disabled,[`yselect--${n.size}`]:!0}]),style:e.normalizeStyle({width:n.width}),ref_key:"selectContainer",ref:B},[e.createElementVNode("div",{ref_key:"triggerElement",ref:N,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":p.value,"yselect__trigger--disabled":n.disabled,"yselect__trigger--error":n.error}]),onMousedown:e.withModifiers(K,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(K,["prevent"]),["enter"]),e.withKeys(e.withModifiers(K,["prevent"]),["space"]),e.withKeys(ae,["escape"]),e.withKeys(e.withModifiers(oe,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(oe,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":p.value,"aria-haspopup":!0},[!n.filterable||!p.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!M.value}])},[e.renderSlot(w.$slots,"value",{value:t.multiple?x.value:u.value,label:M.value,multiple:t.multiple},()=>{var o;return[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[x.value.length>0?(e.openBlock(),e.createElementBlock("div",yn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(i,g)=>(e.openBlock(),e.createElementBlock("span",{key:se(i,g),class:"yselect__tag"},[i!=null&&i.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:i.flagImg,alt:"flag"},null,8,kn)):e.createCommentVNode("",!0),e.createElementVNode("span",wn,e.toDisplayString(Y(i)),1),n.clearable&&!n.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"yselect__tag-close",onClick:e.withModifiers($=>F(i,$),["stop"])},[...s[8]||(s[8]=[e.createElementVNode("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[e.createElementVNode("path",{d:"M2.5 2.5l5 5M7.5 2.5l-5 5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})],-1)])],8,bn)):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("span",Cn,e.toDisplayString(n.placeholder),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(o=u.value)!=null&&o.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:u.value.flagImg,alt:"flag"},null,8,xn)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(M.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.placeholder),1)],64))],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:C,class:"yselect__input",type:"text",placeholder:t.multiple?x.value.length>0?`已选择 ${x.value.length} 项`:n.placeholder:M.value||n.placeholder,"onUpdate:modelValue":s[0]||(s[0]=o=>f.value=o),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(o=>G(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(o=>G(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(o=>W(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(ae,["prevent"]),["esc"]),e.withKeys(e.withModifiers(te,["prevent"]),["delete"])]},null,40,En)),[[e.vModelText,f.value]]),n.clearable&&!n.disabled&&(t.multiple?x.value.length>0:u.value)?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(te,["stop"])},[...s[9]||(s[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 3l6 6M9 3L3 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["yselect__arrow",{"yselect__arrow--open":p.value}])},[...s[10]||(s[10]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],42,gn),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":S.value}]),style:e.normalizeStyle(I.value),onMousedown:s[6]||(s[6]=e.withModifiers(()=>{},["stop"])),onClick:s[7]||(s[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"yselect__options",ref_key:"optionsContainer",ref:r},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:se(o,i),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":X(o),"yselect__option--disabled":L(o),"yselect__option--hover":m.value===i}]),onClick:g=>le(o),onMouseenter:g=>m.value=i,onMouseleave:s[5]||(s[5]=g=>m.value=-1)},[e.renderSlot(w.$slots,"option",{option:o,index:i,selected:X(o)},()=>[t.multiple?(e.openBlock(),e.createElementBlock("span",Nn,[X(o)?(e.openBlock(),e.createElementBlock("svg",Vn,[...s[11]||(s[11]=[e.createElementVNode("path",{d:"M2 7l3 3 7-7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o!=null&&o.flagImg?(e.openBlock(),e.createElementBlock("img",{key:1,class:"yselect__flag",src:o.flagImg,alt:"flag"},null,8,Sn)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(Y(o)),1)],!0)],42,Bn))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Xe=pe(Dn,[["__scopeId","data-v-b08c47e4"]]),Tn={class:"ypagination"},$n={key:0,class:"page-info"},Mn={class:"page-actions"},In={class:"page-size-select"},Ln=e.defineComponent({__name:"ypagination",props:{currentPage:{},pageSize:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"10/页",value:10},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},disableNext:{type:Boolean,default:!1},total:{},showTotal:{type:Boolean,default:!0}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(t.pageSize),m=e.computed(()=>t.pageSizeOptions),r=e.computed({get:()=>t.currentPage,set:C=>{l("update:currentPage",C),l("page-change",C)}});function N(C){t.loading||C>=1&&C!==t.currentPage&&(r.value=C)}function B(C){t.loading||(p.value=C,l("update:pageSize",C),l("page-size-change",C),r.value=1)}function S(C){t.loading||(C==="prev"?N(r.value-1):C==="next"&&N(r.value+1))}return p.value=t.pageSize,e.watch(()=>t.pageSize,C=>{typeof C=="number"&&p.value!==C&&(p.value=C)}),(C,f)=>{const u=e.resolveComponent("YButton"),x=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",Tn,[n.showTotal&&n.total!==void 0&&n.total!==null?(e.openBlock(),e.createElementBlock("div",$n,[e.createElementVNode("span",null,"共 "+e.toDisplayString(n.total)+" 条",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Mn,[e.createVNode(u,{size:"small",variant:"secondary",disabled:r.value===1||n.loading,onClick:f[0]||(f[0]=M=>N(1))},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(u,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:r.value===1||n.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:n.loading||n.disableNext,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:S},null,8,["groupItems"]),e.createElementVNode("div",In,[e.createVNode(x,{modelValue:p.value,"onUpdate:modelValue":f[1]||(f[1]=M=>p.value=M),options:m.value,size:"small",width:"105px",clearable:!1,disabled:n.loading,onChange:B},null,8,["modelValue","options","disabled"])])])])}}}),mt=pe(Ln,[["__scopeId","data-v-43d494c6"]]),zn=["aria-label"],Hn={class:"y-badge__inner"},Rn={key:0,class:"y-badge__progress","aria-hidden":"true"},_n={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Kn={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Wn={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},An={key:1,class:"y-badge__icon","aria-hidden":"true"},Pn={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Fn={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Yn={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},On={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},jn={class:"y-badge__label"},Un=e.defineComponent({__name:"ybadge",props:{tone:{default:"default"},size:{default:"medium"},progress:{default:void 0},icon:{default:void 0},pill:{type:Boolean,default:!0},outline:{type:Boolean,default:!1},label:{default:""}},setup(n){const c=n,t=e.computed(()=>c.tone||"default"),l=e.computed(()=>{const p=(c.label||"").trim(),m=c.tone,r=c.progress;if(r){const N={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return p?`${p},进度:${N[r]||r}`:`进度:${N[r]||r}`}if(m&&m!=="default"){const N={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return p?`${p},语气:${N[m]||m}`:`语气:${N[m]||m}`}return p||"标记"});return(p,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${n.size}`,{"is-outline":n.outline,"is-pill":n.pill},n.progress?`y-badge--progress-${n.progress}`:""]]),role:"status","aria-label":l.value},[e.createElementVNode("span",Hn,[n.progress?(e.openBlock(),e.createElementBlock("span",Rn,[n.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",_n,[...m[0]||(m[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):n.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Kn,[...m[1]||(m[1]=[e.createElementVNode("path",{d:"M10 5a5 5 0 100 10V5z"},null,-1),e.createElementVNode("circle",{cx:"10",cy:"10",r:"5",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1)])])):n.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",Wn,[...m[2]||(m[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)])):n.icon?(e.openBlock(),e.createElementBlock("span",An,[n.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Pn,[...m[3]||(m[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):n.icon==="check"?(e.openBlock(),e.createElementBlock("svg",Fn,[...m[4]||(m[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):n.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Yn,[...m[5]||(m[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",On,[...m[6]||(m[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",jn,[e.renderSlot(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)])])],10,zn))}}),vt=pe(Un,[["__scopeId","data-v-ce819797"]]),qn=["aria-hidden"],Gn=["onKeydown"],Zn={key:0,class:"y-dialog-header"},Qn={class:"y-dialog-title"},Jn={class:"y-dialog-body"},Xn={key:1,class:"y-dialog-footer"},el=e.defineComponent({__name:"ydialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},width:{default:"520px"},top:{default:"15vh"},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:100001},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(n,{emit:c}){const t=n,l=c,p=e.computed({get:()=>t.modelValue,set:f=>l("update:modelValue",f)}),m=e.ref(null),r=e.computed(()=>{const f={};return f.width=typeof t.width=="number"?`${t.width}px`:String(t.width),f.margin="0 auto",f.top=t.top,f});function N(){t.maskClosable&&B()}function B(){p.value&&(p.value=!1,l("close"))}function S(){t.closable&&B()}function C(f){f.key==="Escape"&&S()}return e.watch(()=>t.modelValue,f=>{f?(l("open"),requestAnimationFrame(()=>{var u;return(u=m.value)==null?void 0:u.focus()}),document.addEventListener("keydown",C),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",C),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",C),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",C),document.body.style.overflow=""}),(f,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:N}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-dialog-panel",[n.center?"is-center":""]]),style:e.normalizeStyle(r.value),onKeydown:e.withKeys(e.withModifiers(S,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Zn,[e.renderSlot(f.$slots,"header",{},()=>[e.createElementVNode("div",Qn,e.toDisplayString(n.title),1)],!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:B}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Jn,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),f.$slots.footer?(e.openBlock(),e.createElementBlock("div",Xn,[e.renderSlot(f.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Gn),[[e.vShow,p.value]])]),_:3})],12,qn),[[e.vShow,p.value]])]))}}),ht=pe(el,[["__scopeId","data-v-b4d84def"]]),tl={class:"ypopover__inner"},nl=e.defineComponent({__name:"ypopover",props:{trigger:{default:"click"},placement:{default:"bottom"},showArrow:{type:Boolean,default:!0},showPadding:{type:Boolean,default:!0},dark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDelay:{default:0},closeDelay:{default:200},closeOnClickOutside:{type:Boolean,default:!0},closeOnClickContent:{type:Boolean,default:!1},width:{default:"auto"},maxWidth:{default:"300px"},offset:{default:8},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","show","hide","before-show","before-hide"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(),r=e.ref(),N=e.ref(),B=e.ref(!1),S=e.ref(),C=e.ref(),f=e.ref({});let u=null,x=null;const M=e.computed(()=>{if(!B.value||!S.value)return{};const W={};l.width!=="auto"&&(W.width=typeof l.width=="number"?`${l.width}px`:l.width),l.maxWidth&&(W.maxWidth=typeof l.maxWidth=="number"?`${l.maxWidth}px`:l.maxWidth);const{top:U,left:Q}=I();return W.top=`${U}px`,W.left=`${Q}px`,W}),R=e.computed(()=>{if(!l.showArrow)return{};if(Object.keys(f.value).length>0)return f.value;const W={};return l.placement.startsWith("top")||l.placement.startsWith("bottom")?W.left="50%":W.top="50%",W});function I(){var $,T;if(!S.value)return{top:0,left:0};const{width:W,height:U,top:Q,left:O}=S.value,ee=(($=N.value)==null?void 0:$.offsetWidth)||200,w=((T=N.value)==null?void 0:T.offsetHeight)||100;let s=0,o=0;switch(l.placement){case"top":s=Q-w-l.offset,o=O+(W-ee)/2;break;case"top-start":s=Q-w-l.offset,o=O;break;case"top-end":s=Q-w-l.offset,o=O+W-ee;break;case"bottom":s=Q+U+l.offset,o=O+(W-ee)/2;break;case"bottom-start":s=Q+U+l.offset,o=O;break;case"bottom-end":s=Q+U+l.offset,o=O+W-ee;break;case"left":s=Q+(U-w)/2,o=O-ee-l.offset;break;case"left-start":s=Q,o=O-ee-l.offset;break;case"left-end":s=Q+U-w,o=O-ee-l.offset;break;case"right":s=Q+(U-w)/2,o=O+W+l.offset;break;case"right-start":s=Q,o=O+W+l.offset;break;case"right-end":s=Q+U-w,o=O+W+l.offset;break}const i=window.innerWidth,g=window.innerHeight;return o<8&&(o=8),o+ee>i-8&&(o=i-ee-8),s<8&&(s=8),s+w>g-8&&(s=g-w-8),{top:s,left:o}}function E(){l.disabled||B.value||(X(),l.openDelay>0?u=setTimeout(()=>{D()},l.openDelay):D())}function D(){p("before-show"),B.value=!0,p("update:modelValue",!0),p("show"),e.nextTick(()=>{e.nextTick(()=>{K()})})}function Y(){B.value&&(X(),l.closeDelay>0?x=setTimeout(()=>{se()},l.closeDelay):se())}function se(){p("before-hide"),B.value=!1,p("update:modelValue",!1),p("hide")}function X(){u&&(clearTimeout(u),u=null),x&&(clearTimeout(x),x=null)}function L(){if(!l.showArrow||!S.value||!N.value){f.value={};return}const W=S.value,U=N.value.getBoundingClientRect();if(U.width===0||U.height===0){const O={};l.placement.startsWith("top")||l.placement.startsWith("bottom")?O.left="50%":O.top="50%",f.value=O;return}const Q={};if(l.placement.startsWith("top")){Q.bottom="-6px";const O=W.left+W.width/2,ee=U.left,w=O-ee;Q.left=`${Math.max(12,Math.min(w,U.width-12))}px`}else if(l.placement.startsWith("bottom")){Q.top="-6px";const O=W.left+W.width/2,ee=U.left,w=O-ee;Q.left=`${Math.max(12,Math.min(w,U.width-12))}px`}else if(l.placement.startsWith("left")){Q.right="-6px";const O=W.top+W.height/2,ee=U.top,w=O-ee;Q.top=`${Math.max(12,Math.min(w,U.height-12))}px`}else if(l.placement.startsWith("right")){Q.left="-6px";const O=W.top+W.height/2,ee=U.top,w=O-ee;Q.top=`${Math.max(12,Math.min(w,U.height-12))}px`}f.value=Q}function K(){r.value&&(S.value=r.value.getBoundingClientRect(),N.value&&(C.value=N.value.getBoundingClientRect(),L(),B.value&&requestAnimationFrame(()=>{N.value&&(C.value=N.value.getBoundingClientRect(),L())})))}function oe(){l.disabled||l.trigger==="click"&&(B.value?Y():E())}function ae(){l.disabled||l.trigger!=="hover"||(X(),E())}function le(){l.disabled||l.trigger!=="hover"||Y()}function te(){l.disabled||l.trigger!=="hover"||X()}function F(){l.disabled||l.trigger!=="hover"||Y()}function G(W){if(!l.closeOnClickOutside||!B.value)return;const U=W.target;m.value&&!m.value.contains(U)&&N.value&&!N.value.contains(U)&&Y()}return e.watch(()=>l.modelValue,W=>{W!==B.value&&(W?E():Y())}),e.watch(B,W=>{W?(document.addEventListener("click",G),window.addEventListener("resize",K),window.addEventListener("scroll",K,!0),e.nextTick(()=>{K(),requestAnimationFrame(()=>{K()}),setTimeout(()=>{K()},0)})):(document.removeEventListener("click",G),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0))}),e.onMounted(()=>{l.modelValue&&E()}),e.onUnmounted(()=>{X(),document.removeEventListener("click",G),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0)}),c({show:E,hide:Y,updatePosition:K}),(W,U)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:m},[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,onClick:oe,onMouseenter:ae,onMouseleave:le},[e.renderSlot(W.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:N,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${n.placement}`,{"ypopover__content--dark":n.dark,"ypopover__content--no-padding":!n.showPadding}]]),style:e.normalizeStyle(M.value),onClick:U[0]||(U[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:te,onMouseleave:F},[n.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${n.placement}`]),style:e.normalizeStyle(R.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",tl,[e.renderSlot(W.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),pt=pe(nl,[["__scopeId","data-v-6d9a965e"]]),ll={class:"relative"},ol=["value","placeholder"],al={class:"nh-time-suffix"},il={class:"nh-time-shortcuts"},rl={class:"nh-time-shortcuts-list"},sl=["onClick","onKeydown","onMouseenter"],cl={class:"nh-time-custom"},dl={class:"nh-time-custom-header"},ul={class:"nh-time-selection-status"},fl={key:0,class:"status-text"},ml={key:1,class:"status-text"},vl={key:2,class:"status-text status-complete"},hl={class:"nh-time-pickers"},pl={class:"nh-time-picker"},gl={class:"nh-date-picker"},yl={class:"nh-date-picker-header"},kl={class:"nh-date-picker-header-label"},wl={class:"nh-date-picker-content"},bl={class:"nh-date-table"},Cl=["onClick"],xl={class:"nh-date-table-cell"},El={key:0},Bl={class:"nh-time-picker"},Nl={class:"nh-date-picker"},Vl={class:"nh-date-picker-header"},Sl={class:"nh-date-picker-header-label"},Dl={class:"nh-date-picker-content"},Tl={class:"nh-date-table"},$l=["onClick"],Ml={class:"nh-date-table-cell"},Il={key:0},Ll={class:"nh-time-actions"},zl=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const n=new Date,c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"昨天",getValue:()=>{const n=new Date;n.setDate(n.getDate()-1);const c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"近7天",getValue:()=>{const n=new Date,c=new Date;return c.setDate(c.getDate()-6),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}},{label:"近30天",getValue:()=>{const n=new Date,c=new Date;return c.setDate(c.getDate()-29),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}},{label:"近3个月",getValue:()=>{const n=new Date,c=new Date;return c.setMonth(c.getMonth()-3),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"},width:{default:"250px"},maxRange:{default:void 0},defaultValue:{default:void 0}},emits:["update:modelValue","change"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(-1),r=e.ref(-1),N=e.ref(null),B=e.ref(),S=e.ref(),C=e.ref({top:!0,left:!0}),f=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),u=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),x=()=>{const d=new Date(f.value.year,f.value.month).getTime(),h=new Date(u.value.year,u.value.month).getTime();if(d>=h){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}},M=()=>{const d=new Date(f.value.year,f.value.month).getTime();if(new Date(u.value.year,u.value.month).getTime()<=d){const V=new Date(u.value.year,u.value.month-1);f.value.year=V.getFullYear(),f.value.month=V.getMonth()}},R=["一","二","三","四","五","六","日"],I=e.ref(null),E=e.ref(null),D=d=>{if(!d)return null;if(d instanceof Date)return d;if(typeof d=="number")return new Date(d);if(typeof d=="string"){const h=new Date(d);return isNaN(h.getTime())?null:h}return null},Y=d=>{if(!d)return null;const h=d.getFullYear(),V=String(d.getMonth()+1).padStart(2,"0"),H=String(d.getDate()).padStart(2,"0");if(t.includeTime){const ie=String(d.getHours()).padStart(2,"0"),de=String(d.getMinutes()).padStart(2,"0"),fe=String(d.getSeconds()).padStart(2,"0");return`${h}-${V}-${H} ${ie}:${de}:${fe}`}else return`${h}-${V}-${H}`},se=d=>d?d.getTime():null,X=d=>d?{startDate:D(d.startDate),endDate:D(d.endDate)}:{startDate:null,endDate:null},L=d=>t.format==="string"?{startDate:Y(d.startDate),endDate:Y(d.endDate)}:t.format==="timestamp"?{startDate:se(d.startDate),endDate:se(d.endDate)}:d,K=(d,h)=>`${String(h+1).padStart(2,"0")}/${d}`,oe=(d,h)=>d.getFullYear()===h.getFullYear()&&d.getMonth()===h.getMonth()&&d.getDate()===h.getDate(),ae=(d,h,V)=>!h||!V?!1:d>=h&&d<=V,le=d=>{const h=X(d);if(!(h!=null&&h.startDate)||!(h!=null&&h.endDate))return-1;for(let V=0;V<ye.value.length;V++){const H=ye.value[V].getValue();if(H.startDate&&H.endDate&&h.startDate&&h.endDate){const ie=new Date(h.startDate.getFullYear(),h.startDate.getMonth(),h.startDate.getDate()),de=new Date(h.endDate.getFullYear(),h.endDate.getMonth(),h.endDate.getDate()),fe=new Date(H.startDate.getFullYear(),H.startDate.getMonth(),H.startDate.getDate()),Ce=new Date(H.endDate.getFullYear(),H.endDate.getMonth(),H.endDate.getDate());if(ie.getTime()===fe.getTime()&&de.getTime()===Ce.getTime())return V}}return-1},te=(d,h)=>{const V=new Date(d,h,1),H=new Date(d,h+1,0),ie=V.getDay(),de=H.getDate(),fe=[],Ce=new Date,Ne=ie===0?6:ie-1,je=new Date(d,h,0);for(let he=Ne-1;he>=0;he--){const ke=new Date(d,h-1,je.getDate()-he);fe.push({date:ke,day:ke.getDate(),isCurrentMonth:!1,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let he=1;he<=de;he++){const ke=new Date(d,h,he);fe.push({date:ke,day:he,isCurrentMonth:!0,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!1})}const Ue=42-fe.length;for(let he=1;he<=Ue;he++){const ke=new Date(d,h+1,he);fe.push({date:ke,day:he,isCurrentMonth:!1,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!0})}const ze=[];for(let he=0;he<fe.length;he+=7)ze.push(fe.slice(he,he+7));return ze},F=d=>{const h=L(d);l("update:modelValue",h),l("change",h)},G=()=>{if(!B.value||!S.value)return;const d=B.value.getBoundingClientRect(),h=S.value.getBoundingClientRect(),V=window.innerWidth,ie=window.innerHeight-d.bottom,de=d.top,fe=h.height||400;ie<fe&&de>fe?C.value.top=!1:C.value.top=!0;const Ce=V-d.left,Ne=h.width||640;Ce<Ne?C.value.left=!1:C.value.left=!0},W=()=>{if(p.value=!p.value,p.value){const d=X(t.modelValue);if(I.value=(d==null?void 0:d.startDate)||null,E.value=(d==null?void 0:d.endDate)||null,r.value=le(t.modelValue),m.value=-1,d!=null&&d.startDate&&(f.value.year=d.startDate.getFullYear(),f.value.month=d.startDate.getMonth()),d!=null&&d.endDate)u.value.year=d.endDate.getFullYear(),u.value.month=d.endDate.getMonth();else{const h=new Date(f.value.year,f.value.month+1);u.value.year=h.getFullYear(),u.value.month=h.getMonth()}x(),e.nextTick(()=>{G()})}},U=d=>{const h=d.target,V=B.value,H=S.value;V&&H&&!V.contains(h)&&!H.contains(h)&&(p.value=!1,m.value=-1)},Q=d=>{d.key==="Enter"||d.key===" "?(d.preventDefault(),W()):d.key==="ArrowDown"&&(d.preventDefault(),p.value=!0,e.nextTick(()=>{G(),o()}))},O=d=>{var h;d.key==="Escape"&&(p.value=!1,m.value=-1,(h=B.value)==null||h.focus())},ee=(d,h)=>{d.key==="ArrowDown"?(d.preventDefault(),m.value=Math.min(h+1,ye.value.length-1),i(m.value)):d.key==="ArrowUp"?(d.preventDefault(),m.value=Math.max(h-1,0),i(m.value)):(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),g(ye.value[h]))},w=d=>{m.value=d},s=()=>{m.value=-1},o=()=>{m.value=0,i(0)},i=d=>{if(S.value){const V=S.value.querySelectorAll(".nh-time-shortcut")[d];V&&V.focus()}},g=d=>{const h=d.getValue();t.includeTime&&h.startDate&&h.endDate&&(h.startDate.setHours(0,0,0,0),h.endDate.setHours(23,59,59,999)),F(h),r.value=ye.value.findIndex(V=>V.label===d.label),m.value=-1,p.value=!1},$=(d,h)=>{if(!d||d.isDisabled)return;let V;if(t.includeTime?(V=new Date(d.date),h==="start"||!I.value?V.setHours(0,0,0,0):V.setHours(23,59,59,999)):V=new Date(d.date.getFullYear(),d.date.getMonth(),d.date.getDate()),!I.value&&!E.value)I.value=V,E.value=null;else if(I.value&&!E.value)if(V>=I.value){if(t.maxRange!==void 0&&t.maxRange!==null){const H=new Date(V);if(t.includeTime&&H.setHours(23,59,59,999),!ue(I.value,H)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}}t.includeTime&&V.setHours(23,59,59,999),E.value=V}else{if(t.maxRange!==void 0&&t.maxRange!==null){const ie=new Date(I.value);if(t.includeTime&&ie.setHours(23,59,59,999),!ue(V,ie)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}}const H=I.value;t.includeTime&&H.setHours(23,59,59,999),E.value=H,I.value=V}else I.value=V,E.value=null;if(r.value=-1,I.value&&E.value){const H=new Date(E.value);t.includeTime&&H.setHours(23,59,59,999),N.value={startDate:I.value,endDate:H}}else N.value=null},T=(d,h)=>{if(!d)return["nh-date-table-td"];const V=["nh-date-table-td"];return d.isCurrentMonth||V.push("is-prev-month"),d.isToday&&V.push("is-today"),d.isDisabled&&V.push("is-disabled"),I.value&&oe(d.date,I.value)&&V.push("is-selected","is-start"),E.value&&oe(d.date,E.value)&&V.push("is-selected","is-end"),I.value&&E.value&&ae(d.date,I.value,E.value)&&V.push("is-in-range"),V},z=()=>{if(N.value){if(t.maxRange!==void 0&&t.maxRange!==null&&!ue(N.value.startDate,N.value.endDate)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}t.includeTime&&N.value.endDate&&N.value.endDate.setHours(23,59,59,999),F(N.value),r.value=le(N.value),p.value=!1}},A=(d,h)=>{const V=new Date(d.getFullYear(),d.getMonth(),d.getDate()),ie=new Date(h.getFullYear(),h.getMonth(),h.getDate()).getTime()-V.getTime();return Math.floor(ie/(1e3*60*60*24))+1},P=d=>{if(t.maxRange===void 0||t.maxRange===null)return!0;const h=d.getValue();if(!h.startDate||!h.endDate)return!0;const V=D(h.startDate),H=D(h.endDate);return!V||!H?!0:A(V,H)<=t.maxRange},ne=()=>{if(t.defaultValue){const d=X(t.defaultValue);F(d)}else F({startDate:null,endDate:null});Te(),m.value=-1,p.value=!1},J=()=>{p.value&&e.nextTick(()=>{G()})},me=e.computed(()=>te(f.value.year,f.value.month)),j=e.computed(()=>te(u.value.year,u.value.month)),q=e.computed(()=>{const d=X(t.modelValue);if(!d||!d.startDate||!d.endDate)return"";const h=ie=>{const de=String(ie.getFullYear()),fe=String(ie.getMonth()+1).padStart(2,"0"),Ce=String(ie.getDate()).padStart(2,"0");return`${de}/${fe}/${Ce}`},V=h(d.startDate),H=h(d.endDate);return!t.includeTime&&V===H?V:`${V} - ${H}`}),Z=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!C.value.top,"nh-time-dropdown-right":!C.value.left}]),ce=e.computed(()=>{const d=X(t.modelValue);return!!(d!=null&&d.startDate&&(d!=null&&d.endDate))}),ue=(d,h)=>t.maxRange===void 0||t.maxRange===null?!0:!d||!h?!1:A(d,h)<=t.maxRange,ve=e.computed(()=>!I.value||!E.value?!1:t.maxRange!==void 0&&t.maxRange!==null?ue(I.value,E.value):!0),ye=e.computed(()=>t.maxRange===void 0||t.maxRange===null?t.shortcuts:t.shortcuts.filter(P)),Te=()=>{I.value=null,E.value=null,N.value=null,r.value=-1};e.watch(()=>t.modelValue,d=>{const h=X(d);if(h!=null&&h.startDate){const V=h.startDate;f.value.year=V.getFullYear(),f.value.month=V.getMonth()}if(h!=null&&h.endDate){const V=h.endDate;u.value.year=V.getFullYear(),u.value.month=V.getMonth()}else if(h!=null&&h.startDate){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}(h!=null&&h.startDate||h!=null&&h.endDate)&&x(),p.value||(r.value=le(d))},{immediate:!0,deep:!0}),e.watch([f,u],()=>{const d=new Date(f.value.year,f.value.month).getTime(),h=new Date(u.value.year,u.value.month).getTime();if(d===h){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",U),window.addEventListener("resize",J),window.addEventListener("scroll",J);const d=X(t.modelValue);if((!(d!=null&&d.startDate)||!(d!=null&&d.endDate))&&t.defaultValue){const H=X(t.defaultValue);H!=null&&H.startDate&&(H!=null&&H.endDate)&&F(H)}const h=X(t.modelValue)||X(t.defaultValue);r.value=le(h);const V=h;if(V!=null&&V.startDate&&(f.value.year=V.startDate.getFullYear(),f.value.month=V.startDate.getMonth()),V!=null&&V.endDate)u.value.year=V.endDate.getFullYear(),u.value.month=V.endDate.getMonth();else{const H=new Date(f.value.year,f.value.month+1);u.value.year=H.getFullYear(),u.value.month=H.getMonth()}x()}),e.onUnmounted(()=>{document.removeEventListener("click",U),window.removeEventListener("resize",J),window.removeEventListener("scroll",J)});const ge=()=>{if(t.clearable){if(t.defaultValue){const d=X(t.defaultValue);F(d)}else F({startDate:null,endDate:null});Te(),m.value=-1}},xe=(d,h)=>{if(d==="start"){const V=new Date(f.value.year,f.value.month+h,1);f.value.year=V.getFullYear(),f.value.month=V.getMonth(),x()}else{const V=new Date(u.value.year,u.value.month+h,1);u.value.year=V.getFullYear(),u.value.month=V.getMonth(),M()}};return(d,h)=>{const V=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${n.size}`]]),style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",ll,[e.createElementVNode("div",{ref_key:"trigger",ref:B,onClick:W,onKeydown:Q,class:e.normalizeClass(["nh-time-trigger",{"is-focus":p.value,"has-value":ce.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:q.value,placeholder:n.placeholder,class:"nh-time-input"},null,8,ol),e.createElementVNode("span",al,[n.clearable&&ce.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(ge,["stop"]),class:"nh-time-clear"},[...h[4]||(h[4]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1 1.9-11.2c1.5-1.2 3.3-1.9 5.2-1.9l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130.1 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0),h[6]||(h[6]=e.createElementVNode("i",{class:"nh-time-icon"},[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648 248v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h112v120H152V248h112v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h312zm184 584H192V424h640v408z",fill:"currentColor"})])],-1)),e.createElementVNode("i",{class:e.normalizeClass(["nh-time-arrow",{"is-reverse":p.value}])},[...h[5]||(h[5]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z",fill:"currentColor"})],-1)])],2)])],34),e.createVNode(e.Transition,{name:"el-zoom-in-top"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:S,class:e.normalizeClass(Z.value),onKeydown:O},[e.createElementVNode("div",il,[h[7]||(h[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",rl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(H,ie)=>(e.openBlock(),e.createElementBlock("li",{key:H.label,onClick:de=>g(H),onKeydown:de=>ee(de,ie),onMouseenter:de=>w(ie),onMouseleave:s,class:e.normalizeClass(["nh-time-shortcut",{"is-active":m.value===ie,"is-selected":r.value===ie}]),tabindex:"0"},e.toDisplayString(H.label),43,sl))),128))])]),e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[h[8]||(h[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",ul,[!I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",fl," 请选择开始日期 ")):I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",ml," 请选择结束日期 ")):I.value&&E.value?(e.openBlock(),e.createElementBlock("span",vl," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",hl,[e.createElementVNode("div",pl,[e.createElementVNode("div",gl,[e.createElementVNode("div",yl,[e.createElementVNode("button",{onClick:h[0]||(h[0]=H=>xe("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...h[9]||(h[9]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",kl,e.toDisplayString(K(f.value.year,f.value.month)),1),e.createElementVNode("button",{onClick:h[1]||(h[1]=H=>xe("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",wl,[e.createElementVNode("table",bl,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,H=>e.createElementVNode("th",{key:H,class:"nh-date-table-th"},e.toDisplayString(H),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,(H,ie)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${ie}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H,(de,fe)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${ie}-${fe}`,class:e.normalizeClass(T(de)),onClick:Ce=>$(de,"start")},[e.createElementVNode("div",xl,[de?(e.openBlock(),e.createElementBlock("span",El,e.toDisplayString(de.day),1)):e.createCommentVNode("",!0)])],10,Cl))),128))]))),128))])])])])]),e.createElementVNode("div",Bl,[e.createElementVNode("div",Nl,[e.createElementVNode("div",Vl,[e.createElementVNode("button",{onClick:h[2]||(h[2]=H=>xe("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...h[11]||(h[11]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",Sl,e.toDisplayString(K(u.value.year,u.value.month)),1),e.createElementVNode("button",{onClick:h[3]||(h[3]=H=>xe("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...h[12]||(h[12]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",Dl,[e.createElementVNode("table",Tl,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,H=>e.createElementVNode("th",{key:H,class:"nh-date-table-th"},e.toDisplayString(H),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(H,ie)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${ie}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H,(de,fe)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${ie}-${fe}`,class:e.normalizeClass(T(de)),onClick:Ce=>$(de,"end")},[e.createElementVNode("div",Ml,[de?(e.openBlock(),e.createElementBlock("span",Il,e.toDisplayString(de.day),1)):e.createCommentVNode("",!0)])],10,$l))),128))]))),128))])])])])])]),e.createElementVNode("div",Ll,[n.clearable?(e.openBlock(),e.createBlock(V,{key:0,onClick:ne,variant:"secondary",size:n.size},{default:e.withCtx(()=>[...h[13]||(h[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(V,{onClick:z,disabled:!ve.value,variant:"primary",size:n.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I.value&&!E.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],6)}}}),et=pe(zl,[["__scopeId","data-v-64b1efbe"]]),Hl=["aria-checked","aria-disabled","disabled","onKeydown"],Rl={class:"yswitch__thumb"},_l={key:0,class:"yswitch__spinner","aria-hidden":"true"},Kl=e.defineComponent({__name:"yswitch",props:{modelValue:{default:!1},trueValue:{default:!0},falseValue:{default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"medium"},activeColor:{default:"#10b981"},inactiveColor:{default:"#e5e7eb"},activeText:{default:"开"},inactiveText:{default:"关"},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(),m=e.computed(()=>t.modelValue===t.trueValue),r=e.computed(()=>{const B={};return B.background=m.value?t.activeColor:t.inactiveColor,B});function N(){if(t.disabled||t.loading)return;const B=m.value?t.falseValue:t.trueValue;l("update:modelValue",B),l("change",B)}return e.onMounted(()=>{const B=p.value;B&&(B.addEventListener("focus",S=>l("focus",S)),B.addEventListener("blur",S=>l("blur",S)))}),(B,S)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:p,class:e.normalizeClass(["yswitch",[`yswitch--${n.size}`,{"yswitch--checked":m.value,"yswitch--disabled":n.disabled,"yswitch--loading":n.loading}]]),style:e.normalizeStyle(r.value),role:"switch","aria-checked":m.value,"aria-disabled":n.disabled,disabled:n.disabled||n.loading,onClick:N,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[S[0]||(S[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",Rl,[n.loading?(e.openBlock(),e.createElementBlock("span",_l)):e.createCommentVNode("",!0)]),n.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!m.value,"yswitch__label--right":m.value}])},e.toDisplayString(m.value?n.activeText:n.inactiveText),3)):e.createCommentVNode("",!0)],46,Hl))}}),tt=pe(Kl,[["__scopeId","data-v-0b157fc4"]]),Wl=["src","alt"],Al=["src","alt"],Pl=["src"],Fl=e.defineComponent({__name:"yimage",props:{src:{},alt:{default:""},width:{},height:{},lazy:{type:Boolean,default:!0},preview:{type:Boolean,default:!0},fit:{default:"cover"},radius:{default:"0"},className:{default:""},previewSrcList:{},hoverPreview:{type:Boolean,default:!1},hoverPreviewWidth:{default:400},hoverPreviewHeight:{default:400}},emits:["load","error","preview"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(),r=e.ref(),N=e.ref(),B=e.ref(!1),S=e.ref(!1),C=e.ref(!1),f=e.ref(!1),u=e.ref(!1),x=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),M=e.ref(""),R=e.ref(1),I=e.ref(!1),E=e.ref({visible:!1,src:"",top:0,left:0,width:400,height:400,isHoveringPreview:!1});let D=null;const Y=e.ref({overflow:"",paddingRight:""}),se={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},X=e.computed(()=>l.className||""),L=e.computed(()=>{if(typeof l.radius=="number")return`${l.radius}px`;if(typeof l.radius=="string"){if(/(px|%|rem|em)$/.test(l.radius))return l.radius;if(se[l.radius])return se[l.radius]}return""}),K=e.computed(()=>L.value?{borderRadius:L.value}:{}),oe=e.computed(()=>["yimage-image",l.preview?"is-previewable":""].filter(Boolean).join(" ")),ae=e.computed(()=>{const j={objectFit:l.fit||"cover",backgroundColor:"#fff"};return l.width&&(j.width=typeof l.width=="number"?`${l.width}px`:l.width),l.height&&(j.height=typeof l.height=="number"?`${l.height}px`:l.height),L.value&&(j.borderRadius=L.value),j}),le=e.computed(()=>M.value?M.value:Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),te=e.computed(()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),F=()=>{const j=document.createElement("div");j.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(j);const q=j.offsetWidth-j.clientWidth;return document.body.removeChild(j),q},G=()=>{if(Y.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const q=F();document.body.style.paddingRight=`${q}px`}document.body.style.overflow="hidden"},W=()=>{document.body.style.overflow=Y.value.overflow,document.body.style.paddingRight=Y.value.paddingRight};let U=null;const Q=()=>{!l.lazy||!m.value||(U=new IntersectionObserver(j=>{j.forEach(q=>{q.isIntersecting&&(f.value=!0,x.value=l.src,U==null||U.unobserve(q.target))})},{rootMargin:"50px"}),U.observe(m.value))},O=j=>{B.value=!0,S.value=!1,C.value=!1,p("load",j)},ee=j=>{C.value=!0,S.value=!1,B.value=!1,p("error",j)},w=()=>{C.value=!1,S.value=!0,B.value=!1,e.nextTick(()=>{r.value&&(r.value.src=l.src)})},s=()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src,o=()=>{l.preview&&(l.previewSrcList||l.src)?i():w()},i=()=>{if(!l.preview)return;R.value=1;const j=s();if(r.value&&r.value.complete&&r.value.naturalWidth>0){M.value=j,e.nextTick(()=>{u.value=!0,G(),p("preview",j)});return}const q=new Image;let Z=null,ce=!1;const ue=()=>{ce||(ce=!0,Z&&(clearTimeout(Z),Z=null),M.value=j,e.nextTick(()=>{u.value=!0,G(),p("preview",j)}))};Z=setTimeout(()=>{ue()},500),q.onload=()=>{ue()},q.onerror=()=>{ue()},q.src=j,q.complete&&ue()},g=()=>{u.value=!1,setTimeout(()=>{W()},300)},$=j=>{const q=j.deltaY<0?1:-1;let ce=R.value+q*.1;ce=Math.max(.5,Math.min(2,ce)),R.value=ce};function T(j){if(!(j instanceof HTMLElement))return;const q=j.getBoundingClientRect(),Z=12,ce=window.innerWidth||document.documentElement.clientWidth,ue=window.innerHeight||document.documentElement.clientHeight;let ve=q.right+Z;ve+E.value.width>ce-Z&&(ve=q.left-E.value.width-Z);let ye=q.top;ye+E.value.height>ue-Z&&(ye=ue-E.value.height-Z),ye<Z&&(ye=Z),ve<Z&&(ve=Z),E.value.left=ve,E.value.top=ye}function z(j){l.hoverPreview&&(D&&(clearTimeout(D),D=null),E.value.isHoveringPreview=!1,E.value.src=te.value,E.value.width=l.hoverPreviewWidth,E.value.height=l.hoverPreviewHeight,E.value.visible=!0,T(j.currentTarget))}function A(j){l.hoverPreview&&E.value.visible&&(D&&(clearTimeout(D),D=null),T(j.currentTarget))}function P(){l.hoverPreview&&(E.value.isHoveringPreview||(D&&(clearTimeout(D),D=null),D=setTimeout(()=>{E.value.isHoveringPreview||(E.value.visible=!1,E.value.src=""),D=null},50)))}function ne(){l.hoverPreview&&(D&&(clearTimeout(D),D=null),E.value.isHoveringPreview=!0)}function J(){l.hoverPreview&&(E.value.isHoveringPreview=!1,E.value.visible=!1,E.value.src="",D&&(clearTimeout(D),D=null))}e.onMounted(()=>{l.lazy?Q():f.value=!0,f.value&&(S.value=!0),I.value=!0}),e.onUnmounted(()=>{U&&U.disconnect(),u.value&&W(),D&&(clearTimeout(D),D=null)});const me=()=>{l.src&&f.value&&(S.value=!0,C.value=!1,B.value=!1)};return e.watch(()=>x.value,me),e.watch(()=>l.src,j=>{x.value=j||""}),c({retryLoad:w,closePreview:g}),(j,q)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:m,class:e.normalizeClass(["yimage-container",X.value])},[!B.value&&!C.value&&!f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(K.value)},[...q[1]||(q[1]=[e.createElementVNode("div",{class:"yimage-placeholder-content"},[e.createElementVNode("svg",{class:"yimage-placeholder-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)])],4)):e.createCommentVNode("",!0),S.value&&!C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(K.value)},[...q[2]||(q[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(K.value),onClick:o},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:"yimage-error-image",style:e.normalizeStyle(K.value)},null,4)],4)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:r,src:x.value,alt:n.alt,class:e.normalizeClass(oe.value),onLoad:O,onError:ee,onClick:e.withModifiers(i,["stop"]),onMouseenter:z,onMouseleave:P,onMousemove:A,style:e.normalizeStyle(ae.value)},null,46,Wl),[[e.vShow,B.value&&!C.value]]),l.preview&&(!B.value||S.value||C.value||!f.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(i,["stop"])})):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(g,["self"]),onWheel:e.withModifiers($,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":u.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:N,src:le.value,alt:n.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${R.value})`}),onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"]))},null,12,Al)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),I.value&&l.hoverPreview?(e.openBlock(),e.createBlock(e.Teleport,{key:5,to:"body"},[e.createVNode(e.Transition,{name:"hover-preview-fade",appear:""},{default:e.withCtx(()=>[E.value.visible&&E.value.src?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-hover-preview",style:e.normalizeStyle({top:E.value.top+"px",left:E.value.left+"px",width:E.value.width+"px",height:E.value.height+"px"}),onMouseenter:ne,onMouseleave:J},[e.createElementVNode("img",{src:E.value.src,alt:"图片预览"},null,8,Pl)],36)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),gt=pe(Fl,[["__scopeId","data-v-02c24bfc"]]),Yl=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(n){const c=n,t=e.ref(!1),l=e.ref();let p=null;const m=e.computed(()=>`y-dropdown__menu--${c.placement}`),r=e.computed(()=>{if(!c.menuWidth)return{};const u=typeof c.menuWidth=="number"?`${c.menuWidth}px`:c.menuWidth;return{width:u,minWidth:u,maxWidth:u}}),N=()=>{console.log("显示下拉菜单",t.value),!c.disabled&&(p&&(clearTimeout(p),p=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{S()}))},B=()=>{console.log("隐藏下拉菜单"),p=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},S=()=>{if(!l.value)return;const u=l.value.querySelector(".y-dropdown__trigger"),x=l.value.querySelector(".y-dropdown__menu");if(!u||!x)return;const M=u.getBoundingClientRect(),R=x.getBoundingClientRect(),I=window.innerWidth,E=window.innerHeight;x.style.top="",x.style.left="",x.style.right="",x.style.bottom="",x.style.transform="";let D=0,Y=0;switch(c.placement){case"bottom":D=M.height+4,Y=0;break;case"top":D=-(R.height+4),Y=0;break;case"right":D=0,Y=M.width+4;break;case"left":D=0,Y=-(R.width+4);break}let se=M.top+D,X=M.left+Y;if(c.placement==="bottom"||c.placement==="top"){const L=R.width||260;X+L>I-10&&(X=I-L-10),X<10&&(X=10)}if(c.placement==="left"||c.placement==="right"){const L=R.height||200;se+L>E-10&&(se=E-L-10),se<10&&(se=10)}x.style.top=`${se}px`,x.style.left=`${X}px`},C=u=>{c.trigger==="click"&&l.value&&!l.value.contains(u.target)&&(t.value=!1)},f=()=>{t.value&&S()};return e.onMounted(()=>{c.trigger==="click"&&document.addEventListener("click",C),window.addEventListener("resize",f),window.addEventListener("scroll",f)}),e.onUnmounted(()=>{c.trigger==="click"&&document.removeEventListener("click",C),p&&clearTimeout(p),window.removeEventListener("resize",f),window.removeEventListener("scroll",f)}),e.watch(()=>c.menuWidth,()=>{t.value&&e.nextTick(()=>{S()})}),(u,x)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:l},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:N,onMouseleave:B},[e.renderSlot(u.$slots,"trigger",{},()=>[x[0]||(x[0]=e.createElementVNode("button",{class:"y-dropdown__button"}," 下拉菜单 ",-1))],!0)],32),e.createVNode(e.Transition,{name:"dropdown-fade",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-dropdown__menu",m.value]),style:e.normalizeStyle(r.value),onMouseenter:N,onMouseleave:B},[e.renderSlot(u.$slots,"default",{},()=>[x[1]||(x[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),x[2]||(x[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),x[3]||(x[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),yt=pe(Yl,[["__scopeId","data-v-ada3172a"]]),Ol=["aria-hidden"],jl=["onKeydown"],Ul={key:0,class:"y-drawer-header"},ql={class:"y-drawer-title"},Gl={class:"y-drawer-body"},Zl={key:1,class:"y-drawer-footer"},Ql=e.defineComponent({__name:"ydrawer",props:{modelValue:{type:Boolean,default:!1},placement:{default:"right"},width:{default:"420px"},height:{default:"60vh"},title:{default:""},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:1e5},showHeader:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(n,{emit:c}){const t=n,l=c,p=e.computed({get:()=>t.modelValue,set:x=>l("update:modelValue",x)}),m=e.ref(null),r=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),N=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),B=e.computed(()=>{const x={};return t.placement==="right"?(x.width=typeof t.width=="number"?`${t.width}px`:String(t.width),x.height="100%",x.right="0",x.top="0"):(x.height=typeof t.height=="number"?`${t.height}px`:String(t.height),x.width="100%",x.bottom="0",x.left="0"),x});function S(){t.maskClosable&&C()}function C(){p.value&&(p.value=!1,l("close"))}function f(){t.closable&&C()}function u(x){x.key==="Escape"&&f()}return e.watch(()=>t.modelValue,x=>{x?(l("open"),requestAnimationFrame(()=>{var M;return(M=m.value)==null?void 0:M.focus()}),document.addEventListener("keydown",u),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",u),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",u),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",u),document.body.style.overflow=""}),(x,M)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:S}),e.createVNode(e.Transition,{name:r.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-drawer-panel",[`is-${n.placement}`,N.value]]),style:e.normalizeStyle(B.value),onKeydown:e.withKeys(e.withModifiers(f,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Ul,[e.createElementVNode("div",ql,e.toDisplayString(n.title),1),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:C}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gl,[e.renderSlot(x.$slots,"default",{},void 0,!0)]),x.$slots.footer?(e.openBlock(),e.createElementBlock("div",Zl,[e.renderSlot(x.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,jl),[[e.vShow,p.value]])]),_:3},8,["name"])],12,Ol),[[e.vShow,p.value]])]))}}),kt=pe(Ql,[["__scopeId","data-v-6bf99d52"]]),Jl=["data-level"],Xl={key:1,class:"ytree-node__expand-icon--empty"},eo={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},to={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},no=["src","alt"],lo={class:"ytree-node__custom-content"},oo={key:0,class:"ytree-node__children"},ao=e.defineComponent({__name:"ytree-node",props:{node:{},rootNode:{},level:{default:1},showCheckbox:{type:Boolean,default:!1},iconClass:{default:""},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0}},setup(n){const c=n;e.inject("treeStore");const t=e.inject("getNodeKey"),l=e.inject("getNodeLabel"),p=e.inject("getNodeChildren"),m=e.inject("hasChildren"),r=e.inject("isEmployeeNode"),N=e.inject("getNodeIcon"),B=e.inject("getNodeDepth"),S=e.inject("isChildStyleNode"),C=e.inject("isNodeExpanded"),f=e.inject("isNodeChecked"),u=e.inject("isNodeIndeterminate"),x=e.inject("isNodeCurrent"),M=e.inject("isNodeHighlighted"),R=e.inject("handleExpandClick"),I=e.inject("handleCheckClick"),E=e.inject("handleNodeClick"),D=e.inject("handleNodeContextMenu");e.computed(()=>t(c.node));const Y=e.computed(()=>l(c.node)),se=e.computed(()=>N(c.node,c.rootNode)),X=e.computed(()=>B(c.rootNode,c.node)),L=e.computed(()=>C(c.node)),K=e.computed(()=>f(c.node)),oe=e.computed(()=>u(c.node)),ae=e.computed(()=>x(c.node)),le=e.computed(()=>M(c.node)),te=e.computed(()=>m(c.node)),F=e.computed(()=>p(c.node)),G=e.computed(()=>S(c.node,c.rootNode)),W=e.computed(()=>r(c.node)),U=e.computed(()=>c.level===1?8:8+(c.level-1)*16);return(Q,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree-node",{"ytree-node--current":ae.value,"ytree-node--highlight":le.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":G.value}]),style:e.normalizeStyle({paddingLeft:`${U.value}px`}),"data-level":X.value,onClick:O[2]||(O[2]=ee=>e.unref(E)(c.node,c.node,null,c.rootNode)),onContextmenu:O[3]||(O[3]=ee=>e.unref(D)(ee,c.node,c.node,null))},[te.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L.value}]),onClick:O[0]||(O[0]=e.withModifiers(ee=>e.unref(R)(c.node),["stop"]))},[...O[4]||(O[4]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)):(e.openBlock(),e.createElementBlock("span",Xl)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":K.value,"is-indeterminate":oe.value}]),onClick:O[1]||(O[1]=e.withModifiers(ee=>e.unref(I)(c.node),["stop"]))},[K.value?(e.openBlock(),e.createElementBlock("svg",eo,[...O[5]||(O[5]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):oe.value?(e.openBlock(),e.createElementBlock("svg",to,[...O[6]||(O[6]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:se.value,alt:W.value?"person":"dept"},null,8,no),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":W.value}])},e.toDisplayString(Y.value),3),e.createElementVNode("div",lo,[e.renderSlot(Q.$slots,"node-content",{node:c.node,isCurrent:ae.value,isExpanded:L.value,hasChildren:te.value},void 0,!0)])],46,Jl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[te.value&&L.value?(e.openBlock(),e.createElementBlock("div",oo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,ee=>(e.openBlock(),e.createBlock(wt,{key:e.unref(t)(ee),node:ee,"root-node":n.rootNode,level:n.level+1,"show-checkbox":n.showCheckbox,"icon-class":n.iconClass,"dept-icon-url":n.deptIconUrl,"person-icon-url":n.personIconUrl,"button-icon-url":n.buttonIconUrl,"child-style-level":n.childStyleLevel,"child-style-icon-url":n.childStyleIconUrl,"enable-child-style-custom-click":n.enableChildStyleCustomClick,disabled:n.disabled,"expand-on-click-node":n.expandOnClickNode},{"node-content":e.withCtx(w=>[e.renderSlot(Q.$slots,"node-content",e.mergeProps({ref_for:!0},w),void 0,!0)]),_:3},8,["node","root-node","level","show-checkbox","icon-class","dept-icon-url","person-icon-url","button-icon-url","child-style-level","child-style-icon-url","enable-child-style-custom-click","disabled","expand-on-click-node"]))),128))])):e.createCommentVNode("",!0)]),_:3})],2))}}),wt=pe(ao,[["__scopeId","data-v-f424ccf5"]]),io={class:"ytree__container"},ro="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",so="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",co=e.defineComponent({__name:"ytree",props:{data:{default:()=>[]},emptyText:{default:"暂无数据"},nodeKey:{default:"id"},props:{default:()=>({children:"children",label:"label",disabled:"disabled",isLeaf:"isLeaf"})},renderAfterExpand:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!1},defaultExpandedKeys:{default:()=>[]},defaultCheckedKeys:{default:()=>[]},defaultSelectedKeys:{default:()=>[]},checkStrictly:{type:Boolean,default:!1},checkOnClickNode:{type:Boolean,default:!1},checkDescendants:{type:Boolean,default:!0},autoExpandParent:{type:Boolean,default:!0},defaultChecked:{type:Boolean,default:!1},filterNodeMethod:{},lazy:{type:Boolean,default:!1},load:{},renderContent:{},highlightCurrent:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0},currentNodeKey:{},accordion:{type:Boolean,default:!1},indent:{default:18},iconClass:{default:""},showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:{},allowDrop:{},size:{default:"medium"},disabled:{type:Boolean,default:!1},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},enableFourthLevelSpecialHandling:{type:Boolean,default:!1},restrictAutoExpandFromLevel:{default:void 0},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1}},emits:["node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop","checked-keys-change","child-node-click"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.computed(()=>l.data||[]),r=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set}),N=e.ref(0),B=new Map;function S(){B.clear()}e.provide("treeStore",r),e.provide("getNodeKey",f),e.provide("getNodeLabel",u),e.provide("getNodeChildren",I),e.provide("hasChildren",R),e.provide("isEmployeeNode",x),e.provide("getNodeIcon",M),e.provide("getNodeDepth",E),e.provide("isChildStyleNode",D),e.provide("isNodeExpanded",Y),e.provide("isNodeChecked",X),e.provide("isNodeIndeterminate",L),e.provide("isNodeCurrent",K),e.provide("isNodeHighlighted",oe),e.provide("handleExpandClick",le),e.provide("handleCheckClick",ae),e.provide("handleNodeClick",F),e.provide("handleNodeContextMenu",G);const C=e.computed(()=>l.restrictAutoExpandFromLevel&&l.restrictAutoExpandFromLevel>0?l.restrictAutoExpandFromLevel:void 0);function f(o){return o[l.nodeKey]||o.id||Math.random()}function u(o){var i;return((i=l.props)!=null&&i.label?o[l.props.label]:void 0)||o.label||""}function x(o){var i;return!!((i=o==null?void 0:o.data)!=null&&i.isEmployee)}function M(o,i){var A;const g=l.deptIconUrl||ro,$=l.personIconUrl||so,T=l.buttonIconUrl||"",z=l.childStyleIconUrl||"";return i&&z&&D(o,i)?z:(A=o==null?void 0:o.data)!=null&&A.isButton&&T?T:x(o)?$:g}function R(o){var g;const i=((g=l.props)!=null&&g.children?o[l.props.children]:void 0)||o.children;return i&&i.length>0}function I(o){var i;return((i=l.props)!=null&&i.children?o[l.props.children]:void 0)||o.children||[]}function E(o,i,g=1){if(o===i)return g;const $=I(o);for(const T of $){const z=E(T,i,g+1);if(z>0)return z}return 0}function D(o,i){return!l.childStyleLevel||l.childStyleLevel<1?!1:E(i,o)===l.childStyleLevel}function Y(o){const i=f(o);return r.value.expandedKeys.has(i)}function se(o,i=new Set){const g=f(o);if(i.has(g))return{checked:!1,indeterminate:!1};i.add(g);const T=r.value.checkedKeys.has(g);if(!R(o))return{checked:T,indeterminate:!1};const z=I(o);if(z.length===0)return{checked:T,indeterminate:!1};let A=0,P=0;for(const q of z){const Z=se(q,i);Z.checked?A++:Z.indeterminate&&P++}let ne,J;const me=A===z.length&&P===0,j=A>0||P>0;return T?me?(ne=!0,J=!1):j?(ne=!1,J=!0):(ne=!0,J=!1):me?(ne=!0,J=!1):j?(ne=!1,J=!0):(ne=!1,J=!1),{checked:ne,indeterminate:J}}function X(o){return N.value,se(o).checked}function L(o){return N.value,se(o).indeterminate}function K(o){const i=f(o);return r.value.currentKey===i}function oe(o){const i=f(o);return r.value.highlightedKeys.has(i)}function ae(o){if(l.disabled)return;const i=f(o),$=!r.value.checkedKeys.has(i),T=new Set(r.value.expandedKeys);S(),$?r.value.checkedKeys.add(i):r.value.checkedKeys.delete(i);function z(A,P){A.forEach(ne=>{const J=f(ne);P?r.value.checkedKeys.add(J):r.value.checkedKeys.delete(J),R(ne)&&z(I(ne),P)})}z(I(o),$),te(),r.value.expandedKeys=T,S(),p("check-change",o,$,!1),p("check",o,$,!1),p("checked-keys-change",Array.from(r.value.checkedKeys))}function le(o){const i=f(o);r.value.expandedKeys.has(i)?(r.value.expandedKeys.delete(i),p("node-collapse",o,o,null)):(r.value.expandedKeys.add(i),p("node-expand",o,o,null))}function te(){const o=new Map,i=[],g=new Map;function $(z,A){z.forEach(P=>{const ne=f(P);i.push(P),g.set(ne,P),A&&o.set(ne,A),R(P)&&$(I(P),P)})}$(m.value);function T(z){if(!R(z))return;const A=I(z),P=f(z);let ne=0,J=0;for(const me of A){const j=se(me);j.checked?ne++:j.indeterminate&&J++}ne===A.length&&J===0?r.value.checkedKeys.add(P):(ne>0||J>0,r.value.checkedKeys.delete(P))}for(let z=i.length-1;z>=0;z--)T(i[z]);S()}function F(o,i,g,$){if(l.disabled)return;const T=$?D(o,$):!1;if(l.enableChildStyleCustomClick&&T){p("child-node-click",o,i,g);return}if(l.expandOnClickNode&&R(o)){le(o);return}r.value.currentNode=o,r.value.currentKey=f(o),l.showCheckbox&&ae(o),p("node-click",o,i,g)}function G(o,i,g,$){l.disabled||p("node-contextmenu",o,i,g,$)}e.watch(()=>l.defaultExpandedKeys,o=>{if(o){const i=C.value;if(i){let g=function(A,P,ne=1){for(const J of P){if(f(J)===A)return ne;if(R(J)){const me=g(A,I(J),ne+1);if(me>0)return me}}return 0},$=function(A,P,ne){A.forEach(J=>{P<ne&&R(J)?(z.add(f(J)),$(I(J),P+1,ne)):P<ne&&R(J)})};const T=(o||[]).filter(A=>{const P=g(A,m.value,1);return P>0&&P<i}),z=new Set(T);$(m.value,1,i),r.value.expandedKeys.forEach(A=>{g(A,m.value,1)>=i&&z.add(A)}),r.value.expandedKeys=z}else r.value.expandedKeys=new Set(o)}},{immediate:!0});function W(){if(l.defaultExpandAll){let o=function($,T=1){$.forEach(z=>{if(!R(z))return;const A=I(z);if(g){if(T>=g)return;T+1===g||i.add(f(z)),o(A,T+1)}else i.add(f(z)),o(A,T+1)})};const i=new Set,g=C.value;o(m.value,1),r.value.expandedKeys=i}}function U(){if(l.defaultCheckedKeys&&l.defaultCheckedKeys.length>0){let o=function(T,z=[]){T.forEach(A=>{const P=f(A),ne=[...z,P];i.has(P)&&z.forEach(J=>g.add(J)),R(A)&&o(I(A),ne)})};const i=new Set(l.defaultCheckedKeys),g=new Set;if(o(m.value),C.value)return;r.value.expandedKeys=g}}let Q=null;const O=()=>{Q&&clearTimeout(Q),Q=setTimeout(()=>{W(),Q=null},50)};e.watch(()=>l.defaultExpandAll,W,{immediate:!0}),e.watch(()=>m.value,O,{deep:!0}),e.watch(()=>l.defaultCheckedKeys,o=>{o?(r.value.checkedKeys=new Set(o),l.enableFourthLevelSpecialHandling||U()):r.value.checkedKeys.clear()},{immediate:!0});function ee(o){try{let i=function(T,z,A=[]){for(const P of T){const ne=f(P),J=[...A,ne];if(ne===z)return J;if(R(P)){const me=i(I(P),z,J);if(me)return me}}return null};const g=Array.isArray(o)?o:[];if(g.length===0)return;r.value.highlightedKeys.clear();const $=new Set(r.value.expandedKeys);g.forEach(T=>{const z=i(m.value,T);z&&z.length>0&&(z.slice(0,-1).forEach(A=>$.add(A)),r.value.highlightedKeys.add(z[z.length-1]))}),r.value.expandedKeys=$}catch(i){process.env.NODE_ENV==="development"&&console.warn("highlightAndExpandByIds 执行失败",i)}}function w(){r.value.highlightedKeys.clear()}function s(){r.value.currentNode=null,r.value.currentKey=null}return c({highlightAndExpandByIds:ee,clearHighlights:w,clearCurrentNode:s}),e.watch(()=>l.defaultSelectedKeys,o=>{o&&(r.value.selectedKeys=new Set(o))},{immediate:!0}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${n.size}`,{"ytree--disabled":n.disabled}]])},[e.createElementVNode("div",io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,g=>(e.openBlock(),e.createBlock(wt,{key:f(g),node:g,"root-node":g,level:1,"show-checkbox":n.showCheckbox,"icon-class":n.iconClass,"dept-icon-url":n.deptIconUrl,"person-icon-url":n.personIconUrl,"button-icon-url":n.buttonIconUrl,"child-style-level":n.childStyleLevel,"child-style-icon-url":n.childStyleIconUrl,"enable-child-style-custom-click":n.enableChildStyleCustomClick,disabled:n.disabled,"expand-on-click-node":n.expandOnClickNode},{"node-content":e.withCtx($=>[e.renderSlot(o.$slots,"node-content",e.mergeProps({ref_for:!0},$),void 0,!0)]),_:3},8,["node","root-node","show-checkbox","icon-class","dept-icon-url","person-icon-url","button-icon-url","child-style-level","child-style-icon-url","enable-child-style-custom-click","disabled","expand-on-click-node"]))),128))])],2))}}),bt=pe(co,[["__scopeId","data-v-ad65c979"]]),uo={class:"query-encapsulation"},fo={class:"query-encapsulation__container"},mo={class:"query-encapsulation__content"},vo={class:"query-encapsulation__field-wrapper"},ho={key:0,class:"query-encapsulation__field-label"},po={key:0,class:"query-encapsulation__toggle"},go={class:"query-encapsulation__actions-group"},yo=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(!1),r=e.reactive({}),N=["select","date","daterange","switch"];let B;const S=e.ref(null),C=e.ref(null),f=new Map,u=new Map,x=e.ref(1/0);let M=null,R,I=0;const E=e.computed(()=>l.fields.filter(s=>!s.hidden)),D=e.computed(()=>m.value?E.value:E.value.slice(0,x.value)),Y=e.computed(()=>E.value.length>x.value);function se(s){switch(s){case"select":return Xe;case"date":case"daterange":return et;case"switch":return tt;case"input":default:return Je}}function X(s,o){r[s]=o;const i=l.fields.find(g=>g.key===s);i&&L(i)}function L(s){p("field-change",s,r[s.key]),p("update:modelValue",{...r}),N.includes(s.type)&&U()}function K(s,o){s.onSwitchChange&&typeof s.onSwitchChange=="function"&&s.onSwitchChange(o,s),L(s)}function oe(){const s=Q(r),o=O(s),i={...r};p("search",{data:o,raw:i})}function ae(){Object.keys(r).forEach(s=>{const o=l.fields.find(i=>i.key===s);(o==null?void 0:o.type)==="daterange"?o.defaultValue?r[s]=o.defaultValue:r[s]={startDate:null,endDate:null}:(o==null?void 0:o.type)==="date"?r[s]=null:(o==null?void 0:o.type)==="switch"?r[s]=o.falseValue!==void 0?o.falseValue:!1:(o==null?void 0:o.type)==="select"&&o.multiple?r[s]=[]:r[s]=""}),p("reset"),p("update:modelValue",{...r})}function le(){m.value=!m.value,setTimeout(()=>{e.nextTick(()=>{F()})},300)}function te(s,o){s?(f.set(o,s),e.nextTick(()=>{if(s&&!u.has(o)){const i=s.offsetWidth;i>0&&u.set(o,i)}})):f.delete(o)}function F(){R&&clearTimeout(R),R=setTimeout(()=>{e.nextTick().then(()=>{if(!S.value||!C.value)return;const s=S.value.offsetWidth;if(s===0){setTimeout(()=>F(),50);return}if(I>0&&Math.abs(s-I)>10&&(u.clear(),!m.value&&E.value.length>0)){m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const q of E.value){const Z=f.get(q.key);if(Z){const ce=Z.offsetWidth;ce>0&&u.set(q.key,ce)}}m.value=!1,I=s,setTimeout(()=>F(),50)},150)});return}I=s;const o=12,i=20,g=C.value.querySelector(".query-encapsulation__actions-group");if(!g){setTimeout(()=>F(),50);return}const T=g.getBoundingClientRect().width||g.offsetWidth||200;if(T<50){setTimeout(()=>F(),50);return}for(const q of E.value){const Z=f.get(q.key);if(Z){const ce=Z.offsetWidth;ce>0&&u.set(q.key,ce)}}if(!E.value.every(q=>u.has(q.key)&&u.get(q.key)>0)){const q=E.value.filter(Z=>!u.has(Z.key)||u.get(Z.key)===0);if(m.value){let Z=!1;for(const ce of q){const ue=f.get(ce.key);if(ue){const ve=ue.offsetWidth;ve>0&&(u.set(ce.key,ve),Z=!0)}}if(!Z){setTimeout(()=>F(),50);return}}else{const Z=q.filter(ce=>!D.value.some(ue=>ue.key===ce.key));if(Z.length>0){const ce=Array.from(u.values()).filter(ve=>ve>0),ue=ce.length>0?ce.reduce((ve,ye)=>ve+ye,0)/ce.length:180;for(const ve of Z)(!u.has(ve.key)||u.get(ve.key)===0)&&u.set(ve.key,ue)}else{setTimeout(()=>F(),50);return}}}const A=100;let P=0;for(const q of E.value){const Z=u.get(q.key)||0;Z>0&&(P+=Z+(P>0?o:0))}const ne=s-T-i;if(P<=ne){x.value=1/0;return}const J=s-T-A-i;let me=0,j=0;for(const q of E.value){const Z=u.get(q.key)||0;if(Z===0)continue;const ce=j>0?Z+o:Z;if(me+ce>J)break;me+=ce,j++}x.value=Math.max(1,j)})},150)}function G(s){return s.type!=="input"?{}:{enter:()=>W(),paste:()=>W()}}async function W(){await e.nextTick(),oe()}function U(){B&&clearTimeout(B),B=setTimeout(()=>{B=void 0,e.nextTick().then(()=>oe())},0)}function Q(s){const o={};return Object.keys(s).forEach(i=>{const g=l.fields.find(z=>z.key===i),$=s[i],T=typeof $=="string"?$.trim():$;if(Array.isArray(T)){T.length>0&&(o[i]=T);return}if(!(T==null||T==="")){if(typeof T=="object"&&T.startDate&&T.endDate){T.startDate&&T.endDate&&(o[i]=T);return}if(g&&(g.type==="date"||g.type==="daterange")){T!==0&&(o[i]=T);return}o[i]=T}}),o}function O(s){const o={};return Object.keys(s).forEach(i=>{const g=s[i],$=l.fields.find(T=>T.key===i);if($)if($.type==="daterange"&&typeof g=="object"){const T=$.startKey||`${i}Start`,z=$.endKey||`${i}End`;g.startDate&&g.endDate&&g.startDate!==0&&g.endDate!==0&&($.format==="timestamp"?(o[T]=new Date(g.startDate).getTime(),o[z]=new Date(g.endDate).getTime()):(o[T]=g.startDate,o[z]=g.endDate))}else $.type==="date"&&g&&g!==0&&$.format==="timestamp"?o[i]=new Date(g).getTime():o[i]=g;else o[i]=g}),o}function ee(){l.fields.forEach(s=>{var o,i,g,$,T;r[s.key]===void 0&&(s.type==="daterange"?r[s.key]=((o=l.modelValue)==null?void 0:o[s.key])||s.defaultValue||{startDate:null,endDate:null}:s.type==="date"?r[s.key]=((i=l.modelValue)==null?void 0:i[s.key])||null:s.type==="switch"?r[s.key]=((g=l.modelValue)==null?void 0:g[s.key])!==void 0?l.modelValue[s.key]:s.falseValue!==void 0?s.falseValue:!1:s.type==="select"&&s.multiple?r[s.key]=(($=l.modelValue)==null?void 0:$[s.key])!==void 0?l.modelValue[s.key]:[]:r[s.key]=((T=l.modelValue)==null?void 0:T[s.key])||"")})}e.watch(()=>l.modelValue,s=>{s&&Object.assign(r,s)},{deep:!0,immediate:!0}),e.watch(()=>l.fields,(s,o)=>{const i=(s==null?void 0:s.map($=>$.key).join(","))||"",g=(o==null?void 0:o.map($=>$.key).join(","))||"";i!==g&&(f.clear(),u.clear(),I=0),e.nextTick(()=>{const T=(s==null?void 0:s.length)!==(o==null?void 0:o.length)?200:100;setTimeout(()=>{e.nextTick(()=>{E.value.length>3&&!m.value&&i!==g?(m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const z of E.value){const A=f.get(z.key);if(A){const P=A.offsetWidth;P>0&&u.set(z.key,P)}}m.value=!1,e.nextTick(()=>{F()})},150)})):F()})},T)})},{deep:!0}),e.watch(()=>E.value.length,()=>{e.nextTick(()=>{F()})});function w(){ee(),e.nextTick(()=>{E.value.length>3&&!m.value?(m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const s of E.value){const o=f.get(s.key);if(o){const i=o.offsetWidth;i>0&&u.set(s.key,i)}}m.value=!1,e.nextTick(()=>{F()})},150)})):F(),S.value&&window.ResizeObserver&&(M&&M.disconnect(),M=new ResizeObserver(()=>{F()}),M.observe(S.value),C.value&&M.observe(C.value)),window.addEventListener("resize",F)})}return e.onMounted(()=>{w()}),e.onActivated(()=>{f.clear(),u.clear(),m.value=!1,I=0,e.nextTick(()=>{setTimeout(()=>{w()},150)})}),e.onBeforeUnmount(()=>{B&&(clearTimeout(B),B=void 0),R&&(clearTimeout(R),R=void 0),M&&(M.disconnect(),M=null),window.removeEventListener("resize",F)}),c({search:oe,reset:ae}),(s,o)=>(e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",fo,[e.createElementVNode("div",mo,[e.createElementVNode("div",{class:"query-encapsulation__fields",ref_key:"fieldsContainerRef",ref:S},[e.createVNode(e.TransitionGroup,{name:"qf",tag:"div",class:"query-encapsulation__fields-group"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,i=>(e.openBlock(),e.createElementBlock("div",{key:i.key,class:"query-encapsulation__field-item",ref_for:!0,ref:g=>te(g,i.key)},[e.renderSlot(s.$slots,`field-${i.key}`,{field:i,value:r[i.key],updateValue:g=>X(i.key,g)},()=>[e.createElementVNode("div",vo,[n.Iflabel||i.type==="switch"?(e.openBlock(),e.createElementBlock("label",ho,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(se(i.type)),e.mergeProps({modelValue:r[i.key],"onUpdate:modelValue":g=>r[i.key]=g,placeholder:i.placeholder||`请输入${i.label}`,options:i.options,clearable:i.clearable!==!1,size:i.size||"small",width:i.width||"180px",format:i.format||"timestamp","include-time":i.includeTime||!1,"max-range":i.maxRange,"default-value":i.defaultValue,filterable:i.filterable===!0,multiple:i.multiple===!0,"true-value":i.trueValue,"false-value":i.falseValue,"active-text":i.activeText,"inactive-text":i.inactiveText,"show-text":i.showText,"active-color":i.activeColor||(i.type==="switch"?"#1B2433":void 0),"inactive-color":i.inactiveColor},e.toHandlers(G(i)),{onInput:g=>i.type!=="switch"?L(i):void 0,onChange:g=>i.type==="switch"?K(i,g):L(i)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","max-range","default-value","filterable","multiple","true-value","false-value","active-text","inactive-text","show-text","active-color","inactive-color","onInput","onChange"]))])],!0)]))),128))]),_:3}),Y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(Me,{variant:"secondary",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":m.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"query-encapsulation__actions",ref_key:"actionsRef",ref:C},[e.createElementVNode("div",go,[e.createVNode(Me,{variant:"primary",size:"small",onClick:oe,loading:n.loading},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(Me,{variant:"secondary",size:"small",onClick:ae,loading:n.loading},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(s.$slots,"extra-actions",{},void 0,!0)])],512)],512)])])]))}}),Ct=pe(yo,[["__scopeId","data-v-94c47976"]]),ko={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},wo={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},bo={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Co=["textContent"],xo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(n){const c=n,t=e.ref(!1);let l,p=0,m=0;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,c.duration&&c.duration>0&&r(c.duration)})}),e.onBeforeUnmount(()=>{N()});function r(u){p=u,m=Date.now(),l=window.setTimeout(()=>C(),u)}function N(){l&&(window.clearTimeout(l),l=void 0)}function B(){if(l&&c.duration&&c.duration>0){N();const u=Date.now()-m;p=Math.max(0,p-u)}}function S(){c.duration&&c.duration>0&&p>0&&r(p)}function C(){t.value=!1}function f(){var u;(u=c.onClose)==null||u.call(c,c.id)}return(u,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:f},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${n.type}`]]),style:e.normalizeStyle({zIndex:n.zIndex}),role:"status","aria-live":"polite",onMouseenter:B,onMouseleave:S},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${n.type}`]),"aria-hidden":"true"},[n.type==="success"?(e.openBlock(),e.createElementBlock("svg",ko,[...x[0]||(x[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.type==="warning"?(e.openBlock(),e.createElementBlock("svg",wo,[...x[1]||(x[1]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",bo,[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],2),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(n.message)},null,8,Co),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:C},"✕")):e.createCommentVNode("",!0)],38),[[e.vShow,t.value]])]),_:1}))}}),Eo=pe(xo,[["__scopeId","data-v-db173617"]]);let Bo=1;const Ze=12,Be=[];function No(){let n=20;return Be.forEach(c=>{n+=c.height+Ze}),n}function ct(n){const c=Be.findIndex(m=>m.id===n);if(c===-1)return;const{el:t}=Be[c],l=t.firstElementChild;if(l){const m=window.getComputedStyle(l).top;l.style.top=m,l.classList.add("is-leaving"),l.style.willChange="opacity, transform"}Be[c].leaving=!0,Fe(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const m=Be.findIndex(r=>r.id===n);m!==-1&&Be.splice(m,1),Fe()},260)}function Ge(n){var m;const c=Bo++,t=document.createElement("div");document.body.appendChild(t);const l=e.createVNode(Eo,{id:c,type:n.type||"success",message:n.message,duration:n.duration??2500,offset:No(),zIndex:2e5+c,closable:n.closable??!1,onClose:r=>ct(r)});e.render(l,t);const p=((m=t.firstElementChild)==null?void 0:m.offsetHeight)||0;return Be.push({id:c,el:t,vm:l,height:p,leaving:!1}),Fe(),requestAnimationFrame(()=>{const r=t.firstElementChild;if(!r)return;const N=r.offsetHeight||p||0,B=Be.find(S=>S.id===c);B&&(B.height=N,Fe())}),{close:()=>ct(c)}}const Le={success(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"success",message:n})},warning(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"warning",message:n})},error(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"error",message:n})}};typeof window<"u"&&(window.YMessage=Le,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=Le));function Fe(){let n=20;Be.forEach(c=>{const t=c.el.firstElementChild;if(!t)return;const l=n;if(t.style.transform=`translate(-50%, ${l}px)`,t.style.top||(t.style.top="0px"),!c.leaving)n+=(t.offsetHeight||c.height)+Ze;else{const p=t.offsetHeight||c.height;n+=p+Ze}})}const Vo=12;let So=1;const Ye=[];function Do(n){const c=n.elRef.value;return c&&c.getBoundingClientRect().height||0}function nt(){let n=0;Ye.forEach(c=>{const t=Do(c);if(t<=0){c.setOffset(0);return}c.setOffset(n),n+=t+Vo})}function To(n){const c=So++,t={id:c,elRef:n.el,setOffset:n.setOffset};return Ye.push(t),nt(),c}function $o(n){const c=Ye.findIndex(t=>t.id===n);c!==-1&&(Ye.splice(c,1),nt())}function Mo(){nt()}const Io={class:"floating-tip__content"},Lo=e.defineComponent({__name:"FloatingTip",props:{content:{default:""},duration:{default:5e3},manual:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},width:{default:void 0},height:{default:void 0},right:{default:16},bottom:{default:16},zIndex:{default:9999},maxWidth:{default:360}},emits:["close"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(null),r=e.ref(null),N=e.ref(0);let B=null;const S=e.ref(!0);function C(D){if(!(D==null||D===""))return typeof D=="number"?`${D}px`:D}const f=e.computed(()=>({right:`${t.right}px`,bottom:`${(t.bottom||0)+N.value}px`,zIndex:t.zIndex,width:C(t.width),height:C(t.height),maxWidth:t.width?void 0:`${t.maxWidth}px`}));function u(){m.value!==null&&(window.clearTimeout(m.value),m.value=null)}function x(){u(),!t.manual&&S.value&&(p.value||!t.duration||t.duration<=0||(m.value=window.setTimeout(()=>{p.value||M()},t.duration)))}function M(){u(),S.value=!1}function R(){p.value=!0,u()}function I(){p.value=!1,x()}function E(){l("close")}return e.onMounted(()=>{B=To({el:r,setOffset(D){N.value=D}}),x(),e.nextTick(()=>{Mo()})}),e.onBeforeUnmount(()=>{u(),B!==null&&($o(B),B=null)}),(D,Y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"floating-tip-fade",appear:"",onAfterLeave:E},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootRef",ref:r,class:"floating-tip",style:e.normalizeStyle(f.value),role:"status","aria-live":"polite",onMouseenter:R,onMouseleave:I},[e.createElementVNode("div",Io,[e.renderSlot(D.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)]),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"floating-tip__close","aria-label":"关闭提示",onClick:M}," × ")):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]),_:3})]))}}),dt=pe(Lo,[["__scopeId","data-v-ca26e00f"]]);let zo=1;const Ie=[];function Oe(n){const c=zo++,t=document.createElement("div");document.body.appendChild(t);const l={content:n.content??"",duration:n.duration??5e3,manual:n.manual??!1,closable:n.closable??!0,width:n.width,height:n.height,right:n.right,bottom:n.bottom,zIndex:n.zIndex,maxWidth:n.maxWidth,onClose:()=>{m()}},p=n.renderContent?e.createVNode(dt,l,{default:n.renderContent}):e.createVNode(dt,l);function m(){const r=Ie.findIndex(N=>N.id===c);r!==-1&&Ie.splice(r,1),e.render(null,t),t.parentNode&&t.parentNode.removeChild(t)}return e.render(p,t),Ie.push({id:c,el:t}),{close:m}}function Qe(n){const c=[...Ie];return Ie.length=0,c.forEach(t=>{e.render(null,t.el),t.el.parentNode&&t.el.parentNode.removeChild(t.el)}),Oe(n)}const Ho={class:"hint-tag-popup-content"},Ro=["title"],_o=e.defineComponent({__name:"hintTag",props:{content:{default:""},position:{default:"right"},defaultExpanded:{type:Boolean,default:!0},width:{default:"280px"},tooltip:{default:""},borderColor:{default:"#00a8e8"},maxLines:{default:void 0}},setup(n,{expose:c}){const t=n,l=e.ref(null),p=e.ref(null),m=e.ref(!1),r=e.ref(!1);let N=null;const B=()=>{if(!t.maxLines||!l.value){m.value=!1;return}const L=l.value,K=L.style.maxHeight,oe=L.classList.contains("hint-tag-content-clamp");L.style.maxHeight="none",oe&&L.classList.remove("hint-tag-content-clamp");const ae=L.scrollHeight,le=parseFloat(getComputedStyle(L).lineHeight)||18,te=t.maxLines*le;L.style.maxHeight=K,oe&&L.classList.add("hint-tag-content-clamp"),m.value=ae>te},S=()=>{t.maxLines&&m.value&&(N&&(clearTimeout(N),N=null),r.value=!0,setTimeout(()=>{x()},0))},C=()=>{N=window.setTimeout(()=>{r.value=!1,N=null},100)},f=()=>{N&&(clearTimeout(N),N=null)},u=()=>{r.value=!1},x=()=>{if(!p.value||!l.value)return;const L=l.value.getBoundingClientRect(),K=p.value.getBoundingClientRect(),oe=window.innerWidth,ae=window.innerHeight,le=window.scrollX||window.pageXOffset,te=window.scrollY||window.pageYOffset;let F=0,G=0;switch(t.position){case"right":F=L.right+12,G=L.top+te,F+K.width>oe+le&&(F=L.left-K.width-12),G=L.top+te+(L.height-K.height)/2,G<te&&(G=te+8),G+K.height>te+ae&&(G=te+ae-K.height-8);break;case"left":F=L.left-K.width-12,G=L.top+te,F<le&&(F=L.right+12),G=L.top+te+(L.height-K.height)/2,G<te&&(G=te+8),G+K.height>te+ae&&(G=te+ae-K.height-8);break;case"top":F=L.left+le+(L.width-K.width)/2,G=L.top-K.height-12,G<te&&(G=L.bottom+te+12),F<le+8&&(F=le+8),F+K.width>le+oe&&(F=le+oe-K.width-8);break;case"bottom":F=L.left+le+(L.width-K.width)/2,G=L.bottom+te+12,G+K.height>te+ae&&(G=L.top-K.height-12),F<le+8&&(F=le+8),F+K.width>le+oe&&(F=le+oe-K.width-8);break}p.value.style.left=`${F}px`,p.value.style.top=`${G}px`};e.onUpdated(()=>{B()});const M=e.ref(t.defaultExpanded),R=()=>{M.value=!M.value},I=()=>{M.value&&(M.value=!1)},E=()=>{M.value||(M.value=!0)};c({toggle:R,isExpanded:M,collapse:I,expand:E});const D=e.inject("registerHintTag",null),Y=e.inject("unregisterHintTag",null),se=e.inject("notifyHintTagStateChange",null),X={collapse:I,expand:E,toggle:R,get isExpanded(){return M.value}};return e.watch(()=>M.value,()=>{se&&se(),setTimeout(()=>{B()},0)}),e.watch(()=>[t.content,t.maxLines],()=>{setTimeout(()=>{B()},0)}),e.watch(r,L=>{L?(setTimeout(()=>{x()},0),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)):(window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x))}),e.onMounted(()=>{B(),D&&D(X)}),e.onUnmounted(()=>{Y&&Y(X),N&&(clearTimeout(N),N=null),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),(L,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hint-tag-wrapper",`hint-tag-wrapper-${n.position}`])},[e.createVNode(e.Transition,{name:"hint-slide"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag",`hint-tag-${n.position}`]),style:e.normalizeStyle({width:n.position==="top"||n.position==="bottom"?"auto":n.width,borderColor:n.borderColor})},[e.createElementVNode("div",{ref_key:"contentRef",ref:l,class:e.normalizeClass(["hint-tag-content",{"hint-tag-content-clamp":n.maxLines}]),style:e.normalizeStyle(n.maxLines?{"--line-clamp":n.maxLines,lineHeight:"1.5",maxHeight:`${n.maxLines*1.5}em`}:{}),onMouseenter:S,onMouseleave:C},[e.renderSlot(L.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)],38),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"popup-fade"},{default:e.withCtx(()=>[r.value&&m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popupRef",ref:p,class:"hint-tag-popup",onMouseenter:f,onMouseleave:u},[e.createElementVNode("div",Ho,[e.renderSlot(L.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)])],544)):e.createCommentVNode("",!0)]),_:3})])),e.createElementVNode("div",{class:"hint-tag-toggle",onClick:R},[...K[0]||(K[0]=[e.createElementVNode("svg",{class:"hint-tag-icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M15 18L9 12L15 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])],6),[[e.vShow,M.value]])]),_:3}),e.createVNode(e.Transition,{name:"hint-button-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag-button",`hint-tag-button-${n.position}`]),onClick:R,title:n.tooltip||n.content},[...K[1]||(K[1]=[e.createElementVNode("svg",{class:"hint-tag-button-icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Ro),[[e.vShow,!M.value]])]),_:1})],2))}}),Ko=pe(_o,[["__scopeId","data-v-9bfcff29"]]),ut={YButton:Me,YInput:Je,YTable:ft,YSelect:Xe,YPagination:mt,YBadge:vt,YDialog:ht,YPopover:pt,YTime:et,YSwitch:tt,YImage:gt,YDropdown:yt,YDrawer:kt,YTree:bt,QueryEncapsulation:Ct,HintTag:Ko},Wo={install(n){Object.keys(ut).forEach(c=>{n.component(c,ut[c])}),n.config.globalProperties.$message=Le,n.config.globalProperties.$showFloatingTip=Oe,n.config.globalProperties.$showFloatingTipReplace=Qe,typeof window<"u"&&(window.YMessage=Le,window.showFloatingTip=Oe,window.showFloatingTipReplace=Qe)}};exports.QueryEncapsulation=Ct;exports.YBadge=vt;exports.YButton=Me;exports.YDialog=ht;exports.YDrawer=kt;exports.YDropdown=yt;exports.YImage=gt;exports.YInput=Je;exports.YMessage=Le;exports.YPagination=mt;exports.YPopover=pt;exports.YSelect=Xe;exports.YSwitch=tt;exports.YTable=ft;exports.YTime=et;exports.YTree=bt;exports.default=Wo;exports.showFloatingTip=Oe;exports.showFloatingTipReplace=Qe;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Bt=["type","disabled","aria-busy","aria-disabled"],Nt={class:"content"},Vt={key:1,class:"y-btn-group",role:"group"},St=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Dt={class:"content"},Tt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},$t={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Mt={key:2},It=e.defineComponent({__name:"ybutton",props:{htmlType:{default:"button"},variant:{default:"primary"},size:{default:"medium"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},block:{type:Boolean,default:!1},groupPosition:{default:"single"},groupItems:{default:void 0}},emits:["click","group-click"],setup(n,{emit:c}){const t=n,l=c;function p(B){if(t.disabled||t.loading){B.preventDefault(),B.stopPropagation();return}l("click",B)}const m=e.computed(()=>{switch(t.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),r=e.computed(()=>Array.isArray(t.groupItems)&&t.groupItems.length>0);function N(B,S){if(t.disabled||t.loading||B.disabled||B.loading){S.preventDefault(),S.stopPropagation();return}l("group-click",B.value,S)}return(B,S)=>r.value?(e.openBlock(),e.createElementBlock("div",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.groupItems,(C,f)=>{var u;return e.openBlock(),e.createElementBlock("button",{key:C.value??f,class:e.normalizeClass(["y-btn",[`y-btn--${C.variant??n.variant}`,`y-btn--${C.size??n.size}`,"is-grouped",f===0?"group-pos-start":f===(((u=n.groupItems)==null?void 0:u.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":C.loading||n.loading}]]),type:n.htmlType,disabled:(C.disabled??!1)||n.disabled||n.loading||C.loading,"aria-busy":C.loading||n.loading?"true":"false","aria-disabled":(C.disabled??!1)||n.disabled||n.loading||C.loading?"true":"false","aria-label":C.ariaLabel||C.label,onClick:x=>N(C,x)},[e.createElementVNode("span",Dt,[C.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",Tt,[...S[0]||(S[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z","clip-rule":"evenodd"},null,-1)])])):C.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",$t,[...S[1]||(S[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0),C.label&&!C.onlyIcon?(e.openBlock(),e.createElementBlock("span",Mt,e.toDisplayString(C.label),1)):e.createCommentVNode("",!0)])],10,St)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${n.variant}`,`y-btn--${n.size}`,{"is-block":n.block,"is-loading":n.loading},n.groupPosition!=="single"?"is-grouped":"",m.value]]),type:n.htmlType,disabled:n.disabled||n.loading,"aria-busy":n.loading?"true":"false","aria-disabled":n.disabled||n.loading?"true":"false",onClick:p},[e.createElementVNode("span",Nt,[e.renderSlot(B.$slots,"default",{},void 0,!0)])],10,Bt))}}),pe=(n,c)=>{const t=n.__vccOpts||n;for(const[l,p]of c)t[l]=p;return t},Me=pe(It,[["__scopeId","data-v-53157673"]]),Lt=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],zt={key:0,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ht={key:1,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Rt=e.defineComponent({__name:"yinput",props:{modelValue:{default:""},type:{default:"text"},placeholder:{default:""},autocomplete:{default:"off"},inputmode:{default:void 0},id:{default:void 0},name:{default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},size:{default:"medium"},width:{default:"200px"},min:{default:void 0},max:{default:void 0},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue","enter","paste"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(null),m=e.ref(""),r=e.ref(!1),N=e.ref(!1),B=e.ref(t.placeholder||""),S=e.ref(!1),C=e.computed(()=>t.type==="password"),f=e.computed(()=>t.type==="password"&&S.value?"text":t.type);function u(){S.value=!S.value}e.watch(()=>t.placeholder,D=>{N.value||(B.value=D||"")});function x(D){const Y=D.target;r.value=!0,l("update:modelValue",Y.value)}function M(){N.value=!0,t.clearOnFocus&&(m.value=t.modelValue||"",r.value=!1,B.value=m.value||t.placeholder||"",l("update:modelValue",""))}function R(){if(N.value=!1,t.clearOnFocus&&!r.value&&(!t.modelValue||t.modelValue==="")&&l("update:modelValue",m.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const D=Number(t.modelValue),Y=Number(t.min);!Number.isNaN(D)&&!Number.isNaN(Y)&&D<Y&&l("update:modelValue",String(Y))}B.value=t.placeholder||""}function I(D){const Y=D.target;l("enter",Y.value)}function E(D){const Y=D.target;requestAnimationFrame(()=>{l("paste",Y.value)})}return(D,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":n.block,"has-password-toggle":C.value}]),style:e.normalizeStyle({width:n.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:p,class:e.normalizeClass(["y-input",`y-input--${n.size}`]),id:n.id,name:n.name,type:f.value,placeholder:B.value,autocomplete:n.autocomplete,inputmode:n.inputmode,min:n.min,max:n.max,disabled:n.disabled,required:n.required,value:n.modelValue,onInput:x,onFocus:M,onBlur:R,onKeyup:e.withKeys(I,["enter"]),onPaste:E},null,42,Lt),C.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["y-input-password-toggle",`y-input-password-toggle--${n.size}`]),onClick:u,tabindex:"-1"},[S.value?(e.openBlock(),e.createElementBlock("svg",zt,[...Y[0]||(Y[0]=[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ht,[...Y[1]||(Y[1]=[e.createElementVNode("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),e.createElementVNode("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))],2)):e.createCommentVNode("",!0)],6))}}),Je=pe(Rt,[["__scopeId","data-v-e954aa01"]]),_t={key:0,class:"bulk-bar"},Kt={class:"bulk-left"},Wt={class:"bulk-actions"},At={key:0,class:"table-header-actions"},Pt=["title"],Ft={key:0,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Yt={key:1,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Ot={key:1,class:"selected-header-floating"},jt={class:"table"},Ut={key:0,style:{width:"34px","min-width":"34px"}},qt={key:1,style:{width:"60px","min-width":"60px"}},Gt={key:0,class:"col-expand"},Zt={key:1,class:"col-select"},Qt={class:"select-header"},Jt=["checked","indeterminate","disabled"],Xt={key:0,class:"select-count"},en=["colspan"],tn={class:"selected-header-wrapper"},nn={key:0,class:"loading-overlay",style:{"z-index":"100"}},ln={key:1,class:"empty-overlay"},on={key:0,style:{width:"34px","min-width":"34px"}},an={key:1,style:{width:"60px","min-width":"60px"}},rn={key:0},sn=["colspan"],cn=["onClick"],dn={key:0,class:"col-expand"},un=["onClick"],fn=["value","checked","disabled","onChange"],mn=["colspan"],vn={key:1},hn=["colspan"],pn=e.defineComponent({__name:"ytable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},showBulkActions:{type:Boolean,default:!1},pagination:{type:Boolean,default:!0},pageSize:{default:10},currentPage:{},total:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},showTotal:{type:Boolean,default:!0},rowKey:{type:[String,Function],default:"id"},emptyText:{default:"无数据"},searchKeyword:{default:""},searchFields:{default:()=>[]},stickyHeader:{type:Boolean,default:!1},expandable:{type:Boolean},rowDisabled:{type:Function,default:void 0},selectedItems:{default:void 0},rowSelectable:{type:Boolean,default:!1},requireDeselectBeforeSelect:{type:Boolean,default:!0},selectedHeaderFloat:{type:Boolean,default:!1},virtualScroll:{type:Boolean,default:!1},virtualRowHeight:{default:36},virtualBuffer:{default:5},size:{default:"default"}},emits:["edit","select","update:selectedItems","page-change","page-size-change","row-click"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(t.currentPage||1),m=e.ref(t.pageSize),r=e.ref(t.selectedItems||[]),N=e.ref([]),B=e.ref(new Set),S=e.ref("none"),C=e.ref(),f=e.ref(),u=e.ref(),x=e.ref(),M=e.ref([]),R=e.ref({}),I=e.ref(35),E=e.ref(new Set),D=e.computed(()=>E.value.size>0),Y=e.computed(()=>{if(ae.value,E.value.size===0)return!1;let a=0;return E.value.forEach(v=>{v&&v.isExpanded&&a++}),a===E.value.size});e.computed(()=>{if(ae.value,E.value.size===0)return!0;let a=0;return E.value.forEach(v=>{v&&!v.isExpanded&&a++}),a===E.value.size});function se(a){E.value.add(a)}function X(a){E.value.delete(a)}function L(){E.value.forEach(a=>{a&&typeof a.collapse=="function"&&a.collapse()})}function K(){E.value.forEach(a=>{a&&typeof a.expand=="function"&&a.expand()})}function oe(){Y.value?L():K()}const ae=e.ref(0);function le(){ae.value++}e.provide("registerHintTag",se),e.provide("unregisterHintTag",X),e.provide("notifyHintTagStateChange",le);const te=e.computed(()=>t.columns.filter(a=>!w(a.width)).map(a=>a.key));function F(){return`${(100/(te.value.length||1)).toFixed(6)}%`}const G=e.ref(),W=e.ref({show:!1,thumbHeight:40,thumbTop:0});let U=!1,Q=0,O=0;const ee=e.ref(0);function w(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const v=String(a).trim();if(v)return/^\d+(\.\d+)?$/.test(v)?`${v}px`:v}function s(a){const v=w(a);if(!v)return null;const y=parseFloat(v);return Number.isFinite(y)?y:null}const o=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),i=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(v=>t.searchFields.some(y=>{const k=V(v,y);return String(k).toLowerCase().includes(a)}))}),g=e.computed(()=>(t.pagination,i.value)),$=e.computed(()=>!!t.virtualScroll),T=e.computed(()=>{const a=Number(t.virtualRowHeight);return Number.isFinite(a)&&a>0?a:36}),z=e.computed(()=>{const a=Number(t.virtualBuffer);return Number.isFinite(a)&&a>=0?Math.floor(a):5}),A=e.ref(0),P=e.ref(0),ne=e.computed(()=>$.value?g.value.length*T.value:0),J=e.computed(()=>$.value?A.value*T.value:0),me=e.computed(()=>{if(!$.value)return 0;const a=ne.value-J.value-(P.value-A.value)*T.value;return a>0?a:0}),j=e.computed(()=>{if(!$.value)return g.value.map((k,b)=>({item:k,index:b}));if(g.value.length===0)return[];const a=Math.max(0,Math.min(A.value,g.value.length)),v=Math.max(a,Math.min(g.value.length,P.value)),y=[];for(let k=a;k<v;k++)g.value[k]&&y.push({item:g.value[k],index:k});return y}),q=e.computed(()=>{if(!t.selectable)return!1;const v=j.value.map(({item:y,index:k})=>({key:ge(y,k),item:y,index:k})).filter(({item:y,index:k})=>!xe(y,k)).map(({key:y})=>y);return v.length>0&&v.every(y=>r.value.includes(y))}),Z=e.computed(()=>{if(!t.selectable||q.value)return!1;const v=j.value.map(({item:k,index:b})=>({key:ge(k,b),item:k,index:b})).filter(({item:k,index:b})=>!xe(k,b)).map(({key:k})=>k);if(v.length===0)return!1;const y=v.filter(k=>r.value.includes(k)).length;return y>0&&y<v.length}),ce=e.computed(()=>{if(!t.selectable)return!1;const a=j.value.map(({item:v,index:y})=>({item:v,index:y}));return a.length>0&&a.every(({item:v,index:y})=>xe(v,y))}),ue=e.computed(()=>t.pagination?g.value.length<m.value:!1),ve=e.computed(()=>{const a=[];let v=t.selectable?60:0;for(let y=0;y<t.columns.length;y++){const k=t.columns[y];if(k.fixed==="left"){let b=80;const _=s(k.width);_!==null?b=_:M.value[y]&&(b=s(M.value[y])??b),a.push(v),v+=b}}return a}),ye=e.computed(()=>{const a=[];let v=0;const y=[];for(let k=t.columns.length-1;k>=0;k--){const b=t.columns[k];if(b.fixed==="right"){let _=80;const re=s(b.width);re!==null?_=re:M.value[k]&&(_=s(M.value[k])??_),y.push({index:k,width:_})}}for(let k=0;k<y.length;k++)a.push(v),v+=y[k].width;return a});function Te(a,v){if(v==="left"){let y=0;for(let k=0;k<a;k++)t.columns[k].fixed==="left"&&y++;return y}else{let y=0;for(let k=t.columns.length-1;k>a;k--)t.columns[k].fixed==="right"&&y++;return y}}function ge(a,v){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||v}function xe(a,v){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,v):!1}function d(a){return B.value.has(a)}function h(a){B.value.has(a)?B.value.delete(a):B.value.add(a)}function V(a,v){return v.split(".").reduce((y,k)=>y==null?void 0:y[k],a)}function H(a,v=!1){const y=[];return a.align&&y.push(`text-${a.align}`),a.fixed==="right"&&(y.push("col-fixed-right"),v&&y.push("col-fixed-right-header")),a.fixed==="left"&&(y.push("col-fixed-left"),v&&y.push("col-fixed-left-header")),y.join(" ")}function ie(a,v,y){const k={},b=w(a.width);if(b)k.width=b,k.minWidth=b,k.maxWidth=b;else{const _=F();k.width=_,k.minWidth=_,k.maxWidth=_}if(a.fixed==="left"){const _=Te(v,"left"),re=ve.value[_]||0;k.left=`${re}px`,k.zIndex=y?`${10+_}`:`${5+_}`}else if(a.fixed==="right"){const _=Te(v,"right"),re=ye.value[_]||0;y?k.right=`${re-3}px`:k.right=`${re}px`,k.zIndex=y?`${10+_}`:`${5+_}`}return k}function de(a,v){const y=V(a,v.key);return v.formatter?v.formatter(y,a):y||""}function fe(a){const v=g.value.find((k,b)=>ge(k,b)===a),y=g.value.findIndex((k,b)=>ge(k,b)===a);v&&y>=0&&xe(v,y)||(r.value.includes(a)?r.value=r.value.filter(k=>k!==a):r.value=[...r.value,a],l("select",r.value),l("update:selectedItems",r.value))}function Ce(){const a=g.value.map((v,y)=>({key:ge(v,y),item:v,index:y})).filter(({item:v,index:y})=>!xe(v,y)).map(({key:v})=>v);if(a.length!==0){if(a.every(v=>r.value.includes(v)))r.value=r.value.filter(v=>!a.includes(v));else{const v=new Set([...r.value,...a]);r.value=Array.from(v)}l("select",r.value),l("update:selectedItems",r.value)}}function Ne(){r.value=[],l("select",r.value),l("update:selectedItems",r.value)}function je(a,v){if(!t.rowSelectable)return;const y=ge(a,v);xe(a,v)||(t.requireDeselectBeforeSelect?N.value.includes(y)?(N.value=N.value.filter(k=>k!==y),l("row-click",a,null)):(N.value=[...N.value,y],l("row-click",a,y)):N.value.includes(y)?(N.value=[],l("row-click",a,null)):(N.value=[y],l("row-click",a,y)))}function Ue(a,v){if(!t.rowSelectable)return!1;const y=ge(a,v);return N.value.includes(y)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const v=new Set(r.value),y=new Set(a);(v.size!==y.size||![...v].every(k=>y.has(k)))&&(r.value=[...a])}else a===void 0&&r.value.length>0&&(r.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{p.value=1}),e.watch(()=>t.data,()=>{t.total||(p.value=1),t.rowSelectable&&(N.value=[]),e.nextTick(()=>{requestAnimationFrame(()=>{if($.value&&u.value){const a=u.value.clientHeight;if(a>0){const v=T.value,y=z.value,k=Math.ceil(a/v)+y*2;A.value=0,P.value=Math.min(g.value.length,k)}else setTimeout(()=>{if(u.value){const v=u.value.clientHeight;if(v>0){const y=T.value,k=z.value,b=Math.ceil(v/y)+k*2;A.value=0,P.value=Math.min(g.value.length,b)}}},100)}else A.value=0,P.value=g.value.length})})},{deep:!0});function ze(a){p.value=a,t.rowSelectable&&(N.value=[]),l("page-change",a)}function he(a){m.value=a,p.value=1,t.rowSelectable&&(N.value=[]),l("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const v=typeof a=="number"&&a>0?a:1;p.value!==v&&(p.value=v)}),e.watch(()=>t.pageSize,a=>{const v=typeof a=="number"&&a>0?a:10;m.value!==v&&(m.value=v)});function ke(){C.value&&e.nextTick(()=>{const a=C.value.getBoundingClientRect(),v=window.innerHeight,y=a.top,k=C.value.querySelector(".table-header"),b=k?k.offsetHeight:40;let _=0;if(t.pagination){const De=C.value.querySelector(".ypagination");_=De?De.offsetHeight:60}const re=C.value.querySelector(".bulk-bar"),we=re?re.offsetHeight:0,Ke=b+_+we+20,We=v-y-Ke,Ae=Math.max(200,We),Pe=C.value.querySelector(".table-body-wrap .table");Pe&&(Pe.offsetHeight>We?S.value=`${Ae}px`:S.value="none")})}let Ve=!1;function Se(){!f.value||!u.value||Ve||f.value.scrollLeft!==u.value.scrollLeft&&(Ve=!0,f.value.scrollLeft=u.value.scrollLeft,requestAnimationFrame(()=>{Ve=!1}))}function lt(){!f.value||!u.value||Ve||u.value.scrollLeft!==f.value.scrollLeft&&(Ve=!0,u.value.scrollLeft=f.value.scrollLeft,requestAnimationFrame(()=>{Ve=!1}))}function He(){e.nextTick(()=>{if(!u.value)return;const a=u.value,v=a.scrollHeight,y=a.clientHeight,k=a.scrollTop,b=v>y+1;if(W.value.show=b,!b)return;const _=24,re=y/v,we=G.value?G.value.clientHeight:y,be=Math.max(_,Math.floor(we*re));W.value.thumbHeight=be;const Ke=Math.max(0,we-be),We=Math.max(1,v-y);if(W.value.thumbTop=Math.min(Ke,Math.floor(k/We*Ke)),$.value&&y>0){const qe=T.value,Ae=z.value,Pe=g.value.length,De=Math.floor(k/qe)-Ae,xt=Math.ceil(y/qe)+Ae*2,Et=De+xt;A.value=Math.max(0,De),P.value=Math.min(Pe,Et)}})}function ot(a){if(!U||!u.value||!G.value)return;a.preventDefault();const v=G.value.clientHeight,y=Math.max(0,v-W.value.thumbHeight),k=u.value,b=k.scrollHeight,_=k.clientHeight,re=Math.max(1,b-_),be=(a.clientY-Q)/Math.max(1,y)*re;k.scrollTop=Math.min(re,Math.max(0,O+be)),He()}function at(){U=!1,window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",at)}function it(){e.nextTick(()=>{var y,k;if(M.value.length===t.columns.length&&M.value.every(b=>!!b))return;const a=[];t.columns.forEach((b,_)=>{const re=w(b.width);if(re)a.push(re),R.value[b.key]=re;else if(R.value[b.key])a.push(R.value[b.key]);else{const we=M.value[_];if(we)a.push(we),R.value[b.key]=we;else{const be=F();a.push(be),R.value[b.key]=be}}});const v=(y=x.value)==null?void 0:y.querySelector("tbody tr");if(v){const b=t.selectable?1:0,_=Array.from(v.children);for(let re=0;re<t.columns.length;re++)if(!a[re]){const we=_[b+re];if(we&&we.clientWidth>0){const be=`${we.clientWidth}px`;a[re]=be,R.value[t.columns[re].key]=be}else{const be=F();a[re]=be,R.value[t.columns[re].key]=be}}}else for(let b=0;b<a.length;b++)if(!a[b]){const _=R.value[((k=t.columns[b])==null?void 0:k.key)||""];a[b]=_||M.value[b]||"80px",t.columns[b]&&(R.value[t.columns[b].key]=a[b])}M.value=a})}function Re(){ke(),Ee(),_e()}e.watch(()=>t.data,()=>{e.nextTick(()=>{ke(),Se(),Ee(),B.value.clear()})},{deep:!0}),e.watch([p,m],()=>{e.nextTick(()=>{ke(),Se(),Ee()})}),e.watch(()=>t.columns,()=>{const a=[],v={...R.value};t.columns.forEach((k,b)=>{const _=w(k.width);_?(a.push(_),v[k.key]=_):v[k.key]?a.push(v[k.key]):M.value[b]?(a.push(M.value[b]),v[k.key]=M.value[b]):a.push("")});const y=new Set(t.columns.map(k=>k.key));Object.keys(v).forEach(k=>{y.has(k)||delete v[k]}),R.value=v,M.value=a,e.nextTick(()=>{it(),Se(),Ee(),_e()})},{deep:!0});function rt(){e.nextTick(()=>{if(!f.value)return;const a=f.value.querySelector(".table");if(a&&r.value.length===0){const v=a.querySelector("thead th:not(.col-select):not(.col-expand)");v&&v.offsetHeight>0&&(I.value=v.offsetHeight)}})}function _e(){e.nextTick(()=>{if(!f.value)return;const a=f.value.querySelector(".table");if(!a)return;const v=a.querySelector(".col-selected-header");if(v){const y=v.querySelector(".selected-header-wrapper");y&&(y.style.height=`${I.value}px`)}else rt()})}e.watch(()=>r.value,()=>{e.nextTick(()=>{ke(),Ee(),_e()})},{deep:!0}),e.watch(()=>t.loading,(a,v)=>{e.nextTick(()=>{Ee(),v===!0&&a===!1&&$.value&&requestAnimationFrame(()=>{if(u.value){const y=u.value.clientHeight,k=T.value,b=z.value,_=Math.ceil(y/k)+b*2;A.value=0,P.value=Math.min(g.value.length,_),He()}})})}),e.onMounted(()=>{var a,v;e.nextTick(()=>{ke(),it(),Ee(),He(),$.value&&u.value&&requestAnimationFrame(()=>{if(u.value){const y=u.value.clientHeight;if(y>0){const k=T.value,b=z.value,_=Math.ceil(y/k)+b*2;A.value=0,P.value=Math.min(g.value.length,_)}else setTimeout(()=>{if(u.value){const k=u.value.clientHeight;if(k>0){const b=T.value,_=z.value,re=Math.ceil(k/b)+_*2;A.value=0,P.value=Math.min(g.value.length,re)}}},100)}}),rt(),_e()}),window.addEventListener("resize",Re),window.addEventListener("scroll",Re,!0),(a=u.value)==null||a.addEventListener("scroll",()=>{Se(),He(),Ee()},{passive:!0}),(v=f.value)==null||v.addEventListener("scroll",()=>{lt()},{passive:!0}),e.nextTick(()=>Se()),u.value&&typeof ResizeObserver<"u"&&($e=new ResizeObserver(()=>{Ee()}),$e.observe(u.value))}),e.onUnmounted(()=>{var a,v;window.removeEventListener("resize",Re),window.removeEventListener("scroll",Re,!0),(a=u.value)==null||a.removeEventListener("scroll",Se),(v=f.value)==null||v.removeEventListener("scroll",lt),window.removeEventListener("mousemove",ot),window.removeEventListener("mouseup",at),$e&&($e.disconnect(),$e=null)});let st=-1;function Ee(){!f.value||!u.value||requestAnimationFrame(()=>{if(!f.value||!u.value)return;const a=u.value,v=Math.ceil(a.offsetWidth-a.clientWidth);if(ee.value=v,v!==st){st=v;const y=f.value.querySelector(".table"),k=x.value;y&&k&&(f.value.style.paddingRight="0px",y.style.width="",y.style.marginRight="",v>0?(f.value.style.paddingRight=`${v}px`,y.style.width="100%",y.style.marginRight=`-${v}px`):(f.value.style.paddingRight="0px",y.style.width="100%",y.style.marginRight="0px"))}})}let $e=null;return e.onUnmounted(()=>{E.value.clear()}),(a,v)=>{const y=e.resolveComponent("YButton"),k=e.resolveComponent("ypagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:C},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[r.value.length&&n.showBulkActions?(e.openBlock(),e.createElementBlock("div",_t,[e.createElementVNode("div",Kt,"已选择 "+e.toDisplayString(r.value.length)+" 项",1),e.createElementVNode("div",Wt,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:r.value,clearSelection:Ne},()=>[e.createVNode(y,{size:"small",class:"btn",onClick:Ne},{default:e.withCtx(()=>[...v[3]||(v[3]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",{class:e.normalizeClass(["card",`ytable-size-${n.size}`])},[D.value?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-all-hints-btn",{"is-expanded":Y.value}]),onClick:oe,title:Y.value?"收起所有提示标签":"展开所有提示标签"},[Y.value?(e.openBlock(),e.createElementBlock("svg",Ft,[...v[4]||(v[4]=[e.createElementVNode("path",{d:"M15 18L9 12L15 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Yt,[...v[5]||(v[5]=[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],10,Pt)])):e.createCommentVNode("",!0),n.selectedHeaderFloat&&r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:Ne},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:f},[e.createElementVNode("table",jt,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",Ut)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",qt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("col",{key:b.key,style:e.normalizeStyle({width:M.value[_]||void 0,minWidth:M.value[_]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",Gt)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("th",Zt,[e.createElementVNode("div",Qt,[e.createElementVNode("input",{type:"checkbox",checked:q.value,indeterminate:Z.value,disabled:ce.value,onChange:Ce},null,40,Jt),r.value.length>0?(e.openBlock(),e.createElementBlock("span",Xt,e.toDisplayString(r.value.length),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),!n.selectedHeaderFloat&&r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("th",{key:2,colspan:n.columns.length,class:"col-selected-header",style:{width:"100%"}},[e.createElementVNode("div",tn,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:Ne},void 0,!0)])],8,en)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("th",{key:b.key,class:e.normalizeClass(H(b,!0)),style:e.normalizeStyle(ie(b,_,!0))},e.toDisplayString(b.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":n.loading,"is-empty":!g.value.length&&!n.loading}]),ref_key:"bodyWrapRef",ref:u,style:e.normalizeStyle({maxHeight:S.value})},[n.loading?(e.openBlock(),e.createElementBlock("div",nn,[...v[6]||(v[6]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!g.value.length&&!n.loading?(e.openBlock(),e.createElementBlock("div",ln,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":n.loading}]),ref_key:"bodyTableRef",ref:x},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",on)):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("col",an)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(b,_)=>(e.openBlock(),e.createElementBlock("col",{key:b.key,style:e.normalizeStyle({width:M.value[_]||void 0,minWidth:M.value[_]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[$.value&&J.value>0?(e.openBlock(),e.createElementBlock("tr",rn,[e.createElementVNode("td",{colspan:o.value,style:e.normalizeStyle({height:J.value+"px",borderBottom:"none",padding:0})},null,12,sn)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,b=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ge(b.item,b.index)},[e.createElementVNode("tr",{class:e.normalizeClass({"row-selected":Ue(b.item,b.index)}),onClick:_=>je(b.item,b.index)},[t.expandable?(e.openBlock(),e.createElementBlock("td",dn,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:e.withModifiers(_=>h(ge(b.item,b.index)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":d(ge(b.item,b.index))}])},null,2)],8,un)])):e.createCommentVNode("",!0),n.selectable?(e.openBlock(),e.createElementBlock("td",{key:1,class:"col-select",onClick:v[0]||(v[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("input",{type:"checkbox",value:ge(b.item,b.index),checked:r.value.includes(ge(b.item,b.index)),disabled:xe(b.item,b.index),onChange:e.withModifiers(_=>fe(ge(b.item,b.index)),["stop"])},null,40,fn)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(_,re)=>(e.openBlock(),e.createElementBlock("td",{key:_.key,class:e.normalizeClass(H(_)),style:e.normalizeStyle(ie(_,re,!1))},[e.renderSlot(a.$slots,`cell-${_.key}`,{item:b.item,value:V(b.item,_.key),index:b.index},()=>[e.createTextVNode(e.toDisplayString(de(b.item,_)),1)],!0)],6))),128))],10,cn),t.expandable&&d(ge(b.item,b.index))?(e.openBlock(),e.createElementBlock("tr",{key:`${ge(b.item,b.index)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:o.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:b.item,index:b.index},void 0,!0)],8,mn)])):e.createCommentVNode("",!0)],64))),128)),$.value&&me.value>0?(e.openBlock(),e.createElementBlock("tr",vn,[e.createElementVNode("td",{colspan:o.value,style:e.normalizeStyle({height:me.value+"px",borderBottom:"none",padding:0})},null,12,hn)])):e.createCommentVNode("",!0)])],2)],6),n.pagination?(e.openBlock(),e.createBlock(k,{key:2,class:"align-right","current-page":p.value,"onUpdate:currentPage":v[1]||(v[1]=b=>p.value=b),"page-size":m.value,"onUpdate:pageSize":v[2]||(v[2]=b=>m.value=b),loading:t.loading,"disable-next":ue.value,"page-size-options":n.pageSizeOptions,total:t.total,"show-total":t.showTotal,onPageChange:ze,onPageSizeChange:he},null,8,["current-page","page-size","loading","disable-next","page-size-options","total","show-total"])):e.createCommentVNode("",!0)],2)],512)}}}),ft=pe(pn,[["__scopeId","data-v-114a4371"]]),gn=["onKeydown","aria-expanded"],yn={key:0,class:"yselect__tags"},kn=["src"],wn={class:"yselect__tag-text"},bn=["onClick"],Cn={key:1,class:"yselect__placeholder-text"},xn=["src"],En=["placeholder","onKeydown"],Bn=["onClick","onMouseenter"],Nn={key:0,class:"yselect__option-check"},Vn={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},Sn=["src"],Dn=e.defineComponent({__name:"yselect",props:{modelValue:{},options:{},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},clearTo:{default:void 0},filterable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(-1),r=e.ref(),N=e.ref(),B=e.ref(),S=e.ref(!1),C=e.ref(),f=e.ref(""),u=e.computed(()=>t.multiple?null:t.options.find(w=>D(w)===t.modelValue)||null),x=e.computed(()=>{if(!t.multiple)return[];const w=Array.isArray(t.modelValue)?t.modelValue:[];return t.options.filter(s=>w.includes(D(s)))}),M=e.computed(()=>{if(t.multiple){const w=x.value.length;return w===0?"":`已选择 ${w} 项`}return u.value?Y(u.value):""}),R=e.computed(()=>{if(!t.filterable)return t.options;const w=f.value.trim().toLowerCase();return w?t.options.filter(s=>{const o=Y(s);return String(o).toLowerCase().includes(w)}):t.options}),I=e.computed(()=>{var g;const w={position:"fixed",zIndex:"100001"},s=N.value;if(!s)return w;const o=s.getBoundingClientRect(),i=((g=B.value)==null?void 0:g.getBoundingClientRect().width)||o.width;return w.left=`${o.left}px`,w.width=`${i}px`,S.value?(w.bottom=`${window.innerHeight-o.top+4}px`,w.top="auto"):w.top=`${o.bottom+4}px`,w});function E(){!p.value||!N.value||e.nextTick(()=>{const w=N.value;if(!w)return;const s=w.getBoundingClientRect(),o=window.innerHeight,i=200,g=s.bottom+i+4,$=s.top-i-4,T=g<=o-20,z=$>=20;S.value=!T&&z})}function D(w){return typeof w=="object"&&w!==null?w[t.valueKey]:w}function Y(w){return typeof w=="object"&&w!==null?w[t.labelKey]||String(w[t.valueKey]):String(w)}function se(w,s){return typeof w=="object"&&w!==null&&w.id!==void 0?w.id:D(w)||s}function X(w){return t.multiple?(Array.isArray(t.modelValue)?t.modelValue:[]).includes(D(w)):D(w)===t.modelValue}function L(w){return typeof w=="object"&&w!==null?w[t.disabledKey]===!0:!1}function K(){t.disabled||(p.value?ae():oe())}function oe(){t.disabled||(p.value=!0,e.nextTick(()=>{E(),U(),t.filterable&&C.value&&(C.value.focus(),f.value="")}))}function ae(){p.value=!1,m.value=-1,S.value=!1,t.filterable&&(f.value="")}function le(w,s){if(L(w))return;const o=D(w);if(t.multiple){const i=Array.isArray(t.modelValue)?[...t.modelValue]:[],g=D(w),$=i.indexOf(g);$>-1?i.splice($,1):i.push(g),l("update:modelValue",i),l("change",i,x.value)}else l("update:modelValue",o),l("change",o,w),ae()}function te(){if(!t.clearable||t.disabled)return;const w=t.multiple?t.clearTo!==void 0?t.clearTo:[]:t.clearTo;l("update:modelValue",w),l("change",w,t.multiple?[]:null),l("clear"),t.multiple||ae()}function F(w,s){if(s.stopPropagation(),t.disabled||!t.multiple)return;const o=Array.isArray(t.modelValue)?[...t.modelValue]:[],i=D(w),g=o.indexOf(i);g>-1&&(o.splice(g,1),l("update:modelValue",o),l("change",o,x.value))}function G(w){if(!R.value||R.value.length===0){m.value=-1;return}let s=m.value;const o=R.value.length;s===-1?s=w>0?0:o-1:s=(s+w+o)%o;let i=0;for(;i<o&&L(R.value[s]);)s=(s+w+o)%o,i++;m.value=i>=o?-1:s,Q()}function W(){if(m.value<0)return;const w=R.value[m.value];!w||L(w)||le(w,m.value)}function U(){if(!r.value)return;const w=r.value.querySelector(".yselect__option--selected");w&&w.scrollIntoView({block:"nearest"})}function Q(){if(!r.value||m.value<0)return;const s=r.value.querySelectorAll(".yselect__option")[m.value];s&&s.scrollIntoView({block:"nearest"})}function O(w){const s=w.target;(!B.value||!B.value.contains(s))&&ae()}e.watch(()=>t.modelValue,()=>{m.value=-1});function ee(){p.value&&E()}return e.onMounted(()=>{document.addEventListener("click",O),window.addEventListener("resize",ee),window.addEventListener("scroll",ee,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",O),window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee,!0)}),(w,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":n.disabled,[`yselect--${n.size}`]:!0}]),style:e.normalizeStyle({width:n.width}),ref_key:"selectContainer",ref:B},[e.createElementVNode("div",{ref_key:"triggerElement",ref:N,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":p.value,"yselect__trigger--disabled":n.disabled,"yselect__trigger--error":n.error}]),onMousedown:e.withModifiers(K,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(K,["prevent"]),["enter"]),e.withKeys(e.withModifiers(K,["prevent"]),["space"]),e.withKeys(ae,["escape"]),e.withKeys(e.withModifiers(oe,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(oe,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":p.value,"aria-haspopup":!0},[!n.filterable||!p.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!M.value}])},[e.renderSlot(w.$slots,"value",{value:t.multiple?x.value:u.value,label:M.value,multiple:t.multiple},()=>{var o;return[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[x.value.length>0?(e.openBlock(),e.createElementBlock("div",yn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(i,g)=>(e.openBlock(),e.createElementBlock("span",{key:se(i,g),class:"yselect__tag"},[i!=null&&i.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:i.flagImg,alt:"flag"},null,8,kn)):e.createCommentVNode("",!0),e.createElementVNode("span",wn,e.toDisplayString(Y(i)),1),n.clearable&&!n.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"yselect__tag-close",onClick:e.withModifiers($=>F(i,$),["stop"])},[...s[8]||(s[8]=[e.createElementVNode("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[e.createElementVNode("path",{d:"M2.5 2.5l5 5M7.5 2.5l-5 5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})],-1)])],8,bn)):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("span",Cn,e.toDisplayString(n.placeholder),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(o=u.value)!=null&&o.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:u.value.flagImg,alt:"flag"},null,8,xn)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(M.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(n.placeholder),1)],64))],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:C,class:"yselect__input",type:"text",placeholder:t.multiple?x.value.length>0?`已选择 ${x.value.length} 项`:n.placeholder:M.value||n.placeholder,"onUpdate:modelValue":s[0]||(s[0]=o=>f.value=o),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(o=>G(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(o=>G(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(o=>W(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(ae,["prevent"]),["esc"]),e.withKeys(e.withModifiers(te,["prevent"]),["delete"])]},null,40,En)),[[e.vModelText,f.value]]),n.clearable&&!n.disabled&&(t.multiple?x.value.length>0:u.value)?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(te,["stop"])},[...s[9]||(s[9]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 3l6 6M9 3L3 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["yselect__arrow",{"yselect__arrow--open":p.value}])},[...s[10]||(s[10]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)],42,gn),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":S.value}]),style:e.normalizeStyle(I.value),onMousedown:s[6]||(s[6]=e.withModifiers(()=>{},["stop"])),onClick:s[7]||(s[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"yselect__options",ref_key:"optionsContainer",ref:r},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(o,i)=>(e.openBlock(),e.createElementBlock("div",{key:se(o,i),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":X(o),"yselect__option--disabled":L(o),"yselect__option--hover":m.value===i}]),onClick:g=>le(o),onMouseenter:g=>m.value=i,onMouseleave:s[5]||(s[5]=g=>m.value=-1)},[e.renderSlot(w.$slots,"option",{option:o,index:i,selected:X(o)},()=>[t.multiple?(e.openBlock(),e.createElementBlock("span",Nn,[X(o)?(e.openBlock(),e.createElementBlock("svg",Vn,[...s[11]||(s[11]=[e.createElementVNode("path",{d:"M2 7l3 3 7-7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),o!=null&&o.flagImg?(e.openBlock(),e.createElementBlock("img",{key:1,class:"yselect__flag",src:o.flagImg,alt:"flag"},null,8,Sn)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(Y(o)),1)],!0)],42,Bn))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Xe=pe(Dn,[["__scopeId","data-v-b08c47e4"]]),Tn={class:"ypagination"},$n={key:0,class:"page-info"},Mn={class:"page-actions"},In={class:"page-size-select"},Ln=e.defineComponent({__name:"ypagination",props:{currentPage:{},pageSize:{},loading:{type:Boolean,default:!1},pageSizeOptions:{default:()=>[{label:"10/页",value:10},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},disableNext:{type:Boolean,default:!1},total:{},showTotal:{type:Boolean,default:!0}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(t.pageSize),m=e.computed(()=>t.pageSizeOptions),r=e.computed({get:()=>t.currentPage,set:C=>{l("update:currentPage",C),l("page-change",C)}});function N(C){t.loading||C>=1&&C!==t.currentPage&&(r.value=C)}function B(C){t.loading||(p.value=C,l("update:pageSize",C),l("page-size-change",C),r.value=1)}function S(C){t.loading||(C==="prev"?N(r.value-1):C==="next"&&N(r.value+1))}return p.value=t.pageSize,e.watch(()=>t.pageSize,C=>{typeof C=="number"&&p.value!==C&&(p.value=C)}),(C,f)=>{const u=e.resolveComponent("YButton"),x=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",Tn,[n.showTotal&&n.total!==void 0&&n.total!==null?(e.openBlock(),e.createElementBlock("div",$n,[e.createElementVNode("span",null,"共 "+e.toDisplayString(n.total)+" 条",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Mn,[e.createVNode(u,{size:"small",variant:"secondary",disabled:r.value===1||n.loading,onClick:f[0]||(f[0]=M=>N(1))},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(u,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:r.value===1||n.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:n.loading||n.disableNext,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:S},null,8,["groupItems"]),e.createElementVNode("div",In,[e.createVNode(x,{modelValue:p.value,"onUpdate:modelValue":f[1]||(f[1]=M=>p.value=M),options:m.value,size:"small",width:"105px",clearable:!1,disabled:n.loading,onChange:B},null,8,["modelValue","options","disabled"])])])])}}}),mt=pe(Ln,[["__scopeId","data-v-43d494c6"]]),zn=["aria-label"],Hn={class:"y-badge__inner"},Rn={key:0,class:"y-badge__progress","aria-hidden":"true"},_n={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Kn={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Wn={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},An={key:1,class:"y-badge__icon","aria-hidden":"true"},Pn={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Fn={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Yn={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},On={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},jn={class:"y-badge__label"},Un=e.defineComponent({__name:"ybadge",props:{tone:{default:"default"},size:{default:"medium"},progress:{default:void 0},icon:{default:void 0},pill:{type:Boolean,default:!0},outline:{type:Boolean,default:!1},label:{default:""}},setup(n){const c=n,t=e.computed(()=>c.tone||"default"),l=e.computed(()=>{const p=(c.label||"").trim(),m=c.tone,r=c.progress;if(r){const N={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return p?`${p},进度:${N[r]||r}`:`进度:${N[r]||r}`}if(m&&m!=="default"){const N={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return p?`${p},语气:${N[m]||m}`:`语气:${N[m]||m}`}return p||"标记"});return(p,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${n.size}`,{"is-outline":n.outline,"is-pill":n.pill},n.progress?`y-badge--progress-${n.progress}`:""]]),role:"status","aria-label":l.value},[e.createElementVNode("span",Hn,[n.progress?(e.openBlock(),e.createElementBlock("span",Rn,[n.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",_n,[...m[0]||(m[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):n.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Kn,[...m[1]||(m[1]=[e.createElementVNode("path",{d:"M10 5a5 5 0 100 10V5z"},null,-1),e.createElementVNode("circle",{cx:"10",cy:"10",r:"5",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1)])])):n.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",Wn,[...m[2]||(m[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)])):n.icon?(e.openBlock(),e.createElementBlock("span",An,[n.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Pn,[...m[3]||(m[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):n.icon==="check"?(e.openBlock(),e.createElementBlock("svg",Fn,[...m[4]||(m[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):n.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Yn,[...m[5]||(m[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",On,[...m[6]||(m[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",jn,[e.renderSlot(p.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.label),1)],!0)])])],10,zn))}}),vt=pe(Un,[["__scopeId","data-v-ce819797"]]),qn=["aria-hidden"],Gn=["onKeydown"],Zn={key:0,class:"y-dialog-header"},Qn={class:"y-dialog-title"},Jn={class:"y-dialog-body"},Xn={key:1,class:"y-dialog-footer"},el=e.defineComponent({__name:"ydialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},width:{default:"520px"},top:{default:"15vh"},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:100001},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(n,{emit:c}){const t=n,l=c,p=e.computed({get:()=>t.modelValue,set:f=>l("update:modelValue",f)}),m=e.ref(null),r=e.computed(()=>{const f={};return f.width=typeof t.width=="number"?`${t.width}px`:String(t.width),f.margin="0 auto",f.top=t.top,f});function N(){t.maskClosable&&B()}function B(){p.value&&(p.value=!1,l("close"))}function S(){t.closable&&B()}function C(f){f.key==="Escape"&&S()}return e.watch(()=>t.modelValue,f=>{f?(l("open"),requestAnimationFrame(()=>{var u;return(u=m.value)==null?void 0:u.focus()}),document.addEventListener("keydown",C),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",C),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",C),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",C),document.body.style.overflow=""}),(f,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:N}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-dialog-panel",[n.center?"is-center":""]]),style:e.normalizeStyle(r.value),onKeydown:e.withKeys(e.withModifiers(S,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Zn,[e.renderSlot(f.$slots,"header",{},()=>[e.createElementVNode("div",Qn,e.toDisplayString(n.title),1)],!0),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:B}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Jn,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),f.$slots.footer?(e.openBlock(),e.createElementBlock("div",Xn,[e.renderSlot(f.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Gn),[[e.vShow,p.value]])]),_:3})],12,qn),[[e.vShow,p.value]])]))}}),ht=pe(el,[["__scopeId","data-v-b4d84def"]]),tl={class:"ypopover__inner"},nl=e.defineComponent({__name:"ypopover",props:{trigger:{default:"click"},placement:{default:"bottom"},showArrow:{type:Boolean,default:!0},showPadding:{type:Boolean,default:!0},dark:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDelay:{default:0},closeDelay:{default:200},closeOnClickOutside:{type:Boolean,default:!0},closeOnClickContent:{type:Boolean,default:!1},width:{default:"auto"},maxWidth:{default:"300px"},offset:{default:8},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","show","hide","before-show","before-hide"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(),r=e.ref(),N=e.ref(),B=e.ref(!1),S=e.ref(),C=e.ref(),f=e.ref({});let u=null,x=null;const M=e.computed(()=>{if(!B.value||!S.value)return{};const W={};l.width!=="auto"&&(W.width=typeof l.width=="number"?`${l.width}px`:l.width),l.maxWidth&&(W.maxWidth=typeof l.maxWidth=="number"?`${l.maxWidth}px`:l.maxWidth);const{top:U,left:Q}=I();return W.top=`${U}px`,W.left=`${Q}px`,W}),R=e.computed(()=>{if(!l.showArrow)return{};if(Object.keys(f.value).length>0)return f.value;const W={};return l.placement.startsWith("top")||l.placement.startsWith("bottom")?W.left="50%":W.top="50%",W});function I(){var $,T;if(!S.value)return{top:0,left:0};const{width:W,height:U,top:Q,left:O}=S.value,ee=(($=N.value)==null?void 0:$.offsetWidth)||200,w=((T=N.value)==null?void 0:T.offsetHeight)||100;let s=0,o=0;switch(l.placement){case"top":s=Q-w-l.offset,o=O+(W-ee)/2;break;case"top-start":s=Q-w-l.offset,o=O;break;case"top-end":s=Q-w-l.offset,o=O+W-ee;break;case"bottom":s=Q+U+l.offset,o=O+(W-ee)/2;break;case"bottom-start":s=Q+U+l.offset,o=O;break;case"bottom-end":s=Q+U+l.offset,o=O+W-ee;break;case"left":s=Q+(U-w)/2,o=O-ee-l.offset;break;case"left-start":s=Q,o=O-ee-l.offset;break;case"left-end":s=Q+U-w,o=O-ee-l.offset;break;case"right":s=Q+(U-w)/2,o=O+W+l.offset;break;case"right-start":s=Q,o=O+W+l.offset;break;case"right-end":s=Q+U-w,o=O+W+l.offset;break}const i=window.innerWidth,g=window.innerHeight;return o<8&&(o=8),o+ee>i-8&&(o=i-ee-8),s<8&&(s=8),s+w>g-8&&(s=g-w-8),{top:s,left:o}}function E(){l.disabled||B.value||(X(),l.openDelay>0?u=setTimeout(()=>{D()},l.openDelay):D())}function D(){p("before-show"),B.value=!0,p("update:modelValue",!0),p("show"),e.nextTick(()=>{e.nextTick(()=>{K()})})}function Y(){B.value&&(X(),l.closeDelay>0?x=setTimeout(()=>{se()},l.closeDelay):se())}function se(){p("before-hide"),B.value=!1,p("update:modelValue",!1),p("hide")}function X(){u&&(clearTimeout(u),u=null),x&&(clearTimeout(x),x=null)}function L(){if(!l.showArrow||!S.value||!N.value){f.value={};return}const W=S.value,U=N.value.getBoundingClientRect();if(U.width===0||U.height===0){const O={};l.placement.startsWith("top")||l.placement.startsWith("bottom")?O.left="50%":O.top="50%",f.value=O;return}const Q={};if(l.placement.startsWith("top")){Q.bottom="-6px";const O=W.left+W.width/2,ee=U.left,w=O-ee;Q.left=`${Math.max(12,Math.min(w,U.width-12))}px`}else if(l.placement.startsWith("bottom")){Q.top="-6px";const O=W.left+W.width/2,ee=U.left,w=O-ee;Q.left=`${Math.max(12,Math.min(w,U.width-12))}px`}else if(l.placement.startsWith("left")){Q.right="-6px";const O=W.top+W.height/2,ee=U.top,w=O-ee;Q.top=`${Math.max(12,Math.min(w,U.height-12))}px`}else if(l.placement.startsWith("right")){Q.left="-6px";const O=W.top+W.height/2,ee=U.top,w=O-ee;Q.top=`${Math.max(12,Math.min(w,U.height-12))}px`}f.value=Q}function K(){r.value&&(S.value=r.value.getBoundingClientRect(),N.value&&(C.value=N.value.getBoundingClientRect(),L(),B.value&&requestAnimationFrame(()=>{N.value&&(C.value=N.value.getBoundingClientRect(),L())})))}function oe(){l.disabled||l.trigger==="click"&&(B.value?Y():E())}function ae(){l.disabled||l.trigger!=="hover"||(X(),E())}function le(){l.disabled||l.trigger!=="hover"||Y()}function te(){l.disabled||l.trigger!=="hover"||X()}function F(){l.disabled||l.trigger!=="hover"||Y()}function G(W){if(!l.closeOnClickOutside||!B.value)return;const U=W.target;m.value&&!m.value.contains(U)&&N.value&&!N.value.contains(U)&&Y()}return e.watch(()=>l.modelValue,W=>{W!==B.value&&(W?E():Y())}),e.watch(B,W=>{W?(document.addEventListener("click",G),window.addEventListener("resize",K),window.addEventListener("scroll",K,!0),e.nextTick(()=>{K(),requestAnimationFrame(()=>{K()}),setTimeout(()=>{K()},0)})):(document.removeEventListener("click",G),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0))}),e.onMounted(()=>{l.modelValue&&E()}),e.onUnmounted(()=>{X(),document.removeEventListener("click",G),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0)}),c({show:E,hide:Y,updatePosition:K}),(W,U)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:m},[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,onClick:oe,onMouseenter:ae,onMouseleave:le},[e.renderSlot(W.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:N,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${n.placement}`,{"ypopover__content--dark":n.dark,"ypopover__content--no-padding":!n.showPadding}]]),style:e.normalizeStyle(M.value),onClick:U[0]||(U[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:te,onMouseleave:F},[n.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${n.placement}`]),style:e.normalizeStyle(R.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",tl,[e.renderSlot(W.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),pt=pe(nl,[["__scopeId","data-v-6d9a965e"]]),ll={class:"relative"},ol=["value","placeholder"],al={class:"nh-time-suffix"},il={class:"nh-time-shortcuts"},rl={class:"nh-time-shortcuts-list"},sl=["onClick","onKeydown","onMouseenter"],cl={class:"nh-time-custom"},dl={class:"nh-time-custom-header"},ul={class:"nh-time-selection-status"},fl={key:0,class:"status-text"},ml={key:1,class:"status-text"},vl={key:2,class:"status-text status-complete"},hl={class:"nh-time-pickers"},pl={class:"nh-time-picker"},gl={class:"nh-date-picker"},yl={class:"nh-date-picker-header"},kl={class:"nh-date-picker-header-label"},wl={class:"nh-date-picker-content"},bl={class:"nh-date-table"},Cl=["onClick"],xl={class:"nh-date-table-cell"},El={key:0},Bl={class:"nh-time-picker"},Nl={class:"nh-date-picker"},Vl={class:"nh-date-picker-header"},Sl={class:"nh-date-picker-header-label"},Dl={class:"nh-date-picker-content"},Tl={class:"nh-date-table"},$l=["onClick"],Ml={class:"nh-date-table-cell"},Il={key:0},Ll={class:"nh-time-actions"},zl=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const n=new Date,c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"昨天",getValue:()=>{const n=new Date;n.setDate(n.getDate()-1);const c=new Date(n.getFullYear(),n.getMonth(),n.getDate()),t=new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"近7天",getValue:()=>{const n=new Date,c=new Date;return c.setDate(c.getDate()-6),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}},{label:"近30天",getValue:()=>{const n=new Date,c=new Date;return c.setDate(c.getDate()-29),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}},{label:"近3个月",getValue:()=>{const n=new Date,c=new Date;return c.setMonth(c.getMonth()-3),c.setHours(0,0,0,0),n.setHours(23,59,59,999),{startDate:c,endDate:n}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"},width:{default:"250px"},maxRange:{default:void 0},defaultValue:{default:void 0}},emits:["update:modelValue","change"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(-1),r=e.ref(-1),N=e.ref(null),B=e.ref(),S=e.ref(),C=e.ref({top:!0,left:!0}),f=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),u=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),x=()=>{const d=new Date(f.value.year,f.value.month).getTime(),h=new Date(u.value.year,u.value.month).getTime();if(d>=h){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}},M=()=>{const d=new Date(f.value.year,f.value.month).getTime();if(new Date(u.value.year,u.value.month).getTime()<=d){const V=new Date(u.value.year,u.value.month-1);f.value.year=V.getFullYear(),f.value.month=V.getMonth()}},R=["一","二","三","四","五","六","日"],I=e.ref(null),E=e.ref(null),D=d=>{if(!d)return null;if(d instanceof Date)return d;if(typeof d=="number")return new Date(d);if(typeof d=="string"){const h=new Date(d);return isNaN(h.getTime())?null:h}return null},Y=d=>{if(!d)return null;const h=d.getFullYear(),V=String(d.getMonth()+1).padStart(2,"0"),H=String(d.getDate()).padStart(2,"0");if(t.includeTime){const ie=String(d.getHours()).padStart(2,"0"),de=String(d.getMinutes()).padStart(2,"0"),fe=String(d.getSeconds()).padStart(2,"0");return`${h}-${V}-${H} ${ie}:${de}:${fe}`}else return`${h}-${V}-${H}`},se=d=>d?d.getTime():null,X=d=>d?{startDate:D(d.startDate),endDate:D(d.endDate)}:{startDate:null,endDate:null},L=d=>t.format==="string"?{startDate:Y(d.startDate),endDate:Y(d.endDate)}:t.format==="timestamp"?{startDate:se(d.startDate),endDate:se(d.endDate)}:d,K=(d,h)=>`${String(h+1).padStart(2,"0")}/${d}`,oe=(d,h)=>d.getFullYear()===h.getFullYear()&&d.getMonth()===h.getMonth()&&d.getDate()===h.getDate(),ae=(d,h,V)=>!h||!V?!1:d>=h&&d<=V,le=d=>{const h=X(d);if(!(h!=null&&h.startDate)||!(h!=null&&h.endDate))return-1;for(let V=0;V<ye.value.length;V++){const H=ye.value[V].getValue();if(H.startDate&&H.endDate&&h.startDate&&h.endDate){const ie=new Date(h.startDate.getFullYear(),h.startDate.getMonth(),h.startDate.getDate()),de=new Date(h.endDate.getFullYear(),h.endDate.getMonth(),h.endDate.getDate()),fe=new Date(H.startDate.getFullYear(),H.startDate.getMonth(),H.startDate.getDate()),Ce=new Date(H.endDate.getFullYear(),H.endDate.getMonth(),H.endDate.getDate());if(ie.getTime()===fe.getTime()&&de.getTime()===Ce.getTime())return V}}return-1},te=(d,h)=>{const V=new Date(d,h,1),H=new Date(d,h+1,0),ie=V.getDay(),de=H.getDate(),fe=[],Ce=new Date,Ne=ie===0?6:ie-1,je=new Date(d,h,0);for(let he=Ne-1;he>=0;he--){const ke=new Date(d,h-1,je.getDate()-he);fe.push({date:ke,day:ke.getDate(),isCurrentMonth:!1,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let he=1;he<=de;he++){const ke=new Date(d,h,he);fe.push({date:ke,day:he,isCurrentMonth:!0,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!1})}const Ue=42-fe.length;for(let he=1;he<=Ue;he++){const ke=new Date(d,h+1,he);fe.push({date:ke,day:he,isCurrentMonth:!1,isToday:oe(ke,Ce),isSelected:!1,isInRange:!1,isDisabled:!0})}const ze=[];for(let he=0;he<fe.length;he+=7)ze.push(fe.slice(he,he+7));return ze},F=d=>{const h=L(d);l("update:modelValue",h),l("change",h)},G=()=>{if(!B.value||!S.value)return;const d=B.value.getBoundingClientRect(),h=S.value.getBoundingClientRect(),V=window.innerWidth,ie=window.innerHeight-d.bottom,de=d.top,fe=h.height||400;ie<fe&&de>fe?C.value.top=!1:C.value.top=!0;const Ce=V-d.left,Ne=h.width||640;Ce<Ne?C.value.left=!1:C.value.left=!0},W=()=>{if(p.value=!p.value,p.value){const d=X(t.modelValue);if(I.value=(d==null?void 0:d.startDate)||null,E.value=(d==null?void 0:d.endDate)||null,r.value=le(t.modelValue),m.value=-1,d!=null&&d.startDate&&(f.value.year=d.startDate.getFullYear(),f.value.month=d.startDate.getMonth()),d!=null&&d.endDate)u.value.year=d.endDate.getFullYear(),u.value.month=d.endDate.getMonth();else{const h=new Date(f.value.year,f.value.month+1);u.value.year=h.getFullYear(),u.value.month=h.getMonth()}x(),e.nextTick(()=>{G()})}},U=d=>{const h=d.target,V=B.value,H=S.value;V&&H&&!V.contains(h)&&!H.contains(h)&&(p.value=!1,m.value=-1)},Q=d=>{d.key==="Enter"||d.key===" "?(d.preventDefault(),W()):d.key==="ArrowDown"&&(d.preventDefault(),p.value=!0,e.nextTick(()=>{G(),o()}))},O=d=>{var h;d.key==="Escape"&&(p.value=!1,m.value=-1,(h=B.value)==null||h.focus())},ee=(d,h)=>{d.key==="ArrowDown"?(d.preventDefault(),m.value=Math.min(h+1,ye.value.length-1),i(m.value)):d.key==="ArrowUp"?(d.preventDefault(),m.value=Math.max(h-1,0),i(m.value)):(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),g(ye.value[h]))},w=d=>{m.value=d},s=()=>{m.value=-1},o=()=>{m.value=0,i(0)},i=d=>{if(S.value){const V=S.value.querySelectorAll(".nh-time-shortcut")[d];V&&V.focus()}},g=d=>{const h=d.getValue();t.includeTime&&h.startDate&&h.endDate&&(h.startDate.setHours(0,0,0,0),h.endDate.setHours(23,59,59,999)),F(h),r.value=ye.value.findIndex(V=>V.label===d.label),m.value=-1,p.value=!1},$=(d,h)=>{if(!d||d.isDisabled)return;let V;if(t.includeTime?(V=new Date(d.date),h==="start"||!I.value?V.setHours(0,0,0,0):V.setHours(23,59,59,999)):V=new Date(d.date.getFullYear(),d.date.getMonth(),d.date.getDate()),!I.value&&!E.value)I.value=V,E.value=null;else if(I.value&&!E.value)if(V>=I.value){if(t.maxRange!==void 0&&t.maxRange!==null){const H=new Date(V);if(t.includeTime&&H.setHours(23,59,59,999),!ue(I.value,H)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}}t.includeTime&&V.setHours(23,59,59,999),E.value=V}else{if(t.maxRange!==void 0&&t.maxRange!==null){const ie=new Date(I.value);if(t.includeTime&&ie.setHours(23,59,59,999),!ue(V,ie)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}}const H=I.value;t.includeTime&&H.setHours(23,59,59,999),E.value=H,I.value=V}else I.value=V,E.value=null;if(r.value=-1,I.value&&E.value){const H=new Date(E.value);t.includeTime&&H.setHours(23,59,59,999),N.value={startDate:I.value,endDate:H}}else N.value=null},T=(d,h)=>{if(!d)return["nh-date-table-td"];const V=["nh-date-table-td"];return d.isCurrentMonth||V.push("is-prev-month"),d.isToday&&V.push("is-today"),d.isDisabled&&V.push("is-disabled"),I.value&&oe(d.date,I.value)&&V.push("is-selected","is-start"),E.value&&oe(d.date,E.value)&&V.push("is-selected","is-end"),I.value&&E.value&&ae(d.date,I.value,E.value)&&V.push("is-in-range"),V},z=()=>{if(N.value){if(t.maxRange!==void 0&&t.maxRange!==null&&!ue(N.value.startDate,N.value.endDate)){typeof YMessage<"u"?YMessage.warning(`选择的时间范围不能超过 ${t.maxRange} 天`):alert(`选择的时间范围不能超过 ${t.maxRange} 天`);return}t.includeTime&&N.value.endDate&&N.value.endDate.setHours(23,59,59,999),F(N.value),r.value=le(N.value),p.value=!1}},A=(d,h)=>{const V=new Date(d.getFullYear(),d.getMonth(),d.getDate()),ie=new Date(h.getFullYear(),h.getMonth(),h.getDate()).getTime()-V.getTime();return Math.floor(ie/(1e3*60*60*24))+1},P=d=>{if(t.maxRange===void 0||t.maxRange===null)return!0;const h=d.getValue();if(!h.startDate||!h.endDate)return!0;const V=D(h.startDate),H=D(h.endDate);return!V||!H?!0:A(V,H)<=t.maxRange},ne=()=>{if(t.defaultValue){const d=X(t.defaultValue);F(d)}else F({startDate:null,endDate:null});Te(),m.value=-1,p.value=!1},J=()=>{p.value&&e.nextTick(()=>{G()})},me=e.computed(()=>te(f.value.year,f.value.month)),j=e.computed(()=>te(u.value.year,u.value.month)),q=e.computed(()=>{const d=X(t.modelValue);if(!d||!d.startDate||!d.endDate)return"";const h=ie=>{const de=String(ie.getFullYear()),fe=String(ie.getMonth()+1).padStart(2,"0"),Ce=String(ie.getDate()).padStart(2,"0");return`${de}/${fe}/${Ce}`},V=h(d.startDate),H=h(d.endDate);return!t.includeTime&&V===H?V:`${V} - ${H}`}),Z=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!C.value.top,"nh-time-dropdown-right":!C.value.left}]),ce=e.computed(()=>{const d=X(t.modelValue);return!!(d!=null&&d.startDate&&(d!=null&&d.endDate))}),ue=(d,h)=>t.maxRange===void 0||t.maxRange===null?!0:!d||!h?!1:A(d,h)<=t.maxRange,ve=e.computed(()=>!I.value||!E.value?!1:t.maxRange!==void 0&&t.maxRange!==null?ue(I.value,E.value):!0),ye=e.computed(()=>t.maxRange===void 0||t.maxRange===null?t.shortcuts:t.shortcuts.filter(P)),Te=()=>{I.value=null,E.value=null,N.value=null,r.value=-1};e.watch(()=>t.modelValue,d=>{const h=X(d);if(h!=null&&h.startDate){const V=h.startDate;f.value.year=V.getFullYear(),f.value.month=V.getMonth()}if(h!=null&&h.endDate){const V=h.endDate;u.value.year=V.getFullYear(),u.value.month=V.getMonth()}else if(h!=null&&h.startDate){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}(h!=null&&h.startDate||h!=null&&h.endDate)&&x(),p.value||(r.value=le(d))},{immediate:!0,deep:!0}),e.watch([f,u],()=>{const d=new Date(f.value.year,f.value.month).getTime(),h=new Date(u.value.year,u.value.month).getTime();if(d===h){const V=new Date(f.value.year,f.value.month+1);u.value.year=V.getFullYear(),u.value.month=V.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",U),window.addEventListener("resize",J),window.addEventListener("scroll",J);const d=X(t.modelValue);if((!(d!=null&&d.startDate)||!(d!=null&&d.endDate))&&t.defaultValue){const H=X(t.defaultValue);H!=null&&H.startDate&&(H!=null&&H.endDate)&&F(H)}const h=X(t.modelValue)||X(t.defaultValue);r.value=le(h);const V=h;if(V!=null&&V.startDate&&(f.value.year=V.startDate.getFullYear(),f.value.month=V.startDate.getMonth()),V!=null&&V.endDate)u.value.year=V.endDate.getFullYear(),u.value.month=V.endDate.getMonth();else{const H=new Date(f.value.year,f.value.month+1);u.value.year=H.getFullYear(),u.value.month=H.getMonth()}x()}),e.onUnmounted(()=>{document.removeEventListener("click",U),window.removeEventListener("resize",J),window.removeEventListener("scroll",J)});const ge=()=>{if(t.clearable){if(t.defaultValue){const d=X(t.defaultValue);F(d)}else F({startDate:null,endDate:null});Te(),m.value=-1}},xe=(d,h)=>{if(d==="start"){const V=new Date(f.value.year,f.value.month+h,1);f.value.year=V.getFullYear(),f.value.month=V.getMonth(),x()}else{const V=new Date(u.value.year,u.value.month+h,1);u.value.year=V.getFullYear(),u.value.month=V.getMonth(),M()}};return(d,h)=>{const V=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${n.size}`]]),style:e.normalizeStyle({width:t.width})},[e.createElementVNode("div",ll,[e.createElementVNode("div",{ref_key:"trigger",ref:B,onClick:W,onKeydown:Q,class:e.normalizeClass(["nh-time-trigger",{"is-focus":p.value,"has-value":ce.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:q.value,placeholder:n.placeholder,class:"nh-time-input"},null,8,ol),e.createElementVNode("span",al,[n.clearable&&ce.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(ge,["stop"]),class:"nh-time-clear"},[...h[4]||(h[4]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1 1.9-11.2c1.5-1.2 3.3-1.9 5.2-1.9l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130.1 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0),h[6]||(h[6]=e.createElementVNode("i",{class:"nh-time-icon"},[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[e.createElementVNode("path",{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648 248v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h112v120H152V248h112v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h312zm184 584H192V424h640v408z",fill:"currentColor"})])],-1)),e.createElementVNode("i",{class:e.normalizeClass(["nh-time-arrow",{"is-reverse":p.value}])},[...h[5]||(h[5]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z",fill:"currentColor"})],-1)])],2)])],34),e.createVNode(e.Transition,{name:"el-zoom-in-top"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:S,class:e.normalizeClass(Z.value),onKeydown:O},[e.createElementVNode("div",il,[h[7]||(h[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",rl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(H,ie)=>(e.openBlock(),e.createElementBlock("li",{key:H.label,onClick:de=>g(H),onKeydown:de=>ee(de,ie),onMouseenter:de=>w(ie),onMouseleave:s,class:e.normalizeClass(["nh-time-shortcut",{"is-active":m.value===ie,"is-selected":r.value===ie}]),tabindex:"0"},e.toDisplayString(H.label),43,sl))),128))])]),e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[h[8]||(h[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",ul,[!I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",fl," 请选择开始日期 ")):I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",ml," 请选择结束日期 ")):I.value&&E.value?(e.openBlock(),e.createElementBlock("span",vl," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",hl,[e.createElementVNode("div",pl,[e.createElementVNode("div",gl,[e.createElementVNode("div",yl,[e.createElementVNode("button",{onClick:h[0]||(h[0]=H=>xe("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...h[9]||(h[9]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",kl,e.toDisplayString(K(f.value.year,f.value.month)),1),e.createElementVNode("button",{onClick:h[1]||(h[1]=H=>xe("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",wl,[e.createElementVNode("table",bl,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,H=>e.createElementVNode("th",{key:H,class:"nh-date-table-th"},e.toDisplayString(H),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,(H,ie)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${ie}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H,(de,fe)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${ie}-${fe}`,class:e.normalizeClass(T(de)),onClick:Ce=>$(de,"start")},[e.createElementVNode("div",xl,[de?(e.openBlock(),e.createElementBlock("span",El,e.toDisplayString(de.day),1)):e.createCommentVNode("",!0)])],10,Cl))),128))]))),128))])])])])]),e.createElementVNode("div",Bl,[e.createElementVNode("div",Nl,[e.createElementVNode("div",Vl,[e.createElementVNode("button",{onClick:h[2]||(h[2]=H=>xe("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...h[11]||(h[11]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",fill:"currentColor"})],-1)])]),e.createElementVNode("span",Sl,e.toDisplayString(K(u.value.year,u.value.month)),1),e.createElementVNode("button",{onClick:h[3]||(h[3]=H=>xe("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...h[12]||(h[12]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"12",height:"12"},[e.createElementVNode("path",{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",fill:"currentColor"})],-1)])])]),e.createElementVNode("div",Dl,[e.createElementVNode("table",Tl,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,H=>e.createElementVNode("th",{key:H,class:"nh-date-table-th"},e.toDisplayString(H),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(H,ie)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${ie}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H,(de,fe)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${ie}-${fe}`,class:e.normalizeClass(T(de)),onClick:Ce=>$(de,"end")},[e.createElementVNode("div",Ml,[de?(e.openBlock(),e.createElementBlock("span",Il,e.toDisplayString(de.day),1)):e.createCommentVNode("",!0)])],10,$l))),128))]))),128))])])])])])]),e.createElementVNode("div",Ll,[n.clearable?(e.openBlock(),e.createBlock(V,{key:0,onClick:ne,variant:"secondary",size:n.size},{default:e.withCtx(()=>[...h[13]||(h[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(V,{onClick:z,disabled:!ve.value,variant:"primary",size:n.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I.value&&!E.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],6)}}}),et=pe(zl,[["__scopeId","data-v-64b1efbe"]]),Hl=["aria-checked","aria-disabled","disabled","onKeydown"],Rl={class:"yswitch__thumb"},_l={key:0,class:"yswitch__spinner","aria-hidden":"true"},Kl=e.defineComponent({__name:"yswitch",props:{modelValue:{default:!1},trueValue:{default:!0},falseValue:{default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"medium"},activeColor:{default:"#10b981"},inactiveColor:{default:"#e5e7eb"},activeText:{default:"开"},inactiveText:{default:"关"},showText:{type:Boolean,default:!1}},emits:["update:modelValue","change","focus","blur"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(),m=e.computed(()=>t.modelValue===t.trueValue),r=e.computed(()=>{const B={};return B.background=m.value?t.activeColor:t.inactiveColor,B});function N(){if(t.disabled||t.loading)return;const B=m.value?t.falseValue:t.trueValue;l("update:modelValue",B),l("change",B)}return e.onMounted(()=>{const B=p.value;B&&(B.addEventListener("focus",S=>l("focus",S)),B.addEventListener("blur",S=>l("blur",S)))}),(B,S)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:p,class:e.normalizeClass(["yswitch",[`yswitch--${n.size}`,{"yswitch--checked":m.value,"yswitch--disabled":n.disabled,"yswitch--loading":n.loading}]]),style:e.normalizeStyle(r.value),role:"switch","aria-checked":m.value,"aria-disabled":n.disabled,disabled:n.disabled||n.loading,onClick:N,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[S[0]||(S[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",Rl,[n.loading?(e.openBlock(),e.createElementBlock("span",_l)):e.createCommentVNode("",!0)]),n.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!m.value,"yswitch__label--right":m.value}])},e.toDisplayString(m.value?n.activeText:n.inactiveText),3)):e.createCommentVNode("",!0)],46,Hl))}}),tt=pe(Kl,[["__scopeId","data-v-0b157fc4"]]),Wl=["src","alt"],Al=["src","alt"],Pl=["src"],Fl=e.defineComponent({__name:"yimage",props:{src:{},alt:{default:""},width:{},height:{},lazy:{type:Boolean,default:!0},preview:{type:Boolean,default:!0},fit:{default:"cover"},radius:{default:"0"},className:{default:""},previewSrcList:{},hoverPreview:{type:Boolean,default:!1},hoverPreviewWidth:{default:400},hoverPreviewHeight:{default:400}},emits:["load","error","preview"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(),r=e.ref(),N=e.ref(),B=e.ref(!1),S=e.ref(!1),C=e.ref(!1),f=e.ref(!1),u=e.ref(!1),x=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),M=e.ref(""),R=e.ref(1),I=e.ref(!1),E=e.ref({visible:!1,src:"",top:0,left:0,width:400,height:400,isHoveringPreview:!1});let D=null;const Y=e.ref({overflow:"",paddingRight:""}),se={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},X=e.computed(()=>l.className||""),L=e.computed(()=>{if(typeof l.radius=="number")return`${l.radius}px`;if(typeof l.radius=="string"){if(/(px|%|rem|em)$/.test(l.radius))return l.radius;if(se[l.radius])return se[l.radius]}return""}),K=e.computed(()=>L.value?{borderRadius:L.value}:{}),oe=e.computed(()=>["yimage-image",l.preview?"is-previewable":""].filter(Boolean).join(" ")),ae=e.computed(()=>{const j={objectFit:l.fit||"cover",backgroundColor:"#fff"};return l.width&&(j.width=typeof l.width=="number"?`${l.width}px`:l.width),l.height&&(j.height=typeof l.height=="number"?`${l.height}px`:l.height),L.value&&(j.borderRadius=L.value),j}),le=e.computed(()=>M.value?M.value:Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),te=e.computed(()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src),F=()=>{const j=document.createElement("div");j.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(j);const q=j.offsetWidth-j.clientWidth;return document.body.removeChild(j),q},G=()=>{if(Y.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const q=F();document.body.style.paddingRight=`${q}px`}document.body.style.overflow="hidden"},W=()=>{document.body.style.overflow=Y.value.overflow,document.body.style.paddingRight=Y.value.paddingRight};let U=null;const Q=()=>{!l.lazy||!m.value||(U=new IntersectionObserver(j=>{j.forEach(q=>{q.isIntersecting&&(f.value=!0,x.value=l.src,U==null||U.unobserve(q.target))})},{rootMargin:"50px"}),U.observe(m.value))},O=j=>{B.value=!0,S.value=!1,C.value=!1,p("load",j)},ee=j=>{C.value=!0,S.value=!1,B.value=!1,p("error",j)},w=()=>{C.value=!1,S.value=!0,B.value=!1,e.nextTick(()=>{r.value&&(r.value.src=l.src)})},s=()=>Array.isArray(l.previewSrcList)?l.previewSrcList.find(Boolean)||l.src:l.previewSrcList||l.src,o=()=>{l.preview&&(l.previewSrcList||l.src)?i():w()},i=()=>{if(!l.preview)return;R.value=1;const j=s();if(r.value&&r.value.complete&&r.value.naturalWidth>0){M.value=j,e.nextTick(()=>{u.value=!0,G(),p("preview",j)});return}const q=new Image;let Z=null,ce=!1;const ue=()=>{ce||(ce=!0,Z&&(clearTimeout(Z),Z=null),M.value=j,e.nextTick(()=>{u.value=!0,G(),p("preview",j)}))};Z=setTimeout(()=>{ue()},500),q.onload=()=>{ue()},q.onerror=()=>{ue()},q.src=j,q.complete&&ue()},g=()=>{u.value=!1,setTimeout(()=>{W()},300)},$=j=>{const q=j.deltaY<0?1:-1;let ce=R.value+q*.1;ce=Math.max(.5,Math.min(2,ce)),R.value=ce};function T(j){if(!(j instanceof HTMLElement))return;const q=j.getBoundingClientRect(),Z=12,ce=window.innerWidth||document.documentElement.clientWidth,ue=window.innerHeight||document.documentElement.clientHeight;let ve=q.right+Z;ve+E.value.width>ce-Z&&(ve=q.left-E.value.width-Z);let ye=q.top;ye+E.value.height>ue-Z&&(ye=ue-E.value.height-Z),ye<Z&&(ye=Z),ve<Z&&(ve=Z),E.value.left=ve,E.value.top=ye}function z(j){l.hoverPreview&&(D&&(clearTimeout(D),D=null),E.value.isHoveringPreview=!1,E.value.src=te.value,E.value.width=l.hoverPreviewWidth,E.value.height=l.hoverPreviewHeight,E.value.visible=!0,T(j.currentTarget))}function A(j){l.hoverPreview&&E.value.visible&&(D&&(clearTimeout(D),D=null),T(j.currentTarget))}function P(){l.hoverPreview&&(E.value.isHoveringPreview||(D&&(clearTimeout(D),D=null),D=setTimeout(()=>{E.value.isHoveringPreview||(E.value.visible=!1,E.value.src=""),D=null},50)))}function ne(){l.hoverPreview&&(D&&(clearTimeout(D),D=null),E.value.isHoveringPreview=!0)}function J(){l.hoverPreview&&(E.value.isHoveringPreview=!1,E.value.visible=!1,E.value.src="",D&&(clearTimeout(D),D=null))}e.onMounted(()=>{l.lazy?Q():f.value=!0,f.value&&(S.value=!0),I.value=!0}),e.onUnmounted(()=>{U&&U.disconnect(),u.value&&W(),D&&(clearTimeout(D),D=null)});const me=()=>{l.src&&f.value&&(S.value=!0,C.value=!1,B.value=!1)};return e.watch(()=>x.value,me),e.watch(()=>l.src,j=>{x.value=j||""}),c({retryLoad:w,closePreview:g}),(j,q)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:m,class:e.normalizeClass(["yimage-container",X.value])},[!B.value&&!C.value&&!f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(K.value)},[...q[1]||(q[1]=[e.createElementVNode("div",{class:"yimage-placeholder-content"},[e.createElementVNode("svg",{class:"yimage-placeholder-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)])],4)):e.createCommentVNode("",!0),S.value&&!C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(K.value)},[...q[2]||(q[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(K.value),onClick:o},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:"yimage-error-image",style:e.normalizeStyle(K.value)},null,4)],4)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:r,src:x.value,alt:n.alt,class:e.normalizeClass(oe.value),onLoad:O,onError:ee,onClick:e.withModifiers(i,["stop"]),onMouseenter:z,onMouseleave:P,onMousemove:A,style:e.normalizeStyle(ae.value)},null,46,Wl),[[e.vShow,B.value&&!C.value]]),l.preview&&(!B.value||S.value||C.value||!f.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(i,["stop"])})):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(g,["self"]),onWheel:e.withModifiers($,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":u.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:N,src:le.value,alt:n.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${R.value})`}),onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"]))},null,12,Al)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),I.value&&l.hoverPreview?(e.openBlock(),e.createBlock(e.Teleport,{key:5,to:"body"},[e.createVNode(e.Transition,{name:"hover-preview-fade",appear:""},{default:e.withCtx(()=>[E.value.visible&&E.value.src?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-hover-preview",style:e.normalizeStyle({top:E.value.top+"px",left:E.value.left+"px",width:E.value.width+"px",height:E.value.height+"px"}),onMouseenter:ne,onMouseleave:J},[e.createElementVNode("img",{src:E.value.src,alt:"图片预览"},null,8,Pl)],36)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),gt=pe(Fl,[["__scopeId","data-v-02c24bfc"]]),Yl=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(n){const c=n,t=e.ref(!1),l=e.ref();let p=null;const m=e.computed(()=>`y-dropdown__menu--${c.placement}`),r=e.computed(()=>{if(!c.menuWidth)return{};const u=typeof c.menuWidth=="number"?`${c.menuWidth}px`:c.menuWidth;return{width:u,minWidth:u,maxWidth:u}}),N=()=>{console.log("显示下拉菜单",t.value),!c.disabled&&(p&&(clearTimeout(p),p=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{S()}))},B=()=>{console.log("隐藏下拉菜单"),p=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},S=()=>{if(!l.value)return;const u=l.value.querySelector(".y-dropdown__trigger"),x=l.value.querySelector(".y-dropdown__menu");if(!u||!x)return;const M=u.getBoundingClientRect(),R=x.getBoundingClientRect(),I=window.innerWidth,E=window.innerHeight;x.style.top="",x.style.left="",x.style.right="",x.style.bottom="",x.style.transform="";let D=0,Y=0;switch(c.placement){case"bottom":D=M.height+4,Y=0;break;case"top":D=-(R.height+4),Y=0;break;case"right":D=0,Y=M.width+4;break;case"left":D=0,Y=-(R.width+4);break}let se=M.top+D,X=M.left+Y;if(c.placement==="bottom"||c.placement==="top"){const L=R.width||260;X+L>I-10&&(X=I-L-10),X<10&&(X=10)}if(c.placement==="left"||c.placement==="right"){const L=R.height||200;se+L>E-10&&(se=E-L-10),se<10&&(se=10)}x.style.top=`${se}px`,x.style.left=`${X}px`},C=u=>{c.trigger==="click"&&l.value&&!l.value.contains(u.target)&&(t.value=!1)},f=()=>{t.value&&S()};return e.onMounted(()=>{c.trigger==="click"&&document.addEventListener("click",C),window.addEventListener("resize",f),window.addEventListener("scroll",f)}),e.onUnmounted(()=>{c.trigger==="click"&&document.removeEventListener("click",C),p&&clearTimeout(p),window.removeEventListener("resize",f),window.removeEventListener("scroll",f)}),e.watch(()=>c.menuWidth,()=>{t.value&&e.nextTick(()=>{S()})}),(u,x)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:l},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:N,onMouseleave:B},[e.renderSlot(u.$slots,"trigger",{},()=>[x[0]||(x[0]=e.createElementVNode("button",{class:"y-dropdown__button"}," 下拉菜单 ",-1))],!0)],32),e.createVNode(e.Transition,{name:"dropdown-fade",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-dropdown__menu",m.value]),style:e.normalizeStyle(r.value),onMouseenter:N,onMouseleave:B},[e.renderSlot(u.$slots,"default",{},()=>[x[1]||(x[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),x[2]||(x[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),x[3]||(x[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),yt=pe(Yl,[["__scopeId","data-v-ada3172a"]]),Ol=["aria-hidden"],jl=["onKeydown"],Ul={key:0,class:"y-drawer-header"},ql={class:"y-drawer-title"},Gl={class:"y-drawer-body"},Zl={key:1,class:"y-drawer-footer"},Ql=e.defineComponent({__name:"ydrawer",props:{modelValue:{type:Boolean,default:!1},placement:{default:"right"},width:{default:"420px"},height:{default:"60vh"},title:{default:""},closable:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},zIndex:{default:1e5},showHeader:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(n,{emit:c}){const t=n,l=c,p=e.computed({get:()=>t.modelValue,set:x=>l("update:modelValue",x)}),m=e.ref(null),r=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),N=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),B=e.computed(()=>{const x={};return t.placement==="right"?(x.width=typeof t.width=="number"?`${t.width}px`:String(t.width),x.height="100%",x.right="0",x.top="0"):(x.height=typeof t.height=="number"?`${t.height}px`:String(t.height),x.width="100%",x.bottom="0",x.left="0"),x});function S(){t.maskClosable&&C()}function C(){p.value&&(p.value=!1,l("close"))}function f(){t.closable&&C()}function u(x){x.key==="Escape"&&f()}return e.watch(()=>t.modelValue,x=>{x?(l("open"),requestAnimationFrame(()=>{var M;return(M=m.value)==null?void 0:M.focus()}),document.addEventListener("keydown",u),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",u),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",u),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",u),document.body.style.overflow=""}),(x,M)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!p.value,style:e.normalizeStyle({zIndex:String(n.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:S}),e.createVNode(e.Transition,{name:r.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-drawer-panel",[`is-${n.placement}`,N.value]]),style:e.normalizeStyle(B.value),onKeydown:e.withKeys(e.withModifiers(f,["prevent","stop"]),["esc"]),tabindex:"-1"},[n.showHeader?(e.openBlock(),e.createElementBlock("div",Ul,[e.createElementVNode("div",ql,e.toDisplayString(n.title),1),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:C}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gl,[e.renderSlot(x.$slots,"default",{},void 0,!0)]),x.$slots.footer?(e.openBlock(),e.createElementBlock("div",Zl,[e.renderSlot(x.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,jl),[[e.vShow,p.value]])]),_:3},8,["name"])],12,Ol),[[e.vShow,p.value]])]))}}),kt=pe(Ql,[["__scopeId","data-v-6bf99d52"]]),Jl=["data-level"],Xl={key:1,class:"ytree-node__expand-icon--empty"},eo={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},to={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},no=["src","alt"],lo={class:"ytree-node__custom-content"},oo={key:0,class:"ytree-node__children"},ao=e.defineComponent({__name:"ytree-node",props:{node:{},rootNode:{},level:{default:1},showCheckbox:{type:Boolean,default:!1},iconClass:{default:""},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0}},setup(n){const c=n;e.inject("treeStore");const t=e.inject("getNodeKey"),l=e.inject("getNodeLabel"),p=e.inject("getNodeChildren"),m=e.inject("hasChildren"),r=e.inject("isEmployeeNode"),N=e.inject("getNodeIcon"),B=e.inject("getNodeDepth"),S=e.inject("isChildStyleNode"),C=e.inject("isNodeExpanded"),f=e.inject("isNodeChecked"),u=e.inject("isNodeIndeterminate"),x=e.inject("isNodeCurrent"),M=e.inject("isNodeHighlighted"),R=e.inject("handleExpandClick"),I=e.inject("handleCheckClick"),E=e.inject("handleNodeClick"),D=e.inject("handleNodeContextMenu");e.computed(()=>t(c.node));const Y=e.computed(()=>l(c.node)),se=e.computed(()=>N(c.node,c.rootNode)),X=e.computed(()=>B(c.rootNode,c.node)),L=e.computed(()=>C(c.node)),K=e.computed(()=>f(c.node)),oe=e.computed(()=>u(c.node)),ae=e.computed(()=>x(c.node)),le=e.computed(()=>M(c.node)),te=e.computed(()=>m(c.node)),F=e.computed(()=>p(c.node)),G=e.computed(()=>S(c.node,c.rootNode)),W=e.computed(()=>r(c.node)),U=e.computed(()=>c.level===1?8:8+(c.level-1)*16);return(Q,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree-node",{"ytree-node--current":ae.value,"ytree-node--highlight":le.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":G.value}]),style:e.normalizeStyle({paddingLeft:`${U.value}px`}),"data-level":X.value,onClick:O[2]||(O[2]=ee=>e.unref(E)(c.node,c.node,null,c.rootNode)),onContextmenu:O[3]||(O[3]=ee=>e.unref(D)(ee,c.node,c.node,null))},[te.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L.value}]),onClick:O[0]||(O[0]=e.withModifiers(ee=>e.unref(R)(c.node),["stop"]))},[...O[4]||(O[4]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M4.5 3L7.5 6L4.5 9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)):(e.openBlock(),e.createElementBlock("span",Xl)),n.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":K.value,"is-indeterminate":oe.value}]),onClick:O[1]||(O[1]=e.withModifiers(ee=>e.unref(I)(c.node),["stop"]))},[K.value?(e.openBlock(),e.createElementBlock("svg",eo,[...O[5]||(O[5]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):oe.value?(e.openBlock(),e.createElementBlock("svg",to,[...O[6]||(O[6]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",n.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:se.value,alt:W.value?"person":"dept"},null,8,no),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":W.value}])},e.toDisplayString(Y.value),3),e.createElementVNode("div",lo,[e.renderSlot(Q.$slots,"node-content",{node:c.node,isCurrent:ae.value,isExpanded:L.value,hasChildren:te.value},void 0,!0)])],46,Jl),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[te.value&&L.value?(e.openBlock(),e.createElementBlock("div",oo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,ee=>(e.openBlock(),e.createBlock(wt,{key:e.unref(t)(ee),node:ee,"root-node":n.rootNode,level:n.level+1,"show-checkbox":n.showCheckbox,"icon-class":n.iconClass,"dept-icon-url":n.deptIconUrl,"person-icon-url":n.personIconUrl,"button-icon-url":n.buttonIconUrl,"child-style-level":n.childStyleLevel,"child-style-icon-url":n.childStyleIconUrl,"enable-child-style-custom-click":n.enableChildStyleCustomClick,disabled:n.disabled,"expand-on-click-node":n.expandOnClickNode},{"node-content":e.withCtx(w=>[e.renderSlot(Q.$slots,"node-content",e.mergeProps({ref_for:!0},w),void 0,!0)]),_:3},8,["node","root-node","level","show-checkbox","icon-class","dept-icon-url","person-icon-url","button-icon-url","child-style-level","child-style-icon-url","enable-child-style-custom-click","disabled","expand-on-click-node"]))),128))])):e.createCommentVNode("",!0)]),_:3})],2))}}),wt=pe(ao,[["__scopeId","data-v-f424ccf5"]]),io={class:"ytree__container"},ro="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",so="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",co=e.defineComponent({__name:"ytree",props:{data:{default:()=>[]},emptyText:{default:"暂无数据"},nodeKey:{default:"id"},props:{default:()=>({children:"children",label:"label",disabled:"disabled",isLeaf:"isLeaf"})},renderAfterExpand:{type:Boolean,default:!0},defaultExpandAll:{type:Boolean,default:!1},defaultExpandedKeys:{default:()=>[]},defaultCheckedKeys:{default:()=>[]},defaultSelectedKeys:{default:()=>[]},checkStrictly:{type:Boolean,default:!1},checkOnClickNode:{type:Boolean,default:!1},checkDescendants:{type:Boolean,default:!0},autoExpandParent:{type:Boolean,default:!0},defaultChecked:{type:Boolean,default:!1},filterNodeMethod:{},lazy:{type:Boolean,default:!1},load:{},renderContent:{},highlightCurrent:{type:Boolean,default:!1},expandOnClickNode:{type:Boolean,default:!0},currentNodeKey:{},accordion:{type:Boolean,default:!1},indent:{default:18},iconClass:{default:""},showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:{},allowDrop:{},size:{default:"medium"},disabled:{type:Boolean,default:!1},deptIconUrl:{default:""},personIconUrl:{default:""},buttonIconUrl:{default:""},enableFourthLevelSpecialHandling:{type:Boolean,default:!1},restrictAutoExpandFromLevel:{default:void 0},childStyleLevel:{default:void 0},childStyleIconUrl:{default:""},enableChildStyleCustomClick:{type:Boolean,default:!1}},emits:["node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop","checked-keys-change","child-node-click"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.computed(()=>l.data||[]),r=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set}),N=e.ref(0),B=new Map;function S(){B.clear()}e.provide("treeStore",r),e.provide("getNodeKey",f),e.provide("getNodeLabel",u),e.provide("getNodeChildren",I),e.provide("hasChildren",R),e.provide("isEmployeeNode",x),e.provide("getNodeIcon",M),e.provide("getNodeDepth",E),e.provide("isChildStyleNode",D),e.provide("isNodeExpanded",Y),e.provide("isNodeChecked",X),e.provide("isNodeIndeterminate",L),e.provide("isNodeCurrent",K),e.provide("isNodeHighlighted",oe),e.provide("handleExpandClick",le),e.provide("handleCheckClick",ae),e.provide("handleNodeClick",F),e.provide("handleNodeContextMenu",G);const C=e.computed(()=>l.restrictAutoExpandFromLevel&&l.restrictAutoExpandFromLevel>0?l.restrictAutoExpandFromLevel:void 0);function f(o){return o[l.nodeKey]||o.id||Math.random()}function u(o){var i;return((i=l.props)!=null&&i.label?o[l.props.label]:void 0)||o.label||""}function x(o){var i;return!!((i=o==null?void 0:o.data)!=null&&i.isEmployee)}function M(o,i){var A;const g=l.deptIconUrl||ro,$=l.personIconUrl||so,T=l.buttonIconUrl||"",z=l.childStyleIconUrl||"";return i&&z&&D(o,i)?z:(A=o==null?void 0:o.data)!=null&&A.isButton&&T?T:x(o)?$:g}function R(o){var g;const i=((g=l.props)!=null&&g.children?o[l.props.children]:void 0)||o.children;return i&&i.length>0}function I(o){var i;return((i=l.props)!=null&&i.children?o[l.props.children]:void 0)||o.children||[]}function E(o,i,g=1){if(o===i)return g;const $=I(o);for(const T of $){const z=E(T,i,g+1);if(z>0)return z}return 0}function D(o,i){return!l.childStyleLevel||l.childStyleLevel<1?!1:E(i,o)===l.childStyleLevel}function Y(o){const i=f(o);return r.value.expandedKeys.has(i)}function se(o,i=new Set){const g=f(o);if(i.has(g))return{checked:!1,indeterminate:!1};i.add(g);const T=r.value.checkedKeys.has(g);if(!R(o))return{checked:T,indeterminate:!1};const z=I(o);if(z.length===0)return{checked:T,indeterminate:!1};let A=0,P=0;for(const q of z){const Z=se(q,i);Z.checked?A++:Z.indeterminate&&P++}let ne,J;const me=A===z.length&&P===0,j=A>0||P>0;return T?me?(ne=!0,J=!1):j?(ne=!1,J=!0):(ne=!0,J=!1):me?(ne=!0,J=!1):j?(ne=!1,J=!0):(ne=!1,J=!1),{checked:ne,indeterminate:J}}function X(o){return N.value,se(o).checked}function L(o){return N.value,se(o).indeterminate}function K(o){const i=f(o);return r.value.currentKey===i}function oe(o){const i=f(o);return r.value.highlightedKeys.has(i)}function ae(o){if(l.disabled)return;const i=f(o),$=!r.value.checkedKeys.has(i),T=new Set(r.value.expandedKeys);S(),$?r.value.checkedKeys.add(i):r.value.checkedKeys.delete(i);function z(A,P){A.forEach(ne=>{const J=f(ne);P?r.value.checkedKeys.add(J):r.value.checkedKeys.delete(J),R(ne)&&z(I(ne),P)})}z(I(o),$),te(),r.value.expandedKeys=T,S(),p("check-change",o,$,!1),p("check",o,$,!1),p("checked-keys-change",Array.from(r.value.checkedKeys))}function le(o){const i=f(o);r.value.expandedKeys.has(i)?(r.value.expandedKeys.delete(i),p("node-collapse",o,o,null)):(r.value.expandedKeys.add(i),p("node-expand",o,o,null))}function te(){const o=new Map,i=[],g=new Map;function $(z,A){z.forEach(P=>{const ne=f(P);i.push(P),g.set(ne,P),A&&o.set(ne,A),R(P)&&$(I(P),P)})}$(m.value);function T(z){if(!R(z))return;const A=I(z),P=f(z);let ne=0,J=0;for(const me of A){const j=se(me);j.checked?ne++:j.indeterminate&&J++}ne===A.length&&J===0?r.value.checkedKeys.add(P):(ne>0||J>0,r.value.checkedKeys.delete(P))}for(let z=i.length-1;z>=0;z--)T(i[z]);S()}function F(o,i,g,$){if(l.disabled)return;const T=$?D(o,$):!1;if(l.enableChildStyleCustomClick&&T){p("child-node-click",o,i,g);return}if(l.expandOnClickNode&&R(o)){le(o);return}r.value.currentNode=o,r.value.currentKey=f(o),l.showCheckbox&&ae(o),p("node-click",o,i,g)}function G(o,i,g,$){l.disabled||p("node-contextmenu",o,i,g,$)}e.watch(()=>l.defaultExpandedKeys,o=>{if(o){const i=C.value;if(i){let g=function(A,P,ne=1){for(const J of P){if(f(J)===A)return ne;if(R(J)){const me=g(A,I(J),ne+1);if(me>0)return me}}return 0},$=function(A,P,ne){A.forEach(J=>{P<ne&&R(J)?(z.add(f(J)),$(I(J),P+1,ne)):P<ne&&R(J)})};const T=(o||[]).filter(A=>{const P=g(A,m.value,1);return P>0&&P<i}),z=new Set(T);$(m.value,1,i),r.value.expandedKeys.forEach(A=>{g(A,m.value,1)>=i&&z.add(A)}),r.value.expandedKeys=z}else r.value.expandedKeys=new Set(o)}},{immediate:!0});function W(){if(l.defaultExpandAll){let o=function($,T=1){$.forEach(z=>{if(!R(z))return;const A=I(z);if(g){if(T>=g)return;T+1===g||i.add(f(z)),o(A,T+1)}else i.add(f(z)),o(A,T+1)})};const i=new Set,g=C.value;o(m.value,1),r.value.expandedKeys=i}}function U(){if(l.defaultCheckedKeys&&l.defaultCheckedKeys.length>0){let o=function(T,z=[]){T.forEach(A=>{const P=f(A),ne=[...z,P];i.has(P)&&z.forEach(J=>g.add(J)),R(A)&&o(I(A),ne)})};const i=new Set(l.defaultCheckedKeys),g=new Set;if(o(m.value),C.value)return;r.value.expandedKeys=g}}let Q=null;const O=()=>{Q&&clearTimeout(Q),Q=setTimeout(()=>{W(),Q=null},50)};e.watch(()=>l.defaultExpandAll,W,{immediate:!0}),e.watch(()=>m.value,O,{deep:!0}),e.watch(()=>l.defaultCheckedKeys,o=>{o?(r.value.checkedKeys=new Set(o),l.enableFourthLevelSpecialHandling||U()):r.value.checkedKeys.clear()},{immediate:!0});function ee(o){try{let i=function(T,z,A=[]){for(const P of T){const ne=f(P),J=[...A,ne];if(ne===z)return J;if(R(P)){const me=i(I(P),z,J);if(me)return me}}return null};const g=Array.isArray(o)?o:[];if(g.length===0)return;r.value.highlightedKeys.clear();const $=new Set(r.value.expandedKeys);g.forEach(T=>{const z=i(m.value,T);z&&z.length>0&&(z.slice(0,-1).forEach(A=>$.add(A)),r.value.highlightedKeys.add(z[z.length-1]))}),r.value.expandedKeys=$}catch(i){process.env.NODE_ENV==="development"&&console.warn("highlightAndExpandByIds 执行失败",i)}}function w(){r.value.highlightedKeys.clear()}function s(){r.value.currentNode=null,r.value.currentKey=null}return c({highlightAndExpandByIds:ee,clearHighlights:w,clearCurrentNode:s}),e.watch(()=>l.defaultSelectedKeys,o=>{o&&(r.value.selectedKeys=new Set(o))},{immediate:!0}),(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${n.size}`,{"ytree--disabled":n.disabled}]])},[e.createElementVNode("div",io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,g=>(e.openBlock(),e.createBlock(wt,{key:f(g),node:g,"root-node":g,level:1,"show-checkbox":n.showCheckbox,"icon-class":n.iconClass,"dept-icon-url":n.deptIconUrl,"person-icon-url":n.personIconUrl,"button-icon-url":n.buttonIconUrl,"child-style-level":n.childStyleLevel,"child-style-icon-url":n.childStyleIconUrl,"enable-child-style-custom-click":n.enableChildStyleCustomClick,disabled:n.disabled,"expand-on-click-node":n.expandOnClickNode},{"node-content":e.withCtx($=>[e.renderSlot(o.$slots,"node-content",e.mergeProps({ref_for:!0},$),void 0,!0)]),_:3},8,["node","root-node","show-checkbox","icon-class","dept-icon-url","person-icon-url","button-icon-url","child-style-level","child-style-icon-url","enable-child-style-custom-click","disabled","expand-on-click-node"]))),128))])],2))}}),bt=pe(co,[["__scopeId","data-v-ad65c979"]]),uo={class:"query-encapsulation"},fo={class:"query-encapsulation__container"},mo={class:"query-encapsulation__content"},vo={class:"query-encapsulation__field-wrapper"},ho={key:0,class:"query-encapsulation__field-label"},po={key:0,class:"query-encapsulation__toggle"},go={class:"query-encapsulation__actions-group"},yo=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(n,{expose:c,emit:t}){const l=n,p=t,m=e.ref(!1),r=e.reactive({}),N=["select","date","daterange","switch"];let B;const S=e.ref(null),C=e.ref(null),f=new Map,u=new Map,x=e.ref(1/0);let M=null,R,I=0;const E=e.computed(()=>l.fields.filter(s=>!s.hidden)),D=e.computed(()=>m.value?E.value:E.value.slice(0,x.value)),Y=e.computed(()=>E.value.length>x.value);function se(s){switch(s){case"select":return Xe;case"date":case"daterange":return et;case"switch":return tt;case"input":default:return Je}}function X(s,o){r[s]=o;const i=l.fields.find(g=>g.key===s);i&&L(i)}function L(s){p("field-change",s,r[s.key]),p("update:modelValue",{...r}),N.includes(s.type)&&U()}function K(s,o){s.onSwitchChange&&typeof s.onSwitchChange=="function"&&s.onSwitchChange(o,s),L(s)}function oe(){const s=Q(r),o=O(s),i={...r};p("search",{data:o,raw:i})}function ae(){Object.keys(r).forEach(s=>{const o=l.fields.find(i=>i.key===s);(o==null?void 0:o.type)==="daterange"?o.defaultValue?r[s]=o.defaultValue:r[s]={startDate:null,endDate:null}:(o==null?void 0:o.type)==="date"?r[s]=null:(o==null?void 0:o.type)==="switch"?r[s]=o.falseValue!==void 0?o.falseValue:!1:(o==null?void 0:o.type)==="select"&&o.multiple?r[s]=[]:r[s]=""}),p("reset"),p("update:modelValue",{...r})}function le(){m.value=!m.value,setTimeout(()=>{e.nextTick(()=>{F()})},300)}function te(s,o){s?(f.set(o,s),e.nextTick(()=>{if(s&&!u.has(o)){const i=s.offsetWidth;i>0&&u.set(o,i)}})):f.delete(o)}function F(){R&&clearTimeout(R),R=setTimeout(()=>{e.nextTick().then(()=>{if(!S.value||!C.value)return;const s=S.value.offsetWidth;if(s===0){setTimeout(()=>F(),50);return}if(I>0&&Math.abs(s-I)>10&&(u.clear(),!m.value&&E.value.length>0)){m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const q of E.value){const Z=f.get(q.key);if(Z){const ce=Z.offsetWidth;ce>0&&u.set(q.key,ce)}}m.value=!1,I=s,setTimeout(()=>F(),50)},150)});return}I=s;const o=12,i=20,g=C.value.querySelector(".query-encapsulation__actions-group");if(!g){setTimeout(()=>F(),50);return}const T=g.getBoundingClientRect().width||g.offsetWidth||200;if(T<50){setTimeout(()=>F(),50);return}for(const q of E.value){const Z=f.get(q.key);if(Z){const ce=Z.offsetWidth;ce>0&&u.set(q.key,ce)}}if(!E.value.every(q=>u.has(q.key)&&u.get(q.key)>0)){const q=E.value.filter(Z=>!u.has(Z.key)||u.get(Z.key)===0);if(m.value){let Z=!1;for(const ce of q){const ue=f.get(ce.key);if(ue){const ve=ue.offsetWidth;ve>0&&(u.set(ce.key,ve),Z=!0)}}if(!Z){setTimeout(()=>F(),50);return}}else{const Z=q.filter(ce=>!D.value.some(ue=>ue.key===ce.key));if(Z.length>0){const ce=Array.from(u.values()).filter(ve=>ve>0),ue=ce.length>0?ce.reduce((ve,ye)=>ve+ye,0)/ce.length:180;for(const ve of Z)(!u.has(ve.key)||u.get(ve.key)===0)&&u.set(ve.key,ue)}else{setTimeout(()=>F(),50);return}}}const A=100;let P=0;for(const q of E.value){const Z=u.get(q.key)||0;Z>0&&(P+=Z+(P>0?o:0))}const ne=s-T-i;if(P<=ne){x.value=1/0;return}const J=s-T-A-i;let me=0,j=0;for(const q of E.value){const Z=u.get(q.key)||0;if(Z===0)continue;const ce=j>0?Z+o:Z;if(me+ce>J)break;me+=ce,j++}x.value=Math.max(1,j)})},150)}function G(s){return s.type!=="input"?{}:{enter:()=>W(),paste:()=>W()}}async function W(){await e.nextTick(),oe()}function U(){B&&clearTimeout(B),B=setTimeout(()=>{B=void 0,e.nextTick().then(()=>oe())},0)}function Q(s){const o={};return Object.keys(s).forEach(i=>{const g=l.fields.find(z=>z.key===i),$=s[i],T=typeof $=="string"?$.trim():$;if(Array.isArray(T)){T.length>0&&(o[i]=T);return}if(!(T==null||T==="")){if(typeof T=="object"&&T.startDate&&T.endDate){T.startDate&&T.endDate&&(o[i]=T);return}if(g&&(g.type==="date"||g.type==="daterange")){T!==0&&(o[i]=T);return}o[i]=T}}),o}function O(s){const o={};return Object.keys(s).forEach(i=>{const g=s[i],$=l.fields.find(T=>T.key===i);if($)if($.type==="daterange"&&typeof g=="object"){const T=$.startKey||`${i}Start`,z=$.endKey||`${i}End`;g.startDate&&g.endDate&&g.startDate!==0&&g.endDate!==0&&($.format==="timestamp"?(o[T]=new Date(g.startDate).getTime(),o[z]=new Date(g.endDate).getTime()):(o[T]=g.startDate,o[z]=g.endDate))}else $.type==="date"&&g&&g!==0&&$.format==="timestamp"?o[i]=new Date(g).getTime():o[i]=g;else o[i]=g}),o}function ee(){l.fields.forEach(s=>{var o,i,g,$,T;r[s.key]===void 0&&(s.type==="daterange"?r[s.key]=((o=l.modelValue)==null?void 0:o[s.key])||s.defaultValue||{startDate:null,endDate:null}:s.type==="date"?r[s.key]=((i=l.modelValue)==null?void 0:i[s.key])||null:s.type==="switch"?r[s.key]=((g=l.modelValue)==null?void 0:g[s.key])!==void 0?l.modelValue[s.key]:s.falseValue!==void 0?s.falseValue:!1:s.type==="select"&&s.multiple?r[s.key]=(($=l.modelValue)==null?void 0:$[s.key])!==void 0?l.modelValue[s.key]:[]:r[s.key]=((T=l.modelValue)==null?void 0:T[s.key])||"")})}e.watch(()=>l.modelValue,s=>{s&&Object.assign(r,s)},{deep:!0,immediate:!0}),e.watch(()=>l.fields,(s,o)=>{const i=(s==null?void 0:s.map($=>$.key).join(","))||"",g=(o==null?void 0:o.map($=>$.key).join(","))||"";i!==g&&(f.clear(),u.clear(),I=0),e.nextTick(()=>{const T=(s==null?void 0:s.length)!==(o==null?void 0:o.length)?200:100;setTimeout(()=>{e.nextTick(()=>{E.value.length>3&&!m.value&&i!==g?(m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const z of E.value){const A=f.get(z.key);if(A){const P=A.offsetWidth;P>0&&u.set(z.key,P)}}m.value=!1,e.nextTick(()=>{F()})},150)})):F()})},T)})},{deep:!0}),e.watch(()=>E.value.length,()=>{e.nextTick(()=>{F()})});function w(){ee(),e.nextTick(()=>{E.value.length>3&&!m.value?(m.value=!0,e.nextTick(()=>{setTimeout(()=>{for(const s of E.value){const o=f.get(s.key);if(o){const i=o.offsetWidth;i>0&&u.set(s.key,i)}}m.value=!1,e.nextTick(()=>{F()})},150)})):F(),S.value&&window.ResizeObserver&&(M&&M.disconnect(),M=new ResizeObserver(()=>{F()}),M.observe(S.value),C.value&&M.observe(C.value)),window.addEventListener("resize",F)})}return e.onMounted(()=>{w()}),e.onActivated(()=>{f.clear(),u.clear(),m.value=!1,I=0,e.nextTick(()=>{setTimeout(()=>{w()},150)})}),e.onBeforeUnmount(()=>{B&&(clearTimeout(B),B=void 0),R&&(clearTimeout(R),R=void 0),M&&(M.disconnect(),M=null),window.removeEventListener("resize",F)}),c({search:oe,reset:ae}),(s,o)=>(e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",fo,[e.createElementVNode("div",mo,[e.createElementVNode("div",{class:"query-encapsulation__fields",ref_key:"fieldsContainerRef",ref:S},[e.createVNode(e.TransitionGroup,{name:"qf",tag:"div",class:"query-encapsulation__fields-group"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,i=>(e.openBlock(),e.createElementBlock("div",{key:i.key,class:"query-encapsulation__field-item",ref_for:!0,ref:g=>te(g,i.key)},[e.renderSlot(s.$slots,`field-${i.key}`,{field:i,value:r[i.key],updateValue:g=>X(i.key,g)},()=>[e.createElementVNode("div",vo,[n.Iflabel||i.type==="switch"?(e.openBlock(),e.createElementBlock("label",ho,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(se(i.type)),e.mergeProps({modelValue:r[i.key],"onUpdate:modelValue":g=>r[i.key]=g,placeholder:i.placeholder||`请输入${i.label}`,options:i.options,clearable:i.clearable!==!1,size:i.size||"small",width:i.width||"180px",format:i.format||"timestamp","include-time":i.includeTime||!1,"max-range":i.maxRange,"default-value":i.defaultValue,filterable:i.filterable===!0,multiple:i.multiple===!0,"true-value":i.trueValue,"false-value":i.falseValue,"active-text":i.activeText,"inactive-text":i.inactiveText,"show-text":i.showText,"active-color":i.activeColor||(i.type==="switch"?"#1B2433":void 0),"inactive-color":i.inactiveColor},e.toHandlers(G(i)),{onInput:g=>i.type!=="switch"?L(i):void 0,onChange:g=>i.type==="switch"?K(i,g):L(i)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","max-range","default-value","filterable","multiple","true-value","false-value","active-text","inactive-text","show-text","active-color","inactive-color","onInput","onChange"]))])],!0)]))),128))]),_:3}),Y.value?(e.openBlock(),e.createElementBlock("div",po,[e.createVNode(Me,{variant:"secondary",size:"small",onClick:le},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":m.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"query-encapsulation__actions",ref_key:"actionsRef",ref:C},[e.createElementVNode("div",go,[e.createVNode(Me,{variant:"primary",size:"small",onClick:oe,loading:n.loading},{default:e.withCtx(()=>[...o[0]||(o[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(Me,{variant:"secondary",size:"small",onClick:ae,loading:n.loading},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(s.$slots,"extra-actions",{},void 0,!0)])],512)],512)])])]))}}),Ct=pe(yo,[["__scopeId","data-v-94c47976"]]),ko={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},wo={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},bo={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Co=["textContent"],xo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(n){const c=n,t=e.ref(!1);let l,p=0,m=0;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,c.duration&&c.duration>0&&r(c.duration)})}),e.onBeforeUnmount(()=>{N()});function r(u){p=u,m=Date.now(),l=window.setTimeout(()=>C(),u)}function N(){l&&(window.clearTimeout(l),l=void 0)}function B(){if(l&&c.duration&&c.duration>0){N();const u=Date.now()-m;p=Math.max(0,p-u)}}function S(){c.duration&&c.duration>0&&p>0&&r(p)}function C(){t.value=!1}function f(){var u;(u=c.onClose)==null||u.call(c,c.id)}return(u,x)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:f},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${n.type}`]]),style:e.normalizeStyle({zIndex:n.zIndex}),role:"status","aria-live":"polite",onMouseenter:B,onMouseleave:S},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${n.type}`]),"aria-hidden":"true"},[n.type==="success"?(e.openBlock(),e.createElementBlock("svg",ko,[...x[0]||(x[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):n.type==="warning"?(e.openBlock(),e.createElementBlock("svg",wo,[...x[1]||(x[1]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",bo,[...x[2]||(x[2]=[e.createElementVNode("path",{d:"M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],2),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(n.message)},null,8,Co),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:C},"✕")):e.createCommentVNode("",!0)],38),[[e.vShow,t.value]])]),_:1}))}}),Eo=pe(xo,[["__scopeId","data-v-db173617"]]);let Bo=1;const Ze=12,Be=[];function No(){let n=20;return Be.forEach(c=>{n+=c.height+Ze}),n}function ct(n){const c=Be.findIndex(m=>m.id===n);if(c===-1)return;const{el:t}=Be[c],l=t.firstElementChild;if(l){const m=window.getComputedStyle(l).top;l.style.top=m,l.classList.add("is-leaving"),l.style.willChange="opacity, transform"}Be[c].leaving=!0,Fe(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const m=Be.findIndex(r=>r.id===n);m!==-1&&Be.splice(m,1),Fe()},260)}function Ge(n){var m;const c=Bo++,t=document.createElement("div");document.body.appendChild(t);const l=e.createVNode(Eo,{id:c,type:n.type||"success",message:n.message,duration:n.duration??2500,offset:No(),zIndex:2e5+c,closable:n.closable??!1,onClose:r=>ct(r)});e.render(l,t);const p=((m=t.firstElementChild)==null?void 0:m.offsetHeight)||0;return Be.push({id:c,el:t,vm:l,height:p,leaving:!1}),Fe(),requestAnimationFrame(()=>{const r=t.firstElementChild;if(!r)return;const N=r.offsetHeight||p||0,B=Be.find(S=>S.id===c);B&&(B.height=N,Fe())}),{close:()=>ct(c)}}const Le={success(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"success",message:n})},warning(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"warning",message:n})},error(n,c){return Ge({...typeof c=="number"?{duration:c}:c||{},type:"error",message:n})}};typeof window<"u"&&(window.YMessage=Le,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=Le));function Fe(){let n=20;Be.forEach(c=>{const t=c.el.firstElementChild;if(!t)return;const l=n;if(t.style.transform=`translate(-50%, ${l}px)`,t.style.top||(t.style.top="0px"),!c.leaving)n+=(t.offsetHeight||c.height)+Ze;else{const p=t.offsetHeight||c.height;n+=p+Ze}})}const Vo=12;let So=1;const Ye=[];function Do(n){const c=n.elRef.value;return c&&c.getBoundingClientRect().height||0}function nt(){let n=0;Ye.forEach(c=>{const t=Do(c);if(t<=0){c.setOffset(0);return}c.setOffset(n),n+=t+Vo})}function To(n){const c=So++,t={id:c,elRef:n.el,setOffset:n.setOffset};return Ye.push(t),nt(),c}function $o(n){const c=Ye.findIndex(t=>t.id===n);c!==-1&&(Ye.splice(c,1),nt())}function Mo(){nt()}const Io={class:"floating-tip__content"},Lo=e.defineComponent({__name:"FloatingTip",props:{content:{default:""},duration:{default:5e3},manual:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},width:{default:void 0},height:{default:void 0},right:{default:16},bottom:{default:16},zIndex:{default:9999},maxWidth:{default:360}},emits:["close"],setup(n,{emit:c}){const t=n,l=c,p=e.ref(!1),m=e.ref(null),r=e.ref(null),N=e.ref(0);let B=null;const S=e.ref(!0);function C(D){if(!(D==null||D===""))return typeof D=="number"?`${D}px`:D}const f=e.computed(()=>({right:`${t.right}px`,bottom:`${(t.bottom||0)+N.value}px`,zIndex:t.zIndex,width:C(t.width),height:C(t.height),maxWidth:t.width?void 0:`${t.maxWidth}px`}));function u(){m.value!==null&&(window.clearTimeout(m.value),m.value=null)}function x(){u(),!t.manual&&S.value&&(p.value||!t.duration||t.duration<=0||(m.value=window.setTimeout(()=>{p.value||M()},t.duration)))}function M(){u(),S.value=!1}function R(){p.value=!0,u()}function I(){p.value=!1,x()}function E(){l("close")}return e.onMounted(()=>{B=To({el:r,setOffset(D){N.value=D}}),x(),e.nextTick(()=>{Mo()})}),e.onBeforeUnmount(()=>{u(),B!==null&&($o(B),B=null)}),(D,Y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"floating-tip-fade",appear:"",onAfterLeave:E},{default:e.withCtx(()=>[S.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"rootRef",ref:r,class:"floating-tip",style:e.normalizeStyle(f.value),role:"status","aria-live":"polite",onMouseenter:R,onMouseleave:I},[e.createElementVNode("div",Io,[e.renderSlot(D.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)]),n.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"floating-tip__close","aria-label":"关闭提示",onClick:M}," × ")):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]),_:3})]))}}),dt=pe(Lo,[["__scopeId","data-v-ca26e00f"]]);let zo=1;const Ie=[];function Oe(n){const c=zo++,t=document.createElement("div");document.body.appendChild(t);const l={content:n.content??"",duration:n.duration??5e3,manual:n.manual??!1,closable:n.closable??!0,width:n.width,height:n.height,right:n.right,bottom:n.bottom,zIndex:n.zIndex,maxWidth:n.maxWidth,onClose:()=>{m()}},p=n.renderContent?e.createVNode(dt,l,{default:n.renderContent}):e.createVNode(dt,l);function m(){const r=Ie.findIndex(N=>N.id===c);r!==-1&&Ie.splice(r,1),e.render(null,t),t.parentNode&&t.parentNode.removeChild(t)}return e.render(p,t),Ie.push({id:c,el:t}),{close:m}}function Qe(n){const c=[...Ie];return Ie.length=0,c.forEach(t=>{e.render(null,t.el),t.el.parentNode&&t.el.parentNode.removeChild(t.el)}),Oe(n)}const Ho={class:"hint-tag-popup-content"},Ro=["title"],_o=e.defineComponent({__name:"hintTag",props:{content:{default:""},position:{default:"right"},defaultExpanded:{type:Boolean,default:!0},width:{default:"280px"},tooltip:{default:""},borderColor:{default:"#00a8e8"},maxLines:{default:void 0}},setup(n,{expose:c}){const t=n,l=e.ref(null),p=e.ref(null),m=e.ref(!1),r=e.ref(!1);let N=null;const B=()=>{if(!t.maxLines||!l.value){m.value=!1;return}const L=l.value,K=L.style.maxHeight,oe=L.classList.contains("hint-tag-content-clamp");L.style.maxHeight="none",oe&&L.classList.remove("hint-tag-content-clamp");const ae=L.scrollHeight,le=parseFloat(getComputedStyle(L).lineHeight)||18,te=t.maxLines*le;L.style.maxHeight=K,oe&&L.classList.add("hint-tag-content-clamp"),m.value=ae>te},S=()=>{t.maxLines&&m.value&&(N&&(clearTimeout(N),N=null),r.value=!0,setTimeout(()=>{x()},0))},C=()=>{N=window.setTimeout(()=>{r.value=!1,N=null},100)},f=()=>{N&&(clearTimeout(N),N=null)},u=()=>{r.value=!1},x=()=>{if(!p.value||!l.value)return;const L=l.value.getBoundingClientRect(),K=p.value.getBoundingClientRect(),oe=window.innerWidth,ae=window.innerHeight,le=window.scrollX||window.pageXOffset,te=window.scrollY||window.pageYOffset;let F=0,G=0;switch(t.position){case"right":F=L.right+12,G=L.top+te,F+K.width>oe+le&&(F=L.left-K.width-12),G=L.top+te+(L.height-K.height)/2,G<te&&(G=te+8),G+K.height>te+ae&&(G=te+ae-K.height-8);break;case"left":F=L.left-K.width-12,G=L.top+te,F<le&&(F=L.right+12),G=L.top+te+(L.height-K.height)/2,G<te&&(G=te+8),G+K.height>te+ae&&(G=te+ae-K.height-8);break;case"top":F=L.left+le+(L.width-K.width)/2,G=L.top-K.height-12,G<te&&(G=L.bottom+te+12),F<le+8&&(F=le+8),F+K.width>le+oe&&(F=le+oe-K.width-8);break;case"bottom":F=L.left+le+(L.width-K.width)/2,G=L.bottom+te+12,G+K.height>te+ae&&(G=L.top-K.height-12),F<le+8&&(F=le+8),F+K.width>le+oe&&(F=le+oe-K.width-8);break}p.value.style.left=`${F}px`,p.value.style.top=`${G}px`};e.onUpdated(()=>{B()});const M=e.ref(t.defaultExpanded),R=()=>{M.value=!M.value},I=()=>{M.value&&(M.value=!1)},E=()=>{M.value||(M.value=!0)};c({toggle:R,isExpanded:M,collapse:I,expand:E});const D=e.inject("registerHintTag",null),Y=e.inject("unregisterHintTag",null),se=e.inject("notifyHintTagStateChange",null),X={collapse:I,expand:E,toggle:R,get isExpanded(){return M.value}};return e.watch(()=>M.value,()=>{se&&se(),setTimeout(()=>{B()},0)}),e.watch(()=>[t.content,t.maxLines],()=>{setTimeout(()=>{B()},0)}),e.watch(r,L=>{L?(setTimeout(()=>{x()},0),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)):(window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x))}),e.onMounted(()=>{B(),D&&D(X)}),e.onUnmounted(()=>{Y&&Y(X),N&&(clearTimeout(N),N=null),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),(L,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hint-tag-wrapper",`hint-tag-wrapper-${n.position}`])},[e.createVNode(e.Transition,{name:"hint-slide"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag",`hint-tag-${n.position}`]),style:e.normalizeStyle({width:n.position==="top"||n.position==="bottom"?"auto":n.width,borderColor:n.borderColor})},[e.createElementVNode("div",{ref_key:"contentRef",ref:l,class:e.normalizeClass(["hint-tag-content",{"hint-tag-content-clamp":n.maxLines}]),style:e.normalizeStyle(n.maxLines?{"--line-clamp":n.maxLines,lineHeight:"1.5",maxHeight:`${n.maxLines*1.5}em`}:{}),onMouseenter:S,onMouseleave:C},[e.renderSlot(L.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)],38),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"popup-fade"},{default:e.withCtx(()=>[r.value&&m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popupRef",ref:p,class:"hint-tag-popup",onMouseenter:f,onMouseleave:u},[e.createElementVNode("div",Ho,[e.renderSlot(L.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(n.content),1)],!0)])],544)):e.createCommentVNode("",!0)]),_:3})])),e.createElementVNode("div",{class:"hint-tag-toggle",onClick:R},[...K[0]||(K[0]=[e.createElementVNode("svg",{class:"hint-tag-icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M15 18L9 12L15 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])],6),[[e.vShow,M.value]])]),_:3}),e.createVNode(e.Transition,{name:"hint-button-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag-button",`hint-tag-button-${n.position}`]),onClick:R,title:n.tooltip||n.content},[...K[1]||(K[1]=[e.createElementVNode("svg",{class:"hint-tag-button-icon",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],10,Ro),[[e.vShow,!M.value]])]),_:1})],2))}}),Ko=pe(_o,[["__scopeId","data-v-9bfcff29"]]),ut={YButton:Me,YInput:Je,YTable:ft,YSelect:Xe,YPagination:mt,YBadge:vt,YDialog:ht,YPopover:pt,YTime:et,YSwitch:tt,YImage:gt,YDropdown:yt,YDrawer:kt,YTree:bt,QueryEncapsulation:Ct,HintTag:Ko},Wo={install(n){Object.keys(ut).forEach(c=>{n.component(c,ut[c])}),n.config.globalProperties.$message=Le,n.config.globalProperties.$showFloatingTip=Oe,n.config.globalProperties.$showFloatingTipReplace=Qe,typeof window<"u"&&(window.YMessage=Le,window.showFloatingTip=Oe,window.showFloatingTipReplace=Qe)}};exports.QueryEncapsulation=Ct;exports.YBadge=vt;exports.YButton=Me;exports.YDialog=ht;exports.YDrawer=kt;exports.YDropdown=yt;exports.YImage=gt;exports.YInput=Je;exports.YMessage=Le;exports.YPagination=mt;exports.YPopover=pt;exports.YSelect=Xe;exports.YSwitch=tt;exports.YTable=ft;exports.YTime=et;exports.YTree=bt;exports.default=Wo;exports.showFloatingTip=Oe;exports.showFloatingTipReplace=Qe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|