@nhdropshipping/y-components 1.0.74 → 1.0.75
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 +2 -2
- 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"),it=["type","disabled","aria-busy","aria-disabled"],st={class:"content"},ct={key:1,class:"y-btn-group",role:"group"},dt=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],ut={class:"content"},ft={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},mt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ht={key:2},vt=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(l,{emit:c}){const t=l,n=c;function m(w){if(t.disabled||t.loading){w.preventDefault(),w.stopPropagation();return}n("click",w)}const f=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 b(w,C){if(t.disabled||t.loading||w.disabled||w.loading){C.preventDefault(),C.stopPropagation();return}n("group-click",w.value,C)}return(w,C)=>r.value?(e.openBlock(),e.createElementBlock("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.groupItems,(E,h)=>{var v;return e.openBlock(),e.createElementBlock("button",{key:E.value??h,class:e.normalizeClass(["y-btn",[`y-btn--${E.variant??l.variant}`,`y-btn--${E.size??l.size}`,"is-grouped",h===0?"group-pos-start":h===(((v=l.groupItems)==null?void 0:v.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":E.loading||l.loading}]]),type:l.htmlType,disabled:(E.disabled??!1)||l.disabled||l.loading||E.loading,"aria-busy":E.loading||l.loading?"true":"false","aria-disabled":(E.disabled??!1)||l.disabled||l.loading||E.loading?"true":"false","aria-label":E.ariaLabel||E.label,onClick:g=>b(E,g)},[e.createElementVNode("span",ut,[E.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",ft,[...C[0]||(C[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)])])):E.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",mt,[...C[1]||(C[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),E.label&&!E.onlyIcon?(e.openBlock(),e.createElementBlock("span",ht,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])],10,dt)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${l.variant}`,`y-btn--${l.size}`,{"is-block":l.block,"is-loading":l.loading},l.groupPosition!=="single"?"is-grouped":"",f.value]]),type:l.htmlType,disabled:l.disabled||l.loading,"aria-busy":l.loading?"true":"false","aria-disabled":l.disabled||l.loading?"true":"false",onClick:m},[e.createElementVNode("span",st,[e.renderSlot(w.$slots,"default",{},void 0,!0)])],10,it))}}),fe=(l,c)=>{const t=l.__vccOpts||l;for(const[n,m]of c)t[n]=m;return t},Se=fe(vt,[["__scopeId","data-v-53157673"]]),pt=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],gt={key:0,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},yt={key:1,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},wt=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(l,{emit:c}){const t=l,n=c,m=e.ref(null),f=e.ref(""),r=e.ref(!1),b=e.ref(!1),w=e.ref(t.placeholder||""),C=e.ref(!1),E=e.computed(()=>t.type==="password"),h=e.computed(()=>t.type==="password"&&C.value?"text":t.type);function v(){C.value=!C.value}e.watch(()=>t.placeholder,I=>{b.value||(w.value=I||"")});function g(I){const R=I.target;r.value=!0,n("update:modelValue",R.value)}function S(){b.value=!0,t.clearOnFocus&&(f.value=t.modelValue||"",r.value=!1,w.value=f.value||t.placeholder||"",n("update:modelValue",""))}function U(){if(b.value=!1,t.clearOnFocus&&!r.value&&(!t.modelValue||t.modelValue==="")&&n("update:modelValue",f.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const I=Number(t.modelValue),R=Number(t.min);!Number.isNaN(I)&&!Number.isNaN(R)&&I<R&&n("update:modelValue",String(R))}w.value=t.placeholder||""}function F(I){const R=I.target;n("enter",R.value)}function x(I){const R=I.target;requestAnimationFrame(()=>{n("paste",R.value)})}return(I,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":l.block,"has-password-toggle":E.value}]),style:e.normalizeStyle({width:l.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:m,class:e.normalizeClass(["y-input",`y-input--${l.size}`]),id:l.id,name:l.name,type:h.value,placeholder:w.value,autocomplete:l.autocomplete,inputmode:l.inputmode,min:l.min,max:l.max,disabled:l.disabled,required:l.required,value:l.modelValue,onInput:g,onFocus:S,onBlur:U,onKeyup:e.withKeys(F,["enter"]),onPaste:x},null,42,pt),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["y-input-password-toggle",`y-input-password-toggle--${l.size}`]),onClick:v,tabindex:"-1"},[C.value?(e.openBlock(),e.createElementBlock("svg",gt,[...R[0]||(R[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",yt,[...R[1]||(R[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))}}),Ke=fe(wt,[["__scopeId","data-v-e954aa01"]]),kt={key:0,class:"bulk-bar"},bt={class:"bulk-left"},Ct={class:"bulk-actions"},Et={class:"card"},Bt={key:0,class:"table-header-actions"},xt=["title"],Nt={key:0,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Vt={key:1,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},St={class:"table"},Dt={key:0,style:{width:"34px","min-width":"34px"}},$t={key:1,style:{width:"60px","min-width":"60px"}},Tt={key:0,class:"col-expand"},Mt={key:1,class:"col-select"},Lt={class:"select-header"},It=["checked","indeterminate","disabled"],zt={key:0,class:"select-count"},Ht=["colspan"],_t={class:"selected-header-wrapper"},Kt={key:0,class:"loading-overlay"},Pt={key:1,class:"empty-overlay"},At={key:0,style:{width:"34px","min-width":"34px"}},Rt={key:1,style:{width:"60px","min-width":"60px"}},Ft=["onClick"],Wt={key:0,class:"col-expand"},Yt=["onClick"],jt=["value","checked","disabled","onChange"],Ot=["colspan"],Ut=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:"1/页",value:1},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},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}},emits:["edit","select","update:selectedItems","page-change","page-size-change","row-click"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(t.currentPage||1),f=e.ref(t.pageSize),r=e.ref(t.selectedItems||[]),b=e.ref([]),w=e.ref(new Set),C=e.ref("none"),E=e.ref(),h=e.ref(),v=e.ref(),g=e.ref(),S=e.ref([]),U=e.ref({}),F=e.ref(35),x=e.ref(new Set),I=e.computed(()=>x.value.size>0),R=e.computed(()=>{if(B.value,x.value.size===0)return!1;let a=0;return x.value.forEach(d=>{d&&d.isExpanded&&a++}),a===x.value.size});e.computed(()=>{if(B.value,x.value.size===0)return!0;let a=0;return x.value.forEach(d=>{d&&!d.isExpanded&&a++}),a===x.value.size});function oe(a){x.value.add(a)}function X(a){x.value.delete(a)}function H(){x.value.forEach(a=>{a&&typeof a.collapse=="function"&&a.collapse()})}function K(){x.value.forEach(a=>{a&&typeof a.expand=="function"&&a.expand()})}function le(){R.value?H():K()}const B=e.ref(0);function D(){B.value++}e.provide("registerHintTag",oe),e.provide("unregisterHintTag",X),e.provide("notifyHintTagStateChange",D);const k=e.computed(()=>t.columns.filter(a=>!o(a.width)).map(a=>a.key));function L(){return`${(100/(k.value.length||1)).toFixed(6)}%`}const A=e.ref(),N=e.ref({show:!1,thumbHeight:40,thumbTop:0});let W=!1,J=0,j=0;const Q=e.ref(0);function o(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const d=String(a).trim();if(d)return/^\d+(\.\d+)?$/.test(d)?`${d}px`:d}function s(a){const d=o(a);if(!d)return null;const y=parseFloat(d);return Number.isFinite(y)?y:null}const p=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),T=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(d=>t.searchFields.some(y=>{const V=ve(d,y);return String(V).toLowerCase().includes(a)}))}),z=e.computed(()=>(t.pagination,T.value)),_=e.computed(()=>{if(!t.selectable)return!1;const a=z.value.map((d,y)=>({key:ie(d,y),item:d,index:y})).filter(({item:d,index:y})=>!G(d,y)).map(({key:d})=>d);return a.length>0&&a.every(d=>r.value.includes(d))}),Y=e.computed(()=>{if(!t.selectable||_.value)return!1;const a=z.value.map((y,V)=>({key:ie(y,V),item:y,index:V})).filter(({item:y,index:V})=>!G(y,V)).map(({key:y})=>y);if(a.length===0)return!1;const d=a.filter(y=>r.value.includes(y)).length;return d>0&&d<a.length}),O=e.computed(()=>{if(!t.selectable)return!1;const a=z.value.map((d,y)=>({item:d,index:y}));return a.length>0&&a.every(({item:d,index:y})=>G(d,y))}),te=e.computed(()=>t.pagination?z.value.length<f.value:!1),ee=e.computed(()=>{const a=[];let d=t.selectable?60:0;for(let y=0;y<t.columns.length;y++){const V=t.columns[y];if(V.fixed==="left"){let $=80;const P=s(V.width);P!==null?$=P:S.value[y]&&($=s(S.value[y])??$),a.push(d),d+=$}}return a}),de=e.computed(()=>{const a=[];let d=0;const y=[];for(let V=t.columns.length-1;V>=0;V--){const $=t.columns[V];if($.fixed==="right"){let P=80;const Z=s($.width);Z!==null?P=Z:S.value[V]&&(P=s(S.value[V])??P),y.push({index:V,width:P})}}for(let V=0;V<y.length;V++)a.push(d),d+=y[V].width;return a});function me(a,d){if(d==="left"){let y=0;for(let V=0;V<a;V++)t.columns[V].fixed==="left"&&y++;return y}else{let y=0;for(let V=t.columns.length-1;V>a;V--)t.columns[V].fixed==="right"&&y++;return y}}function ie(a,d){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||d}function G(a,d){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,d):!1}function ne(a){return w.value.has(a)}function ue(a){w.value.has(a)?w.value.delete(a):w.value.add(a)}function ve(a,d){return d.split(".").reduce((y,V)=>y==null?void 0:y[V],a)}function we(a,d=!1){const y=[];return a.align&&y.push(`text-${a.align}`),a.fixed==="right"&&(y.push("col-fixed-right"),d&&y.push("col-fixed-right-header")),a.fixed==="left"&&(y.push("col-fixed-left"),d&&y.push("col-fixed-left-header")),y.join(" ")}function ge(a,d,y){const V={},$=o(a.width);if($)V.width=$,V.minWidth=$,V.maxWidth=$;else{const P=L();V.width=P,V.minWidth=P,V.maxWidth=P}if(a.fixed==="left"){const P=me(d,"left"),Z=ee.value[P]||0;V.left=`${Z}px`,V.zIndex=y?`${10+P}`:`${5+P}`}else if(a.fixed==="right"){const P=me(d,"right"),Z=de.value[P]||0;y?V.right=`${Z-3}px`:V.right=`${Z}px`,V.zIndex=y?`${10+P}`:`${5+P}`}return V}function i(a,d){const y=ve(a,d.key);return d.formatter?d.formatter(y,a):y||""}function u(a){const d=z.value.find((V,$)=>ie(V,$)===a),y=z.value.findIndex((V,$)=>ie(V,$)===a);d&&y>=0&&G(d,y)||(r.value.includes(a)?r.value=r.value.filter(V=>V!==a):r.value=[...r.value,a],n("select",r.value),n("update:selectedItems",r.value))}function M(){const a=z.value.map((d,y)=>({key:ie(d,y),item:d,index:y})).filter(({item:d,index:y})=>!G(d,y)).map(({key:d})=>d);if(a.length!==0){if(a.every(d=>r.value.includes(d)))r.value=r.value.filter(d=>!a.includes(d));else{const d=new Set([...r.value,...a]);r.value=Array.from(d)}n("select",r.value),n("update:selectedItems",r.value)}}function q(){r.value=[],n("select",r.value),n("update:selectedItems",r.value)}function ae(a,d){if(!t.rowSelectable)return;const y=ie(a,d);G(a,d)||(t.requireDeselectBeforeSelect?b.value.includes(y)?(b.value=b.value.filter(V=>V!==y),n("row-click",a,null)):(b.value=[...b.value,y],n("row-click",a,y)):b.value.includes(y)?(b.value=[],n("row-click",a,null)):(b.value=[y],n("row-click",a,y)))}function re(a,d){if(!t.rowSelectable)return!1;const y=ie(a,d);return b.value.includes(y)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const d=new Set(r.value),y=new Set(a);(d.size!==y.size||![...d].every(V=>y.has(V)))&&(r.value=[...a])}else a===void 0&&r.value.length>0&&(r.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{m.value=1}),e.watch(()=>t.data,()=>{t.total||(m.value=1),t.rowSelectable&&(b.value=[])},{deep:!0});function ce(a){m.value=a,t.rowSelectable&&(b.value=[]),n("page-change",a)}function ye(a){f.value=a,m.value=1,t.rowSelectable&&(b.value=[]),n("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const d=typeof a=="number"&&a>0?a:1;m.value!==d&&(m.value=d)}),e.watch(()=>t.pageSize,a=>{const d=typeof a=="number"&&a>0?a:10;f.value!==d&&(f.value=d)});function be(){E.value&&e.nextTick(()=>{const a=E.value.getBoundingClientRect(),d=window.innerHeight,y=a.top,V=E.value.querySelector(".table-header"),$=V?V.offsetHeight:40;let P=0;if(t.pagination){const ze=E.value.querySelector(".ypagination");P=ze?ze.offsetHeight:60}const Z=E.value.querySelector(".bulk-bar"),he=Z?Z.offsetHeight:0,Me=$+P+he+20,Le=d-y-Me,rt=Math.max(200,Le),Oe=E.value.querySelector(".table-body-wrap .table");Oe&&(Oe.offsetHeight>Le?C.value=`${rt}px`:C.value="none")})}let Be=!1;function xe(){!h.value||!v.value||Be||h.value.scrollLeft!==v.value.scrollLeft&&(Be=!0,h.value.scrollLeft=v.value.scrollLeft,requestAnimationFrame(()=>{Be=!1}))}function Ne(){!h.value||!v.value||Be||v.value.scrollLeft!==h.value.scrollLeft&&(Be=!0,v.value.scrollLeft=h.value.scrollLeft,requestAnimationFrame(()=>{Be=!1}))}function se(){e.nextTick(()=>{if(!v.value)return;const a=v.value,d=a.scrollHeight,y=a.clientHeight,V=a.scrollTop,$=d>y+1;if(N.value.show=$,!$)return;const P=24,Z=y/d,he=A.value?A.value.clientHeight:y,pe=Math.max(P,Math.floor(he*Z));N.value.thumbHeight=pe;const Me=Math.max(0,he-pe),Le=Math.max(1,d-y);N.value.thumbTop=Math.min(Me,Math.floor(V/Le*Me))})}function ke(a){if(!W||!v.value||!A.value)return;a.preventDefault();const d=A.value.clientHeight,y=Math.max(0,d-N.value.thumbHeight),V=v.value,$=V.scrollHeight,P=V.clientHeight,Z=Math.max(1,$-P),pe=(a.clientY-J)/Math.max(1,y)*Z;V.scrollTop=Math.min(Z,Math.max(0,j+pe)),se()}function Fe(){W=!1,window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Fe)}function We(){e.nextTick(()=>{var y,V;if(S.value.length===t.columns.length&&S.value.every($=>!!$))return;const a=[];t.columns.forEach(($,P)=>{const Z=o($.width);if(Z)a.push(Z),U.value[$.key]=Z;else if(U.value[$.key])a.push(U.value[$.key]);else{const he=S.value[P];if(he)a.push(he),U.value[$.key]=he;else{const pe=L();a.push(pe),U.value[$.key]=pe}}});const d=(y=g.value)==null?void 0:y.querySelector("tbody tr");if(d){const $=t.selectable?1:0,P=Array.from(d.children);for(let Z=0;Z<t.columns.length;Z++)if(!a[Z]){const he=P[$+Z];if(he&&he.clientWidth>0){const pe=`${he.clientWidth}px`;a[Z]=pe,U.value[t.columns[Z].key]=pe}else{const pe=L();a[Z]=pe,U.value[t.columns[Z].key]=pe}}}else for(let $=0;$<a.length;$++)if(!a[$]){const P=U.value[((V=t.columns[$])==null?void 0:V.key)||""];a[$]=P||S.value[$]||"80px",t.columns[$]&&(U.value[t.columns[$].key]=a[$])}S.value=a})}function $e(){be(),Ce(),Te()}e.watch(()=>t.data,()=>{e.nextTick(()=>{be(),xe(),Ce(),w.value.clear()})},{deep:!0}),e.watch([m,f],()=>{e.nextTick(()=>{be(),xe(),Ce()})}),e.watch(()=>t.columns,()=>{const a=[],d={...U.value};t.columns.forEach((V,$)=>{const P=o(V.width);P?(a.push(P),d[V.key]=P):d[V.key]?a.push(d[V.key]):S.value[$]?(a.push(S.value[$]),d[V.key]=S.value[$]):a.push("")});const y=new Set(t.columns.map(V=>V.key));Object.keys(d).forEach(V=>{y.has(V)||delete d[V]}),U.value=d,S.value=a,e.nextTick(()=>{We(),xe(),Ce(),Te()})},{deep:!0});function Ye(){e.nextTick(()=>{if(!h.value)return;const a=h.value.querySelector(".table");if(a&&r.value.length===0){const d=a.querySelector("thead th:not(.col-select):not(.col-expand)");d&&d.offsetHeight>0&&(F.value=d.offsetHeight)}})}function Te(){e.nextTick(()=>{if(!h.value)return;const a=h.value.querySelector(".table");if(!a)return;const d=a.querySelector(".col-selected-header");if(d){const y=d.querySelector(".selected-header-wrapper");y&&(y.style.height=`${F.value}px`)}else Ye()})}e.watch(()=>r.value,()=>{e.nextTick(()=>{be(),Ce(),Te()})},{deep:!0}),e.watch(()=>t.loading,()=>{e.nextTick(()=>{Ce()})}),e.onMounted(()=>{var a,d;e.nextTick(()=>{be(),We(),Ce(),se(),Ye(),Te()}),window.addEventListener("resize",$e),window.addEventListener("scroll",$e,!0),(a=v.value)==null||a.addEventListener("scroll",()=>{xe(),se(),Ce()},{passive:!0}),(d=h.value)==null||d.addEventListener("scroll",()=>{Ne()},{passive:!0}),e.nextTick(()=>xe()),v.value&&typeof ResizeObserver<"u"&&(Ve=new ResizeObserver(()=>{Ce()}),Ve.observe(v.value))}),e.onUnmounted(()=>{var a,d;window.removeEventListener("resize",$e),window.removeEventListener("scroll",$e,!0),(a=v.value)==null||a.removeEventListener("scroll",xe),(d=h.value)==null||d.removeEventListener("scroll",Ne),window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Fe),Ve&&(Ve.disconnect(),Ve=null)});let je=-1;function Ce(){!h.value||!v.value||requestAnimationFrame(()=>{if(!h.value||!v.value)return;const a=v.value,d=Math.ceil(a.offsetWidth-a.clientWidth);if(Q.value=d,d!==je){je=d;const y=h.value.querySelector(".table"),V=g.value;y&&V&&(h.value.style.paddingRight="0px",y.style.width="",y.style.marginRight="",d>0?(h.value.style.paddingRight=`${d}px`,y.style.width="100%",y.style.marginRight=`-${d}px`):(h.value.style.paddingRight="0px",y.style.width="100%",y.style.marginRight="0px"))}})}let Ve=null;return e.onUnmounted(()=>{x.value.clear()}),(a,d)=>{const y=e.resolveComponent("YButton"),V=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:E},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[r.value.length&&l.showBulkActions?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",bt,"已选择 "+e.toDisplayString(r.value.length)+" 项",1),e.createElementVNode("div",Ct,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:r.value,clearSelection:q},()=>[e.createVNode(y,{size:"small",class:"btn",onClick:q},{default:e.withCtx(()=>[...d[3]||(d[3]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",Et,[I.value?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-all-hints-btn",{"is-expanded":R.value}]),onClick:le,title:R.value?"收起所有提示标签":"展开所有提示标签"},[R.value?(e.openBlock(),e.createElementBlock("svg",Nt,[...d[4]||(d[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",Vt,[...d[5]||(d[5]=[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],10,xt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:h},[e.createElementVNode("table",St,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",Dt)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("col",$t)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("col",{key:$.key,style:e.normalizeStyle({width:S.value[P]||void 0,minWidth:S.value[P]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",Tt)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("th",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("input",{type:"checkbox",checked:_.value,indeterminate:Y.value,disabled:O.value,onChange:M},null,40,It),r.value.length>0?(e.openBlock(),e.createElementBlock("span",zt,e.toDisplayString(r.value.length),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("th",{key:2,colspan:l.columns.length,class:"col-selected-header"},[e.createElementVNode("div",_t,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:q},void 0,!0)])],8,Ht)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("th",{key:$.key,class:e.normalizeClass(we($,!0)),style:e.normalizeStyle(ge($,P,!0))},e.toDisplayString($.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":l.loading,"is-empty":!z.value.length&&!l.loading}]),ref_key:"bodyWrapRef",ref:v,style:e.normalizeStyle({maxHeight:C.value})},[l.loading?(e.openBlock(),e.createElementBlock("div",Kt,[...d[6]||(d[6]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!z.value.length&&!l.loading?(e.openBlock(),e.createElementBlock("div",Pt,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(l.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":l.loading}]),ref_key:"bodyTableRef",ref:g},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",At)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("col",Rt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("col",{key:$.key,style:e.normalizeStyle({width:S.value[P]||void 0,minWidth:S.value[P]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,($,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie($,P)},[e.createElementVNode("tr",{class:e.normalizeClass({"row-selected":re($,P)}),onClick:Z=>ae($,P)},[t.expandable?(e.openBlock(),e.createElementBlock("td",Wt,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:e.withModifiers(Z=>ue(ie($,P)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":ne(ie($,P))}])},null,2)],8,Yt)])):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("td",{key:1,class:"col-select",onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("input",{type:"checkbox",value:ie($,P),checked:r.value.includes(ie($,P)),disabled:G($,P),onChange:e.withModifiers(Z=>u(ie($,P)),["stop"])},null,40,jt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(Z,he)=>(e.openBlock(),e.createElementBlock("td",{key:Z.key,class:e.normalizeClass(we(Z)),style:e.normalizeStyle(ge(Z,he,!1))},[e.renderSlot(a.$slots,`cell-${Z.key}`,{item:$,value:ve($,Z.key),index:P},()=>[e.createTextVNode(e.toDisplayString(i($,Z)),1)],!0)],6))),128))],10,Ft),t.expandable&&ne(ie($,P))?(e.openBlock(),e.createElementBlock("tr",{key:`${ie($,P)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:p.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:$,index:P},void 0,!0)],8,Ot)])):e.createCommentVNode("",!0)],64))),128))])],2)],6),l.pagination?(e.openBlock(),e.createBlock(V,{key:1,class:"align-right","current-page":m.value,"onUpdate:currentPage":d[1]||(d[1]=$=>m.value=$),"page-size":f.value,"onUpdate:pageSize":d[2]||(d[2]=$=>f.value=$),loading:t.loading,"disable-next":te.value,"page-size-options":l.pageSizeOptions,onPageChange:ce,onPageSizeChange:ye},null,8,["current-page","page-size","loading","disable-next","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),Ge=fe(Ut,[["__scopeId","data-v-8e9d3cdd"]]),qt=["onKeydown","aria-expanded"],Gt={key:0,class:"yselect__tags"},Zt=["src"],Qt={class:"yselect__tag-text"},Jt=["onClick"],Xt={key:1,class:"yselect__placeholder-text"},el=["src"],tl=["placeholder","onKeydown"],ll=["onClick","onMouseenter"],nl={key:0,class:"yselect__option-check"},ol={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},al=["src"],rl=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(l,{emit:c}){const t=l,n=c,m=e.ref(!1),f=e.ref(-1),r=e.ref(),b=e.ref(),w=e.ref(),C=e.ref(!1),E=e.ref(),h=e.ref(""),v=e.computed(()=>t.multiple?null:t.options.find(o=>I(o)===t.modelValue)||null),g=e.computed(()=>{if(!t.multiple)return[];const o=Array.isArray(t.modelValue)?t.modelValue:[];return t.options.filter(s=>o.includes(I(s)))}),S=e.computed(()=>{if(t.multiple){const o=g.value.length;return o===0?"":`已选择 ${o} 项`}return v.value?R(v.value):""}),U=e.computed(()=>{if(!t.filterable)return t.options;const o=h.value.trim().toLowerCase();return o?t.options.filter(s=>{const p=R(s);return String(p).toLowerCase().includes(o)}):t.options}),F=e.computed(()=>{var z;const o={position:"fixed",zIndex:"4000"},s=b.value;if(!s)return o;const p=s.getBoundingClientRect(),T=((z=w.value)==null?void 0:z.getBoundingClientRect().width)||p.width;return o.left=`${p.left}px`,o.width=`${T}px`,C.value?(o.bottom=`${window.innerHeight-p.top+4}px`,o.top="auto"):o.top=`${p.bottom+4}px`,o});function x(){!m.value||!b.value||e.nextTick(()=>{const o=b.value;if(!o)return;const s=o.getBoundingClientRect(),p=window.innerHeight,T=200,z=s.bottom+T+4,_=s.top-T-4,Y=z<=p-20,O=_>=20;C.value=!Y&&O})}function I(o){return typeof o=="object"&&o!==null?o[t.valueKey]:o}function R(o){return typeof o=="object"&&o!==null?o[t.labelKey]||String(o[t.valueKey]):String(o)}function oe(o,s){return typeof o=="object"&&o!==null&&o.id!==void 0?o.id:I(o)||s}function X(o){return t.multiple?(Array.isArray(t.modelValue)?t.modelValue:[]).includes(I(o)):I(o)===t.modelValue}function H(o){return typeof o=="object"&&o!==null?o[t.disabledKey]===!0:!1}function K(){t.disabled||(m.value?B():le())}function le(){t.disabled||(m.value=!0,e.nextTick(()=>{x(),W(),t.filterable&&E.value&&(E.value.focus(),h.value="")}))}function B(){m.value=!1,f.value=-1,C.value=!1,t.filterable&&(h.value="")}function D(o,s){if(H(o))return;const p=I(o);if(t.multiple){const T=Array.isArray(t.modelValue)?[...t.modelValue]:[],z=I(o),_=T.indexOf(z);_>-1?T.splice(_,1):T.push(z),n("update:modelValue",T),n("change",T,g.value)}else n("update:modelValue",p),n("change",p,o),B()}function k(){if(!t.clearable||t.disabled)return;const o=t.multiple?t.clearTo!==void 0?t.clearTo:[]:t.clearTo;n("update:modelValue",o),n("change",o,t.multiple?[]:null),n("clear"),t.multiple||B()}function L(o,s){if(s.stopPropagation(),t.disabled||!t.multiple)return;const p=Array.isArray(t.modelValue)?[...t.modelValue]:[],T=I(o),z=p.indexOf(T);z>-1&&(p.splice(z,1),n("update:modelValue",p),n("change",p,g.value))}function A(o){if(!U.value||U.value.length===0){f.value=-1;return}let s=f.value;const p=U.value.length;s===-1?s=o>0?0:p-1:s=(s+o+p)%p;let T=0;for(;T<p&&H(U.value[s]);)s=(s+o+p)%p,T++;f.value=T>=p?-1:s,J()}function N(){if(f.value<0)return;const o=U.value[f.value];!o||H(o)||D(o,f.value)}function W(){if(!r.value)return;const o=r.value.querySelector(".yselect__option--selected");o&&o.scrollIntoView({block:"nearest"})}function J(){if(!r.value||f.value<0)return;const s=r.value.querySelectorAll(".yselect__option")[f.value];s&&s.scrollIntoView({block:"nearest"})}function j(o){const s=o.target;(!w.value||!w.value.contains(s))&&B()}e.watch(()=>t.modelValue,()=>{f.value=-1});function Q(){m.value&&x()}return e.onMounted(()=>{document.addEventListener("click",j),window.addEventListener("resize",Q),window.addEventListener("scroll",Q,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",j),window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q,!0)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":l.disabled,[`yselect--${l.size}`]:!0}]),style:e.normalizeStyle({width:l.width}),ref_key:"selectContainer",ref:w},[e.createElementVNode("div",{ref_key:"triggerElement",ref:b,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":m.value,"yselect__trigger--disabled":l.disabled,"yselect__trigger--error":l.error}]),onMousedown:e.withModifiers(K,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(K,["prevent"]),["enter"]),e.withKeys(e.withModifiers(K,["prevent"]),["space"]),e.withKeys(B,["escape"]),e.withKeys(e.withModifiers(le,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(le,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":m.value,"aria-haspopup":!0},[!l.filterable||!m.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!S.value}])},[e.renderSlot(o.$slots,"value",{value:t.multiple?g.value:v.value,label:S.value,multiple:t.multiple},()=>{var p;return[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.value.length>0?(e.openBlock(),e.createElementBlock("div",Gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock("span",{key:oe(T,z),class:"yselect__tag"},[T!=null&&T.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:T.flagImg,alt:"flag"},null,8,Zt)):e.createCommentVNode("",!0),e.createElementVNode("span",Qt,e.toDisplayString(R(T)),1),l.clearable&&!l.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"yselect__tag-close",onClick:e.withModifiers(_=>L(T,_),["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,Jt)):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("span",Xt,e.toDisplayString(l.placeholder),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(p=v.value)!=null&&p.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:v.value.flagImg,alt:"flag"},null,8,el)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(S.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.placeholder),1)],64))],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:E,class:"yselect__input",type:"text",placeholder:t.multiple?g.value.length>0?`已选择 ${g.value.length} 项`:l.placeholder:S.value||l.placeholder,"onUpdate:modelValue":s[0]||(s[0]=p=>h.value=p),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(p=>A(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(p=>A(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(p=>N(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(B,["prevent"]),["esc"]),e.withKeys(e.withModifiers(k,["prevent"]),["delete"])]},null,40,tl)),[[e.vModelText,h.value]]),l.clearable&&!l.disabled&&(t.multiple?g.value.length>0:v.value)?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(k,["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":m.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,qt),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":C.value}]),style:e.normalizeStyle(F.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(U.value,(p,T)=>(e.openBlock(),e.createElementBlock("div",{key:oe(p,T),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":X(p),"yselect__option--disabled":H(p),"yselect__option--hover":f.value===T}]),onClick:z=>D(p),onMouseenter:z=>f.value=T,onMouseleave:s[5]||(s[5]=z=>f.value=-1)},[e.renderSlot(o.$slots,"option",{option:p,index:T,selected:X(p)},()=>[t.multiple?(e.openBlock(),e.createElementBlock("span",nl,[X(p)?(e.openBlock(),e.createElementBlock("svg",ol,[...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),p!=null&&p.flagImg?(e.openBlock(),e.createElementBlock("img",{key:1,class:"yselect__flag",src:p.flagImg,alt:"flag"},null,8,al)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(R(p)),1)],!0)],42,ll))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Pe=fe(rl,[["__scopeId","data-v-b3f1516d"]]),il={class:"ypagination"},sl={class:"page-actions"},cl={class:"page-size-select"},dl=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}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(t.pageSize),f=e.computed(()=>t.pageSizeOptions),r=e.computed({get:()=>t.currentPage,set:E=>{n("update:currentPage",E),n("page-change",E)}});function b(E){t.loading||E>=1&&E!==t.currentPage&&(r.value=E)}function w(E){t.loading||(m.value=E,n("update:pageSize",E),n("page-size-change",E),r.value=1)}function C(E){t.loading||(E==="prev"?b(r.value-1):E==="next"&&b(r.value+1))}return m.value=t.pageSize,e.watch(()=>t.pageSize,E=>{typeof E=="number"&&m.value!==E&&(m.value=E)}),(E,h)=>{const v=e.resolveComponent("YButton"),g=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",sl,[e.createVNode(v,{size:"small",variant:"secondary",disabled:r.value===1||l.loading,onClick:h[0]||(h[0]=S=>b(1))},{default:e.withCtx(()=>[...h[2]||(h[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(v,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:r.value===1||l.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:l.loading||l.disableNext,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:C},null,8,["groupItems"]),e.createElementVNode("div",cl,[e.createVNode(g,{modelValue:m.value,"onUpdate:modelValue":h[1]||(h[1]=S=>m.value=S),options:f.value,size:"small",width:"105px",clearable:!1,disabled:l.loading,onChange:w},null,8,["modelValue","options","disabled"])])])])}}}),Ze=fe(dl,[["__scopeId","data-v-5a512f0f"]]),ul=["aria-label"],fl={class:"y-badge__inner"},ml={key:0,class:"y-badge__progress","aria-hidden":"true"},hl={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},vl={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},pl={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},gl={key:1,class:"y-badge__icon","aria-hidden":"true"},yl={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},wl={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},kl={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},bl={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Cl={class:"y-badge__label"},El=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(l){const c=l,t=e.computed(()=>c.tone||"default"),n=e.computed(()=>{const m=(c.label||"").trim(),f=c.tone,r=c.progress;if(r){const b={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return m?`${m},进度:${b[r]||r}`:`进度:${b[r]||r}`}if(f&&f!=="default"){const b={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return m?`${m},语气:${b[f]||f}`:`语气:${b[f]||f}`}return m||"标记"});return(m,f)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${l.size}`,{"is-outline":l.outline,"is-pill":l.pill},l.progress?`y-badge--progress-${l.progress}`:""]]),role:"status","aria-label":n.value},[e.createElementVNode("span",fl,[l.progress?(e.openBlock(),e.createElementBlock("span",ml,[l.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",hl,[...f[0]||(f[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):l.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",vl,[...f[1]||(f[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)])])):l.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",pl,[...f[2]||(f[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)])):l.icon?(e.openBlock(),e.createElementBlock("span",gl,[l.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",yl,[...f[3]||(f[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):l.icon==="check"?(e.openBlock(),e.createElementBlock("svg",wl,[...f[4]||(f[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)])])):l.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",kl,[...f[5]||(f[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",bl,[...f[6]||(f[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",Cl,[e.renderSlot(m.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.label),1)],!0)])])],10,ul))}}),Qe=fe(El,[["__scopeId","data-v-ce819797"]]),Bl=["aria-hidden"],xl=["onKeydown"],Nl={key:0,class:"y-dialog-header"},Vl={class:"y-dialog-title"},Sl={class:"y-dialog-body"},Dl={key:1,class:"y-dialog-footer"},$l=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:3e3},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(l,{emit:c}){const t=l,n=c,m=e.computed({get:()=>t.modelValue,set:h=>n("update:modelValue",h)}),f=e.ref(null),r=e.computed(()=>{const h={};return h.width=typeof t.width=="number"?`${t.width}px`:String(t.width),h.margin="0 auto",h.top=t.top,h});function b(){t.maskClosable&&w()}function w(){m.value&&(m.value=!1,n("close"))}function C(){t.closable&&w()}function E(h){h.key==="Escape"&&C()}return e.watch(()=>t.modelValue,h=>{h?(n("open"),requestAnimationFrame(()=>{var v;return(v=f.value)==null?void 0:v.focus()}),document.addEventListener("keydown",E),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",E),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",E),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",E),document.body.style.overflow=""}),(h,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!m.value,style:e.normalizeStyle({zIndex:String(l.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:b}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-dialog-panel",[l.center?"is-center":""]]),style:e.normalizeStyle(r.value),onKeydown:e.withKeys(e.withModifiers(C,["prevent","stop"]),["esc"]),tabindex:"-1"},[l.showHeader?(e.openBlock(),e.createElementBlock("div",Nl,[e.renderSlot(h.$slots,"header",{},()=>[e.createElementVNode("div",Vl,e.toDisplayString(l.title),1)],!0),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:w}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Sl,[e.renderSlot(h.$slots,"default",{},void 0,!0)]),h.$slots.footer?(e.openBlock(),e.createElementBlock("div",Dl,[e.renderSlot(h.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,xl),[[e.vShow,m.value]])]),_:3})],12,Bl),[[e.vShow,m.value]])]))}}),Je=fe($l,[["__scopeId","data-v-a7acc6dc"]]),Tl={class:"ypopover__inner"},Ml=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(),r=e.ref(),b=e.ref(),w=e.ref(!1),C=e.ref(),E=e.ref(),h=e.ref({});let v=null,g=null;const S=e.computed(()=>{if(!w.value||!C.value)return{};const N={};n.width!=="auto"&&(N.width=typeof n.width=="number"?`${n.width}px`:n.width),n.maxWidth&&(N.maxWidth=typeof n.maxWidth=="number"?`${n.maxWidth}px`:n.maxWidth);const{top:W,left:J}=F();return N.top=`${W}px`,N.left=`${J}px`,N}),U=e.computed(()=>{if(!n.showArrow)return{};if(Object.keys(h.value).length>0)return h.value;const N={};return n.placement.startsWith("top")||n.placement.startsWith("bottom")?N.left="50%":N.top="50%",N});function F(){var _,Y;if(!C.value)return{top:0,left:0};const{width:N,height:W,top:J,left:j}=C.value,Q=((_=b.value)==null?void 0:_.offsetWidth)||200,o=((Y=b.value)==null?void 0:Y.offsetHeight)||100;let s=0,p=0;switch(n.placement){case"top":s=J-o-n.offset,p=j+(N-Q)/2;break;case"top-start":s=J-o-n.offset,p=j;break;case"top-end":s=J-o-n.offset,p=j+N-Q;break;case"bottom":s=J+W+n.offset,p=j+(N-Q)/2;break;case"bottom-start":s=J+W+n.offset,p=j;break;case"bottom-end":s=J+W+n.offset,p=j+N-Q;break;case"left":s=J+(W-o)/2,p=j-Q-n.offset;break;case"left-start":s=J,p=j-Q-n.offset;break;case"left-end":s=J+W-o,p=j-Q-n.offset;break;case"right":s=J+(W-o)/2,p=j+N+n.offset;break;case"right-start":s=J,p=j+N+n.offset;break;case"right-end":s=J+W-o,p=j+N+n.offset;break}const T=window.innerWidth,z=window.innerHeight;return p<8&&(p=8),p+Q>T-8&&(p=T-Q-8),s<8&&(s=8),s+o>z-8&&(s=z-o-8),{top:s,left:p}}function x(){n.disabled||w.value||(X(),n.openDelay>0?v=setTimeout(()=>{I()},n.openDelay):I())}function I(){m("before-show"),w.value=!0,m("update:modelValue",!0),m("show"),e.nextTick(()=>{e.nextTick(()=>{K()})})}function R(){w.value&&(X(),n.closeDelay>0?g=setTimeout(()=>{oe()},n.closeDelay):oe())}function oe(){m("before-hide"),w.value=!1,m("update:modelValue",!1),m("hide")}function X(){v&&(clearTimeout(v),v=null),g&&(clearTimeout(g),g=null)}function H(){if(!n.showArrow||!C.value||!b.value){h.value={};return}const N=C.value,W=b.value.getBoundingClientRect();if(W.width===0||W.height===0){const j={};n.placement.startsWith("top")||n.placement.startsWith("bottom")?j.left="50%":j.top="50%",h.value=j;return}const J={};if(n.placement.startsWith("top")){J.bottom="-6px";const j=N.left+N.width/2,Q=W.left,o=j-Q;J.left=`${Math.max(12,Math.min(o,W.width-12))}px`}else if(n.placement.startsWith("bottom")){J.top="-6px";const j=N.left+N.width/2,Q=W.left,o=j-Q;J.left=`${Math.max(12,Math.min(o,W.width-12))}px`}else if(n.placement.startsWith("left")){J.right="-6px";const j=N.top+N.height/2,Q=W.top,o=j-Q;J.top=`${Math.max(12,Math.min(o,W.height-12))}px`}else if(n.placement.startsWith("right")){J.left="-6px";const j=N.top+N.height/2,Q=W.top,o=j-Q;J.top=`${Math.max(12,Math.min(o,W.height-12))}px`}h.value=J}function K(){r.value&&(C.value=r.value.getBoundingClientRect(),b.value&&(E.value=b.value.getBoundingClientRect(),H(),w.value&&requestAnimationFrame(()=>{b.value&&(E.value=b.value.getBoundingClientRect(),H())})))}function le(){n.disabled||n.trigger==="click"&&(w.value?R():x())}function B(){n.disabled||n.trigger!=="hover"||(X(),x())}function D(){n.disabled||n.trigger!=="hover"||R()}function k(){n.disabled||n.trigger!=="hover"||X()}function L(){n.disabled||n.trigger!=="hover"||R()}function A(N){if(!n.closeOnClickOutside||!w.value)return;const W=N.target;f.value&&!f.value.contains(W)&&b.value&&!b.value.contains(W)&&R()}return e.watch(()=>n.modelValue,N=>{N!==w.value&&(N?x():R())}),e.watch(w,N=>{N?(document.addEventListener("click",A),window.addEventListener("resize",K),window.addEventListener("scroll",K,!0),e.nextTick(()=>{K(),requestAnimationFrame(()=>{K()}),setTimeout(()=>{K()},0)})):(document.removeEventListener("click",A),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0))}),e.onMounted(()=>{n.modelValue&&x()}),e.onUnmounted(()=>{X(),document.removeEventListener("click",A),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0)}),c({show:x,hide:R,updatePosition:K}),(N,W)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:f},[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,onClick:le,onMouseenter:B,onMouseleave:D},[e.renderSlot(N.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[w.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:b,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${l.placement}`,{"ypopover__content--dark":l.dark,"ypopover__content--no-padding":!l.showPadding}]]),style:e.normalizeStyle(S.value),onClick:W[0]||(W[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:k,onMouseleave:L},[l.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${l.placement}`]),style:e.normalizeStyle(U.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",Tl,[e.renderSlot(N.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),Xe=fe(Ml,[["__scopeId","data-v-be755399"]]),Ll={class:"relative"},Il=["value","placeholder"],zl={class:"nh-time-suffix"},Hl={class:"nh-time-shortcuts"},_l={class:"nh-time-shortcuts-list"},Kl=["onClick","onKeydown","onMouseenter"],Pl={class:"nh-time-custom"},Al={class:"nh-time-custom-header"},Rl={class:"nh-time-selection-status"},Fl={key:0,class:"status-text"},Wl={key:1,class:"status-text"},Yl={key:2,class:"status-text status-complete"},jl={class:"nh-time-pickers"},Ol={class:"nh-time-picker"},Ul={class:"nh-date-picker"},ql={class:"nh-date-picker-header"},Gl={class:"nh-date-picker-header-label"},Zl={class:"nh-date-picker-content"},Ql={class:"nh-date-table"},Jl=["onClick"],Xl={class:"nh-date-table-cell"},en={key:0},tn={class:"nh-time-picker"},ln={class:"nh-date-picker"},nn={class:"nh-date-picker-header"},on={class:"nh-date-picker-header-label"},an={class:"nh-date-picker-content"},rn={class:"nh-date-table"},sn=["onClick"],cn={class:"nh-date-table-cell"},dn={key:0},un={class:"nh-time-actions"},fn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const l=new Date,c=new Date(l.getFullYear(),l.getMonth(),l.getDate()),t=new Date(l.getFullYear(),l.getMonth(),l.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"昨天",getValue:()=>{const l=new Date;l.setDate(l.getDate()-1);const c=new Date(l.getFullYear(),l.getMonth(),l.getDate()),t=new Date(l.getFullYear(),l.getMonth(),l.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"近7天",getValue:()=>{const l=new Date,c=new Date;return c.setDate(c.getDate()-6),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}},{label:"近30天",getValue:()=>{const l=new Date,c=new Date;return c.setDate(c.getDate()-29),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}},{label:"近3个月",getValue:()=>{const l=new Date,c=new Date;return c.setMonth(c.getMonth()-3),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(!1),f=e.ref(-1),r=e.ref(-1),b=e.ref(null),w=e.ref(),C=e.ref(),E=e.ref({top:!0,left:!0}),h=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),v=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),g=()=>{const i=new Date(h.value.year,h.value.month).getTime(),u=new Date(v.value.year,v.value.month).getTime();if(i>=u){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}},S=()=>{const i=new Date(h.value.year,h.value.month).getTime();if(new Date(v.value.year,v.value.month).getTime()<=i){const M=new Date(v.value.year,v.value.month-1);h.value.year=M.getFullYear(),h.value.month=M.getMonth()}},U=["一","二","三","四","五","六","日"],F=e.ref(null),x=e.ref(null),I=i=>{if(!i)return null;if(i instanceof Date)return i;if(typeof i=="number")return new Date(i);if(typeof i=="string"){const u=new Date(i);return isNaN(u.getTime())?null:u}return null},R=i=>{if(!i)return null;const u=i.getFullYear(),M=String(i.getMonth()+1).padStart(2,"0"),q=String(i.getDate()).padStart(2,"0");if(t.includeTime){const ae=String(i.getHours()).padStart(2,"0"),re=String(i.getMinutes()).padStart(2,"0"),ce=String(i.getSeconds()).padStart(2,"0");return`${u}-${M}-${q} ${ae}:${re}:${ce}`}else return`${u}-${M}-${q}`},oe=i=>i?i.getTime():null,X=i=>i?{startDate:I(i.startDate),endDate:I(i.endDate)}:{startDate:null,endDate:null},H=i=>t.format==="string"?{startDate:R(i.startDate),endDate:R(i.endDate)}:t.format==="timestamp"?{startDate:oe(i.startDate),endDate:oe(i.endDate)}:i,K=(i,u)=>`${String(u+1).padStart(2,"0")}/${i}`,le=(i,u)=>i.getFullYear()===u.getFullYear()&&i.getMonth()===u.getMonth()&&i.getDate()===u.getDate(),B=(i,u,M)=>!u||!M?!1:i>=u&&i<=M,D=i=>{const u=X(i);if(!(u!=null&&u.startDate)||!(u!=null&&u.endDate))return-1;for(let M=0;M<t.shortcuts.length;M++){const q=t.shortcuts[M].getValue();if(q.startDate&&q.endDate&&u.startDate&&u.endDate){const ae=new Date(u.startDate.getFullYear(),u.startDate.getMonth(),u.startDate.getDate()),re=new Date(u.endDate.getFullYear(),u.endDate.getMonth(),u.endDate.getDate()),ce=new Date(q.startDate.getFullYear(),q.startDate.getMonth(),q.startDate.getDate()),ye=new Date(q.endDate.getFullYear(),q.endDate.getMonth(),q.endDate.getDate());if(ae.getTime()===ce.getTime()&&re.getTime()===ye.getTime())return M}}return-1},k=(i,u)=>{const M=new Date(i,u,1),q=new Date(i,u+1,0),ae=M.getDay(),re=q.getDate(),ce=[],ye=new Date,be=ae===0?6:ae-1,Be=new Date(i,u,0);for(let se=be-1;se>=0;se--){const ke=new Date(i,u-1,Be.getDate()-se);ce.push({date:ke,day:ke.getDate(),isCurrentMonth:!1,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let se=1;se<=re;se++){const ke=new Date(i,u,se);ce.push({date:ke,day:se,isCurrentMonth:!0,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!1})}const xe=42-ce.length;for(let se=1;se<=xe;se++){const ke=new Date(i,u+1,se);ce.push({date:ke,day:se,isCurrentMonth:!1,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!0})}const Ne=[];for(let se=0;se<ce.length;se+=7)Ne.push(ce.slice(se,se+7));return Ne},L=i=>{const u=H(i);n("update:modelValue",u),n("change",u)},A=()=>{if(!w.value||!C.value)return;const i=w.value.getBoundingClientRect(),u=C.value.getBoundingClientRect(),M=window.innerWidth,ae=window.innerHeight-i.bottom,re=i.top,ce=u.height||400;ae<ce&&re>ce?E.value.top=!1:E.value.top=!0;const ye=M-i.left,be=u.width||640;ye<be?E.value.left=!1:E.value.left=!0},N=()=>{if(m.value=!m.value,m.value){const i=X(t.modelValue);if(F.value=(i==null?void 0:i.startDate)||null,x.value=(i==null?void 0:i.endDate)||null,r.value=D(t.modelValue),f.value=-1,i!=null&&i.startDate&&(h.value.year=i.startDate.getFullYear(),h.value.month=i.startDate.getMonth()),i!=null&&i.endDate)v.value.year=i.endDate.getFullYear(),v.value.month=i.endDate.getMonth();else{const u=new Date(h.value.year,h.value.month+1);v.value.year=u.getFullYear(),v.value.month=u.getMonth()}g(),e.nextTick(()=>{A()})}},W=i=>{const u=i.target,M=w.value,q=C.value;M&&q&&!M.contains(u)&&!q.contains(u)&&(m.value=!1,f.value=-1)},J=i=>{i.key==="Enter"||i.key===" "?(i.preventDefault(),N()):i.key==="ArrowDown"&&(i.preventDefault(),m.value=!0,e.nextTick(()=>{A(),p()}))},j=i=>{var u;i.key==="Escape"&&(m.value=!1,f.value=-1,(u=w.value)==null||u.focus())},Q=(i,u)=>{i.key==="ArrowDown"?(i.preventDefault(),f.value=Math.min(u+1,t.shortcuts.length-1),T(f.value)):i.key==="ArrowUp"?(i.preventDefault(),f.value=Math.max(u-1,0),T(f.value)):(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),z(t.shortcuts[u]))},o=i=>{f.value=i},s=()=>{f.value=-1},p=()=>{f.value=0,T(0)},T=i=>{if(C.value){const M=C.value.querySelectorAll(".nh-time-shortcut")[i];M&&M.focus()}},z=i=>{const u=i.getValue();t.includeTime&&u.startDate&&u.endDate&&(u.startDate.setHours(0,0,0,0),u.endDate.setHours(23,59,59,999)),L(u),r.value=t.shortcuts.findIndex(M=>M.label===i.label),f.value=-1,m.value=!1},_=(i,u)=>{if(!i||i.isDisabled)return;let M;if(t.includeTime?(M=new Date(i.date),u==="start"||!F.value?M.setHours(0,0,0,0):M.setHours(23,59,59,999)):M=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()),!F.value&&!x.value)F.value=M,x.value=null;else if(F.value&&!x.value)if(M>=F.value)t.includeTime&&M.setHours(23,59,59,999),x.value=M;else{const q=F.value;t.includeTime&&q.setHours(23,59,59,999),x.value=q,F.value=M}else F.value=M,x.value=null;if(r.value=-1,F.value&&x.value){const q=new Date(x.value);t.includeTime&&q.setHours(23,59,59,999),b.value={startDate:F.value,endDate:q}}else b.value=null},Y=(i,u)=>{if(!i)return["nh-date-table-td"];const M=["nh-date-table-td"];return i.isCurrentMonth||M.push("is-prev-month"),i.isToday&&M.push("is-today"),i.isDisabled&&M.push("is-disabled"),F.value&&le(i.date,F.value)&&M.push("is-selected","is-start"),x.value&&le(i.date,x.value)&&M.push("is-selected","is-end"),F.value&&x.value&&B(i.date,F.value,x.value)&&M.push("is-in-range"),M},O=()=>{b.value&&(t.includeTime&&b.value.endDate&&b.value.endDate.setHours(23,59,59,999),L(b.value),r.value=D(b.value),m.value=!1)},te=()=>{L({startDate:null,endDate:null}),ve(),f.value=-1,m.value=!1},ee=()=>{m.value&&e.nextTick(()=>{A()})},de=e.computed(()=>k(h.value.year,h.value.month)),me=e.computed(()=>k(v.value.year,v.value.month)),ie=e.computed(()=>{const i=X(t.modelValue);if(!i||!i.startDate||!i.endDate)return"";const u=ae=>{const re=String(ae.getFullYear()),ce=String(ae.getMonth()+1).padStart(2,"0"),ye=String(ae.getDate()).padStart(2,"0");return`${re}/${ce}/${ye}`},M=u(i.startDate),q=u(i.endDate);return!t.includeTime&&M===q?M:`${M} - ${q}`}),G=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!E.value.top,"nh-time-dropdown-right":!E.value.left}]),ne=e.computed(()=>{const i=X(t.modelValue);return!!(i!=null&&i.startDate&&(i!=null&&i.endDate))}),ue=e.computed(()=>!!(F.value&&x.value)),ve=()=>{F.value=null,x.value=null,b.value=null,r.value=-1};e.watch(()=>t.modelValue,i=>{const u=X(i);if(u!=null&&u.startDate){const M=u.startDate;h.value.year=M.getFullYear(),h.value.month=M.getMonth()}if(u!=null&&u.endDate){const M=u.endDate;v.value.year=M.getFullYear(),v.value.month=M.getMonth()}else if(u!=null&&u.startDate){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}(u!=null&&u.startDate||u!=null&&u.endDate)&&g(),m.value||(r.value=D(i))},{immediate:!0,deep:!0}),e.watch([h,v],()=>{const i=new Date(h.value.year,h.value.month).getTime(),u=new Date(v.value.year,v.value.month).getTime();if(i===u){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",W),window.addEventListener("resize",ee),window.addEventListener("scroll",ee),r.value=D(t.modelValue);const i=X(t.modelValue);if(i!=null&&i.startDate&&(h.value.year=i.startDate.getFullYear(),h.value.month=i.startDate.getMonth()),i!=null&&i.endDate)v.value.year=i.endDate.getFullYear(),v.value.month=i.endDate.getMonth();else{const u=new Date(h.value.year,h.value.month+1);v.value.year=u.getFullYear(),v.value.month=u.getMonth()}g()}),e.onUnmounted(()=>{document.removeEventListener("click",W),window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee)});const we=()=>{t.clearable&&(L({startDate:null,endDate:null}),ve(),f.value=-1)},ge=(i,u)=>{if(i==="start"){const M=new Date(h.value.year,h.value.month+u,1);h.value.year=M.getFullYear(),h.value.month=M.getMonth(),g()}else{const M=new Date(v.value.year,v.value.month+u,1);v.value.year=M.getFullYear(),v.value.month=M.getMonth(),S()}};return(i,u)=>{const M=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${l.size}`]])},[e.createElementVNode("div",Ll,[e.createElementVNode("div",{ref_key:"trigger",ref:w,onClick:N,onKeydown:J,class:e.normalizeClass(["nh-time-trigger",{"is-focus":m.value,"has-value":ne.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:ie.value,placeholder:l.placeholder,class:"nh-time-input"},null,8,Il),e.createElementVNode("span",zl,[l.clearable&&ne.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(we,["stop"]),class:"nh-time-clear"},[...u[4]||(u[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),u[6]||(u[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":m.value}])},[...u[5]||(u[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(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:C,class:e.normalizeClass(G.value),onKeydown:j},[e.createElementVNode("div",Hl,[u[7]||(u[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",_l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.shortcuts,(q,ae)=>(e.openBlock(),e.createElementBlock("li",{key:q.label,onClick:re=>z(q),onKeydown:re=>Q(re,ae),onMouseenter:re=>o(ae),onMouseleave:s,class:e.normalizeClass(["nh-time-shortcut",{"is-active":f.value===ae,"is-selected":r.value===ae}]),tabindex:"0"},e.toDisplayString(q.label),43,Kl))),128))])]),e.createElementVNode("div",Pl,[e.createElementVNode("div",Al,[u[8]||(u[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",Rl,[!F.value&&!x.value?(e.openBlock(),e.createElementBlock("span",Fl," 请选择开始日期 ")):F.value&&!x.value?(e.openBlock(),e.createElementBlock("span",Wl," 请选择结束日期 ")):F.value&&x.value?(e.openBlock(),e.createElementBlock("span",Yl," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",jl,[e.createElementVNode("div",Ol,[e.createElementVNode("div",Ul,[e.createElementVNode("div",ql,[e.createElementVNode("button",{onClick:u[0]||(u[0]=q=>ge("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...u[9]||(u[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",Gl,e.toDisplayString(K(h.value.year,h.value.month)),1),e.createElementVNode("button",{onClick:u[1]||(u[1]=q=>ge("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...u[10]||(u[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",Zl,[e.createElementVNode("table",Ql,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,q=>e.createElementVNode("th",{key:q,class:"nh-date-table-th"},e.toDisplayString(q),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,(q,ae)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${ae}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q,(re,ce)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${ae}-${ce}`,class:e.normalizeClass(Y(re)),onClick:ye=>_(re,"start")},[e.createElementVNode("div",Xl,[re?(e.openBlock(),e.createElementBlock("span",en,e.toDisplayString(re.day),1)):e.createCommentVNode("",!0)])],10,Jl))),128))]))),128))])])])])]),e.createElementVNode("div",tn,[e.createElementVNode("div",ln,[e.createElementVNode("div",nn,[e.createElementVNode("button",{onClick:u[2]||(u[2]=q=>ge("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...u[11]||(u[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",on,e.toDisplayString(K(v.value.year,v.value.month)),1),e.createElementVNode("button",{onClick:u[3]||(u[3]=q=>ge("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...u[12]||(u[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",an,[e.createElementVNode("table",rn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,q=>e.createElementVNode("th",{key:q,class:"nh-date-table-th"},e.toDisplayString(q),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,(q,ae)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${ae}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q,(re,ce)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${ae}-${ce}`,class:e.normalizeClass(Y(re)),onClick:ye=>_(re,"end")},[e.createElementVNode("div",cn,[re?(e.openBlock(),e.createElementBlock("span",dn,e.toDisplayString(re.day),1)):e.createCommentVNode("",!0)])],10,sn))),128))]))),128))])])])])])]),e.createElementVNode("div",un,[l.clearable?(e.openBlock(),e.createBlock(M,{key:0,onClick:te,variant:"secondary",size:l.size},{default:e.withCtx(()=>[...u[13]||(u[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(M,{onClick:O,disabled:!ue.value,variant:"primary",size:l.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F.value&&!x.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),Ae=fe(fn,[["__scopeId","data-v-e5ef63b1"]]),mn=["aria-checked","aria-disabled","disabled","onKeydown"],hn={class:"yswitch__thumb"},vn={key:0,class:"yswitch__spinner","aria-hidden":"true"},pn=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(l,{emit:c}){const t=l,n=c,m=e.ref(),f=e.computed(()=>t.modelValue===t.trueValue),r=e.computed(()=>{const w={};return w.background=f.value?t.activeColor:t.inactiveColor,w});function b(){if(t.disabled||t.loading)return;const w=f.value?t.falseValue:t.trueValue;n("update:modelValue",w),n("change",w)}return e.onMounted(()=>{const w=m.value;w&&(w.addEventListener("focus",C=>n("focus",C)),w.addEventListener("blur",C=>n("blur",C)))}),(w,C)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:m,class:e.normalizeClass(["yswitch",[`yswitch--${l.size}`,{"yswitch--checked":f.value,"yswitch--disabled":l.disabled,"yswitch--loading":l.loading}]]),style:e.normalizeStyle(r.value),role:"switch","aria-checked":f.value,"aria-disabled":l.disabled,disabled:l.disabled||l.loading,onClick:b,onKeydown:[e.withKeys(e.withModifiers(b,["prevent"]),["enter"]),e.withKeys(e.withModifiers(b,["prevent"]),["space"])]},[C[0]||(C[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",hn,[l.loading?(e.openBlock(),e.createElementBlock("span",vn)):e.createCommentVNode("",!0)]),l.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!f.value,"yswitch__label--right":f.value}])},e.toDisplayString(f.value?l.activeText:l.inactiveText),3)):e.createCommentVNode("",!0)],46,mn))}}),Re=fe(pn,[["__scopeId","data-v-0b157fc4"]]),gn=["src","alt"],yn=["src","alt"],wn=["src"],kn=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(),r=e.ref(),b=e.ref(),w=e.ref(!1),C=e.ref(!1),E=e.ref(!1),h=e.ref(!1),v=e.ref(!1),g=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),S=e.ref(""),U=e.ref(1),F=e.ref(!1),x=e.ref({visible:!1,src:"",top:0,left:0,width:400,height:400,isHoveringPreview:!1});let I=null;const R=e.ref({overflow:"",paddingRight:""}),oe={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},X=e.computed(()=>n.className||""),H=e.computed(()=>{if(typeof n.radius=="number")return`${n.radius}px`;if(typeof n.radius=="string"){if(/(px|%|rem|em)$/.test(n.radius))return n.radius;if(oe[n.radius])return oe[n.radius]}return""}),K=e.computed(()=>H.value?{borderRadius:H.value}:{}),le=e.computed(()=>["yimage-image",n.preview?"is-previewable":""].filter(Boolean).join(" ")),B=e.computed(()=>{const G={objectFit:n.fit||"cover",backgroundColor:"#fff"};return n.width&&(G.width=typeof n.width=="number"?`${n.width}px`:n.width),n.height&&(G.height=typeof n.height=="number"?`${n.height}px`:n.height),H.value&&(G.borderRadius=H.value),G}),D=e.computed(()=>S.value?S.value:Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src),k=e.computed(()=>Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src),L=()=>{const G=document.createElement("div");G.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(G);const ne=G.offsetWidth-G.clientWidth;return document.body.removeChild(G),ne},A=()=>{if(R.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const ne=L();document.body.style.paddingRight=`${ne}px`}document.body.style.overflow="hidden"},N=()=>{document.body.style.overflow=R.value.overflow,document.body.style.paddingRight=R.value.paddingRight};let W=null;const J=()=>{!n.lazy||!f.value||(W=new IntersectionObserver(G=>{G.forEach(ne=>{ne.isIntersecting&&(h.value=!0,g.value=n.src,W==null||W.unobserve(ne.target))})},{rootMargin:"50px"}),W.observe(f.value))},j=G=>{w.value=!0,C.value=!1,E.value=!1,m("load",G)},Q=G=>{E.value=!0,C.value=!1,w.value=!1,m("error",G)},o=()=>{E.value=!1,C.value=!0,w.value=!1,e.nextTick(()=>{r.value&&(r.value.src=n.src)})},s=()=>Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src,p=()=>{n.preview&&(n.previewSrcList||n.src)?T():o()},T=()=>{if(!n.preview)return;U.value=1;const G=s();if(r.value&&r.value.complete&&r.value.naturalWidth>0){S.value=G,e.nextTick(()=>{v.value=!0,A(),m("preview",G)});return}const ne=new Image;let ue=null,ve=!1;const we=()=>{ve||(ve=!0,ue&&(clearTimeout(ue),ue=null),S.value=G,e.nextTick(()=>{v.value=!0,A(),m("preview",G)}))};ue=setTimeout(()=>{we()},500),ne.onload=()=>{we()},ne.onerror=()=>{we()},ne.src=G,ne.complete&&we()},z=()=>{v.value=!1,setTimeout(()=>{N()},300)},_=G=>{const ne=G.deltaY<0?1:-1;let ve=U.value+ne*.1;ve=Math.max(.5,Math.min(2,ve)),U.value=ve};function Y(G){if(!(G instanceof HTMLElement))return;const ne=G.getBoundingClientRect(),ue=12,ve=window.innerWidth||document.documentElement.clientWidth,we=window.innerHeight||document.documentElement.clientHeight;let ge=ne.right+ue;ge+x.value.width>ve-ue&&(ge=ne.left-x.value.width-ue);let i=ne.top;i+x.value.height>we-ue&&(i=we-x.value.height-ue),i<ue&&(i=ue),ge<ue&&(ge=ue),x.value.left=ge,x.value.top=i}function O(G){n.hoverPreview&&(I&&(clearTimeout(I),I=null),x.value.isHoveringPreview=!1,x.value.src=k.value,x.value.width=n.hoverPreviewWidth,x.value.height=n.hoverPreviewHeight,x.value.visible=!0,Y(G.currentTarget))}function te(G){n.hoverPreview&&x.value.visible&&(I&&(clearTimeout(I),I=null),Y(G.currentTarget))}function ee(){n.hoverPreview&&(x.value.isHoveringPreview||(I&&(clearTimeout(I),I=null),I=setTimeout(()=>{x.value.isHoveringPreview||(x.value.visible=!1,x.value.src=""),I=null},50)))}function de(){n.hoverPreview&&(I&&(clearTimeout(I),I=null),x.value.isHoveringPreview=!0)}function me(){n.hoverPreview&&(x.value.isHoveringPreview=!1,x.value.visible=!1,x.value.src="",I&&(clearTimeout(I),I=null))}e.onMounted(()=>{n.lazy?J():h.value=!0,h.value&&(C.value=!0),F.value=!0}),e.onUnmounted(()=>{W&&W.disconnect(),v.value&&N(),I&&(clearTimeout(I),I=null)});const ie=()=>{n.src&&h.value&&(C.value=!0,E.value=!1,w.value=!1)};return e.watch(()=>g.value,ie),e.watch(()=>n.src,G=>{g.value=G||""}),c({retryLoad:o,closePreview:z}),(G,ne)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:f,class:e.normalizeClass(["yimage-container",X.value])},[!w.value&&!E.value&&!h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(K.value)},[...ne[1]||(ne[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),C.value&&!E.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(K.value)},[...ne[2]||(ne[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(K.value),onClick:p},[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:g.value,alt:l.alt,class:e.normalizeClass(le.value),onLoad:j,onError:Q,onClick:e.withModifiers(T,["stop"]),onMouseenter:O,onMouseleave:ee,onMousemove:te,style:e.normalizeStyle(B.value)},null,46,gn),[[e.vShow,w.value&&!E.value]]),n.preview&&(!w.value||C.value||E.value||!h.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(T,["stop"])})):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(z,["self"]),onWheel:e.withModifiers(_,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":v.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:b,src:D.value,alt:l.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${U.value})`}),onClick:ne[0]||(ne[0]=e.withModifiers(()=>{},["stop"]))},null,12,yn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),F.value&&n.hoverPreview?(e.openBlock(),e.createBlock(e.Teleport,{key:5,to:"body"},[e.createVNode(e.Transition,{name:"hover-preview-fade",appear:""},{default:e.withCtx(()=>[x.value.visible&&x.value.src?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-hover-preview",style:e.normalizeStyle({top:x.value.top+"px",left:x.value.left+"px",width:x.value.width+"px",height:x.value.height+"px"}),onMouseenter:de,onMouseleave:me},[e.createElementVNode("img",{src:x.value.src,alt:"图片预览"},null,8,wn)],36)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),et=fe(kn,[["__scopeId","data-v-d791a239"]]),bn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(l){const c=l,t=e.ref(!1),n=e.ref();let m=null;const f=e.computed(()=>`y-dropdown__menu--${c.placement}`),r=e.computed(()=>{if(!c.menuWidth)return{};const v=typeof c.menuWidth=="number"?`${c.menuWidth}px`:c.menuWidth;return{width:v,minWidth:v,maxWidth:v}}),b=()=>{console.log("显示下拉菜单",t.value),!c.disabled&&(m&&(clearTimeout(m),m=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{C()}))},w=()=>{console.log("隐藏下拉菜单"),m=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},C=()=>{if(!n.value)return;const v=n.value.querySelector(".y-dropdown__trigger"),g=n.value.querySelector(".y-dropdown__menu");if(!v||!g)return;const S=v.getBoundingClientRect(),U=g.getBoundingClientRect(),F=window.innerWidth,x=window.innerHeight;g.style.top="",g.style.left="",g.style.right="",g.style.bottom="",g.style.transform="";let I=0,R=0;switch(c.placement){case"bottom":I=S.height+4,R=0;break;case"top":I=-(U.height+4),R=0;break;case"right":I=0,R=S.width+4;break;case"left":I=0,R=-(U.width+4);break}let oe=S.top+I,X=S.left+R;if(c.placement==="bottom"||c.placement==="top"){const H=U.width||260;X+H>F-10&&(X=F-H-10),X<10&&(X=10)}if(c.placement==="left"||c.placement==="right"){const H=U.height||200;oe+H>x-10&&(oe=x-H-10),oe<10&&(oe=10)}g.style.top=`${oe}px`,g.style.left=`${X}px`},E=v=>{c.trigger==="click"&&n.value&&!n.value.contains(v.target)&&(t.value=!1)},h=()=>{t.value&&C()};return e.onMounted(()=>{c.trigger==="click"&&document.addEventListener("click",E),window.addEventListener("resize",h),window.addEventListener("scroll",h)}),e.onUnmounted(()=>{c.trigger==="click"&&document.removeEventListener("click",E),m&&clearTimeout(m),window.removeEventListener("resize",h),window.removeEventListener("scroll",h)}),e.watch(()=>c.menuWidth,()=>{t.value&&e.nextTick(()=>{C()})}),(v,g)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:n},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:b,onMouseleave:w},[e.renderSlot(v.$slots,"trigger",{},()=>[g[0]||(g[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",f.value]),style:e.normalizeStyle(r.value),onMouseenter:b,onMouseleave:w},[e.renderSlot(v.$slots,"default",{},()=>[g[1]||(g[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),g[2]||(g[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),g[3]||(g[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),tt=fe(bn,[["__scopeId","data-v-ada3172a"]]),Cn=["aria-hidden"],En=["onKeydown"],Bn={key:0,class:"y-drawer-header"},xn={class:"y-drawer-title"},Nn={class:"y-drawer-body"},Vn={key:1,class:"y-drawer-footer"},Sn=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:3e3},showHeader:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(l,{emit:c}){const t=l,n=c,m=e.computed({get:()=>t.modelValue,set:g=>n("update:modelValue",g)}),f=e.ref(null),r=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),b=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),w=e.computed(()=>{const g={};return t.placement==="right"?(g.width=typeof t.width=="number"?`${t.width}px`:String(t.width),g.height="100%",g.right="0",g.top="0"):(g.height=typeof t.height=="number"?`${t.height}px`:String(t.height),g.width="100%",g.bottom="0",g.left="0"),g});function C(){t.maskClosable&&E()}function E(){m.value&&(m.value=!1,n("close"))}function h(){t.closable&&E()}function v(g){g.key==="Escape"&&h()}return e.watch(()=>t.modelValue,g=>{g?(n("open"),requestAnimationFrame(()=>{var S;return(S=f.value)==null?void 0:S.focus()}),document.addEventListener("keydown",v),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",v),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",v),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}),(g,S)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!m.value,style:e.normalizeStyle({zIndex:String(l.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:C}),e.createVNode(e.Transition,{name:r.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-drawer-panel",[`is-${l.placement}`,b.value]]),style:e.normalizeStyle(w.value),onKeydown:e.withKeys(e.withModifiers(h,["prevent","stop"]),["esc"]),tabindex:"-1"},[l.showHeader?(e.openBlock(),e.createElementBlock("div",Bn,[e.createElementVNode("div",xn,e.toDisplayString(l.title),1),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:E}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nn,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),g.$slots.footer?(e.openBlock(),e.createElementBlock("div",Vn,[e.renderSlot(g.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,En),[[e.vShow,m.value]])]),_:3},8,["name"])],12,Cn),[[e.vShow,m.value]])]))}}),lt=fe(Sn,[["__scopeId","data-v-b2797950"]]),Dn=["data-level"],$n={key:1,class:"ytree-node__expand-icon--empty"},Tn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Mn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Ln=["src","alt"],In={class:"ytree-node__custom-content"},zn={key:0,class:"ytree-node__children"},Hn=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(l){const c=l;e.inject("treeStore");const t=e.inject("getNodeKey"),n=e.inject("getNodeLabel"),m=e.inject("getNodeChildren"),f=e.inject("hasChildren"),r=e.inject("isEmployeeNode"),b=e.inject("getNodeIcon"),w=e.inject("getNodeDepth"),C=e.inject("isChildStyleNode"),E=e.inject("isNodeExpanded"),h=e.inject("isNodeChecked"),v=e.inject("isNodeIndeterminate"),g=e.inject("isNodeCurrent"),S=e.inject("isNodeHighlighted"),U=e.inject("handleExpandClick"),F=e.inject("handleCheckClick"),x=e.inject("handleNodeClick"),I=e.inject("handleNodeContextMenu");e.computed(()=>t(c.node));const R=e.computed(()=>n(c.node)),oe=e.computed(()=>b(c.node,c.rootNode)),X=e.computed(()=>w(c.rootNode,c.node)),H=e.computed(()=>E(c.node)),K=e.computed(()=>h(c.node)),le=e.computed(()=>v(c.node)),B=e.computed(()=>g(c.node)),D=e.computed(()=>S(c.node)),k=e.computed(()=>f(c.node)),L=e.computed(()=>m(c.node)),A=e.computed(()=>C(c.node,c.rootNode)),N=e.computed(()=>r(c.node)),W=e.computed(()=>c.level===1?8:8+(c.level-1)*16);return(J,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree-node",{"ytree-node--current":B.value,"ytree-node--highlight":D.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A.value}]),style:e.normalizeStyle({paddingLeft:`${W.value}px`}),"data-level":X.value,onClick:j[2]||(j[2]=Q=>e.unref(x)(c.node,c.node,null,c.rootNode)),onContextmenu:j[3]||(j[3]=Q=>e.unref(I)(Q,c.node,c.node,null))},[k.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":H.value}]),onClick:j[0]||(j[0]=e.withModifiers(Q=>e.unref(U)(c.node),["stop"]))},[...j[4]||(j[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",$n)),l.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":K.value,"is-indeterminate":le.value}]),onClick:j[1]||(j[1]=e.withModifiers(Q=>e.unref(F)(c.node),["stop"]))},[K.value?(e.openBlock(),e.createElementBlock("svg",Tn,[...j[5]||(j[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)])])):le.value?(e.openBlock(),e.createElementBlock("svg",Mn,[...j[6]||(j[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),l.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",l.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:oe.value,alt:N.value?"person":"dept"},null,8,Ln),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":N.value}])},e.toDisplayString(R.value),3),e.createElementVNode("div",In,[e.renderSlot(J.$slots,"node-content",{node:c.node,isCurrent:B.value,isExpanded:H.value,hasChildren:k.value},void 0,!0)])],46,Dn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[k.value&&H.value?(e.openBlock(),e.createElementBlock("div",zn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,Q=>(e.openBlock(),e.createBlock(nt,{key:e.unref(t)(Q),node:Q,"root-node":l.rootNode,level:l.level+1,"show-checkbox":l.showCheckbox,"icon-class":l.iconClass,"dept-icon-url":l.deptIconUrl,"person-icon-url":l.personIconUrl,"button-icon-url":l.buttonIconUrl,"child-style-level":l.childStyleLevel,"child-style-icon-url":l.childStyleIconUrl,"enable-child-style-custom-click":l.enableChildStyleCustomClick,disabled:l.disabled,"expand-on-click-node":l.expandOnClickNode},{"node-content":e.withCtx(o=>[e.renderSlot(J.$slots,"node-content",e.mergeProps({ref_for:!0},o),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))}}),nt=fe(Hn,[["__scopeId","data-v-f424ccf5"]]),_n={class:"ytree__container"},Kn="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",Pn="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",An=100,Rn=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.computed(()=>n.data||[]),r=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set}),b=new Map;e.provide("treeStore",r),e.provide("getNodeKey",C),e.provide("getNodeLabel",E),e.provide("getNodeChildren",S),e.provide("hasChildren",g),e.provide("isEmployeeNode",h),e.provide("getNodeIcon",v),e.provide("getNodeDepth",U),e.provide("isChildStyleNode",F),e.provide("isNodeExpanded",x),e.provide("isNodeChecked",R),e.provide("isNodeIndeterminate",oe),e.provide("isNodeCurrent",X),e.provide("isNodeHighlighted",H),e.provide("handleExpandClick",le),e.provide("handleCheckClick",K),e.provide("handleNodeClick",D),e.provide("handleNodeContextMenu",k);const w=e.computed(()=>n.restrictAutoExpandFromLevel&&n.restrictAutoExpandFromLevel>0?n.restrictAutoExpandFromLevel:void 0);function C(o){return o[n.nodeKey]||o.id||Math.random()}function E(o){var s;return((s=n.props)!=null&&s.label?o[n.props.label]:void 0)||o.label||""}function h(o){var s;return!!((s=o==null?void 0:o.data)!=null&&s.isEmployee)}function v(o,s){var Y;const p=n.deptIconUrl||Kn,T=n.personIconUrl||Pn,z=n.buttonIconUrl||"",_=n.childStyleIconUrl||"";return s&&_&&F(o,s)?_:(Y=o==null?void 0:o.data)!=null&&Y.isButton&&z?z:h(o)?T:p}function g(o){var p;const s=((p=n.props)!=null&&p.children?o[n.props.children]:void 0)||o.children;return s&&s.length>0}function S(o){var s;return((s=n.props)!=null&&s.children?o[n.props.children]:void 0)||o.children||[]}function U(o,s,p=1){if(o===s)return p;const T=S(o);for(const z of T){const _=U(z,s,p+1);if(_>0)return _}return 0}function F(o,s){return!n.childStyleLevel||n.childStyleLevel<1?!1:U(s,o)===n.childStyleLevel}function x(o){const s=C(o);return r.value.expandedKeys.has(s)}function I(o,s=new Set){const p=C(o);if(s.has(p))return{checked:!1,indeterminate:!1};s.add(p);const T=b.get(p);if(T&&Date.now()-T.timestamp<An)return{checked:T.checked,indeterminate:T.indeterminate};const z=r.value.checkedKeys.has(p);if(!g(o)){const me={checked:z,indeterminate:!1};return b.set(p,{...me,timestamp:Date.now()}),me}const _=S(o);if(_.length===0){const me={checked:z,indeterminate:!1};return b.set(p,{...me,timestamp:Date.now()}),me}let Y=0,O=0;for(const me of _){const ie=I(me,s);ie.checked?Y++:ie.indeterminate&&O++}let te,ee;te=Y===_.length&&O===0,ee=!te&&(Y>0||O>0);const de={checked:te,indeterminate:ee};return b.set(p,{...de,timestamp:Date.now()}),de}function R(o){return I(o).checked}function oe(o){return I(o).indeterminate}function X(o){const s=C(o);return r.value.currentKey===s}function H(o){const s=C(o);return r.value.highlightedKeys.has(s)}function K(o){if(n.disabled)return;const s=C(o),T=!r.value.checkedKeys.has(s);function z(O){b.delete(C(O)),g(O)&&S(O).forEach(z)}z(o);const _=new Set(r.value.expandedKeys);T?r.value.checkedKeys.add(s):r.value.checkedKeys.delete(s);function Y(O,te){O.forEach(ee=>{const de=C(ee);te?r.value.checkedKeys.add(de):r.value.checkedKeys.delete(de),b.delete(de),g(ee)&&Y(S(ee),te)})}Y(S(o),T),B(),r.value.expandedKeys=_,m("check-change",o,T,!1),m("check",o,T,!1),m("checked-keys-change",Array.from(r.value.checkedKeys))}function le(o){const s=C(o);r.value.expandedKeys.has(s)?(r.value.expandedKeys.delete(s),m("node-collapse",o,o,null)):(r.value.expandedKeys.add(s),m("node-expand",o,o,null))}function B(){const o=new Map,s=[],p=new Map;function T(_,Y){_.forEach(O=>{const te=C(O);s.push(O),p.set(te,O),Y&&o.set(te,Y),g(O)&&T(S(O),O)})}T(f.value);function z(_){if(!g(_))return;const Y=S(_),O=C(_);b.delete(O);let te=0,ee=0;for(const de of Y){const me=I(de);me.checked?te++:me.indeterminate&&ee++}te===Y.length&&ee===0||te>0||ee>0?r.value.checkedKeys.add(O):r.value.checkedKeys.delete(O)}for(let _=s.length-1;_>=0;_--)z(s[_])}function D(o,s,p,T){if(n.disabled)return;const z=T?F(o,T):!1;if(n.enableChildStyleCustomClick&&z){m("child-node-click",o,s,p);return}if(n.expandOnClickNode&&g(o)){le(o);return}r.value.currentNode=o,r.value.currentKey=C(o),n.showCheckbox&&K(o),m("node-click",o,s,p)}function k(o,s,p,T){n.disabled||m("node-contextmenu",o,s,p,T)}e.watch(()=>n.defaultExpandedKeys,o=>{if(o){const s=w.value;if(s){let p=function(Y,O,te=1){for(const ee of O){if(C(ee)===Y)return te;if(g(ee)){const de=p(Y,S(ee),te+1);if(de>0)return de}}return 0},T=function(Y,O,te){Y.forEach(ee=>{O<te&&g(ee)?(_.add(C(ee)),T(S(ee),O+1,te)):O<te&&g(ee)})};const z=(o||[]).filter(Y=>{const O=p(Y,f.value,1);return O>0&&O<s}),_=new Set(z);T(f.value,1,s),r.value.expandedKeys.forEach(Y=>{p(Y,f.value,1)>=s&&_.add(Y)}),r.value.expandedKeys=_}else r.value.expandedKeys=new Set(o)}},{immediate:!0});function L(){if(n.defaultExpandAll){let o=function(T,z=1){T.forEach(_=>{if(!g(_))return;const Y=S(_);if(p){if(z>=p)return;z+1===p||s.add(C(_)),o(Y,z+1)}else s.add(C(_)),o(Y,z+1)})};const s=new Set,p=w.value;o(f.value,1),r.value.expandedKeys=s}}function A(){if(n.defaultCheckedKeys&&n.defaultCheckedKeys.length>0){let o=function(z,_=[]){z.forEach(Y=>{const O=C(Y),te=[..._,O];s.has(O)&&_.forEach(ee=>p.add(ee)),g(Y)&&o(S(Y),te)})};const s=new Set(n.defaultCheckedKeys),p=new Set;if(o(f.value),w.value)return;r.value.expandedKeys=p}}let N=null;const W=()=>{N&&clearTimeout(N),N=setTimeout(()=>{L(),N=null},50)};e.watch(()=>n.defaultExpandAll,L,{immediate:!0}),e.watch(()=>f.value,W,{deep:!0}),e.watch(()=>n.defaultCheckedKeys,o=>{o?(r.value.checkedKeys=new Set(o),n.enableFourthLevelSpecialHandling||A()):r.value.checkedKeys.clear()},{immediate:!0});function J(o){try{let s=function(z,_,Y=[]){for(const O of z){const te=C(O),ee=[...Y,te];if(te===_)return ee;if(g(O)){const de=s(S(O),_,ee);if(de)return de}}return null};const p=Array.isArray(o)?o:[];if(p.length===0)return;r.value.highlightedKeys.clear();const T=new Set(r.value.expandedKeys);p.forEach(z=>{const _=s(f.value,z);_&&_.length>0&&(_.slice(0,-1).forEach(Y=>T.add(Y)),r.value.highlightedKeys.add(_[_.length-1]))}),r.value.expandedKeys=T}catch(s){process.env.NODE_ENV==="development"&&console.warn("highlightAndExpandByIds 执行失败",s)}}function j(){r.value.highlightedKeys.clear()}function Q(){r.value.currentNode=null,r.value.currentKey=null}return c({highlightAndExpandByIds:J,clearHighlights:j,clearCurrentNode:Q}),e.watch(()=>n.defaultSelectedKeys,o=>{o&&(r.value.selectedKeys=new Set(o))},{immediate:!0}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${l.size}`,{"ytree--disabled":l.disabled}]])},[e.createElementVNode("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,p=>(e.openBlock(),e.createBlock(nt,{key:C(p),node:p,"root-node":p,level:1,"show-checkbox":l.showCheckbox,"icon-class":l.iconClass,"dept-icon-url":l.deptIconUrl,"person-icon-url":l.personIconUrl,"button-icon-url":l.buttonIconUrl,"child-style-level":l.childStyleLevel,"child-style-icon-url":l.childStyleIconUrl,"enable-child-style-custom-click":l.enableChildStyleCustomClick,disabled:l.disabled,"expand-on-click-node":l.expandOnClickNode},{"node-content":e.withCtx(T=>[e.renderSlot(o.$slots,"node-content",e.mergeProps({ref_for:!0},T),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))}}),ot=fe(Rn,[["__scopeId","data-v-1b63590e"]]),Fn={class:"query-encapsulation"},Wn={class:"query-encapsulation__container"},Yn={class:"query-encapsulation__content"},jn={class:"query-encapsulation__fields"},On={class:"query-encapsulation__field-wrapper"},Un={key:0,class:"query-encapsulation__field-label"},qn={key:0,class:"query-encapsulation__toggle"},Gn={class:"query-encapsulation__actions"},Zn={class:"query-encapsulation__actions-group"},Qn=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(!1),r=e.reactive({}),b=["select","date","daterange","switch"];let w;const C=e.computed(()=>n.fields.filter(B=>!B.hidden)),E=e.computed(()=>f.value?C.value:C.value.slice(0,n.maxVisibleFields)),h=e.computed(()=>C.value.length>n.maxVisibleFields);function v(B){switch(B){case"select":return Pe;case"date":case"daterange":return Ae;case"switch":return Re;case"input":default:return Ke}}function g(B,D){r[B]=D;const k=n.fields.find(L=>L.key===B);k&&S(k)}function S(B){m("field-change",B,r[B.key]),m("update:modelValue",{...r}),b.includes(B.type)&&X()}function U(B,D){B.onSwitchChange&&typeof B.onSwitchChange=="function"&&B.onSwitchChange(D,B),S(B)}function F(){const B=H(r),D=K(B),k={...r};m("search",{data:D,raw:k})}function x(){Object.keys(r).forEach(B=>{const D=n.fields.find(k=>k.key===B);(D==null?void 0:D.type)==="daterange"?r[B]={startDate:null,endDate:null}:(D==null?void 0:D.type)==="date"?r[B]=null:(D==null?void 0:D.type)==="switch"?r[B]=D.falseValue!==void 0?D.falseValue:!1:(D==null?void 0:D.type)==="select"&&D.multiple?r[B]=[]:r[B]=""}),m("reset"),m("update:modelValue",{...r})}function I(){f.value=!f.value}function R(B){return B.type!=="input"?{}:{enter:()=>oe(),paste:()=>oe()}}async function oe(){await e.nextTick(),F()}function X(){w&&clearTimeout(w),w=setTimeout(()=>{w=void 0,e.nextTick().then(()=>F())},0)}function H(B){const D={};return Object.keys(B).forEach(k=>{const L=n.fields.find(W=>W.key===k),A=B[k],N=typeof A=="string"?A.trim():A;if(Array.isArray(N)){N.length>0&&(D[k]=N);return}if(!(N==null||N==="")){if(typeof N=="object"&&N.startDate&&N.endDate){N.startDate&&N.endDate&&(D[k]=N);return}if(L&&(L.type==="date"||L.type==="daterange")){N!==0&&(D[k]=N);return}D[k]=N}}),D}function K(B){const D={};return Object.keys(B).forEach(k=>{const L=B[k],A=n.fields.find(N=>N.key===k);if(A)if(A.type==="daterange"&&typeof L=="object"){const N=A.startKey||`${k}Start`,W=A.endKey||`${k}End`;L.startDate&&L.endDate&&L.startDate!==0&&L.endDate!==0&&(A.format==="timestamp"?(D[N]=new Date(L.startDate).getTime(),D[W]=new Date(L.endDate).getTime()):(D[N]=L.startDate,D[W]=L.endDate))}else A.type==="date"&&L&&L!==0&&A.format==="timestamp"?D[k]=new Date(L).getTime():D[k]=L;else D[k]=L}),D}function le(){n.fields.forEach(B=>{var D,k,L,A,N;r[B.key]===void 0&&(B.type==="daterange"?r[B.key]=((D=n.modelValue)==null?void 0:D[B.key])||{startDate:null,endDate:null}:B.type==="date"?r[B.key]=((k=n.modelValue)==null?void 0:k[B.key])||null:B.type==="switch"?r[B.key]=((L=n.modelValue)==null?void 0:L[B.key])!==void 0?n.modelValue[B.key]:B.falseValue!==void 0?B.falseValue:!1:B.type==="select"&&B.multiple?r[B.key]=((A=n.modelValue)==null?void 0:A[B.key])!==void 0?n.modelValue[B.key]:[]:r[B.key]=((N=n.modelValue)==null?void 0:N[B.key])||"")})}return e.watch(()=>n.modelValue,B=>{B&&Object.assign(r,B)},{deep:!0,immediate:!0}),e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{w&&(clearTimeout(w),w=void 0)}),c({search:F,reset:x}),(B,D)=>(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("div",Wn,[e.createElementVNode("div",Yn,[e.createElementVNode("div",jn,[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(E.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k.key,class:"query-encapsulation__field-item"},[e.renderSlot(B.$slots,`field-${k.key}`,{field:k,value:r[k.key],updateValue:L=>g(k.key,L)},()=>[e.createElementVNode("div",On,[l.Iflabel||k.type==="switch"?(e.openBlock(),e.createElementBlock("label",Un,e.toDisplayString(k.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v(k.type)),e.mergeProps({modelValue:r[k.key],"onUpdate:modelValue":L=>r[k.key]=L,placeholder:k.placeholder||`请输入${k.label}`,options:k.options,clearable:k.clearable!==!1,size:k.size||"small",width:k.width||"180px",format:k.format||"timestamp","include-time":k.includeTime||!1,filterable:k.filterable===!0,multiple:k.multiple===!0,"true-value":k.trueValue,"false-value":k.falseValue,"active-text":k.activeText,"inactive-text":k.inactiveText,"show-text":k.showText,"active-color":k.activeColor||(k.type==="switch"?"#1B2433":void 0),"inactive-color":k.inactiveColor},e.toHandlers(R(k)),{onInput:L=>k.type!=="switch"?S(k):void 0,onChange:L=>k.type==="switch"?U(k,L):S(k)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","multiple","true-value","false-value","active-text","inactive-text","show-text","active-color","inactive-color","onInput","onChange"]))])],!0)]))),128))]),_:3}),h.value?(e.openBlock(),e.createElementBlock("div",qn,[e.createVNode(Se,{variant:"secondary",size:"small",onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":f.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Gn,[e.createElementVNode("div",Zn,[e.createVNode(Se,{variant:"primary",size:"small",onClick:F,loading:l.loading},{default:e.withCtx(()=>[...D[0]||(D[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(Se,{variant:"secondary",size:"small",onClick:x,loading:l.loading},{default:e.withCtx(()=>[...D[1]||(D[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(B.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),at=fe(Qn,[["__scopeId","data-v-68014a1a"]]),Jn={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Xn={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},eo={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},to=["textContent"],lo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(l){const c=l,t=e.ref(!1);let n,m=0,f=0;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,c.duration&&c.duration>0&&r(c.duration)})}),e.onBeforeUnmount(()=>{b()});function r(v){m=v,f=Date.now(),n=window.setTimeout(()=>E(),v)}function b(){n&&(window.clearTimeout(n),n=void 0)}function w(){if(n&&c.duration&&c.duration>0){b();const v=Date.now()-f;m=Math.max(0,m-v)}}function C(){c.duration&&c.duration>0&&m>0&&r(m)}function E(){t.value=!1}function h(){var v;(v=c.onClose)==null||v.call(c,c.id)}return(v,g)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:h},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${l.type}`]]),style:e.normalizeStyle({zIndex:l.zIndex}),role:"status","aria-live":"polite",onMouseenter:w,onMouseleave:C},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${l.type}`]),"aria-hidden":"true"},[l.type==="success"?(e.openBlock(),e.createElementBlock("svg",Jn,[...g[0]||(g[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):l.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Xn,[...g[1]||(g[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",eo,[...g[2]||(g[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(l.message)},null,8,to),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:E},"✕")):e.createCommentVNode("",!0)],38),[[e.vShow,t.value]])]),_:1}))}}),no=fe(lo,[["__scopeId","data-v-db173617"]]);let oo=1;const _e=12,Ee=[];function ao(){let l=20;return Ee.forEach(c=>{l+=c.height+_e}),l}function Ue(l){const c=Ee.findIndex(f=>f.id===l);if(c===-1)return;const{el:t}=Ee[c],n=t.firstElementChild;if(n){const f=window.getComputedStyle(n).top;n.style.top=f,n.classList.add("is-leaving"),n.style.willChange="opacity, transform"}Ee[c].leaving=!0,Ie(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const f=Ee.findIndex(r=>r.id===l);f!==-1&&Ee.splice(f,1),Ie()},260)}function He(l){var f;const c=oo++,t=document.createElement("div");document.body.appendChild(t);const n=e.createVNode(no,{id:c,type:l.type||"success",message:l.message,duration:l.duration??2500,offset:ao(),zIndex:3e3+c,closable:l.closable??!1,onClose:r=>Ue(r)});e.render(n,t);const m=((f=t.firstElementChild)==null?void 0:f.offsetHeight)||0;return Ee.push({id:c,el:t,vm:n,height:m,leaving:!1}),Ie(),requestAnimationFrame(()=>{const r=t.firstElementChild;if(!r)return;const b=r.offsetHeight||m||0,w=Ee.find(C=>C.id===c);w&&(w.height=b,Ie())}),{close:()=>Ue(c)}}const De={success(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"success",message:l})},warning(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"warning",message:l})},error(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"error",message:l})}};typeof window<"u"&&(window.YMessage=De,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=De));function Ie(){let l=20;Ee.forEach(c=>{const t=c.el.firstElementChild;if(!t)return;const n=l;if(t.style.transform=`translate(-50%, ${n}px)`,t.style.top||(t.style.top="0px"),!c.leaving)l+=(t.offsetHeight||c.height)+_e;else{const m=t.offsetHeight||c.height;l+=m+_e}})}const ro={class:"hint-tag-popup-content"},io=["title"],so=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(l,{expose:c}){const t=l,n=e.ref(null),m=e.ref(null),f=e.ref(!1),r=e.ref(!1);let b=null;const w=()=>{if(!t.maxLines||!n.value){f.value=!1;return}const H=n.value,K=H.style.maxHeight,le=H.classList.contains("hint-tag-content-clamp");H.style.maxHeight="none",le&&H.classList.remove("hint-tag-content-clamp");const B=H.scrollHeight,D=parseFloat(getComputedStyle(H).lineHeight)||18,k=t.maxLines*D;H.style.maxHeight=K,le&&H.classList.add("hint-tag-content-clamp"),f.value=B>k},C=()=>{t.maxLines&&f.value&&(b&&(clearTimeout(b),b=null),r.value=!0,setTimeout(()=>{g()},0))},E=()=>{b=window.setTimeout(()=>{r.value=!1,b=null},100)},h=()=>{b&&(clearTimeout(b),b=null)},v=()=>{r.value=!1},g=()=>{if(!m.value||!n.value)return;const H=n.value.getBoundingClientRect(),K=m.value.getBoundingClientRect(),le=window.innerWidth,B=window.innerHeight,D=window.scrollX||window.pageXOffset,k=window.scrollY||window.pageYOffset;let L=0,A=0;switch(t.position){case"right":L=H.right+12,A=H.top+k,L+K.width>le+D&&(L=H.left-K.width-12),A=H.top+k+(H.height-K.height)/2,A<k&&(A=k+8),A+K.height>k+B&&(A=k+B-K.height-8);break;case"left":L=H.left-K.width-12,A=H.top+k,L<D&&(L=H.right+12),A=H.top+k+(H.height-K.height)/2,A<k&&(A=k+8),A+K.height>k+B&&(A=k+B-K.height-8);break;case"top":L=H.left+D+(H.width-K.width)/2,A=H.top-K.height-12,A<k&&(A=H.bottom+k+12),L<D+8&&(L=D+8),L+K.width>D+le&&(L=D+le-K.width-8);break;case"bottom":L=H.left+D+(H.width-K.width)/2,A=H.bottom+k+12,A+K.height>k+B&&(A=H.top-K.height-12),L<D+8&&(L=D+8),L+K.width>D+le&&(L=D+le-K.width-8);break}m.value.style.left=`${L}px`,m.value.style.top=`${A}px`};e.onUpdated(()=>{w()});const S=e.ref(t.defaultExpanded),U=()=>{S.value=!S.value},F=()=>{S.value&&(S.value=!1)},x=()=>{S.value||(S.value=!0)};c({toggle:U,isExpanded:S,collapse:F,expand:x});const I=e.inject("registerHintTag",null),R=e.inject("unregisterHintTag",null),oe=e.inject("notifyHintTagStateChange",null),X={collapse:F,expand:x,toggle:U,get isExpanded(){return S.value}};return e.watch(()=>S.value,()=>{oe&&oe(),setTimeout(()=>{w()},0)}),e.watch(()=>[t.content,t.maxLines],()=>{setTimeout(()=>{w()},0)}),e.watch(r,H=>{H?(setTimeout(()=>{g()},0),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g)):(window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g))}),e.onMounted(()=>{w(),I&&I(X)}),e.onUnmounted(()=>{R&&R(X),b&&(clearTimeout(b),b=null),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}),(H,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hint-tag-wrapper",`hint-tag-wrapper-${l.position}`])},[e.createVNode(e.Transition,{name:"hint-slide"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag",`hint-tag-${l.position}`]),style:e.normalizeStyle({width:l.position==="top"||l.position==="bottom"?"auto":l.width,borderColor:l.borderColor})},[e.createElementVNode("div",{ref_key:"contentRef",ref:n,class:e.normalizeClass(["hint-tag-content",{"hint-tag-content-clamp":l.maxLines}]),style:e.normalizeStyle(l.maxLines?{"--line-clamp":l.maxLines,lineHeight:"1.5",maxHeight:`${l.maxLines*1.5}em`}:{}),onMouseenter:C,onMouseleave:E},[e.renderSlot(H.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.content),1)],!0)],38),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"popup-fade"},{default:e.withCtx(()=>[r.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popupRef",ref:m,class:"hint-tag-popup",onMouseenter:h,onMouseleave:v},[e.createElementVNode("div",ro,[e.renderSlot(H.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.content),1)],!0)])],544)):e.createCommentVNode("",!0)]),_:3})])),e.createElementVNode("div",{class:"hint-tag-toggle",onClick:U},[...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,S.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-${l.position}`]),onClick:U,title:l.tooltip||l.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,io),[[e.vShow,!S.value]])]),_:1})],2))}}),co=fe(so,[["__scopeId","data-v-9bfcff29"]]),qe={YButton:Se,YInput:Ke,YTable:Ge,YSelect:Pe,YPagination:Ze,YBadge:Qe,YDialog:Je,YPopover:Xe,YTime:Ae,YSwitch:Re,YImage:et,YDropdown:tt,YDrawer:lt,YTree:ot,QueryEncapsulation:at,HintTag:co},uo={install(l){Object.keys(qe).forEach(c=>{l.component(c,qe[c])}),l.config.globalProperties.$message=De,typeof window<"u"&&(window.YMessage=De)}};exports.QueryEncapsulation=at;exports.YBadge=Qe;exports.YButton=Se;exports.YDialog=Je;exports.YDrawer=lt;exports.YDropdown=tt;exports.YImage=et;exports.YInput=Ke;exports.YMessage=De;exports.YPagination=Ze;exports.YPopover=Xe;exports.YSelect=Pe;exports.YSwitch=Re;exports.YTable=Ge;exports.YTime=Ae;exports.YTree=ot;exports.default=uo;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),it=["type","disabled","aria-busy","aria-disabled"],st={class:"content"},ct={key:1,class:"y-btn-group",role:"group"},dt=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],ut={class:"content"},ft={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},mt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ht={key:2},vt=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(l,{emit:c}){const t=l,n=c;function m(w){if(t.disabled||t.loading){w.preventDefault(),w.stopPropagation();return}n("click",w)}const f=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 b(w,C){if(t.disabled||t.loading||w.disabled||w.loading){C.preventDefault(),C.stopPropagation();return}n("group-click",w.value,C)}return(w,C)=>r.value?(e.openBlock(),e.createElementBlock("div",ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.groupItems,(E,h)=>{var v;return e.openBlock(),e.createElementBlock("button",{key:E.value??h,class:e.normalizeClass(["y-btn",[`y-btn--${E.variant??l.variant}`,`y-btn--${E.size??l.size}`,"is-grouped",h===0?"group-pos-start":h===(((v=l.groupItems)==null?void 0:v.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":E.loading||l.loading}]]),type:l.htmlType,disabled:(E.disabled??!1)||l.disabled||l.loading||E.loading,"aria-busy":E.loading||l.loading?"true":"false","aria-disabled":(E.disabled??!1)||l.disabled||l.loading||E.loading?"true":"false","aria-label":E.ariaLabel||E.label,onClick:g=>b(E,g)},[e.createElementVNode("span",ut,[E.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",ft,[...C[0]||(C[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)])])):E.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",mt,[...C[1]||(C[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),E.label&&!E.onlyIcon?(e.openBlock(),e.createElementBlock("span",ht,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])],10,dt)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${l.variant}`,`y-btn--${l.size}`,{"is-block":l.block,"is-loading":l.loading},l.groupPosition!=="single"?"is-grouped":"",f.value]]),type:l.htmlType,disabled:l.disabled||l.loading,"aria-busy":l.loading?"true":"false","aria-disabled":l.disabled||l.loading?"true":"false",onClick:m},[e.createElementVNode("span",st,[e.renderSlot(w.$slots,"default",{},void 0,!0)])],10,it))}}),fe=(l,c)=>{const t=l.__vccOpts||l;for(const[n,m]of c)t[n]=m;return t},Se=fe(vt,[["__scopeId","data-v-53157673"]]),pt=["id","name","type","placeholder","autocomplete","inputmode","min","max","disabled","required","value"],gt={key:0,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},yt={key:1,class:"y-input-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},wt=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(l,{emit:c}){const t=l,n=c,m=e.ref(null),f=e.ref(""),r=e.ref(!1),b=e.ref(!1),w=e.ref(t.placeholder||""),C=e.ref(!1),E=e.computed(()=>t.type==="password"),h=e.computed(()=>t.type==="password"&&C.value?"text":t.type);function v(){C.value=!C.value}e.watch(()=>t.placeholder,I=>{b.value||(w.value=I||"")});function g(I){const R=I.target;r.value=!0,n("update:modelValue",R.value)}function S(){b.value=!0,t.clearOnFocus&&(f.value=t.modelValue||"",r.value=!1,w.value=f.value||t.placeholder||"",n("update:modelValue",""))}function U(){if(b.value=!1,t.clearOnFocus&&!r.value&&(!t.modelValue||t.modelValue==="")&&n("update:modelValue",f.value),t.min!==void 0&&t.modelValue!==void 0&&t.modelValue!==""){const I=Number(t.modelValue),R=Number(t.min);!Number.isNaN(I)&&!Number.isNaN(R)&&I<R&&n("update:modelValue",String(R))}w.value=t.placeholder||""}function F(I){const R=I.target;n("enter",R.value)}function x(I){const R=I.target;requestAnimationFrame(()=>{n("paste",R.value)})}return(I,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":l.block,"has-password-toggle":E.value}]),style:e.normalizeStyle({width:l.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:m,class:e.normalizeClass(["y-input",`y-input--${l.size}`]),id:l.id,name:l.name,type:h.value,placeholder:w.value,autocomplete:l.autocomplete,inputmode:l.inputmode,min:l.min,max:l.max,disabled:l.disabled,required:l.required,value:l.modelValue,onInput:g,onFocus:S,onBlur:U,onKeyup:e.withKeys(F,["enter"]),onPaste:x},null,42,pt),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["y-input-password-toggle",`y-input-password-toggle--${l.size}`]),onClick:v,tabindex:"-1"},[C.value?(e.openBlock(),e.createElementBlock("svg",gt,[...R[0]||(R[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",yt,[...R[1]||(R[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))}}),Ke=fe(wt,[["__scopeId","data-v-e954aa01"]]),kt={key:0,class:"bulk-bar"},bt={class:"bulk-left"},Ct={class:"bulk-actions"},Et={class:"card"},Bt={key:0,class:"table-header-actions"},xt=["title"],Nt={key:0,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},Vt={key:1,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"toggle-icon"},St={class:"table"},Dt={key:0,style:{width:"34px","min-width":"34px"}},$t={key:1,style:{width:"60px","min-width":"60px"}},Tt={key:0,class:"col-expand"},Mt={key:1,class:"col-select"},Lt={class:"select-header"},It=["checked","indeterminate","disabled"],zt={key:0,class:"select-count"},Ht=["colspan"],_t={class:"selected-header-wrapper"},Kt={key:0,class:"loading-overlay"},Pt={key:1,class:"empty-overlay"},At={key:0,style:{width:"34px","min-width":"34px"}},Rt={key:1,style:{width:"60px","min-width":"60px"}},Ft=["onClick"],Wt={key:0,class:"col-expand"},Yt=["onClick"],jt=["value","checked","disabled","onChange"],Ot=["colspan"],Ut=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:"1/页",value:1},{label:"20/页",value:20},{label:"50/页",value:50},{label:"100/页",value:100}]},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}},emits:["edit","select","update:selectedItems","page-change","page-size-change","row-click"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(t.currentPage||1),f=e.ref(t.pageSize),r=e.ref(t.selectedItems||[]),b=e.ref([]),w=e.ref(new Set),C=e.ref("none"),E=e.ref(),h=e.ref(),v=e.ref(),g=e.ref(),S=e.ref([]),U=e.ref({}),F=e.ref(35),x=e.ref(new Set),I=e.computed(()=>x.value.size>0),R=e.computed(()=>{if(B.value,x.value.size===0)return!1;let a=0;return x.value.forEach(d=>{d&&d.isExpanded&&a++}),a===x.value.size});e.computed(()=>{if(B.value,x.value.size===0)return!0;let a=0;return x.value.forEach(d=>{d&&!d.isExpanded&&a++}),a===x.value.size});function oe(a){x.value.add(a)}function X(a){x.value.delete(a)}function H(){x.value.forEach(a=>{a&&typeof a.collapse=="function"&&a.collapse()})}function K(){x.value.forEach(a=>{a&&typeof a.expand=="function"&&a.expand()})}function le(){R.value?H():K()}const B=e.ref(0);function D(){B.value++}e.provide("registerHintTag",oe),e.provide("unregisterHintTag",X),e.provide("notifyHintTagStateChange",D);const k=e.computed(()=>t.columns.filter(a=>!o(a.width)).map(a=>a.key));function L(){return`${(100/(k.value.length||1)).toFixed(6)}%`}const A=e.ref(),N=e.ref({show:!1,thumbHeight:40,thumbTop:0});let W=!1,J=0,j=0;const Q=e.ref(0);function o(a){if(a==null)return;if(typeof a=="number")return Number.isFinite(a)?`${a}px`:void 0;const d=String(a).trim();if(d)return/^\d+(\.\d+)?$/.test(d)?`${d}px`:d}function s(a){const d=o(a);if(!d)return null;const y=parseFloat(d);return Number.isFinite(y)?y:null}const p=e.computed(()=>{let a=t.columns.length;return t.selectable&&(a+=1),t.expandable&&(a+=1),a}),T=e.computed(()=>{if(!t.searchKeyword||!t.searchFields.length)return t.data;const a=t.searchKeyword.toLowerCase();return t.data.filter(d=>t.searchFields.some(y=>{const V=ve(d,y);return String(V).toLowerCase().includes(a)}))}),z=e.computed(()=>(t.pagination,T.value)),_=e.computed(()=>{if(!t.selectable)return!1;const a=z.value.map((d,y)=>({key:ie(d,y),item:d,index:y})).filter(({item:d,index:y})=>!G(d,y)).map(({key:d})=>d);return a.length>0&&a.every(d=>r.value.includes(d))}),Y=e.computed(()=>{if(!t.selectable||_.value)return!1;const a=z.value.map((y,V)=>({key:ie(y,V),item:y,index:V})).filter(({item:y,index:V})=>!G(y,V)).map(({key:y})=>y);if(a.length===0)return!1;const d=a.filter(y=>r.value.includes(y)).length;return d>0&&d<a.length}),O=e.computed(()=>{if(!t.selectable)return!1;const a=z.value.map((d,y)=>({item:d,index:y}));return a.length>0&&a.every(({item:d,index:y})=>G(d,y))}),te=e.computed(()=>t.pagination?z.value.length<f.value:!1),ee=e.computed(()=>{const a=[];let d=t.selectable?60:0;for(let y=0;y<t.columns.length;y++){const V=t.columns[y];if(V.fixed==="left"){let $=80;const P=s(V.width);P!==null?$=P:S.value[y]&&($=s(S.value[y])??$),a.push(d),d+=$}}return a}),de=e.computed(()=>{const a=[];let d=0;const y=[];for(let V=t.columns.length-1;V>=0;V--){const $=t.columns[V];if($.fixed==="right"){let P=80;const Z=s($.width);Z!==null?P=Z:S.value[V]&&(P=s(S.value[V])??P),y.push({index:V,width:P})}}for(let V=0;V<y.length;V++)a.push(d),d+=y[V].width;return a});function me(a,d){if(d==="left"){let y=0;for(let V=0;V<a;V++)t.columns[V].fixed==="left"&&y++;return y}else{let y=0;for(let V=t.columns.length-1;V>a;V--)t.columns[V].fixed==="right"&&y++;return y}}function ie(a,d){return typeof t.rowKey=="function"?t.rowKey(a):a[t.rowKey]||d}function G(a,d){return t.rowDisabled&&typeof t.rowDisabled=="function"?t.rowDisabled(a,d):!1}function ne(a){return w.value.has(a)}function ue(a){w.value.has(a)?w.value.delete(a):w.value.add(a)}function ve(a,d){return d.split(".").reduce((y,V)=>y==null?void 0:y[V],a)}function we(a,d=!1){const y=[];return a.align&&y.push(`text-${a.align}`),a.fixed==="right"&&(y.push("col-fixed-right"),d&&y.push("col-fixed-right-header")),a.fixed==="left"&&(y.push("col-fixed-left"),d&&y.push("col-fixed-left-header")),y.join(" ")}function ge(a,d,y){const V={},$=o(a.width);if($)V.width=$,V.minWidth=$,V.maxWidth=$;else{const P=L();V.width=P,V.minWidth=P,V.maxWidth=P}if(a.fixed==="left"){const P=me(d,"left"),Z=ee.value[P]||0;V.left=`${Z}px`,V.zIndex=y?`${10+P}`:`${5+P}`}else if(a.fixed==="right"){const P=me(d,"right"),Z=de.value[P]||0;y?V.right=`${Z-3}px`:V.right=`${Z}px`,V.zIndex=y?`${10+P}`:`${5+P}`}return V}function i(a,d){const y=ve(a,d.key);return d.formatter?d.formatter(y,a):y||""}function u(a){const d=z.value.find((V,$)=>ie(V,$)===a),y=z.value.findIndex((V,$)=>ie(V,$)===a);d&&y>=0&&G(d,y)||(r.value.includes(a)?r.value=r.value.filter(V=>V!==a):r.value=[...r.value,a],n("select",r.value),n("update:selectedItems",r.value))}function M(){const a=z.value.map((d,y)=>({key:ie(d,y),item:d,index:y})).filter(({item:d,index:y})=>!G(d,y)).map(({key:d})=>d);if(a.length!==0){if(a.every(d=>r.value.includes(d)))r.value=r.value.filter(d=>!a.includes(d));else{const d=new Set([...r.value,...a]);r.value=Array.from(d)}n("select",r.value),n("update:selectedItems",r.value)}}function q(){r.value=[],n("select",r.value),n("update:selectedItems",r.value)}function ae(a,d){if(!t.rowSelectable)return;const y=ie(a,d);G(a,d)||(t.requireDeselectBeforeSelect?b.value.includes(y)?(b.value=b.value.filter(V=>V!==y),n("row-click",a,null)):(b.value=[...b.value,y],n("row-click",a,y)):b.value.includes(y)?(b.value=[],n("row-click",a,null)):(b.value=[y],n("row-click",a,y)))}function re(a,d){if(!t.rowSelectable)return!1;const y=ie(a,d);return b.value.includes(y)}e.watch(()=>t.selectedItems,a=>{if(a!==void 0&&Array.isArray(a)){const d=new Set(r.value),y=new Set(a);(d.size!==y.size||![...d].every(V=>y.has(V)))&&(r.value=[...a])}else a===void 0&&r.value.length>0&&(r.value=[])},{deep:!0,immediate:!0}),e.watch(()=>t.searchKeyword,()=>{m.value=1}),e.watch(()=>t.data,()=>{t.total||(m.value=1),t.rowSelectable&&(b.value=[])},{deep:!0});function ce(a){m.value=a,t.rowSelectable&&(b.value=[]),n("page-change",a)}function ye(a){f.value=a,m.value=1,t.rowSelectable&&(b.value=[]),n("page-size-change",a)}e.watch(()=>t.currentPage,a=>{const d=typeof a=="number"&&a>0?a:1;m.value!==d&&(m.value=d)}),e.watch(()=>t.pageSize,a=>{const d=typeof a=="number"&&a>0?a:10;f.value!==d&&(f.value=d)});function be(){E.value&&e.nextTick(()=>{const a=E.value.getBoundingClientRect(),d=window.innerHeight,y=a.top,V=E.value.querySelector(".table-header"),$=V?V.offsetHeight:40;let P=0;if(t.pagination){const ze=E.value.querySelector(".ypagination");P=ze?ze.offsetHeight:60}const Z=E.value.querySelector(".bulk-bar"),he=Z?Z.offsetHeight:0,Me=$+P+he+20,Le=d-y-Me,rt=Math.max(200,Le),Oe=E.value.querySelector(".table-body-wrap .table");Oe&&(Oe.offsetHeight>Le?C.value=`${rt}px`:C.value="none")})}let Be=!1;function xe(){!h.value||!v.value||Be||h.value.scrollLeft!==v.value.scrollLeft&&(Be=!0,h.value.scrollLeft=v.value.scrollLeft,requestAnimationFrame(()=>{Be=!1}))}function Ne(){!h.value||!v.value||Be||v.value.scrollLeft!==h.value.scrollLeft&&(Be=!0,v.value.scrollLeft=h.value.scrollLeft,requestAnimationFrame(()=>{Be=!1}))}function se(){e.nextTick(()=>{if(!v.value)return;const a=v.value,d=a.scrollHeight,y=a.clientHeight,V=a.scrollTop,$=d>y+1;if(N.value.show=$,!$)return;const P=24,Z=y/d,he=A.value?A.value.clientHeight:y,pe=Math.max(P,Math.floor(he*Z));N.value.thumbHeight=pe;const Me=Math.max(0,he-pe),Le=Math.max(1,d-y);N.value.thumbTop=Math.min(Me,Math.floor(V/Le*Me))})}function ke(a){if(!W||!v.value||!A.value)return;a.preventDefault();const d=A.value.clientHeight,y=Math.max(0,d-N.value.thumbHeight),V=v.value,$=V.scrollHeight,P=V.clientHeight,Z=Math.max(1,$-P),pe=(a.clientY-J)/Math.max(1,y)*Z;V.scrollTop=Math.min(Z,Math.max(0,j+pe)),se()}function Fe(){W=!1,window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Fe)}function We(){e.nextTick(()=>{var y,V;if(S.value.length===t.columns.length&&S.value.every($=>!!$))return;const a=[];t.columns.forEach(($,P)=>{const Z=o($.width);if(Z)a.push(Z),U.value[$.key]=Z;else if(U.value[$.key])a.push(U.value[$.key]);else{const he=S.value[P];if(he)a.push(he),U.value[$.key]=he;else{const pe=L();a.push(pe),U.value[$.key]=pe}}});const d=(y=g.value)==null?void 0:y.querySelector("tbody tr");if(d){const $=t.selectable?1:0,P=Array.from(d.children);for(let Z=0;Z<t.columns.length;Z++)if(!a[Z]){const he=P[$+Z];if(he&&he.clientWidth>0){const pe=`${he.clientWidth}px`;a[Z]=pe,U.value[t.columns[Z].key]=pe}else{const pe=L();a[Z]=pe,U.value[t.columns[Z].key]=pe}}}else for(let $=0;$<a.length;$++)if(!a[$]){const P=U.value[((V=t.columns[$])==null?void 0:V.key)||""];a[$]=P||S.value[$]||"80px",t.columns[$]&&(U.value[t.columns[$].key]=a[$])}S.value=a})}function $e(){be(),Ce(),Te()}e.watch(()=>t.data,()=>{e.nextTick(()=>{be(),xe(),Ce(),w.value.clear()})},{deep:!0}),e.watch([m,f],()=>{e.nextTick(()=>{be(),xe(),Ce()})}),e.watch(()=>t.columns,()=>{const a=[],d={...U.value};t.columns.forEach((V,$)=>{const P=o(V.width);P?(a.push(P),d[V.key]=P):d[V.key]?a.push(d[V.key]):S.value[$]?(a.push(S.value[$]),d[V.key]=S.value[$]):a.push("")});const y=new Set(t.columns.map(V=>V.key));Object.keys(d).forEach(V=>{y.has(V)||delete d[V]}),U.value=d,S.value=a,e.nextTick(()=>{We(),xe(),Ce(),Te()})},{deep:!0});function Ye(){e.nextTick(()=>{if(!h.value)return;const a=h.value.querySelector(".table");if(a&&r.value.length===0){const d=a.querySelector("thead th:not(.col-select):not(.col-expand)");d&&d.offsetHeight>0&&(F.value=d.offsetHeight)}})}function Te(){e.nextTick(()=>{if(!h.value)return;const a=h.value.querySelector(".table");if(!a)return;const d=a.querySelector(".col-selected-header");if(d){const y=d.querySelector(".selected-header-wrapper");y&&(y.style.height=`${F.value}px`)}else Ye()})}e.watch(()=>r.value,()=>{e.nextTick(()=>{be(),Ce(),Te()})},{deep:!0}),e.watch(()=>t.loading,()=>{e.nextTick(()=>{Ce()})}),e.onMounted(()=>{var a,d;e.nextTick(()=>{be(),We(),Ce(),se(),Ye(),Te()}),window.addEventListener("resize",$e),window.addEventListener("scroll",$e,!0),(a=v.value)==null||a.addEventListener("scroll",()=>{xe(),se(),Ce()},{passive:!0}),(d=h.value)==null||d.addEventListener("scroll",()=>{Ne()},{passive:!0}),e.nextTick(()=>xe()),v.value&&typeof ResizeObserver<"u"&&(Ve=new ResizeObserver(()=>{Ce()}),Ve.observe(v.value))}),e.onUnmounted(()=>{var a,d;window.removeEventListener("resize",$e),window.removeEventListener("scroll",$e,!0),(a=v.value)==null||a.removeEventListener("scroll",xe),(d=h.value)==null||d.removeEventListener("scroll",Ne),window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Fe),Ve&&(Ve.disconnect(),Ve=null)});let je=-1;function Ce(){!h.value||!v.value||requestAnimationFrame(()=>{if(!h.value||!v.value)return;const a=v.value,d=Math.ceil(a.offsetWidth-a.clientWidth);if(Q.value=d,d!==je){je=d;const y=h.value.querySelector(".table"),V=g.value;y&&V&&(h.value.style.paddingRight="0px",y.style.width="",y.style.marginRight="",d>0?(h.value.style.paddingRight=`${d}px`,y.style.width="100%",y.style.marginRight=`-${d}px`):(h.value.style.paddingRight="0px",y.style.width="100%",y.style.marginRight="0px"))}})}let Ve=null;return e.onUnmounted(()=>{x.value.clear()}),(a,d)=>{const y=e.resolveComponent("YButton"),V=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:E},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[r.value.length&&l.showBulkActions?(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",bt,"已选择 "+e.toDisplayString(r.value.length)+" 项",1),e.createElementVNode("div",Ct,[e.renderSlot(a.$slots,"bulk-actions",{selectedItems:r.value,clearSelection:q},()=>[e.createVNode(y,{size:"small",class:"btn",onClick:q},{default:e.withCtx(()=>[...d[3]||(d[3]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",Et,[I.value?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("button",{class:e.normalizeClass(["toggle-all-hints-btn",{"is-expanded":R.value}]),onClick:le,title:R.value?"收起所有提示标签":"展开所有提示标签"},[R.value?(e.openBlock(),e.createElementBlock("svg",Nt,[...d[4]||(d[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",Vt,[...d[5]||(d[5]=[e.createElementVNode("path",{d:"M9 18L15 12L9 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))],10,xt)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:h},[e.createElementVNode("table",St,[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",Dt)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("col",$t)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("col",{key:$.key,style:e.normalizeStyle({width:S.value[P]||void 0,minWidth:S.value[P]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.expandable?(e.openBlock(),e.createElementBlock("th",Tt)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("th",Mt,[e.createElementVNode("div",Lt,[e.createElementVNode("input",{type:"checkbox",checked:_.value,indeterminate:Y.value,disabled:O.value,onChange:M},null,40,It),r.value.length>0?(e.openBlock(),e.createElementBlock("span",zt,e.toDisplayString(r.value.length),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),r.value.length>0&&a.$slots["selected-header"]?(e.openBlock(),e.createElementBlock("th",{key:2,colspan:l.columns.length,class:"col-selected-header"},[e.createElementVNode("div",_t,[e.renderSlot(a.$slots,"selected-header",{selectedItems:r.value,clearSelection:q},void 0,!0)])],8,Ht)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("th",{key:$.key,class:e.normalizeClass(we($,!0)),style:e.normalizeStyle(ge($,P,!0))},e.toDisplayString($.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":l.loading,"is-empty":!z.value.length&&!l.loading}]),ref_key:"bodyWrapRef",ref:v,style:e.normalizeStyle({maxHeight:C.value})},[l.loading?(e.openBlock(),e.createElementBlock("div",Kt,[...d[6]||(d[6]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!z.value.length&&!l.loading?(e.openBlock(),e.createElementBlock("div",Pt,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(l.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":l.loading}]),ref_key:"bodyTableRef",ref:g},[e.createElementVNode("colgroup",null,[t.expandable?(e.openBlock(),e.createElementBlock("col",At)):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("col",Rt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,($,P)=>(e.openBlock(),e.createElementBlock("col",{key:$.key,style:e.normalizeStyle({width:S.value[P]||void 0,minWidth:S.value[P]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,($,P)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie($,P)},[e.createElementVNode("tr",{class:e.normalizeClass({"row-selected":re($,P)}),onClick:Z=>ae($,P)},[t.expandable?(e.openBlock(),e.createElementBlock("td",Wt,[e.createElementVNode("button",{class:"expand-btn",type:"button",onClick:e.withModifiers(Z=>ue(ie($,P)),["stop"])},[e.createElementVNode("span",{class:e.normalizeClass(["expand-icon",{"is-open":ne(ie($,P))}])},null,2)],8,Yt)])):e.createCommentVNode("",!0),l.selectable?(e.openBlock(),e.createElementBlock("td",{key:1,class:"col-select",onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("input",{type:"checkbox",value:ie($,P),checked:r.value.includes(ie($,P)),disabled:G($,P),onChange:e.withModifiers(Z=>u(ie($,P)),["stop"])},null,40,jt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.columns,(Z,he)=>(e.openBlock(),e.createElementBlock("td",{key:Z.key,class:e.normalizeClass(we(Z)),style:e.normalizeStyle(ge(Z,he,!1))},[e.renderSlot(a.$slots,`cell-${Z.key}`,{item:$,value:ve($,Z.key),index:P},()=>[e.createTextVNode(e.toDisplayString(i($,Z)),1)],!0)],6))),128))],10,Ft),t.expandable&&ne(ie($,P))?(e.openBlock(),e.createElementBlock("tr",{key:`${ie($,P)}-expand`,class:"expand-row"},[e.createElementVNode("td",{colspan:p.value,class:"expand-cell"},[e.renderSlot(a.$slots,"expand",{item:$,index:P},void 0,!0)],8,Ot)])):e.createCommentVNode("",!0)],64))),128))])],2)],6),l.pagination?(e.openBlock(),e.createBlock(V,{key:1,class:"align-right","current-page":m.value,"onUpdate:currentPage":d[1]||(d[1]=$=>m.value=$),"page-size":f.value,"onUpdate:pageSize":d[2]||(d[2]=$=>f.value=$),loading:t.loading,"disable-next":te.value,"page-size-options":l.pageSizeOptions,onPageChange:ce,onPageSizeChange:ye},null,8,["current-page","page-size","loading","disable-next","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),Ge=fe(Ut,[["__scopeId","data-v-8e9d3cdd"]]),qt=["onKeydown","aria-expanded"],Gt={key:0,class:"yselect__tags"},Zt=["src"],Qt={class:"yselect__tag-text"},Jt=["onClick"],Xt={key:1,class:"yselect__placeholder-text"},el=["src"],tl=["placeholder","onKeydown"],ll=["onClick","onMouseenter"],nl={key:0,class:"yselect__option-check"},ol={key:0,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},al=["src"],rl=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(l,{emit:c}){const t=l,n=c,m=e.ref(!1),f=e.ref(-1),r=e.ref(),b=e.ref(),w=e.ref(),C=e.ref(!1),E=e.ref(),h=e.ref(""),v=e.computed(()=>t.multiple?null:t.options.find(o=>I(o)===t.modelValue)||null),g=e.computed(()=>{if(!t.multiple)return[];const o=Array.isArray(t.modelValue)?t.modelValue:[];return t.options.filter(s=>o.includes(I(s)))}),S=e.computed(()=>{if(t.multiple){const o=g.value.length;return o===0?"":`已选择 ${o} 项`}return v.value?R(v.value):""}),U=e.computed(()=>{if(!t.filterable)return t.options;const o=h.value.trim().toLowerCase();return o?t.options.filter(s=>{const p=R(s);return String(p).toLowerCase().includes(o)}):t.options}),F=e.computed(()=>{var z;const o={position:"fixed",zIndex:"4000"},s=b.value;if(!s)return o;const p=s.getBoundingClientRect(),T=((z=w.value)==null?void 0:z.getBoundingClientRect().width)||p.width;return o.left=`${p.left}px`,o.width=`${T}px`,C.value?(o.bottom=`${window.innerHeight-p.top+4}px`,o.top="auto"):o.top=`${p.bottom+4}px`,o});function x(){!m.value||!b.value||e.nextTick(()=>{const o=b.value;if(!o)return;const s=o.getBoundingClientRect(),p=window.innerHeight,T=200,z=s.bottom+T+4,_=s.top-T-4,Y=z<=p-20,O=_>=20;C.value=!Y&&O})}function I(o){return typeof o=="object"&&o!==null?o[t.valueKey]:o}function R(o){return typeof o=="object"&&o!==null?o[t.labelKey]||String(o[t.valueKey]):String(o)}function oe(o,s){return typeof o=="object"&&o!==null&&o.id!==void 0?o.id:I(o)||s}function X(o){return t.multiple?(Array.isArray(t.modelValue)?t.modelValue:[]).includes(I(o)):I(o)===t.modelValue}function H(o){return typeof o=="object"&&o!==null?o[t.disabledKey]===!0:!1}function K(){t.disabled||(m.value?B():le())}function le(){t.disabled||(m.value=!0,e.nextTick(()=>{x(),W(),t.filterable&&E.value&&(E.value.focus(),h.value="")}))}function B(){m.value=!1,f.value=-1,C.value=!1,t.filterable&&(h.value="")}function D(o,s){if(H(o))return;const p=I(o);if(t.multiple){const T=Array.isArray(t.modelValue)?[...t.modelValue]:[],z=I(o),_=T.indexOf(z);_>-1?T.splice(_,1):T.push(z),n("update:modelValue",T),n("change",T,g.value)}else n("update:modelValue",p),n("change",p,o),B()}function k(){if(!t.clearable||t.disabled)return;const o=t.multiple?t.clearTo!==void 0?t.clearTo:[]:t.clearTo;n("update:modelValue",o),n("change",o,t.multiple?[]:null),n("clear"),t.multiple||B()}function L(o,s){if(s.stopPropagation(),t.disabled||!t.multiple)return;const p=Array.isArray(t.modelValue)?[...t.modelValue]:[],T=I(o),z=p.indexOf(T);z>-1&&(p.splice(z,1),n("update:modelValue",p),n("change",p,g.value))}function A(o){if(!U.value||U.value.length===0){f.value=-1;return}let s=f.value;const p=U.value.length;s===-1?s=o>0?0:p-1:s=(s+o+p)%p;let T=0;for(;T<p&&H(U.value[s]);)s=(s+o+p)%p,T++;f.value=T>=p?-1:s,J()}function N(){if(f.value<0)return;const o=U.value[f.value];!o||H(o)||D(o,f.value)}function W(){if(!r.value)return;const o=r.value.querySelector(".yselect__option--selected");o&&o.scrollIntoView({block:"nearest"})}function J(){if(!r.value||f.value<0)return;const s=r.value.querySelectorAll(".yselect__option")[f.value];s&&s.scrollIntoView({block:"nearest"})}function j(o){const s=o.target;(!w.value||!w.value.contains(s))&&B()}e.watch(()=>t.modelValue,()=>{f.value=-1});function Q(){m.value&&x()}return e.onMounted(()=>{document.addEventListener("click",j),window.addEventListener("resize",Q),window.addEventListener("scroll",Q,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",j),window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q,!0)}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":l.disabled,[`yselect--${l.size}`]:!0}]),style:e.normalizeStyle({width:l.width}),ref_key:"selectContainer",ref:w},[e.createElementVNode("div",{ref_key:"triggerElement",ref:b,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":m.value,"yselect__trigger--disabled":l.disabled,"yselect__trigger--error":l.error}]),onMousedown:e.withModifiers(K,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(K,["prevent"]),["enter"]),e.withKeys(e.withModifiers(K,["prevent"]),["space"]),e.withKeys(B,["escape"]),e.withKeys(e.withModifiers(le,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(le,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":m.value,"aria-haspopup":!0},[!l.filterable||!m.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!S.value}])},[e.renderSlot(o.$slots,"value",{value:t.multiple?g.value:v.value,label:S.value,multiple:t.multiple},()=>{var p;return[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[g.value.length>0?(e.openBlock(),e.createElementBlock("div",Gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(T,z)=>(e.openBlock(),e.createElementBlock("span",{key:oe(T,z),class:"yselect__tag"},[T!=null&&T.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:T.flagImg,alt:"flag"},null,8,Zt)):e.createCommentVNode("",!0),e.createElementVNode("span",Qt,e.toDisplayString(R(T)),1),l.clearable&&!l.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"yselect__tag-close",onClick:e.withModifiers(_=>L(T,_),["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,Jt)):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("span",Xt,e.toDisplayString(l.placeholder),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(p=v.value)!=null&&p.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:v.value.flagImg,alt:"flag"},null,8,el)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(S.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.placeholder),1)],64))],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:E,class:"yselect__input",type:"text",placeholder:t.multiple?g.value.length>0?`已选择 ${g.value.length} 项`:l.placeholder:S.value||l.placeholder,"onUpdate:modelValue":s[0]||(s[0]=p=>h.value=p),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(p=>A(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(p=>A(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(p=>N(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(B,["prevent"]),["esc"]),e.withKeys(e.withModifiers(k,["prevent"]),["delete"])]},null,40,tl)),[[e.vModelText,h.value]]),l.clearable&&!l.disabled&&(t.multiple?g.value.length>0:v.value)?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(k,["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":m.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,qt),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":C.value}]),style:e.normalizeStyle(F.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(U.value,(p,T)=>(e.openBlock(),e.createElementBlock("div",{key:oe(p,T),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":X(p),"yselect__option--disabled":H(p),"yselect__option--hover":f.value===T}]),onClick:z=>D(p),onMouseenter:z=>f.value=T,onMouseleave:s[5]||(s[5]=z=>f.value=-1)},[e.renderSlot(o.$slots,"option",{option:p,index:T,selected:X(p)},()=>[t.multiple?(e.openBlock(),e.createElementBlock("span",nl,[X(p)?(e.openBlock(),e.createElementBlock("svg",ol,[...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),p!=null&&p.flagImg?(e.openBlock(),e.createElementBlock("img",{key:1,class:"yselect__flag",src:p.flagImg,alt:"flag"},null,8,al)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(R(p)),1)],!0)],42,ll))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),Pe=fe(rl,[["__scopeId","data-v-b3f1516d"]]),il={class:"ypagination"},sl={class:"page-actions"},cl={class:"page-size-select"},dl=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}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(t.pageSize),f=e.computed(()=>t.pageSizeOptions),r=e.computed({get:()=>t.currentPage,set:E=>{n("update:currentPage",E),n("page-change",E)}});function b(E){t.loading||E>=1&&E!==t.currentPage&&(r.value=E)}function w(E){t.loading||(m.value=E,n("update:pageSize",E),n("page-size-change",E),r.value=1)}function C(E){t.loading||(E==="prev"?b(r.value-1):E==="next"&&b(r.value+1))}return m.value=t.pageSize,e.watch(()=>t.pageSize,E=>{typeof E=="number"&&m.value!==E&&(m.value=E)}),(E,h)=>{const v=e.resolveComponent("YButton"),g=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",sl,[e.createVNode(v,{size:"small",variant:"secondary",disabled:r.value===1||l.loading,onClick:h[0]||(h[0]=S=>b(1))},{default:e.withCtx(()=>[...h[2]||(h[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(v,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:r.value===1||l.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:l.loading||l.disableNext,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:C},null,8,["groupItems"]),e.createElementVNode("div",cl,[e.createVNode(g,{modelValue:m.value,"onUpdate:modelValue":h[1]||(h[1]=S=>m.value=S),options:f.value,size:"small",width:"105px",clearable:!1,disabled:l.loading,onChange:w},null,8,["modelValue","options","disabled"])])])])}}}),Ze=fe(dl,[["__scopeId","data-v-5a512f0f"]]),ul=["aria-label"],fl={class:"y-badge__inner"},ml={key:0,class:"y-badge__progress","aria-hidden":"true"},hl={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},vl={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},pl={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},gl={key:1,class:"y-badge__icon","aria-hidden":"true"},yl={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},wl={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},kl={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},bl={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Cl={class:"y-badge__label"},El=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(l){const c=l,t=e.computed(()=>c.tone||"default"),n=e.computed(()=>{const m=(c.label||"").trim(),f=c.tone,r=c.progress;if(r){const b={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return m?`${m},进度:${b[r]||r}`:`进度:${b[r]||r}`}if(f&&f!=="default"){const b={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return m?`${m},语气:${b[f]||f}`:`语气:${b[f]||f}`}return m||"标记"});return(m,f)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${t.value}`,`y-badge--${l.size}`,{"is-outline":l.outline,"is-pill":l.pill},l.progress?`y-badge--progress-${l.progress}`:""]]),role:"status","aria-label":n.value},[e.createElementVNode("span",fl,[l.progress?(e.openBlock(),e.createElementBlock("span",ml,[l.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",hl,[...f[0]||(f[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):l.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",vl,[...f[1]||(f[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)])])):l.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",pl,[...f[2]||(f[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)])):l.icon?(e.openBlock(),e.createElementBlock("span",gl,[l.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",yl,[...f[3]||(f[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):l.icon==="check"?(e.openBlock(),e.createElementBlock("svg",wl,[...f[4]||(f[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)])])):l.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",kl,[...f[5]||(f[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",bl,[...f[6]||(f[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",Cl,[e.renderSlot(m.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.label),1)],!0)])])],10,ul))}}),Qe=fe(El,[["__scopeId","data-v-ce819797"]]),Bl=["aria-hidden"],xl=["onKeydown"],Nl={key:0,class:"y-dialog-header"},Vl={class:"y-dialog-title"},Sl={class:"y-dialog-body"},Dl={key:1,class:"y-dialog-footer"},$l=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:3e3},showHeader:{type:Boolean,default:!0},center:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(l,{emit:c}){const t=l,n=c,m=e.computed({get:()=>t.modelValue,set:h=>n("update:modelValue",h)}),f=e.ref(null),r=e.computed(()=>{const h={};return h.width=typeof t.width=="number"?`${t.width}px`:String(t.width),h.margin="0 auto",h.top=t.top,h});function b(){t.maskClosable&&w()}function w(){m.value&&(m.value=!1,n("close"))}function C(){t.closable&&w()}function E(h){h.key==="Escape"&&C()}return e.watch(()=>t.modelValue,h=>{h?(n("open"),requestAnimationFrame(()=>{var v;return(v=f.value)==null?void 0:v.focus()}),document.addEventListener("keydown",E),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",E),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",E),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",E),document.body.style.overflow=""}),(h,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!m.value,style:e.normalizeStyle({zIndex:String(l.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:b}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-dialog-panel",[l.center?"is-center":""]]),style:e.normalizeStyle(r.value),onKeydown:e.withKeys(e.withModifiers(C,["prevent","stop"]),["esc"]),tabindex:"-1"},[l.showHeader?(e.openBlock(),e.createElementBlock("div",Nl,[e.renderSlot(h.$slots,"header",{},()=>[e.createElementVNode("div",Vl,e.toDisplayString(l.title),1)],!0),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:w}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Sl,[e.renderSlot(h.$slots,"default",{},void 0,!0)]),h.$slots.footer?(e.openBlock(),e.createElementBlock("div",Dl,[e.renderSlot(h.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,xl),[[e.vShow,m.value]])]),_:3})],12,Bl),[[e.vShow,m.value]])]))}}),Je=fe($l,[["__scopeId","data-v-a7acc6dc"]]),Tl={class:"ypopover__inner"},Ml=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(),r=e.ref(),b=e.ref(),w=e.ref(!1),C=e.ref(),E=e.ref(),h=e.ref({});let v=null,g=null;const S=e.computed(()=>{if(!w.value||!C.value)return{};const N={};n.width!=="auto"&&(N.width=typeof n.width=="number"?`${n.width}px`:n.width),n.maxWidth&&(N.maxWidth=typeof n.maxWidth=="number"?`${n.maxWidth}px`:n.maxWidth);const{top:W,left:J}=F();return N.top=`${W}px`,N.left=`${J}px`,N}),U=e.computed(()=>{if(!n.showArrow)return{};if(Object.keys(h.value).length>0)return h.value;const N={};return n.placement.startsWith("top")||n.placement.startsWith("bottom")?N.left="50%":N.top="50%",N});function F(){var _,Y;if(!C.value)return{top:0,left:0};const{width:N,height:W,top:J,left:j}=C.value,Q=((_=b.value)==null?void 0:_.offsetWidth)||200,o=((Y=b.value)==null?void 0:Y.offsetHeight)||100;let s=0,p=0;switch(n.placement){case"top":s=J-o-n.offset,p=j+(N-Q)/2;break;case"top-start":s=J-o-n.offset,p=j;break;case"top-end":s=J-o-n.offset,p=j+N-Q;break;case"bottom":s=J+W+n.offset,p=j+(N-Q)/2;break;case"bottom-start":s=J+W+n.offset,p=j;break;case"bottom-end":s=J+W+n.offset,p=j+N-Q;break;case"left":s=J+(W-o)/2,p=j-Q-n.offset;break;case"left-start":s=J,p=j-Q-n.offset;break;case"left-end":s=J+W-o,p=j-Q-n.offset;break;case"right":s=J+(W-o)/2,p=j+N+n.offset;break;case"right-start":s=J,p=j+N+n.offset;break;case"right-end":s=J+W-o,p=j+N+n.offset;break}const T=window.innerWidth,z=window.innerHeight;return p<8&&(p=8),p+Q>T-8&&(p=T-Q-8),s<8&&(s=8),s+o>z-8&&(s=z-o-8),{top:s,left:p}}function x(){n.disabled||w.value||(X(),n.openDelay>0?v=setTimeout(()=>{I()},n.openDelay):I())}function I(){m("before-show"),w.value=!0,m("update:modelValue",!0),m("show"),e.nextTick(()=>{e.nextTick(()=>{K()})})}function R(){w.value&&(X(),n.closeDelay>0?g=setTimeout(()=>{oe()},n.closeDelay):oe())}function oe(){m("before-hide"),w.value=!1,m("update:modelValue",!1),m("hide")}function X(){v&&(clearTimeout(v),v=null),g&&(clearTimeout(g),g=null)}function H(){if(!n.showArrow||!C.value||!b.value){h.value={};return}const N=C.value,W=b.value.getBoundingClientRect();if(W.width===0||W.height===0){const j={};n.placement.startsWith("top")||n.placement.startsWith("bottom")?j.left="50%":j.top="50%",h.value=j;return}const J={};if(n.placement.startsWith("top")){J.bottom="-6px";const j=N.left+N.width/2,Q=W.left,o=j-Q;J.left=`${Math.max(12,Math.min(o,W.width-12))}px`}else if(n.placement.startsWith("bottom")){J.top="-6px";const j=N.left+N.width/2,Q=W.left,o=j-Q;J.left=`${Math.max(12,Math.min(o,W.width-12))}px`}else if(n.placement.startsWith("left")){J.right="-6px";const j=N.top+N.height/2,Q=W.top,o=j-Q;J.top=`${Math.max(12,Math.min(o,W.height-12))}px`}else if(n.placement.startsWith("right")){J.left="-6px";const j=N.top+N.height/2,Q=W.top,o=j-Q;J.top=`${Math.max(12,Math.min(o,W.height-12))}px`}h.value=J}function K(){r.value&&(C.value=r.value.getBoundingClientRect(),b.value&&(E.value=b.value.getBoundingClientRect(),H(),w.value&&requestAnimationFrame(()=>{b.value&&(E.value=b.value.getBoundingClientRect(),H())})))}function le(){n.disabled||n.trigger==="click"&&(w.value?R():x())}function B(){n.disabled||n.trigger!=="hover"||(X(),x())}function D(){n.disabled||n.trigger!=="hover"||R()}function k(){n.disabled||n.trigger!=="hover"||X()}function L(){n.disabled||n.trigger!=="hover"||R()}function A(N){if(!n.closeOnClickOutside||!w.value)return;const W=N.target;f.value&&!f.value.contains(W)&&b.value&&!b.value.contains(W)&&R()}return e.watch(()=>n.modelValue,N=>{N!==w.value&&(N?x():R())}),e.watch(w,N=>{N?(document.addEventListener("click",A),window.addEventListener("resize",K),window.addEventListener("scroll",K,!0),e.nextTick(()=>{K(),requestAnimationFrame(()=>{K()}),setTimeout(()=>{K()},0)})):(document.removeEventListener("click",A),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0))}),e.onMounted(()=>{n.modelValue&&x()}),e.onUnmounted(()=>{X(),document.removeEventListener("click",A),window.removeEventListener("resize",K),window.removeEventListener("scroll",K,!0)}),c({show:x,hide:R,updatePosition:K}),(N,W)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:f},[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,onClick:le,onMouseenter:B,onMouseleave:D},[e.renderSlot(N.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[w.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:b,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${l.placement}`,{"ypopover__content--dark":l.dark,"ypopover__content--no-padding":!l.showPadding}]]),style:e.normalizeStyle(S.value),onClick:W[0]||(W[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:k,onMouseleave:L},[l.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${l.placement}`]),style:e.normalizeStyle(U.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",Tl,[e.renderSlot(N.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),Xe=fe(Ml,[["__scopeId","data-v-be755399"]]),Ll={class:"relative"},Il=["value","placeholder"],zl={class:"nh-time-suffix"},Hl={class:"nh-time-shortcuts"},_l={class:"nh-time-shortcuts-list"},Kl=["onClick","onKeydown","onMouseenter"],Pl={class:"nh-time-custom"},Al={class:"nh-time-custom-header"},Rl={class:"nh-time-selection-status"},Fl={key:0,class:"status-text"},Wl={key:1,class:"status-text"},Yl={key:2,class:"status-text status-complete"},jl={class:"nh-time-pickers"},Ol={class:"nh-time-picker"},Ul={class:"nh-date-picker"},ql={class:"nh-date-picker-header"},Gl={class:"nh-date-picker-header-label"},Zl={class:"nh-date-picker-content"},Ql={class:"nh-date-table"},Jl=["onClick"],Xl={class:"nh-date-table-cell"},en={key:0},tn={class:"nh-time-picker"},ln={class:"nh-date-picker"},nn={class:"nh-date-picker-header"},on={class:"nh-date-picker-header-label"},an={class:"nh-date-picker-content"},rn={class:"nh-date-table"},sn=["onClick"],cn={class:"nh-date-table-cell"},dn={key:0},un={class:"nh-time-actions"},fn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const l=new Date,c=new Date(l.getFullYear(),l.getMonth(),l.getDate()),t=new Date(l.getFullYear(),l.getMonth(),l.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"昨天",getValue:()=>{const l=new Date;l.setDate(l.getDate()-1);const c=new Date(l.getFullYear(),l.getMonth(),l.getDate()),t=new Date(l.getFullYear(),l.getMonth(),l.getDate(),23,59,59);return{startDate:c,endDate:t}}},{label:"近7天",getValue:()=>{const l=new Date,c=new Date;return c.setDate(c.getDate()-6),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}},{label:"近30天",getValue:()=>{const l=new Date,c=new Date;return c.setDate(c.getDate()-29),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}},{label:"近3个月",getValue:()=>{const l=new Date,c=new Date;return c.setMonth(c.getMonth()-3),c.setHours(0,0,0,0),l.setHours(23,59,59,999),{startDate:c,endDate:l}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(l,{emit:c}){const t=l,n=c,m=e.ref(!1),f=e.ref(-1),r=e.ref(-1),b=e.ref(null),w=e.ref(),C=e.ref(),E=e.ref({top:!0,left:!0}),h=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),v=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),g=()=>{const i=new Date(h.value.year,h.value.month).getTime(),u=new Date(v.value.year,v.value.month).getTime();if(i>=u){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}},S=()=>{const i=new Date(h.value.year,h.value.month).getTime();if(new Date(v.value.year,v.value.month).getTime()<=i){const M=new Date(v.value.year,v.value.month-1);h.value.year=M.getFullYear(),h.value.month=M.getMonth()}},U=["一","二","三","四","五","六","日"],F=e.ref(null),x=e.ref(null),I=i=>{if(!i)return null;if(i instanceof Date)return i;if(typeof i=="number")return new Date(i);if(typeof i=="string"){const u=new Date(i);return isNaN(u.getTime())?null:u}return null},R=i=>{if(!i)return null;const u=i.getFullYear(),M=String(i.getMonth()+1).padStart(2,"0"),q=String(i.getDate()).padStart(2,"0");if(t.includeTime){const ae=String(i.getHours()).padStart(2,"0"),re=String(i.getMinutes()).padStart(2,"0"),ce=String(i.getSeconds()).padStart(2,"0");return`${u}-${M}-${q} ${ae}:${re}:${ce}`}else return`${u}-${M}-${q}`},oe=i=>i?i.getTime():null,X=i=>i?{startDate:I(i.startDate),endDate:I(i.endDate)}:{startDate:null,endDate:null},H=i=>t.format==="string"?{startDate:R(i.startDate),endDate:R(i.endDate)}:t.format==="timestamp"?{startDate:oe(i.startDate),endDate:oe(i.endDate)}:i,K=(i,u)=>`${String(u+1).padStart(2,"0")}/${i}`,le=(i,u)=>i.getFullYear()===u.getFullYear()&&i.getMonth()===u.getMonth()&&i.getDate()===u.getDate(),B=(i,u,M)=>!u||!M?!1:i>=u&&i<=M,D=i=>{const u=X(i);if(!(u!=null&&u.startDate)||!(u!=null&&u.endDate))return-1;for(let M=0;M<t.shortcuts.length;M++){const q=t.shortcuts[M].getValue();if(q.startDate&&q.endDate&&u.startDate&&u.endDate){const ae=new Date(u.startDate.getFullYear(),u.startDate.getMonth(),u.startDate.getDate()),re=new Date(u.endDate.getFullYear(),u.endDate.getMonth(),u.endDate.getDate()),ce=new Date(q.startDate.getFullYear(),q.startDate.getMonth(),q.startDate.getDate()),ye=new Date(q.endDate.getFullYear(),q.endDate.getMonth(),q.endDate.getDate());if(ae.getTime()===ce.getTime()&&re.getTime()===ye.getTime())return M}}return-1},k=(i,u)=>{const M=new Date(i,u,1),q=new Date(i,u+1,0),ae=M.getDay(),re=q.getDate(),ce=[],ye=new Date,be=ae===0?6:ae-1,Be=new Date(i,u,0);for(let se=be-1;se>=0;se--){const ke=new Date(i,u-1,Be.getDate()-se);ce.push({date:ke,day:ke.getDate(),isCurrentMonth:!1,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let se=1;se<=re;se++){const ke=new Date(i,u,se);ce.push({date:ke,day:se,isCurrentMonth:!0,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!1})}const xe=42-ce.length;for(let se=1;se<=xe;se++){const ke=new Date(i,u+1,se);ce.push({date:ke,day:se,isCurrentMonth:!1,isToday:le(ke,ye),isSelected:!1,isInRange:!1,isDisabled:!0})}const Ne=[];for(let se=0;se<ce.length;se+=7)Ne.push(ce.slice(se,se+7));return Ne},L=i=>{const u=H(i);n("update:modelValue",u),n("change",u)},A=()=>{if(!w.value||!C.value)return;const i=w.value.getBoundingClientRect(),u=C.value.getBoundingClientRect(),M=window.innerWidth,ae=window.innerHeight-i.bottom,re=i.top,ce=u.height||400;ae<ce&&re>ce?E.value.top=!1:E.value.top=!0;const ye=M-i.left,be=u.width||640;ye<be?E.value.left=!1:E.value.left=!0},N=()=>{if(m.value=!m.value,m.value){const i=X(t.modelValue);if(F.value=(i==null?void 0:i.startDate)||null,x.value=(i==null?void 0:i.endDate)||null,r.value=D(t.modelValue),f.value=-1,i!=null&&i.startDate&&(h.value.year=i.startDate.getFullYear(),h.value.month=i.startDate.getMonth()),i!=null&&i.endDate)v.value.year=i.endDate.getFullYear(),v.value.month=i.endDate.getMonth();else{const u=new Date(h.value.year,h.value.month+1);v.value.year=u.getFullYear(),v.value.month=u.getMonth()}g(),e.nextTick(()=>{A()})}},W=i=>{const u=i.target,M=w.value,q=C.value;M&&q&&!M.contains(u)&&!q.contains(u)&&(m.value=!1,f.value=-1)},J=i=>{i.key==="Enter"||i.key===" "?(i.preventDefault(),N()):i.key==="ArrowDown"&&(i.preventDefault(),m.value=!0,e.nextTick(()=>{A(),p()}))},j=i=>{var u;i.key==="Escape"&&(m.value=!1,f.value=-1,(u=w.value)==null||u.focus())},Q=(i,u)=>{i.key==="ArrowDown"?(i.preventDefault(),f.value=Math.min(u+1,t.shortcuts.length-1),T(f.value)):i.key==="ArrowUp"?(i.preventDefault(),f.value=Math.max(u-1,0),T(f.value)):(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),z(t.shortcuts[u]))},o=i=>{f.value=i},s=()=>{f.value=-1},p=()=>{f.value=0,T(0)},T=i=>{if(C.value){const M=C.value.querySelectorAll(".nh-time-shortcut")[i];M&&M.focus()}},z=i=>{const u=i.getValue();t.includeTime&&u.startDate&&u.endDate&&(u.startDate.setHours(0,0,0,0),u.endDate.setHours(23,59,59,999)),L(u),r.value=t.shortcuts.findIndex(M=>M.label===i.label),f.value=-1,m.value=!1},_=(i,u)=>{if(!i||i.isDisabled)return;let M;if(t.includeTime?(M=new Date(i.date),u==="start"||!F.value?M.setHours(0,0,0,0):M.setHours(23,59,59,999)):M=new Date(i.date.getFullYear(),i.date.getMonth(),i.date.getDate()),!F.value&&!x.value)F.value=M,x.value=null;else if(F.value&&!x.value)if(M>=F.value)t.includeTime&&M.setHours(23,59,59,999),x.value=M;else{const q=F.value;t.includeTime&&q.setHours(23,59,59,999),x.value=q,F.value=M}else F.value=M,x.value=null;if(r.value=-1,F.value&&x.value){const q=new Date(x.value);t.includeTime&&q.setHours(23,59,59,999),b.value={startDate:F.value,endDate:q}}else b.value=null},Y=(i,u)=>{if(!i)return["nh-date-table-td"];const M=["nh-date-table-td"];return i.isCurrentMonth||M.push("is-prev-month"),i.isToday&&M.push("is-today"),i.isDisabled&&M.push("is-disabled"),F.value&&le(i.date,F.value)&&M.push("is-selected","is-start"),x.value&&le(i.date,x.value)&&M.push("is-selected","is-end"),F.value&&x.value&&B(i.date,F.value,x.value)&&M.push("is-in-range"),M},O=()=>{b.value&&(t.includeTime&&b.value.endDate&&b.value.endDate.setHours(23,59,59,999),L(b.value),r.value=D(b.value),m.value=!1)},te=()=>{L({startDate:null,endDate:null}),ve(),f.value=-1,m.value=!1},ee=()=>{m.value&&e.nextTick(()=>{A()})},de=e.computed(()=>k(h.value.year,h.value.month)),me=e.computed(()=>k(v.value.year,v.value.month)),ie=e.computed(()=>{const i=X(t.modelValue);if(!i||!i.startDate||!i.endDate)return"";const u=ae=>{const re=String(ae.getFullYear()),ce=String(ae.getMonth()+1).padStart(2,"0"),ye=String(ae.getDate()).padStart(2,"0");return`${re}/${ce}/${ye}`},M=u(i.startDate),q=u(i.endDate);return!t.includeTime&&M===q?M:`${M} - ${q}`}),G=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!E.value.top,"nh-time-dropdown-right":!E.value.left}]),ne=e.computed(()=>{const i=X(t.modelValue);return!!(i!=null&&i.startDate&&(i!=null&&i.endDate))}),ue=e.computed(()=>!!(F.value&&x.value)),ve=()=>{F.value=null,x.value=null,b.value=null,r.value=-1};e.watch(()=>t.modelValue,i=>{const u=X(i);if(u!=null&&u.startDate){const M=u.startDate;h.value.year=M.getFullYear(),h.value.month=M.getMonth()}if(u!=null&&u.endDate){const M=u.endDate;v.value.year=M.getFullYear(),v.value.month=M.getMonth()}else if(u!=null&&u.startDate){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}(u!=null&&u.startDate||u!=null&&u.endDate)&&g(),m.value||(r.value=D(i))},{immediate:!0,deep:!0}),e.watch([h,v],()=>{const i=new Date(h.value.year,h.value.month).getTime(),u=new Date(v.value.year,v.value.month).getTime();if(i===u){const M=new Date(h.value.year,h.value.month+1);v.value.year=M.getFullYear(),v.value.month=M.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",W),window.addEventListener("resize",ee),window.addEventListener("scroll",ee),r.value=D(t.modelValue);const i=X(t.modelValue);if(i!=null&&i.startDate&&(h.value.year=i.startDate.getFullYear(),h.value.month=i.startDate.getMonth()),i!=null&&i.endDate)v.value.year=i.endDate.getFullYear(),v.value.month=i.endDate.getMonth();else{const u=new Date(h.value.year,h.value.month+1);v.value.year=u.getFullYear(),v.value.month=u.getMonth()}g()}),e.onUnmounted(()=>{document.removeEventListener("click",W),window.removeEventListener("resize",ee),window.removeEventListener("scroll",ee)});const we=()=>{t.clearable&&(L({startDate:null,endDate:null}),ve(),f.value=-1)},ge=(i,u)=>{if(i==="start"){const M=new Date(h.value.year,h.value.month+u,1);h.value.year=M.getFullYear(),h.value.month=M.getMonth(),g()}else{const M=new Date(v.value.year,v.value.month+u,1);v.value.year=M.getFullYear(),v.value.month=M.getMonth(),S()}};return(i,u)=>{const M=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${l.size}`]])},[e.createElementVNode("div",Ll,[e.createElementVNode("div",{ref_key:"trigger",ref:w,onClick:N,onKeydown:J,class:e.normalizeClass(["nh-time-trigger",{"is-focus":m.value,"has-value":ne.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:ie.value,placeholder:l.placeholder,class:"nh-time-input"},null,8,Il),e.createElementVNode("span",zl,[l.clearable&&ne.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(we,["stop"]),class:"nh-time-clear"},[...u[4]||(u[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),u[6]||(u[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":m.value}])},[...u[5]||(u[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(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:C,class:e.normalizeClass(G.value),onKeydown:j},[e.createElementVNode("div",Hl,[u[7]||(u[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",_l,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.shortcuts,(q,ae)=>(e.openBlock(),e.createElementBlock("li",{key:q.label,onClick:re=>z(q),onKeydown:re=>Q(re,ae),onMouseenter:re=>o(ae),onMouseleave:s,class:e.normalizeClass(["nh-time-shortcut",{"is-active":f.value===ae,"is-selected":r.value===ae}]),tabindex:"0"},e.toDisplayString(q.label),43,Kl))),128))])]),e.createElementVNode("div",Pl,[e.createElementVNode("div",Al,[u[8]||(u[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",Rl,[!F.value&&!x.value?(e.openBlock(),e.createElementBlock("span",Fl," 请选择开始日期 ")):F.value&&!x.value?(e.openBlock(),e.createElementBlock("span",Wl," 请选择结束日期 ")):F.value&&x.value?(e.openBlock(),e.createElementBlock("span",Yl," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",jl,[e.createElementVNode("div",Ol,[e.createElementVNode("div",Ul,[e.createElementVNode("div",ql,[e.createElementVNode("button",{onClick:u[0]||(u[0]=q=>ge("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...u[9]||(u[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",Gl,e.toDisplayString(K(h.value.year,h.value.month)),1),e.createElementVNode("button",{onClick:u[1]||(u[1]=q=>ge("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...u[10]||(u[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",Zl,[e.createElementVNode("table",Ql,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,q=>e.createElementVNode("th",{key:q,class:"nh-date-table-th"},e.toDisplayString(q),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,(q,ae)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${ae}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q,(re,ce)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${ae}-${ce}`,class:e.normalizeClass(Y(re)),onClick:ye=>_(re,"start")},[e.createElementVNode("div",Xl,[re?(e.openBlock(),e.createElementBlock("span",en,e.toDisplayString(re.day),1)):e.createCommentVNode("",!0)])],10,Jl))),128))]))),128))])])])])]),e.createElementVNode("div",tn,[e.createElementVNode("div",ln,[e.createElementVNode("div",nn,[e.createElementVNode("button",{onClick:u[2]||(u[2]=q=>ge("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...u[11]||(u[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",on,e.toDisplayString(K(v.value.year,v.value.month)),1),e.createElementVNode("button",{onClick:u[3]||(u[3]=q=>ge("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...u[12]||(u[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",an,[e.createElementVNode("table",rn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,q=>e.createElementVNode("th",{key:q,class:"nh-date-table-th"},e.toDisplayString(q),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,(q,ae)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${ae}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q,(re,ce)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${ae}-${ce}`,class:e.normalizeClass(Y(re)),onClick:ye=>_(re,"end")},[e.createElementVNode("div",cn,[re?(e.openBlock(),e.createElementBlock("span",dn,e.toDisplayString(re.day),1)):e.createCommentVNode("",!0)])],10,sn))),128))]))),128))])])])])])]),e.createElementVNode("div",un,[l.clearable?(e.openBlock(),e.createBlock(M,{key:0,onClick:te,variant:"secondary",size:l.size},{default:e.withCtx(()=>[...u[13]||(u[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(M,{onClick:O,disabled:!ue.value,variant:"primary",size:l.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F.value&&!x.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),Ae=fe(fn,[["__scopeId","data-v-e5ef63b1"]]),mn=["aria-checked","aria-disabled","disabled","onKeydown"],hn={class:"yswitch__thumb"},vn={key:0,class:"yswitch__spinner","aria-hidden":"true"},pn=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(l,{emit:c}){const t=l,n=c,m=e.ref(),f=e.computed(()=>t.modelValue===t.trueValue),r=e.computed(()=>{const w={};return w.background=f.value?t.activeColor:t.inactiveColor,w});function b(){if(t.disabled||t.loading)return;const w=f.value?t.falseValue:t.trueValue;n("update:modelValue",w),n("change",w)}return e.onMounted(()=>{const w=m.value;w&&(w.addEventListener("focus",C=>n("focus",C)),w.addEventListener("blur",C=>n("blur",C)))}),(w,C)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:m,class:e.normalizeClass(["yswitch",[`yswitch--${l.size}`,{"yswitch--checked":f.value,"yswitch--disabled":l.disabled,"yswitch--loading":l.loading}]]),style:e.normalizeStyle(r.value),role:"switch","aria-checked":f.value,"aria-disabled":l.disabled,disabled:l.disabled||l.loading,onClick:b,onKeydown:[e.withKeys(e.withModifiers(b,["prevent"]),["enter"]),e.withKeys(e.withModifiers(b,["prevent"]),["space"])]},[C[0]||(C[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",hn,[l.loading?(e.openBlock(),e.createElementBlock("span",vn)):e.createCommentVNode("",!0)]),l.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!f.value,"yswitch__label--right":f.value}])},e.toDisplayString(f.value?l.activeText:l.inactiveText),3)):e.createCommentVNode("",!0)],46,mn))}}),Re=fe(pn,[["__scopeId","data-v-0b157fc4"]]),gn=["src","alt"],yn=["src","alt"],wn=["src"],kn=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(),r=e.ref(),b=e.ref(),w=e.ref(!1),C=e.ref(!1),E=e.ref(!1),h=e.ref(!1),v=e.ref(!1),g=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),S=e.ref(""),U=e.ref(1),F=e.ref(!1),x=e.ref({visible:!1,src:"",top:0,left:0,width:400,height:400,isHoveringPreview:!1});let I=null;const R=e.ref({overflow:"",paddingRight:""}),oe={none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},X=e.computed(()=>n.className||""),H=e.computed(()=>{if(typeof n.radius=="number")return`${n.radius}px`;if(typeof n.radius=="string"){if(/(px|%|rem|em)$/.test(n.radius))return n.radius;if(oe[n.radius])return oe[n.radius]}return""}),K=e.computed(()=>H.value?{borderRadius:H.value}:{}),le=e.computed(()=>["yimage-image",n.preview?"is-previewable":""].filter(Boolean).join(" ")),B=e.computed(()=>{const G={objectFit:n.fit||"cover",backgroundColor:"#fff"};return n.width&&(G.width=typeof n.width=="number"?`${n.width}px`:n.width),n.height&&(G.height=typeof n.height=="number"?`${n.height}px`:n.height),H.value&&(G.borderRadius=H.value),G}),D=e.computed(()=>S.value?S.value:Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src),k=e.computed(()=>Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src),L=()=>{const G=document.createElement("div");G.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(G);const ne=G.offsetWidth-G.clientWidth;return document.body.removeChild(G),ne},A=()=>{if(R.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const ne=L();document.body.style.paddingRight=`${ne}px`}document.body.style.overflow="hidden"},N=()=>{document.body.style.overflow=R.value.overflow,document.body.style.paddingRight=R.value.paddingRight};let W=null;const J=()=>{!n.lazy||!f.value||(W=new IntersectionObserver(G=>{G.forEach(ne=>{ne.isIntersecting&&(h.value=!0,g.value=n.src,W==null||W.unobserve(ne.target))})},{rootMargin:"50px"}),W.observe(f.value))},j=G=>{w.value=!0,C.value=!1,E.value=!1,m("load",G)},Q=G=>{E.value=!0,C.value=!1,w.value=!1,m("error",G)},o=()=>{E.value=!1,C.value=!0,w.value=!1,e.nextTick(()=>{r.value&&(r.value.src=n.src)})},s=()=>Array.isArray(n.previewSrcList)?n.previewSrcList.find(Boolean)||n.src:n.previewSrcList||n.src,p=()=>{n.preview&&(n.previewSrcList||n.src)?T():o()},T=()=>{if(!n.preview)return;U.value=1;const G=s();if(r.value&&r.value.complete&&r.value.naturalWidth>0){S.value=G,e.nextTick(()=>{v.value=!0,A(),m("preview",G)});return}const ne=new Image;let ue=null,ve=!1;const we=()=>{ve||(ve=!0,ue&&(clearTimeout(ue),ue=null),S.value=G,e.nextTick(()=>{v.value=!0,A(),m("preview",G)}))};ue=setTimeout(()=>{we()},500),ne.onload=()=>{we()},ne.onerror=()=>{we()},ne.src=G,ne.complete&&we()},z=()=>{v.value=!1,setTimeout(()=>{N()},300)},_=G=>{const ne=G.deltaY<0?1:-1;let ve=U.value+ne*.1;ve=Math.max(.5,Math.min(2,ve)),U.value=ve};function Y(G){if(!(G instanceof HTMLElement))return;const ne=G.getBoundingClientRect(),ue=12,ve=window.innerWidth||document.documentElement.clientWidth,we=window.innerHeight||document.documentElement.clientHeight;let ge=ne.right+ue;ge+x.value.width>ve-ue&&(ge=ne.left-x.value.width-ue);let i=ne.top;i+x.value.height>we-ue&&(i=we-x.value.height-ue),i<ue&&(i=ue),ge<ue&&(ge=ue),x.value.left=ge,x.value.top=i}function O(G){n.hoverPreview&&(I&&(clearTimeout(I),I=null),x.value.isHoveringPreview=!1,x.value.src=k.value,x.value.width=n.hoverPreviewWidth,x.value.height=n.hoverPreviewHeight,x.value.visible=!0,Y(G.currentTarget))}function te(G){n.hoverPreview&&x.value.visible&&(I&&(clearTimeout(I),I=null),Y(G.currentTarget))}function ee(){n.hoverPreview&&(x.value.isHoveringPreview||(I&&(clearTimeout(I),I=null),I=setTimeout(()=>{x.value.isHoveringPreview||(x.value.visible=!1,x.value.src=""),I=null},50)))}function de(){n.hoverPreview&&(I&&(clearTimeout(I),I=null),x.value.isHoveringPreview=!0)}function me(){n.hoverPreview&&(x.value.isHoveringPreview=!1,x.value.visible=!1,x.value.src="",I&&(clearTimeout(I),I=null))}e.onMounted(()=>{n.lazy?J():h.value=!0,h.value&&(C.value=!0),F.value=!0}),e.onUnmounted(()=>{W&&W.disconnect(),v.value&&N(),I&&(clearTimeout(I),I=null)});const ie=()=>{n.src&&h.value&&(C.value=!0,E.value=!1,w.value=!1)};return e.watch(()=>g.value,ie),e.watch(()=>n.src,G=>{g.value=G||""}),c({retryLoad:o,closePreview:z}),(G,ne)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:f,class:e.normalizeClass(["yimage-container",X.value])},[!w.value&&!E.value&&!h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-placeholder",style:e.normalizeStyle(K.value)},[...ne[1]||(ne[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),C.value&&!E.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"yimage-loading",style:e.normalizeStyle(K.value)},[...ne[2]||(ne[2]=[e.createElementVNode("div",{class:"yimage-loading-content"},[e.createElementVNode("div",{class:"yimage-spinner"})],-1)])],4)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"yimage-error",style:e.normalizeStyle(K.value),onClick:p},[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:g.value,alt:l.alt,class:e.normalizeClass(le.value),onLoad:j,onError:Q,onClick:e.withModifiers(T,["stop"]),onMouseenter:O,onMouseleave:ee,onMousemove:te,style:e.normalizeStyle(B.value)},null,46,gn),[[e.vShow,w.value&&!E.value]]),n.preview&&(!w.value||C.value||E.value||!h.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"yimage-preview-trigger",onClick:e.withModifiers(T,["stop"])})):e.createCommentVNode("",!0),F.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-preview-mask",onClick:e.withModifiers(z,["self"]),onWheel:e.withModifiers(_,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["yimage-preview-content",{"is-active":v.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:b,src:D.value,alt:l.alt,class:"yimage-preview-image",style:e.normalizeStyle({transform:`scale(${U.value})`}),onClick:ne[0]||(ne[0]=e.withModifiers(()=>{},["stop"]))},null,12,yn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),F.value&&n.hoverPreview?(e.openBlock(),e.createBlock(e.Teleport,{key:5,to:"body"},[e.createVNode(e.Transition,{name:"hover-preview-fade",appear:""},{default:e.withCtx(()=>[x.value.visible&&x.value.src?(e.openBlock(),e.createElementBlock("div",{key:0,class:"yimage-hover-preview",style:e.normalizeStyle({top:x.value.top+"px",left:x.value.left+"px",width:x.value.width+"px",height:x.value.height+"px"}),onMouseenter:de,onMouseleave:me},[e.createElementVNode("img",{src:x.value.src,alt:"图片预览"},null,8,wn)],36)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),et=fe(kn,[["__scopeId","data-v-d791a239"]]),bn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(l){const c=l,t=e.ref(!1),n=e.ref();let m=null;const f=e.computed(()=>`y-dropdown__menu--${c.placement}`),r=e.computed(()=>{if(!c.menuWidth)return{};const v=typeof c.menuWidth=="number"?`${c.menuWidth}px`:c.menuWidth;return{width:v,minWidth:v,maxWidth:v}}),b=()=>{console.log("显示下拉菜单",t.value),!c.disabled&&(m&&(clearTimeout(m),m=null),t.value=!0,console.log("设置 visible 为 true",t.value),e.nextTick(()=>{C()}))},w=()=>{console.log("隐藏下拉菜单"),m=setTimeout(()=>{t.value=!1,console.log("设置 visible 为 false",t.value)},150)},C=()=>{if(!n.value)return;const v=n.value.querySelector(".y-dropdown__trigger"),g=n.value.querySelector(".y-dropdown__menu");if(!v||!g)return;const S=v.getBoundingClientRect(),U=g.getBoundingClientRect(),F=window.innerWidth,x=window.innerHeight;g.style.top="",g.style.left="",g.style.right="",g.style.bottom="",g.style.transform="";let I=0,R=0;switch(c.placement){case"bottom":I=S.height+4,R=0;break;case"top":I=-(U.height+4),R=0;break;case"right":I=0,R=S.width+4;break;case"left":I=0,R=-(U.width+4);break}let oe=S.top+I,X=S.left+R;if(c.placement==="bottom"||c.placement==="top"){const H=U.width||260;X+H>F-10&&(X=F-H-10),X<10&&(X=10)}if(c.placement==="left"||c.placement==="right"){const H=U.height||200;oe+H>x-10&&(oe=x-H-10),oe<10&&(oe=10)}g.style.top=`${oe}px`,g.style.left=`${X}px`},E=v=>{c.trigger==="click"&&n.value&&!n.value.contains(v.target)&&(t.value=!1)},h=()=>{t.value&&C()};return e.onMounted(()=>{c.trigger==="click"&&document.addEventListener("click",E),window.addEventListener("resize",h),window.addEventListener("scroll",h)}),e.onUnmounted(()=>{c.trigger==="click"&&document.removeEventListener("click",E),m&&clearTimeout(m),window.removeEventListener("resize",h),window.removeEventListener("scroll",h)}),e.watch(()=>c.menuWidth,()=>{t.value&&e.nextTick(()=>{C()})}),(v,g)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:n},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:b,onMouseleave:w},[e.renderSlot(v.$slots,"trigger",{},()=>[g[0]||(g[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",f.value]),style:e.normalizeStyle(r.value),onMouseenter:b,onMouseleave:w},[e.renderSlot(v.$slots,"default",{},()=>[g[1]||(g[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),g[2]||(g[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),g[3]||(g[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,t.value]])]),_:3})],512))}}),tt=fe(bn,[["__scopeId","data-v-ada3172a"]]),Cn=["aria-hidden"],En=["onKeydown"],Bn={key:0,class:"y-drawer-header"},xn={class:"y-drawer-title"},Nn={class:"y-drawer-body"},Vn={key:1,class:"y-drawer-footer"},Sn=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(l,{emit:c}){const t=l,n=c,m=e.computed({get:()=>t.modelValue,set:g=>n("update:modelValue",g)}),f=e.ref(null),r=e.computed(()=>t.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),b=e.computed(()=>t.placement==="right"?"rounded-left":"rounded-top"),w=e.computed(()=>{const g={};return t.placement==="right"?(g.width=typeof t.width=="number"?`${t.width}px`:String(t.width),g.height="100%",g.right="0",g.top="0"):(g.height=typeof t.height=="number"?`${t.height}px`:String(t.height),g.width="100%",g.bottom="0",g.left="0"),g});function C(){t.maskClosable&&E()}function E(){m.value&&(m.value=!1,n("close"))}function h(){t.closable&&E()}function v(g){g.key==="Escape"&&h()}return e.watch(()=>t.modelValue,g=>{g?(n("open"),requestAnimationFrame(()=>{var S;return(S=f.value)==null?void 0:S.focus()}),document.addEventListener("keydown",v),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",v),document.body.style.overflow="")}),e.onMounted(()=>{t.modelValue&&(document.addEventListener("keydown",v),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",v),document.body.style.overflow=""}),(g,S)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!m.value,style:e.normalizeStyle({zIndex:String(l.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:C}),e.createVNode(e.Transition,{name:r.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-drawer-panel",[`is-${l.placement}`,b.value]]),style:e.normalizeStyle(w.value),onKeydown:e.withKeys(e.withModifiers(h,["prevent","stop"]),["esc"]),tabindex:"-1"},[l.showHeader?(e.openBlock(),e.createElementBlock("div",Bn,[e.createElementVNode("div",xn,e.toDisplayString(l.title),1),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:E}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nn,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),g.$slots.footer?(e.openBlock(),e.createElementBlock("div",Vn,[e.renderSlot(g.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,En),[[e.vShow,m.value]])]),_:3},8,["name"])],12,Cn),[[e.vShow,m.value]])]))}}),lt=fe(Sn,[["__scopeId","data-v-6bf99d52"]]),Dn=["data-level"],$n={key:1,class:"ytree-node__expand-icon--empty"},Tn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Mn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Ln=["src","alt"],In={class:"ytree-node__custom-content"},zn={key:0,class:"ytree-node__children"},Hn=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(l){const c=l;e.inject("treeStore");const t=e.inject("getNodeKey"),n=e.inject("getNodeLabel"),m=e.inject("getNodeChildren"),f=e.inject("hasChildren"),r=e.inject("isEmployeeNode"),b=e.inject("getNodeIcon"),w=e.inject("getNodeDepth"),C=e.inject("isChildStyleNode"),E=e.inject("isNodeExpanded"),h=e.inject("isNodeChecked"),v=e.inject("isNodeIndeterminate"),g=e.inject("isNodeCurrent"),S=e.inject("isNodeHighlighted"),U=e.inject("handleExpandClick"),F=e.inject("handleCheckClick"),x=e.inject("handleNodeClick"),I=e.inject("handleNodeContextMenu");e.computed(()=>t(c.node));const R=e.computed(()=>n(c.node)),oe=e.computed(()=>b(c.node,c.rootNode)),X=e.computed(()=>w(c.rootNode,c.node)),H=e.computed(()=>E(c.node)),K=e.computed(()=>h(c.node)),le=e.computed(()=>v(c.node)),B=e.computed(()=>g(c.node)),D=e.computed(()=>S(c.node)),k=e.computed(()=>f(c.node)),L=e.computed(()=>m(c.node)),A=e.computed(()=>C(c.node,c.rootNode)),N=e.computed(()=>r(c.node)),W=e.computed(()=>c.level===1?8:8+(c.level-1)*16);return(J,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree-node",{"ytree-node--current":B.value,"ytree-node--highlight":D.value}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A.value}]),style:e.normalizeStyle({paddingLeft:`${W.value}px`}),"data-level":X.value,onClick:j[2]||(j[2]=Q=>e.unref(x)(c.node,c.node,null,c.rootNode)),onContextmenu:j[3]||(j[3]=Q=>e.unref(I)(Q,c.node,c.node,null))},[k.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":H.value}]),onClick:j[0]||(j[0]=e.withModifiers(Q=>e.unref(U)(c.node),["stop"]))},[...j[4]||(j[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",$n)),l.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":K.value,"is-indeterminate":le.value}]),onClick:j[1]||(j[1]=e.withModifiers(Q=>e.unref(F)(c.node),["stop"]))},[K.value?(e.openBlock(),e.createElementBlock("svg",Tn,[...j[5]||(j[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)])])):le.value?(e.openBlock(),e.createElementBlock("svg",Mn,[...j[6]||(j[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),l.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",l.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:oe.value,alt:N.value?"person":"dept"},null,8,Ln),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":N.value}])},e.toDisplayString(R.value),3),e.createElementVNode("div",In,[e.renderSlot(J.$slots,"node-content",{node:c.node,isCurrent:B.value,isExpanded:H.value,hasChildren:k.value},void 0,!0)])],46,Dn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[k.value&&H.value?(e.openBlock(),e.createElementBlock("div",zn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,Q=>(e.openBlock(),e.createBlock(nt,{key:e.unref(t)(Q),node:Q,"root-node":l.rootNode,level:l.level+1,"show-checkbox":l.showCheckbox,"icon-class":l.iconClass,"dept-icon-url":l.deptIconUrl,"person-icon-url":l.personIconUrl,"button-icon-url":l.buttonIconUrl,"child-style-level":l.childStyleLevel,"child-style-icon-url":l.childStyleIconUrl,"enable-child-style-custom-click":l.enableChildStyleCustomClick,disabled:l.disabled,"expand-on-click-node":l.expandOnClickNode},{"node-content":e.withCtx(o=>[e.renderSlot(J.$slots,"node-content",e.mergeProps({ref_for:!0},o),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))}}),nt=fe(Hn,[["__scopeId","data-v-f424ccf5"]]),_n={class:"ytree__container"},Kn="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",Pn="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",An=100,Rn=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(l,{expose:c,emit:t}){const n=l,m=t,f=e.computed(()=>n.data||[]),r=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set}),b=new Map;e.provide("treeStore",r),e.provide("getNodeKey",C),e.provide("getNodeLabel",E),e.provide("getNodeChildren",S),e.provide("hasChildren",g),e.provide("isEmployeeNode",h),e.provide("getNodeIcon",v),e.provide("getNodeDepth",U),e.provide("isChildStyleNode",F),e.provide("isNodeExpanded",x),e.provide("isNodeChecked",R),e.provide("isNodeIndeterminate",oe),e.provide("isNodeCurrent",X),e.provide("isNodeHighlighted",H),e.provide("handleExpandClick",le),e.provide("handleCheckClick",K),e.provide("handleNodeClick",D),e.provide("handleNodeContextMenu",k);const w=e.computed(()=>n.restrictAutoExpandFromLevel&&n.restrictAutoExpandFromLevel>0?n.restrictAutoExpandFromLevel:void 0);function C(o){return o[n.nodeKey]||o.id||Math.random()}function E(o){var s;return((s=n.props)!=null&&s.label?o[n.props.label]:void 0)||o.label||""}function h(o){var s;return!!((s=o==null?void 0:o.data)!=null&&s.isEmployee)}function v(o,s){var Y;const p=n.deptIconUrl||Kn,T=n.personIconUrl||Pn,z=n.buttonIconUrl||"",_=n.childStyleIconUrl||"";return s&&_&&F(o,s)?_:(Y=o==null?void 0:o.data)!=null&&Y.isButton&&z?z:h(o)?T:p}function g(o){var p;const s=((p=n.props)!=null&&p.children?o[n.props.children]:void 0)||o.children;return s&&s.length>0}function S(o){var s;return((s=n.props)!=null&&s.children?o[n.props.children]:void 0)||o.children||[]}function U(o,s,p=1){if(o===s)return p;const T=S(o);for(const z of T){const _=U(z,s,p+1);if(_>0)return _}return 0}function F(o,s){return!n.childStyleLevel||n.childStyleLevel<1?!1:U(s,o)===n.childStyleLevel}function x(o){const s=C(o);return r.value.expandedKeys.has(s)}function I(o,s=new Set){const p=C(o);if(s.has(p))return{checked:!1,indeterminate:!1};s.add(p);const T=b.get(p);if(T&&Date.now()-T.timestamp<An)return{checked:T.checked,indeterminate:T.indeterminate};const z=r.value.checkedKeys.has(p);if(!g(o)){const me={checked:z,indeterminate:!1};return b.set(p,{...me,timestamp:Date.now()}),me}const _=S(o);if(_.length===0){const me={checked:z,indeterminate:!1};return b.set(p,{...me,timestamp:Date.now()}),me}let Y=0,O=0;for(const me of _){const ie=I(me,s);ie.checked?Y++:ie.indeterminate&&O++}let te,ee;te=Y===_.length&&O===0,ee=!te&&(Y>0||O>0);const de={checked:te,indeterminate:ee};return b.set(p,{...de,timestamp:Date.now()}),de}function R(o){return I(o).checked}function oe(o){return I(o).indeterminate}function X(o){const s=C(o);return r.value.currentKey===s}function H(o){const s=C(o);return r.value.highlightedKeys.has(s)}function K(o){if(n.disabled)return;const s=C(o),T=!r.value.checkedKeys.has(s);function z(O){b.delete(C(O)),g(O)&&S(O).forEach(z)}z(o);const _=new Set(r.value.expandedKeys);T?r.value.checkedKeys.add(s):r.value.checkedKeys.delete(s);function Y(O,te){O.forEach(ee=>{const de=C(ee);te?r.value.checkedKeys.add(de):r.value.checkedKeys.delete(de),b.delete(de),g(ee)&&Y(S(ee),te)})}Y(S(o),T),B(),r.value.expandedKeys=_,m("check-change",o,T,!1),m("check",o,T,!1),m("checked-keys-change",Array.from(r.value.checkedKeys))}function le(o){const s=C(o);r.value.expandedKeys.has(s)?(r.value.expandedKeys.delete(s),m("node-collapse",o,o,null)):(r.value.expandedKeys.add(s),m("node-expand",o,o,null))}function B(){const o=new Map,s=[],p=new Map;function T(_,Y){_.forEach(O=>{const te=C(O);s.push(O),p.set(te,O),Y&&o.set(te,Y),g(O)&&T(S(O),O)})}T(f.value);function z(_){if(!g(_))return;const Y=S(_),O=C(_);b.delete(O);let te=0,ee=0;for(const de of Y){const me=I(de);me.checked?te++:me.indeterminate&&ee++}te===Y.length&&ee===0||te>0||ee>0?r.value.checkedKeys.add(O):r.value.checkedKeys.delete(O)}for(let _=s.length-1;_>=0;_--)z(s[_])}function D(o,s,p,T){if(n.disabled)return;const z=T?F(o,T):!1;if(n.enableChildStyleCustomClick&&z){m("child-node-click",o,s,p);return}if(n.expandOnClickNode&&g(o)){le(o);return}r.value.currentNode=o,r.value.currentKey=C(o),n.showCheckbox&&K(o),m("node-click",o,s,p)}function k(o,s,p,T){n.disabled||m("node-contextmenu",o,s,p,T)}e.watch(()=>n.defaultExpandedKeys,o=>{if(o){const s=w.value;if(s){let p=function(Y,O,te=1){for(const ee of O){if(C(ee)===Y)return te;if(g(ee)){const de=p(Y,S(ee),te+1);if(de>0)return de}}return 0},T=function(Y,O,te){Y.forEach(ee=>{O<te&&g(ee)?(_.add(C(ee)),T(S(ee),O+1,te)):O<te&&g(ee)})};const z=(o||[]).filter(Y=>{const O=p(Y,f.value,1);return O>0&&O<s}),_=new Set(z);T(f.value,1,s),r.value.expandedKeys.forEach(Y=>{p(Y,f.value,1)>=s&&_.add(Y)}),r.value.expandedKeys=_}else r.value.expandedKeys=new Set(o)}},{immediate:!0});function L(){if(n.defaultExpandAll){let o=function(T,z=1){T.forEach(_=>{if(!g(_))return;const Y=S(_);if(p){if(z>=p)return;z+1===p||s.add(C(_)),o(Y,z+1)}else s.add(C(_)),o(Y,z+1)})};const s=new Set,p=w.value;o(f.value,1),r.value.expandedKeys=s}}function A(){if(n.defaultCheckedKeys&&n.defaultCheckedKeys.length>0){let o=function(z,_=[]){z.forEach(Y=>{const O=C(Y),te=[..._,O];s.has(O)&&_.forEach(ee=>p.add(ee)),g(Y)&&o(S(Y),te)})};const s=new Set(n.defaultCheckedKeys),p=new Set;if(o(f.value),w.value)return;r.value.expandedKeys=p}}let N=null;const W=()=>{N&&clearTimeout(N),N=setTimeout(()=>{L(),N=null},50)};e.watch(()=>n.defaultExpandAll,L,{immediate:!0}),e.watch(()=>f.value,W,{deep:!0}),e.watch(()=>n.defaultCheckedKeys,o=>{o?(r.value.checkedKeys=new Set(o),n.enableFourthLevelSpecialHandling||A()):r.value.checkedKeys.clear()},{immediate:!0});function J(o){try{let s=function(z,_,Y=[]){for(const O of z){const te=C(O),ee=[...Y,te];if(te===_)return ee;if(g(O)){const de=s(S(O),_,ee);if(de)return de}}return null};const p=Array.isArray(o)?o:[];if(p.length===0)return;r.value.highlightedKeys.clear();const T=new Set(r.value.expandedKeys);p.forEach(z=>{const _=s(f.value,z);_&&_.length>0&&(_.slice(0,-1).forEach(Y=>T.add(Y)),r.value.highlightedKeys.add(_[_.length-1]))}),r.value.expandedKeys=T}catch(s){process.env.NODE_ENV==="development"&&console.warn("highlightAndExpandByIds 执行失败",s)}}function j(){r.value.highlightedKeys.clear()}function Q(){r.value.currentNode=null,r.value.currentKey=null}return c({highlightAndExpandByIds:J,clearHighlights:j,clearCurrentNode:Q}),e.watch(()=>n.defaultSelectedKeys,o=>{o&&(r.value.selectedKeys=new Set(o))},{immediate:!0}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${l.size}`,{"ytree--disabled":l.disabled}]])},[e.createElementVNode("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,p=>(e.openBlock(),e.createBlock(nt,{key:C(p),node:p,"root-node":p,level:1,"show-checkbox":l.showCheckbox,"icon-class":l.iconClass,"dept-icon-url":l.deptIconUrl,"person-icon-url":l.personIconUrl,"button-icon-url":l.buttonIconUrl,"child-style-level":l.childStyleLevel,"child-style-icon-url":l.childStyleIconUrl,"enable-child-style-custom-click":l.enableChildStyleCustomClick,disabled:l.disabled,"expand-on-click-node":l.expandOnClickNode},{"node-content":e.withCtx(T=>[e.renderSlot(o.$slots,"node-content",e.mergeProps({ref_for:!0},T),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))}}),ot=fe(Rn,[["__scopeId","data-v-1b63590e"]]),Fn={class:"query-encapsulation"},Wn={class:"query-encapsulation__container"},Yn={class:"query-encapsulation__content"},jn={class:"query-encapsulation__fields"},On={class:"query-encapsulation__field-wrapper"},Un={key:0,class:"query-encapsulation__field-label"},qn={key:0,class:"query-encapsulation__toggle"},Gn={class:"query-encapsulation__actions"},Zn={class:"query-encapsulation__actions-group"},Qn=e.defineComponent({__name:"QueryEncapsulation",props:{Iflabel:{type:Boolean,default:!0},fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(l,{expose:c,emit:t}){const n=l,m=t,f=e.ref(!1),r=e.reactive({}),b=["select","date","daterange","switch"];let w;const C=e.computed(()=>n.fields.filter(B=>!B.hidden)),E=e.computed(()=>f.value?C.value:C.value.slice(0,n.maxVisibleFields)),h=e.computed(()=>C.value.length>n.maxVisibleFields);function v(B){switch(B){case"select":return Pe;case"date":case"daterange":return Ae;case"switch":return Re;case"input":default:return Ke}}function g(B,D){r[B]=D;const k=n.fields.find(L=>L.key===B);k&&S(k)}function S(B){m("field-change",B,r[B.key]),m("update:modelValue",{...r}),b.includes(B.type)&&X()}function U(B,D){B.onSwitchChange&&typeof B.onSwitchChange=="function"&&B.onSwitchChange(D,B),S(B)}function F(){const B=H(r),D=K(B),k={...r};m("search",{data:D,raw:k})}function x(){Object.keys(r).forEach(B=>{const D=n.fields.find(k=>k.key===B);(D==null?void 0:D.type)==="daterange"?r[B]={startDate:null,endDate:null}:(D==null?void 0:D.type)==="date"?r[B]=null:(D==null?void 0:D.type)==="switch"?r[B]=D.falseValue!==void 0?D.falseValue:!1:(D==null?void 0:D.type)==="select"&&D.multiple?r[B]=[]:r[B]=""}),m("reset"),m("update:modelValue",{...r})}function I(){f.value=!f.value}function R(B){return B.type!=="input"?{}:{enter:()=>oe(),paste:()=>oe()}}async function oe(){await e.nextTick(),F()}function X(){w&&clearTimeout(w),w=setTimeout(()=>{w=void 0,e.nextTick().then(()=>F())},0)}function H(B){const D={};return Object.keys(B).forEach(k=>{const L=n.fields.find(W=>W.key===k),A=B[k],N=typeof A=="string"?A.trim():A;if(Array.isArray(N)){N.length>0&&(D[k]=N);return}if(!(N==null||N==="")){if(typeof N=="object"&&N.startDate&&N.endDate){N.startDate&&N.endDate&&(D[k]=N);return}if(L&&(L.type==="date"||L.type==="daterange")){N!==0&&(D[k]=N);return}D[k]=N}}),D}function K(B){const D={};return Object.keys(B).forEach(k=>{const L=B[k],A=n.fields.find(N=>N.key===k);if(A)if(A.type==="daterange"&&typeof L=="object"){const N=A.startKey||`${k}Start`,W=A.endKey||`${k}End`;L.startDate&&L.endDate&&L.startDate!==0&&L.endDate!==0&&(A.format==="timestamp"?(D[N]=new Date(L.startDate).getTime(),D[W]=new Date(L.endDate).getTime()):(D[N]=L.startDate,D[W]=L.endDate))}else A.type==="date"&&L&&L!==0&&A.format==="timestamp"?D[k]=new Date(L).getTime():D[k]=L;else D[k]=L}),D}function le(){n.fields.forEach(B=>{var D,k,L,A,N;r[B.key]===void 0&&(B.type==="daterange"?r[B.key]=((D=n.modelValue)==null?void 0:D[B.key])||{startDate:null,endDate:null}:B.type==="date"?r[B.key]=((k=n.modelValue)==null?void 0:k[B.key])||null:B.type==="switch"?r[B.key]=((L=n.modelValue)==null?void 0:L[B.key])!==void 0?n.modelValue[B.key]:B.falseValue!==void 0?B.falseValue:!1:B.type==="select"&&B.multiple?r[B.key]=((A=n.modelValue)==null?void 0:A[B.key])!==void 0?n.modelValue[B.key]:[]:r[B.key]=((N=n.modelValue)==null?void 0:N[B.key])||"")})}return e.watch(()=>n.modelValue,B=>{B&&Object.assign(r,B)},{deep:!0,immediate:!0}),e.onMounted(()=>{le()}),e.onBeforeUnmount(()=>{w&&(clearTimeout(w),w=void 0)}),c({search:F,reset:x}),(B,D)=>(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("div",Wn,[e.createElementVNode("div",Yn,[e.createElementVNode("div",jn,[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(E.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k.key,class:"query-encapsulation__field-item"},[e.renderSlot(B.$slots,`field-${k.key}`,{field:k,value:r[k.key],updateValue:L=>g(k.key,L)},()=>[e.createElementVNode("div",On,[l.Iflabel||k.type==="switch"?(e.openBlock(),e.createElementBlock("label",Un,e.toDisplayString(k.label),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(v(k.type)),e.mergeProps({modelValue:r[k.key],"onUpdate:modelValue":L=>r[k.key]=L,placeholder:k.placeholder||`请输入${k.label}`,options:k.options,clearable:k.clearable!==!1,size:k.size||"small",width:k.width||"180px",format:k.format||"timestamp","include-time":k.includeTime||!1,filterable:k.filterable===!0,multiple:k.multiple===!0,"true-value":k.trueValue,"false-value":k.falseValue,"active-text":k.activeText,"inactive-text":k.inactiveText,"show-text":k.showText,"active-color":k.activeColor||(k.type==="switch"?"#1B2433":void 0),"inactive-color":k.inactiveColor},e.toHandlers(R(k)),{onInput:L=>k.type!=="switch"?S(k):void 0,onChange:L=>k.type==="switch"?U(k,L):S(k)}),null,16,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","multiple","true-value","false-value","active-text","inactive-text","show-text","active-color","inactive-color","onInput","onChange"]))])],!0)]))),128))]),_:3}),h.value?(e.openBlock(),e.createElementBlock("div",qn,[e.createVNode(Se,{variant:"secondary",size:"small",onClick:I},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":f.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Gn,[e.createElementVNode("div",Zn,[e.createVNode(Se,{variant:"primary",size:"small",onClick:F,loading:l.loading},{default:e.withCtx(()=>[...D[0]||(D[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(Se,{variant:"secondary",size:"small",onClick:x,loading:l.loading},{default:e.withCtx(()=>[...D[1]||(D[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(B.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),at=fe(Qn,[["__scopeId","data-v-68014a1a"]]),Jn={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Xn={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},eo={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},to=["textContent"],lo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(l){const c=l,t=e.ref(!1);let n,m=0,f=0;e.onMounted(()=>{requestAnimationFrame(()=>{t.value=!0,c.duration&&c.duration>0&&r(c.duration)})}),e.onBeforeUnmount(()=>{b()});function r(v){m=v,f=Date.now(),n=window.setTimeout(()=>E(),v)}function b(){n&&(window.clearTimeout(n),n=void 0)}function w(){if(n&&c.duration&&c.duration>0){b();const v=Date.now()-f;m=Math.max(0,m-v)}}function C(){c.duration&&c.duration>0&&m>0&&r(m)}function E(){t.value=!1}function h(){var v;(v=c.onClose)==null||v.call(c,c.id)}return(v,g)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:h},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${l.type}`]]),style:e.normalizeStyle({zIndex:l.zIndex}),role:"status","aria-live":"polite",onMouseenter:w,onMouseleave:C},[e.createElementVNode("span",{class:e.normalizeClass(["y-msg__icon",`y-msg__icon--${l.type}`]),"aria-hidden":"true"},[l.type==="success"?(e.openBlock(),e.createElementBlock("svg",Jn,[...g[0]||(g[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):l.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Xn,[...g[1]||(g[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",eo,[...g[2]||(g[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(l.message)},null,8,to),l.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:E},"✕")):e.createCommentVNode("",!0)],38),[[e.vShow,t.value]])]),_:1}))}}),no=fe(lo,[["__scopeId","data-v-db173617"]]);let oo=1;const _e=12,Ee=[];function ao(){let l=20;return Ee.forEach(c=>{l+=c.height+_e}),l}function Ue(l){const c=Ee.findIndex(f=>f.id===l);if(c===-1)return;const{el:t}=Ee[c],n=t.firstElementChild;if(n){const f=window.getComputedStyle(n).top;n.style.top=f,n.classList.add("is-leaving"),n.style.willChange="opacity, transform"}Ee[c].leaving=!0,Ie(),setTimeout(()=>{e.render(null,t),t.parentNode&&t.parentNode.removeChild(t);const f=Ee.findIndex(r=>r.id===l);f!==-1&&Ee.splice(f,1),Ie()},260)}function He(l){var f;const c=oo++,t=document.createElement("div");document.body.appendChild(t);const n=e.createVNode(no,{id:c,type:l.type||"success",message:l.message,duration:l.duration??2500,offset:ao(),zIndex:3e3+c,closable:l.closable??!1,onClose:r=>Ue(r)});e.render(n,t);const m=((f=t.firstElementChild)==null?void 0:f.offsetHeight)||0;return Ee.push({id:c,el:t,vm:n,height:m,leaving:!1}),Ie(),requestAnimationFrame(()=>{const r=t.firstElementChild;if(!r)return;const b=r.offsetHeight||m||0,w=Ee.find(C=>C.id===c);w&&(w.height=b,Ie())}),{close:()=>Ue(c)}}const De={success(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"success",message:l})},warning(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"warning",message:l})},error(l,c){return He({...typeof c=="number"?{duration:c}:c||{},type:"error",message:l})}};typeof window<"u"&&(window.YMessage=De,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=De));function Ie(){let l=20;Ee.forEach(c=>{const t=c.el.firstElementChild;if(!t)return;const n=l;if(t.style.transform=`translate(-50%, ${n}px)`,t.style.top||(t.style.top="0px"),!c.leaving)l+=(t.offsetHeight||c.height)+_e;else{const m=t.offsetHeight||c.height;l+=m+_e}})}const ro={class:"hint-tag-popup-content"},io=["title"],so=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(l,{expose:c}){const t=l,n=e.ref(null),m=e.ref(null),f=e.ref(!1),r=e.ref(!1);let b=null;const w=()=>{if(!t.maxLines||!n.value){f.value=!1;return}const H=n.value,K=H.style.maxHeight,le=H.classList.contains("hint-tag-content-clamp");H.style.maxHeight="none",le&&H.classList.remove("hint-tag-content-clamp");const B=H.scrollHeight,D=parseFloat(getComputedStyle(H).lineHeight)||18,k=t.maxLines*D;H.style.maxHeight=K,le&&H.classList.add("hint-tag-content-clamp"),f.value=B>k},C=()=>{t.maxLines&&f.value&&(b&&(clearTimeout(b),b=null),r.value=!0,setTimeout(()=>{g()},0))},E=()=>{b=window.setTimeout(()=>{r.value=!1,b=null},100)},h=()=>{b&&(clearTimeout(b),b=null)},v=()=>{r.value=!1},g=()=>{if(!m.value||!n.value)return;const H=n.value.getBoundingClientRect(),K=m.value.getBoundingClientRect(),le=window.innerWidth,B=window.innerHeight,D=window.scrollX||window.pageXOffset,k=window.scrollY||window.pageYOffset;let L=0,A=0;switch(t.position){case"right":L=H.right+12,A=H.top+k,L+K.width>le+D&&(L=H.left-K.width-12),A=H.top+k+(H.height-K.height)/2,A<k&&(A=k+8),A+K.height>k+B&&(A=k+B-K.height-8);break;case"left":L=H.left-K.width-12,A=H.top+k,L<D&&(L=H.right+12),A=H.top+k+(H.height-K.height)/2,A<k&&(A=k+8),A+K.height>k+B&&(A=k+B-K.height-8);break;case"top":L=H.left+D+(H.width-K.width)/2,A=H.top-K.height-12,A<k&&(A=H.bottom+k+12),L<D+8&&(L=D+8),L+K.width>D+le&&(L=D+le-K.width-8);break;case"bottom":L=H.left+D+(H.width-K.width)/2,A=H.bottom+k+12,A+K.height>k+B&&(A=H.top-K.height-12),L<D+8&&(L=D+8),L+K.width>D+le&&(L=D+le-K.width-8);break}m.value.style.left=`${L}px`,m.value.style.top=`${A}px`};e.onUpdated(()=>{w()});const S=e.ref(t.defaultExpanded),U=()=>{S.value=!S.value},F=()=>{S.value&&(S.value=!1)},x=()=>{S.value||(S.value=!0)};c({toggle:U,isExpanded:S,collapse:F,expand:x});const I=e.inject("registerHintTag",null),R=e.inject("unregisterHintTag",null),oe=e.inject("notifyHintTagStateChange",null),X={collapse:F,expand:x,toggle:U,get isExpanded(){return S.value}};return e.watch(()=>S.value,()=>{oe&&oe(),setTimeout(()=>{w()},0)}),e.watch(()=>[t.content,t.maxLines],()=>{setTimeout(()=>{w()},0)}),e.watch(r,H=>{H?(setTimeout(()=>{g()},0),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g)):(window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g))}),e.onMounted(()=>{w(),I&&I(X)}),e.onUnmounted(()=>{R&&R(X),b&&(clearTimeout(b),b=null),window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}),(H,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hint-tag-wrapper",`hint-tag-wrapper-${l.position}`])},[e.createVNode(e.Transition,{name:"hint-slide"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["hint-tag",`hint-tag-${l.position}`]),style:e.normalizeStyle({width:l.position==="top"||l.position==="bottom"?"auto":l.width,borderColor:l.borderColor})},[e.createElementVNode("div",{ref_key:"contentRef",ref:n,class:e.normalizeClass(["hint-tag-content",{"hint-tag-content-clamp":l.maxLines}]),style:e.normalizeStyle(l.maxLines?{"--line-clamp":l.maxLines,lineHeight:"1.5",maxHeight:`${l.maxLines*1.5}em`}:{}),onMouseenter:C,onMouseleave:E},[e.renderSlot(H.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.content),1)],!0)],38),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"popup-fade"},{default:e.withCtx(()=>[r.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popupRef",ref:m,class:"hint-tag-popup",onMouseenter:h,onMouseleave:v},[e.createElementVNode("div",ro,[e.renderSlot(H.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.content),1)],!0)])],544)):e.createCommentVNode("",!0)]),_:3})])),e.createElementVNode("div",{class:"hint-tag-toggle",onClick:U},[...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,S.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-${l.position}`]),onClick:U,title:l.tooltip||l.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,io),[[e.vShow,!S.value]])]),_:1})],2))}}),co=fe(so,[["__scopeId","data-v-9bfcff29"]]),qe={YButton:Se,YInput:Ke,YTable:Ge,YSelect:Pe,YPagination:Ze,YBadge:Qe,YDialog:Je,YPopover:Xe,YTime:Ae,YSwitch:Re,YImage:et,YDropdown:tt,YDrawer:lt,YTree:ot,QueryEncapsulation:at,HintTag:co},uo={install(l){Object.keys(qe).forEach(c=>{l.component(c,qe[c])}),l.config.globalProperties.$message=De,typeof window<"u"&&(window.YMessage=De)}};exports.QueryEncapsulation=at;exports.YBadge=Qe;exports.YButton=Se;exports.YDialog=Je;exports.YDrawer=lt;exports.YDropdown=tt;exports.YImage=et;exports.YInput=Ke;exports.YMessage=De;exports.YPagination=Ze;exports.YPopover=Xe;exports.YSelect=Pe;exports.YSwitch=Re;exports.YTable=Ge;exports.YTime=Ae;exports.YTree=ot;exports.default=uo;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|