@nhdropshipping/y-components 1.0.21 → 1.0.23
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/components/yimage.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +757 -739
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yimage.vue.d.ts","sourceRoot":"","sources":["../../src/components/yimage.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"yimage.vue.d.ts","sourceRoot":"","sources":["../../src/components/yimage.vue"],"names":[],"mappings":"AAoGA;AAOA,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAA;IAC1D,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;UANQ,OAAO;SAHR,MAAM;aAIF,OAAO;SACX,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY;YACjD,MAAM,GAAG,MAAM;eACZ,MAAM;;AA+rBpB,wBAQG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
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"),He=["type","disabled","aria-busy","aria-disabled"],Fe={class:"content"},Re={key:1,class:"y-btn-group",role:"group"},Ye=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Ae={class:"content"},We={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Pe={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Oe={key:2},je=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(t,{emit:g}){const n=t,o=g;function v(k){if(n.disabled||n.loading){k.preventDefault(),k.stopPropagation();return}o("click",k)}const f=e.computed(()=>{switch(n.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),m=e.computed(()=>Array.isArray(n.groupItems)&&n.groupItems.length>0);function N(k,x){if(n.disabled||n.loading||k.disabled||k.loading){x.preventDefault(),x.stopPropagation();return}o("group-click",k.value,x)}return(k,x)=>m.value?(e.openBlock(),e.createElementBlock("div",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.groupItems,(p,w)=>{var d;return e.openBlock(),e.createElementBlock("button",{key:p.value??w,class:e.normalizeClass(["y-btn",[`y-btn--${p.variant??t.variant}`,`y-btn--${p.size??t.size}`,"is-grouped",w===0?"group-pos-start":w===(((d=t.groupItems)==null?void 0:d.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":p.loading||t.loading}]]),type:t.htmlType,disabled:(p.disabled??!1)||t.disabled||t.loading||p.loading,"aria-busy":p.loading||t.loading?"true":"false","aria-disabled":(p.disabled??!1)||t.disabled||t.loading||p.loading?"true":"false","aria-label":p.ariaLabel||p.label,onClick:b=>N(p,b)},[e.createElementVNode("span",Ae,[p.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",We,[...x[0]||(x[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)])])):p.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",Pe,[...x[1]||(x[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),p.label&&!p.onlyIcon?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(p.label),1)):e.createCommentVNode("",!0)])],10,Ye)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${t.variant}`,`y-btn--${t.size}`,{"is-block":t.block,"is-loading":t.loading},t.groupPosition!=="single"?"is-grouped":"",f.value]]),type:t.htmlType,disabled:t.disabled||t.loading,"aria-busy":t.loading?"true":"false","aria-disabled":t.disabled||t.loading?"true":"false",onClick:v},[e.createElementVNode("span",Fe,[e.renderSlot(k.$slots,"default",{},void 0,!0)])],10,He))}}),le=(t,g)=>{const n=t.__vccOpts||t;for(const[o,v]of g)n[o]=v;return n},me=le(je,[["__scopeId","data-v-40819241"]]),qe=["id","name","type","placeholder","autocomplete","inputmode","disabled","required","value"],Ue=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"},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(null),f=e.ref(""),m=e.ref(!1),N=e.ref(!1),k=e.ref(n.placeholder||"");e.watch(()=>n.placeholder,d=>{N.value||(k.value=d||"")});function x(d){const b=d.target;m.value=!0,o("update:modelValue",b.value)}function p(){N.value=!0,n.clearOnFocus&&(f.value=n.modelValue||"",m.value=!1,k.value=f.value||n.placeholder||"",o("update:modelValue",""))}function w(){N.value=!1,n.clearOnFocus&&!m.value&&(!n.modelValue||n.modelValue==="")&&o("update:modelValue",f.value),k.value=n.placeholder||""}return(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":t.block}]),style:e.normalizeStyle({width:t.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:v,class:e.normalizeClass(["y-input",`y-input--${t.size}`]),id:t.id,name:t.name,type:t.type,placeholder:k.value,autocomplete:t.autocomplete,inputmode:t.inputmode,disabled:t.disabled,required:t.required,value:t.modelValue,onInput:x,onFocus:p,onBlur:w},null,42,qe)],6))}}),ke=le(Ue,[["__scopeId","data-v-e4bfe1f3"]]),Ze={key:0,class:"bulk-bar"},Qe={class:"bulk-left"},Je={class:"bulk-actions"},Xe={class:"card"},Ge={class:"table"},et={key:0,style:{width:"40px","min-width":"40px"}},tt={key:0,class:"col-select"},nt=["checked"],ot={key:0,class:"loading-overlay"},lt={key:1,class:"empty-overlay"},at={key:0,style:{width:"40px","min-width":"40px"}},st={key:0,class:"col-select"},rt=["value","checked","onChange"],it=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}},emits:["edit","select","update:selectedItems","page-change","page-size-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(n.currentPage||1),f=e.ref(n.pageSize),m=e.ref([]),N=e.ref("none"),k=e.ref(),x=e.ref(),p=e.ref(),w=e.ref(),d=e.ref([]),b=e.ref(),R=e.ref({show:!1,thumbHeight:40,thumbTop:0});let A=!1,L=0,B=0;const S=e.ref(0),D=e.computed(()=>{if(!n.searchKeyword||!n.searchFields.length)return n.data;const E=n.searchKeyword.toLowerCase();return n.data.filter(C=>n.searchFields.some(_=>{const $=X(C,_);return String($).toLowerCase().includes(E)}))}),M=e.computed(()=>(n.pagination,D.value)),H=e.computed(()=>{if(!n.selectable)return!1;const E=M.value.map((C,_)=>q(C,_));return E.length>0&&E.every(C=>m.value.includes(C))}),j=e.computed(()=>{const E=[];let C=n.selectable?40:0;for(let _=0;_<n.columns.length;_++){const $=n.columns[_];if($.fixed==="left"){let T=80;if($.width){const F=parseFloat($.width);T=isNaN(F)?80:F}else if(d.value[_]){const F=parseFloat(d.value[_]);T=isNaN(F)?80:F}E.push(C),C+=T}}return E}),W=e.computed(()=>{const E=[];let C=0;const _=[];for(let $=n.columns.length-1;$>=0;$--){const T=n.columns[$];if(T.fixed==="right"){let F=80;if(T.width){const U=parseFloat(T.width);F=isNaN(U)?80:U}else if(d.value[$]){const U=parseFloat(d.value[$]);F=isNaN(U)?80:U}_.push({index:$,width:F})}}for(let $=0;$<_.length;$++)E.push(C),C+=_[$].width;return E});function ee(E,C){if(C==="left"){let _=0;for(let $=0;$<E;$++)n.columns[$].fixed==="left"&&_++;return _}else{let _=0;for(let $=n.columns.length-1;$>E;$--)n.columns[$].fixed==="right"&&_++;return _}}function q(E,C){return typeof n.rowKey=="function"?n.rowKey(E):E[n.rowKey]||C}function X(E,C){return C.split(".").reduce((_,$)=>_==null?void 0:_[$],E)}function oe(E,C=!1){const _=[];return E.align&&_.push(`text-${E.align}`),E.fixed==="right"&&(_.push("col-fixed-right"),C&&_.push("col-fixed-right-header")),E.fixed==="left"&&(_.push("col-fixed-left"),C&&_.push("col-fixed-left-header")),_.join(" ")}function ne(E,C,_){const $={};if(E.width?($.width=E.width,$.minWidth=E.width,$.maxWidth=E.width):($.width="auto",$.minWidth="80px",$.maxWidth="none"),E.fixed==="left"){const T=ee(C,"left"),F=j.value[T]||0;$.left=`${F}px`,$.zIndex=_?`${10+T}`:`${5+T}`}else if(E.fixed==="right"){const T=ee(C,"right"),F=W.value[T]||0;_?$.right=`${F-3}px`:$.right=`${F}px`,$.zIndex=_?`${10+T}`:`${5+T}`}return $}function G(E,C){const _=X(E,C.key);return C.formatter?C.formatter(_,E):_||""}function K(E){m.value.includes(E)?m.value=m.value.filter(C=>C!==E):m.value=[...m.value,E],o("select",m.value),o("update:selectedItems",m.value)}function Y(){const E=M.value.map((C,_)=>q(C,_));if(E.every(C=>m.value.includes(C)))m.value=m.value.filter(C=>!E.includes(C));else{const C=new Set([...m.value,...E]);m.value=Array.from(C)}o("select",m.value),o("update:selectedItems",m.value)}function u(){m.value=[],o("select",m.value),o("update:selectedItems",m.value)}e.watch(()=>n.searchKeyword,()=>{v.value=1}),e.watch(()=>n.data,()=>{n.total||(v.value=1)},{deep:!0});function c(E){v.value=E,o("page-change",E)}function l(E){f.value=E,v.value=1,o("page-size-change",E)}e.watch(()=>n.currentPage,E=>{const C=typeof E=="number"&&E>0?E:1;v.value!==C&&(v.value=C)}),e.watch(()=>n.pageSize,E=>{const C=typeof E=="number"&&E>0?E:10;f.value!==C&&(f.value=C)});function s(){k.value&&e.nextTick(()=>{const E=k.value.getBoundingClientRect(),C=window.innerHeight,_=E.top,$=k.value.querySelector(".table-header"),T=$?$.offsetHeight:40,F=k.value.querySelector(".ypagination"),U=F?F.offsetHeight:60,a=k.value.querySelector(".bulk-bar"),i=a?a.offsetHeight:0,V=T+U+i+20,I=C-_-V,Z=Math.max(200,I),J=k.value.querySelector(".table-body-wrap .table");J&&(J.offsetHeight>I?N.value=`${Z}px`:N.value="none")})}let r=!1;function h(){!x.value||!p.value||r||x.value.scrollLeft!==p.value.scrollLeft&&(r=!0,x.value.scrollLeft=p.value.scrollLeft,requestAnimationFrame(()=>{r=!1}))}function y(){!x.value||!p.value||r||p.value.scrollLeft!==x.value.scrollLeft&&(r=!0,p.value.scrollLeft=x.value.scrollLeft,requestAnimationFrame(()=>{r=!1}))}function z(){e.nextTick(()=>{if(!p.value)return;const E=p.value,C=E.scrollHeight,_=E.clientHeight,$=E.scrollTop,T=C>_+1;if(R.value.show=T,!T)return;const F=24,U=_/C,a=b.value?b.value.clientHeight:_,i=Math.max(F,Math.floor(a*U));R.value.thumbHeight=i;const V=Math.max(0,a-i),I=Math.max(1,C-_);R.value.thumbTop=Math.min(V,Math.floor($/I*V))})}function P(E){if(!A||!p.value||!b.value)return;E.preventDefault();const C=b.value.clientHeight,_=Math.max(0,C-R.value.thumbHeight),$=p.value,T=$.scrollHeight,F=$.clientHeight,U=Math.max(1,T-F),i=(E.clientY-L)/Math.max(1,_)*U;$.scrollTop=Math.min(U,Math.max(0,B+i)),z()}function O(){A=!1,window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",O)}function re(){e.nextTick(()=>{var _;if(d.value.length===n.columns.length&&d.value.every($=>!!$))return;const E=[];for(const $ of n.columns)if($.width&&typeof $.width=="string"&&$.width.trim())E.push($.width);else{const T=d.value[E.length];E.push(T||"")}const C=(_=w.value)==null?void 0:_.querySelector("tbody tr");if(C){const $=n.selectable?1:0,T=Array.from(C.children);for(let F=0;F<n.columns.length;F++)if(!E[F]){const U=T[$+F];if(U){const a=U.clientWidth;E[F]=(a>0?a:80)+"px"}else E[F]="80px"}}else for(let $=0;$<E.length;$++)E[$]||(E[$]=d.value[$]||"80px");d.value=E})}function fe(){s(),se()}e.watch(()=>n.data,()=>{e.nextTick(()=>{s(),h(),se()})},{deep:!0}),e.watch([v,f],()=>{e.nextTick(()=>{s(),h(),se()})}),e.watch(()=>n.columns,()=>{d.value=[],e.nextTick(()=>{re(),h(),se()})},{deep:!0}),e.watch(()=>m.value,()=>{e.nextTick(()=>{s(),se()})},{deep:!0}),e.watch(()=>n.loading,()=>{e.nextTick(()=>{se()})}),e.onMounted(()=>{var E,C;e.nextTick(()=>{s(),re(),se(),z()}),window.addEventListener("resize",fe),window.addEventListener("scroll",fe,!0),(E=p.value)==null||E.addEventListener("scroll",()=>{h(),z(),se()},{passive:!0}),(C=x.value)==null||C.addEventListener("scroll",()=>{y()},{passive:!0}),e.nextTick(()=>h()),p.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(()=>{se()}),ue.observe(p.value))}),e.onUnmounted(()=>{var E,C;window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe,!0),(E=p.value)==null||E.removeEventListener("scroll",h),(C=x.value)==null||C.removeEventListener("scroll",y),window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",O),ue&&(ue.disconnect(),ue=null)});let de=-1;function se(){!x.value||!p.value||requestAnimationFrame(()=>{if(!x.value||!p.value)return;const E=p.value,C=Math.ceil(E.offsetWidth-E.clientWidth);if(S.value=C,C!==de){de=C;const _=x.value.querySelector(".table"),$=w.value;_&&$&&(x.value.style.paddingRight="0px",_.style.width="",_.style.marginRight="",C>0?(x.value.style.paddingRight=`${C}px`,_.style.width="100%",_.style.marginRight=`-${C}px`):(x.value.style.paddingRight="0px",_.style.width="100%",_.style.marginRight="0px"))}})}let ue=null;return(E,C)=>{const _=e.resolveComponent("YButton"),$=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:k},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[m.value.length&&t.showBulkActions?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",Qe,"已选择 "+e.toDisplayString(m.value.length)+" 项",1),e.createElementVNode("div",Je,[e.renderSlot(E.$slots,"bulk-actions",{selectedItems:m.value,clearSelection:u},()=>[e.createVNode(_,{size:"small",class:"btn",onClick:u},{default:e.withCtx(()=>[...C[2]||(C[2]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",Xe,[e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:x},[e.createElementVNode("table",Ge,[e.createElementVNode("colgroup",null,[t.selectable?(e.openBlock(),e.createElementBlock("col",et)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("col",{key:T.key,style:e.normalizeStyle({width:d.value[F]||void 0,minWidth:d.value[F]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",tt,[e.createElementVNode("input",{type:"checkbox",checked:H.value,onChange:Y},null,40,nt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("th",{key:T.key,class:e.normalizeClass(oe(T,!0)),style:e.normalizeStyle(ne(T,F,!0))},e.toDisplayString(T.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":t.loading,"is-empty":!M.value.length&&!t.loading}]),ref_key:"bodyWrapRef",ref:p,style:e.normalizeStyle({maxHeight:N.value})},[t.loading?(e.openBlock(),e.createElementBlock("div",ot,[...C[3]||(C[3]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!M.value.length&&!t.loading?(e.openBlock(),e.createElementBlock("div",lt,[e.renderSlot(E.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(t.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":t.loading}]),ref_key:"bodyTableRef",ref:w},[e.createElementVNode("colgroup",null,[t.selectable?(e.openBlock(),e.createElementBlock("col",at)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("col",{key:T.key,style:e.normalizeStyle({width:d.value[F]||void 0,minWidth:d.value[F]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(T,F)=>(e.openBlock(),e.createElementBlock("tr",{key:q(T,F)},[t.selectable?(e.openBlock(),e.createElementBlock("td",st,[e.createElementVNode("input",{type:"checkbox",value:q(T,F),checked:m.value.includes(q(T,F)),onChange:U=>K(q(T,F))},null,40,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(U,a)=>(e.openBlock(),e.createElementBlock("td",{key:U.key,class:e.normalizeClass(oe(U)),style:e.normalizeStyle(ne(U,a,!1))},[e.renderSlot(E.$slots,`cell-${U.key}`,{item:T,value:X(T,U.key),index:F},()=>[e.createTextVNode(e.toDisplayString(G(T,U)),1)],!0)],6))),128))]))),128))])],2)],6),t.pagination?(e.openBlock(),e.createBlock($,{key:0,class:"align-right","current-page":v.value,"onUpdate:currentPage":C[0]||(C[0]=T=>v.value=T),"page-size":f.value,"onUpdate:pageSize":C[1]||(C[1]=T=>f.value=T),loading:n.loading,"page-size-options":t.pageSizeOptions,onPageChange:c,onPageSizeChange:l},null,8,["current-page","page-size","loading","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),xe=le(it,[["__scopeId","data-v-1b9621b8"]]),ct=["onKeydown","aria-expanded"],dt=["src"],ut=["placeholder","onKeydown"],ft=["onClick","onMouseenter"],mt=["src"],ht=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},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),f=e.ref(-1),m=e.ref(),N=e.ref(),k=e.ref(),x=e.ref(),p=e.ref(!1),w=e.ref(),d=e.ref(""),b=e.computed(()=>n.options.find(l=>S(l)===n.modelValue)||null),R=e.computed(()=>b.value?D(b.value):""),A=e.computed(()=>{if(!n.filterable)return n.options;const l=d.value.trim().toLowerCase();return l?n.options.filter(s=>{const r=D(s);return String(r).toLowerCase().includes(l)}):n.options}),L=e.computed(()=>{var y;const l={position:"fixed",zIndex:"4000"},s=N.value;if(!s)return l;const r=s.getBoundingClientRect(),h=((y=k.value)==null?void 0:y.getBoundingClientRect().width)||r.width;return l.left=`${r.left}px`,l.width=`${h}px`,p.value?(l.bottom=`${window.innerHeight-r.top+4}px`,l.top="auto"):l.top=`${r.bottom+4}px`,l});function B(){!v.value||!N.value||e.nextTick(()=>{const l=N.value;if(!l)return;const s=l.getBoundingClientRect(),r=window.innerHeight,h=200,y=s.bottom+h+4,z=s.top-h-4,P=y<=r-20,O=z>=20;p.value=!P&&O})}function S(l){return typeof l=="object"&&l!==null?l[n.valueKey]:l}function D(l){return typeof l=="object"&&l!==null?l[n.labelKey]||String(l[n.valueKey]):String(l)}function M(l,s){return typeof l=="object"&&l!==null&&l.id!==void 0?l.id:S(l)||s}function H(l){return S(l)===n.modelValue}function j(l){return typeof l=="object"&&l!==null?l[n.disabledKey]===!0:!1}function W(){n.disabled||(v.value?q():ee())}function ee(){n.disabled||(v.value=!0,e.nextTick(()=>{B(),K(),n.filterable&&w.value&&(w.value.focus(),d.value="")}))}function q(){v.value=!1,f.value=-1,p.value=!1,n.filterable&&(d.value="")}function X(l,s){if(j(l))return;const r=S(l);o("update:modelValue",r),o("change",r,l),q()}function oe(){if(!n.clearable||n.disabled)return;const l=n.clearTo;o("update:modelValue",l),o("change",l,null),o("clear"),q()}function ne(l){if(!A.value||A.value.length===0){f.value=-1;return}let s=f.value;const r=A.value.length;s===-1?s=l>0?0:r-1:s=(s+l+r)%r;let h=0;for(;h<r&&j(A.value[s]);)s=(s+l+r)%r,h++;f.value=h>=r?-1:s,Y()}function G(){if(f.value<0)return;const l=A.value[f.value];!l||j(l)||X(l,f.value)}function K(){if(!m.value)return;const l=m.value.querySelector(".yselect__option--selected");l&&l.scrollIntoView({block:"nearest"})}function Y(){if(!m.value||f.value<0)return;const s=m.value.querySelectorAll(".yselect__option")[f.value];s&&s.scrollIntoView({block:"nearest"})}function u(l){const s=l.target;(!k.value||!k.value.contains(s))&&q()}e.watch(()=>n.modelValue,()=>{f.value=-1});function c(){v.value&&B()}return e.onMounted(()=>{document.addEventListener("click",u),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",u),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":t.disabled,[`yselect--${t.size}`]:!0}]),style:e.normalizeStyle({width:t.width}),ref_key:"selectContainer",ref:k},[e.createElementVNode("div",{ref_key:"triggerElement",ref:N,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":v.value,"yselect__trigger--disabled":t.disabled,"yselect__trigger--error":t.error}]),onMousedown:e.withModifiers(W,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(W,["prevent"]),["enter"]),e.withKeys(e.withModifiers(W,["prevent"]),["space"]),e.withKeys(q,["escape"]),e.withKeys(e.withModifiers(ee,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(ee,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":v.value,"aria-haspopup":!0},[!t.filterable||!v.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!R.value}])},[e.renderSlot(l.$slots,"value",{value:b.value,label:R.value},()=>{var r;return[b.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(r=b.value)!=null&&r.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:b.value.flagImg,alt:"flag"},null,8,dt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(R.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.placeholder),1)],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:w,class:"yselect__input",type:"text",placeholder:R.value||t.placeholder,"onUpdate:modelValue":s[0]||(s[0]=r=>d.value=r),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(r=>ne(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(r=>ne(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(r=>G(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(q,["prevent"]),["esc"]),e.withKeys(e.withModifiers(oe,["prevent"]),["delete"])]},null,40,ut)),[[e.vModelText,d.value]]),t.clearable&&!t.disabled&&b.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(oe,["stop"])},[...s[8]||(s[8]=[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":v.value}])},[...s[9]||(s[9]=[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,ct),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownEl",ref:x,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":p.value}]),style:e.normalizeStyle(L.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:m},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(r,h)=>(e.openBlock(),e.createElementBlock("div",{key:M(r,h),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":H(r),"yselect__option--disabled":j(r),"yselect__option--hover":f.value===h}]),onClick:y=>X(r),onMouseenter:y=>f.value=h,onMouseleave:s[5]||(s[5]=y=>f.value=-1)},[e.renderSlot(l.$slots,"option",{option:r,index:h,selected:H(r)},()=>[r!=null&&r.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:r.flagImg,alt:"flag"},null,8,mt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(D(r)),1)],!0)],42,ft))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),we=le(ht,[["__scopeId","data-v-6cd47cb7"]]),vt={class:"ypagination"},pt={class:"page-actions"},yt={class:"page-size-select"},gt=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}]}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(n.pageSize),f=e.computed(()=>n.pageSizeOptions),m=e.computed({get:()=>n.currentPage,set:p=>{o("update:currentPage",p),o("page-change",p)}});function N(p){n.loading||p>=1&&p!==n.currentPage&&(m.value=p)}function k(p){n.loading||(v.value=p,o("update:pageSize",p),o("page-size-change",p),m.value=1)}function x(p){n.loading||(p==="prev"?N(m.value-1):p==="next"&&N(m.value+1))}return v.value=n.pageSize,e.watch(()=>n.pageSize,p=>{typeof p=="number"&&v.value!==p&&(v.value=p)}),(p,w)=>{const d=e.resolveComponent("YButton"),b=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",vt,[e.createElementVNode("div",pt,[e.createVNode(d,{size:"small",variant:"secondary",disabled:m.value===1||t.loading,onClick:w[0]||(w[0]=R=>N(1))},{default:e.withCtx(()=>[...w[2]||(w[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(d,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:m.value===1||t.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:t.loading,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:x},null,8,["groupItems"]),e.createElementVNode("div",yt,[e.createVNode(b,{modelValue:v.value,"onUpdate:modelValue":w[1]||(w[1]=R=>v.value=R),options:f.value,size:"small",width:"105px",clearable:!1,disabled:t.loading,onChange:k},null,8,["modelValue","options","disabled"])])])])}}}),Ve=le(gt,[["__scopeId","data-v-b8406406"]]),kt=["aria-label"],wt={class:"y-badge__inner"},bt={key:0,class:"y-badge__progress","aria-hidden":"true"},Et={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Bt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ct={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},xt={key:1,class:"y-badge__icon","aria-hidden":"true"},Vt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Nt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Dt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},$t={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},St={class:"y-badge__label"},_t=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(t){const g=t,n=e.computed(()=>g.tone||"default"),o=e.computed(()=>{const v=(g.label||"").trim(),f=g.tone,m=g.progress;if(m){const N={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return v?`${v},进度:${N[m]||m}`:`进度:${N[m]||m}`}if(f&&f!=="default"){const N={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return v?`${v},语气:${N[f]||f}`:`语气:${N[f]||f}`}return v||"标记"});return(v,f)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${n.value}`,`y-badge--${t.size}`,{"is-outline":t.outline,"is-pill":t.pill},t.progress?`y-badge--progress-${t.progress}`:""]]),role:"status","aria-label":o.value},[e.createElementVNode("span",wt,[t.progress?(e.openBlock(),e.createElementBlock("span",bt,[t.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",Et,[...f[0]||(f[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):t.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Bt,[...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)])])):t.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",Ct,[...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)])):t.icon?(e.openBlock(),e.createElementBlock("span",xt,[t.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Vt,[...f[3]||(f[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):t.icon==="check"?(e.openBlock(),e.createElementBlock("svg",Nt,[...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)])])):t.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Dt,[...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",$t,[...f[6]||(f[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",St,[e.renderSlot(v.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)])])],10,kt))}}),Ne=le(_t,[["__scopeId","data-v-ce819797"]]),Mt=["aria-hidden"],zt=["onKeydown"],Lt={key:0,class:"y-dialog-header"},Tt={class:"y-dialog-title"},It={class:"y-dialog-body"},Kt={key:1,class:"y-dialog-footer"},Ht=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(t,{emit:g}){const n=t,o=g,v=e.computed({get:()=>n.modelValue,set:w=>o("update:modelValue",w)}),f=e.ref(null),m=e.computed(()=>{const w={};return w.width=typeof n.width=="number"?`${n.width}px`:String(n.width),w.margin="0 auto",w.top=n.top,w});function N(){n.maskClosable&&k()}function k(){v.value&&(v.value=!1,o("close"))}function x(){n.closable&&k()}function p(w){w.key==="Escape"&&x()}return e.watch(()=>n.modelValue,w=>{w?(o("open"),requestAnimationFrame(()=>{var d;return(d=f.value)==null?void 0:d.focus()}),document.addEventListener("keydown",p),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",p),document.body.style.overflow="")}),e.onMounted(()=>{n.modelValue&&(document.addEventListener("keydown",p),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",p),document.body.style.overflow=""}),(w,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!v.value,style:e.normalizeStyle({zIndex:String(t.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:N}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-dialog-panel",[t.center?"is-center":""]]),style:e.normalizeStyle(m.value),onKeydown:e.withKeys(e.withModifiers(x,["prevent","stop"]),["esc"]),tabindex:"-1"},[t.showHeader?(e.openBlock(),e.createElementBlock("div",Lt,[e.renderSlot(w.$slots,"header",{},()=>[e.createElementVNode("div",Tt,e.toDisplayString(t.title),1)],!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:k}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",It,[e.renderSlot(w.$slots,"default",{},void 0,!0)]),w.$slots.footer?(e.openBlock(),e.createElementBlock("div",Kt,[e.renderSlot(w.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,zt),[[e.vShow,v.value]])]),_:3})],12,Mt),[[e.vShow,v.value]])]))}}),De=le(Ht,[["__scopeId","data-v-a7acc6dc"]]),Ft={class:"ypopover__inner"},Rt=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(t,{expose:g,emit:n}){const o=t,v=n,f=e.ref(),m=e.ref(),N=e.ref(),k=e.ref(!1),x=e.ref(),p=e.ref(),w=e.ref({});let d=null,b=null;const R=e.computed(()=>{if(!k.value||!x.value)return{};const K={};o.width!=="auto"&&(K.width=typeof o.width=="number"?`${o.width}px`:o.width),o.maxWidth&&(K.maxWidth=typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth);const{top:Y,left:u}=L();return K.top=`${Y}px`,K.left=`${u}px`,K}),A=e.computed(()=>{if(!o.showArrow)return{};if(Object.keys(w.value).length>0)return w.value;const K={};return o.placement.startsWith("top")||o.placement.startsWith("bottom")?K.left="50%":K.top="50%",K});function L(){var P,O;if(!x.value)return{top:0,left:0};const{width:K,height:Y,top:u,left:c}=x.value,l=((P=N.value)==null?void 0:P.offsetWidth)||200,s=((O=N.value)==null?void 0:O.offsetHeight)||100;let r=0,h=0;switch(o.placement){case"top":r=u-s-o.offset,h=c+(K-l)/2;break;case"top-start":r=u-s-o.offset,h=c;break;case"top-end":r=u-s-o.offset,h=c+K-l;break;case"bottom":r=u+Y+o.offset,h=c+(K-l)/2;break;case"bottom-start":r=u+Y+o.offset,h=c;break;case"bottom-end":r=u+Y+o.offset,h=c+K-l;break;case"left":r=u+(Y-s)/2,h=c-l-o.offset;break;case"left-start":r=u,h=c-l-o.offset;break;case"left-end":r=u+Y-s,h=c-l-o.offset;break;case"right":r=u+(Y-s)/2,h=c+K+o.offset;break;case"right-start":r=u,h=c+K+o.offset;break;case"right-end":r=u+Y-s,h=c+K+o.offset;break}const y=window.innerWidth,z=window.innerHeight;return h<8&&(h=8),h+l>y-8&&(h=y-l-8),r<8&&(r=8),r+s>z-8&&(r=z-s-8),{top:r,left:h}}function B(){o.disabled||k.value||(H(),o.openDelay>0?d=setTimeout(()=>{S()},o.openDelay):S())}function S(){v("before-show"),k.value=!0,v("update:modelValue",!0),v("show"),e.nextTick(()=>{e.nextTick(()=>{W()})})}function D(){k.value&&(H(),o.closeDelay>0?b=setTimeout(()=>{M()},o.closeDelay):M())}function M(){v("before-hide"),k.value=!1,v("update:modelValue",!1),v("hide")}function H(){d&&(clearTimeout(d),d=null),b&&(clearTimeout(b),b=null)}function j(){if(!o.showArrow||!x.value||!N.value){w.value={};return}const K=x.value,Y=N.value.getBoundingClientRect();if(Y.width===0||Y.height===0){const c={};o.placement.startsWith("top")||o.placement.startsWith("bottom")?c.left="50%":c.top="50%",w.value=c;return}const u={};if(o.placement.startsWith("top")){u.bottom="-6px";const c=K.left+K.width/2,l=Y.left,s=c-l;u.left=`${Math.max(12,Math.min(s,Y.width-12))}px`}else if(o.placement.startsWith("bottom")){u.top="-6px";const c=K.left+K.width/2,l=Y.left,s=c-l;u.left=`${Math.max(12,Math.min(s,Y.width-12))}px`}else if(o.placement.startsWith("left")){u.right="-6px";const c=K.top+K.height/2,l=Y.top,s=c-l;u.top=`${Math.max(12,Math.min(s,Y.height-12))}px`}else if(o.placement.startsWith("right")){u.left="-6px";const c=K.top+K.height/2,l=Y.top,s=c-l;u.top=`${Math.max(12,Math.min(s,Y.height-12))}px`}w.value=u}function W(){m.value&&(x.value=m.value.getBoundingClientRect(),N.value&&(p.value=N.value.getBoundingClientRect(),j(),k.value&&requestAnimationFrame(()=>{N.value&&(p.value=N.value.getBoundingClientRect(),j())})))}function ee(){o.disabled||o.trigger==="click"&&(k.value?D():B())}function q(){o.disabled||o.trigger!=="hover"||(H(),B())}function X(){o.disabled||o.trigger!=="hover"||D()}function oe(){o.disabled||o.trigger!=="hover"||H()}function ne(){o.disabled||o.trigger!=="hover"||D()}function G(K){if(!o.closeOnClickOutside||!k.value)return;const Y=K.target;f.value&&!f.value.contains(Y)&&N.value&&!N.value.contains(Y)&&D()}return e.watch(()=>o.modelValue,K=>{K!==k.value&&(K?B():D())}),e.watch(k,K=>{K?(document.addEventListener("click",G),window.addEventListener("resize",W),window.addEventListener("scroll",W,!0),e.nextTick(()=>{W(),requestAnimationFrame(()=>{W()}),setTimeout(()=>{W()},0)})):(document.removeEventListener("click",G),window.removeEventListener("resize",W),window.removeEventListener("scroll",W,!0))}),e.onMounted(()=>{o.modelValue&&B()}),e.onUnmounted(()=>{H(),document.removeEventListener("click",G),window.removeEventListener("resize",W),window.removeEventListener("scroll",W,!0)}),g({show:B,hide:D,updatePosition:W}),(K,Y)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:f},[e.createElementVNode("div",{ref_key:"triggerRef",ref:m,onClick:ee,onMouseenter:q,onMouseleave:X},[e.renderSlot(K.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:N,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${t.placement}`,{"ypopover__content--dark":t.dark,"ypopover__content--no-padding":!t.showPadding}]]),style:e.normalizeStyle(R.value),onClick:Y[0]||(Y[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:oe,onMouseleave:ne},[t.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${t.placement}`]),style:e.normalizeStyle(A.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",Ft,[e.renderSlot(K.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),$e=le(Rt,[["__scopeId","data-v-be755399"]]),Yt={class:"relative"},At=["value","placeholder"],Wt={class:"nh-time-suffix"},Pt={class:"nh-time-shortcuts"},Ot={class:"nh-time-shortcuts-list"},jt=["onClick","onKeydown","onMouseenter"],qt={class:"nh-time-custom"},Ut={class:"nh-time-custom-header"},Zt={class:"nh-time-selection-status"},Qt={key:0,class:"status-text"},Jt={key:1,class:"status-text"},Xt={key:2,class:"status-text status-complete"},Gt={class:"nh-time-pickers"},en={class:"nh-time-picker"},tn={class:"nh-date-picker"},nn={class:"nh-date-picker-header"},on={class:"nh-date-picker-header-label"},ln={class:"nh-date-picker-content"},an={class:"nh-date-table"},sn=["onClick"],rn={class:"nh-date-table-cell"},cn={key:0},dn={class:"nh-time-picker"},un={class:"nh-date-picker"},fn={class:"nh-date-picker-header"},mn={class:"nh-date-picker-header-label"},hn={class:"nh-date-picker-content"},vn={class:"nh-date-table"},pn=["onClick"],yn={class:"nh-date-table-cell"},gn={key:0},kn={class:"nh-time-actions"},wn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const t=new Date,g=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{startDate:g,endDate:n}}},{label:"昨天",getValue:()=>{const t=new Date;t.setDate(t.getDate()-1);const g=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{startDate:g,endDate:n}}},{label:"近7天",getValue:()=>{const t=new Date,g=new Date;return g.setDate(g.getDate()-6),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}},{label:"近30天",getValue:()=>{const t=new Date,g=new Date;return g.setDate(g.getDate()-29),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}},{label:"近3个月",getValue:()=>{const t=new Date,g=new Date;return g.setMonth(g.getMonth()-3),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),f=e.ref(-1),m=e.ref(-1),N=e.ref(null),k=e.ref(),x=e.ref(),p=e.ref({top:!0,left:!0}),w=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),d=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),b=()=>{const a=new Date(w.value.year,w.value.month).getTime(),i=new Date(d.value.year,d.value.month).getTime();if(a>=i){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}},R=()=>{const a=new Date(w.value.year,w.value.month).getTime();if(new Date(d.value.year,d.value.month).getTime()<=a){const V=new Date(d.value.year,d.value.month-1);w.value.year=V.getFullYear(),w.value.month=V.getMonth()}},A=["一","二","三","四","五","六","日"],L=e.ref(null),B=e.ref(null),S=a=>{if(!a)return null;if(a instanceof Date)return a;if(typeof a=="number")return new Date(a);if(typeof a=="string"){const i=new Date(a);return isNaN(i.getTime())?null:i}return null},D=a=>{if(!a)return null;const i=a.getFullYear(),V=String(a.getMonth()+1).padStart(2,"0"),I=String(a.getDate()).padStart(2,"0");if(n.includeTime){const Q=String(a.getHours()).padStart(2,"0"),Z=String(a.getMinutes()).padStart(2,"0"),J=String(a.getSeconds()).padStart(2,"0");return`${i}-${V}-${I} ${Q}:${Z}:${J}`}else return`${i}-${V}-${I}`},M=a=>a?a.getTime():null,H=a=>a?{startDate:S(a.startDate),endDate:S(a.endDate)}:{startDate:null,endDate:null},j=a=>n.format==="string"?{startDate:D(a.startDate),endDate:D(a.endDate)}:n.format==="timestamp"?{startDate:M(a.startDate),endDate:M(a.endDate)}:a,W=(a,i)=>`${String(i+1).padStart(2,"0")}/${a}`,ee=(a,i)=>a.getFullYear()===i.getFullYear()&&a.getMonth()===i.getMonth()&&a.getDate()===i.getDate(),q=(a,i,V)=>!i||!V?!1:a>=i&&a<=V,X=a=>{const i=H(a);if(!(i!=null&&i.startDate)||!(i!=null&&i.endDate))return-1;for(let V=0;V<n.shortcuts.length;V++){const I=n.shortcuts[V].getValue();if(I.startDate&&I.endDate&&i.startDate&&i.endDate){const Q=new Date(i.startDate.getFullYear(),i.startDate.getMonth(),i.startDate.getDate()),Z=new Date(i.endDate.getFullYear(),i.endDate.getMonth(),i.endDate.getDate()),J=new Date(I.startDate.getFullYear(),I.startDate.getMonth(),I.startDate.getDate()),ae=new Date(I.endDate.getFullYear(),I.endDate.getMonth(),I.endDate.getDate());if(Q.getTime()===J.getTime()&&Z.getTime()===ae.getTime())return V}}return-1},oe=(a,i)=>{const V=new Date(a,i,1),I=new Date(a,i+1,0),Q=V.getDay(),Z=I.getDate(),J=[],ae=new Date,pe=Q===0?6:Q-1,Ie=new Date(a,i,0);for(let te=pe-1;te>=0;te--){const ie=new Date(a,i-1,Ie.getDate()-te);J.push({date:ie,day:ie.getDate(),isCurrentMonth:!1,isToday:ee(ie,ae),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let te=1;te<=Z;te++){const ie=new Date(a,i,te);J.push({date:ie,day:te,isCurrentMonth:!0,isToday:ee(ie,ae),isSelected:!1,isInRange:!1,isDisabled:!1})}const Ke=42-J.length;for(let te=1;te<=Ke;te++){const ie=new Date(a,i+1,te);J.push({date:ie,day:te,isCurrentMonth:!1,isToday:ee(ie,ae),isSelected:!1,isInRange:!1,isDisabled:!0})}const Ee=[];for(let te=0;te<J.length;te+=7)Ee.push(J.slice(te,te+7));return Ee},ne=a=>{const i=j(a);o("update:modelValue",i),o("change",i)},G=()=>{if(!k.value||!x.value)return;const a=k.value.getBoundingClientRect(),i=x.value.getBoundingClientRect(),V=window.innerWidth,Q=window.innerHeight-a.bottom,Z=a.top,J=i.height||400;Q<J&&Z>J?p.value.top=!1:p.value.top=!0;const ae=V-a.left,pe=i.width||640;ae<pe?p.value.left=!1:p.value.left=!0},K=()=>{if(v.value=!v.value,v.value){const a=H(n.modelValue);if(L.value=(a==null?void 0:a.startDate)||null,B.value=(a==null?void 0:a.endDate)||null,m.value=X(n.modelValue),f.value=-1,a!=null&&a.startDate&&(w.value.year=a.startDate.getFullYear(),w.value.month=a.startDate.getMonth()),a!=null&&a.endDate)d.value.year=a.endDate.getFullYear(),d.value.month=a.endDate.getMonth();else{const i=new Date(w.value.year,w.value.month+1);d.value.year=i.getFullYear(),d.value.month=i.getMonth()}b(),e.nextTick(()=>{G()})}},Y=a=>{const i=a.target,V=k.value,I=x.value;V&&I&&!V.contains(i)&&!I.contains(i)&&(v.value=!1,f.value=-1)},u=a=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),K()):a.key==="ArrowDown"&&(a.preventDefault(),v.value=!0,e.nextTick(()=>{G(),h()}))},c=a=>{var i;a.key==="Escape"&&(v.value=!1,f.value=-1,(i=k.value)==null||i.focus())},l=(a,i)=>{a.key==="ArrowDown"?(a.preventDefault(),f.value=Math.min(i+1,n.shortcuts.length-1),y(f.value)):a.key==="ArrowUp"?(a.preventDefault(),f.value=Math.max(i-1,0),y(f.value)):(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),z(n.shortcuts[i]))},s=a=>{f.value=a},r=()=>{f.value=-1},h=()=>{f.value=0,y(0)},y=a=>{if(x.value){const V=x.value.querySelectorAll(".nh-time-shortcut")[a];V&&V.focus()}},z=a=>{const i=a.getValue();n.includeTime&&i.startDate&&i.endDate&&(i.startDate.setHours(0,0,0,0),i.endDate.setHours(23,59,59,999)),ne(i),m.value=n.shortcuts.findIndex(V=>V.label===a.label),f.value=-1,v.value=!1},P=(a,i)=>{if(!a||a.isDisabled)return;let V;if(n.includeTime?(V=new Date(a.date),i==="start"||!L.value?V.setHours(0,0,0,0):V.setHours(23,59,59,999)):V=new Date(a.date.getFullYear(),a.date.getMonth(),a.date.getDate()),!L.value&&!B.value)L.value=V,B.value=null;else if(L.value&&!B.value)if(V>=L.value)n.includeTime&&V.setHours(23,59,59,999),B.value=V;else{const I=L.value;n.includeTime&&I.setHours(23,59,59,999),B.value=I,L.value=V}else L.value=V,B.value=null;if(m.value=-1,L.value&&B.value){const I=new Date(B.value);n.includeTime&&I.setHours(23,59,59,999),N.value={startDate:L.value,endDate:I}}else N.value=null},O=(a,i)=>{if(!a)return["nh-date-table-td"];const V=["nh-date-table-td"];return a.isCurrentMonth||V.push("is-prev-month"),a.isToday&&V.push("is-today"),a.isDisabled&&V.push("is-disabled"),L.value&&ee(a.date,L.value)&&V.push("is-selected","is-start"),B.value&&ee(a.date,B.value)&&V.push("is-selected","is-end"),L.value&&B.value&&q(a.date,L.value,B.value)&&V.push("is-in-range"),V},re=()=>{N.value&&(n.includeTime&&N.value.endDate&&N.value.endDate.setHours(23,59,59,999),ne(N.value),m.value=X(N.value),v.value=!1)},fe=()=>{ne({startDate:null,endDate:null}),T(),f.value=-1,v.value=!1},de=()=>{v.value&&e.nextTick(()=>{G()})},se=e.computed(()=>oe(w.value.year,w.value.month)),ue=e.computed(()=>oe(d.value.year,d.value.month)),E=e.computed(()=>{const a=H(n.modelValue);if(!a||!a.startDate||!a.endDate)return"";const i=Q=>{const Z=String(Q.getFullYear()),J=String(Q.getMonth()+1).padStart(2,"0"),ae=String(Q.getDate()).padStart(2,"0");return`${Z}/${J}/${ae}`},V=i(a.startDate),I=i(a.endDate);return!n.includeTime&&V===I?V:`${V} - ${I}`}),C=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!p.value.top,"nh-time-dropdown-right":!p.value.left}]),_=e.computed(()=>{const a=H(n.modelValue);return!!(a!=null&&a.startDate&&(a!=null&&a.endDate))}),$=e.computed(()=>!!(L.value&&B.value)),T=()=>{L.value=null,B.value=null,N.value=null,m.value=-1};e.watch(()=>n.modelValue,a=>{const i=H(a);if(i!=null&&i.startDate){const V=i.startDate;w.value.year=V.getFullYear(),w.value.month=V.getMonth()}if(i!=null&&i.endDate){const V=i.endDate;d.value.year=V.getFullYear(),d.value.month=V.getMonth()}else if(i!=null&&i.startDate){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}(i!=null&&i.startDate||i!=null&&i.endDate)&&b(),v.value||(m.value=X(a))},{immediate:!0,deep:!0}),e.watch([w,d],()=>{const a=new Date(w.value.year,w.value.month).getTime(),i=new Date(d.value.year,d.value.month).getTime();if(a===i){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",Y),window.addEventListener("resize",de),window.addEventListener("scroll",de),m.value=X(n.modelValue);const a=H(n.modelValue);if(a!=null&&a.startDate&&(w.value.year=a.startDate.getFullYear(),w.value.month=a.startDate.getMonth()),a!=null&&a.endDate)d.value.year=a.endDate.getFullYear(),d.value.month=a.endDate.getMonth();else{const i=new Date(w.value.year,w.value.month+1);d.value.year=i.getFullYear(),d.value.month=i.getMonth()}b()}),e.onUnmounted(()=>{document.removeEventListener("click",Y),window.removeEventListener("resize",de),window.removeEventListener("scroll",de)});const F=()=>{n.clearable&&(ne({startDate:null,endDate:null}),T(),f.value=-1)},U=(a,i)=>{if(a==="start"){const V=new Date(w.value.year,w.value.month+i,1);w.value.year=V.getFullYear(),w.value.month=V.getMonth(),b()}else{const V=new Date(d.value.year,d.value.month+i,1);d.value.year=V.getFullYear(),d.value.month=V.getMonth(),R()}};return(a,i)=>{const V=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${t.size}`]])},[e.createElementVNode("div",Yt,[e.createElementVNode("div",{ref_key:"trigger",ref:k,onClick:K,onKeydown:u,class:e.normalizeClass(["nh-time-trigger",{"is-focus":v.value,"has-value":_.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:E.value,placeholder:t.placeholder,class:"nh-time-input"},null,8,At),e.createElementVNode("span",Wt,[t.clearable&&_.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(F,["stop"]),class:"nh-time-clear"},[...i[4]||(i[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),i[6]||(i[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":v.value}])},[...i[5]||(i[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(()=>[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:x,class:e.normalizeClass(C.value),onKeydown:c},[e.createElementVNode("div",Pt,[i[7]||(i[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",Ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shortcuts,(I,Q)=>(e.openBlock(),e.createElementBlock("li",{key:I.label,onClick:Z=>z(I),onKeydown:Z=>l(Z,Q),onMouseenter:Z=>s(Q),onMouseleave:r,class:e.normalizeClass(["nh-time-shortcut",{"is-active":f.value===Q,"is-selected":m.value===Q}]),tabindex:"0"},e.toDisplayString(I.label),43,jt))),128))])]),e.createElementVNode("div",qt,[e.createElementVNode("div",Ut,[i[8]||(i[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",Zt,[!L.value&&!B.value?(e.openBlock(),e.createElementBlock("span",Qt," 请选择开始日期 ")):L.value&&!B.value?(e.openBlock(),e.createElementBlock("span",Jt," 请选择结束日期 ")):L.value&&B.value?(e.openBlock(),e.createElementBlock("span",Xt," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Gt,[e.createElementVNode("div",en,[e.createElementVNode("div",tn,[e.createElementVNode("div",nn,[e.createElementVNode("button",{onClick:i[0]||(i[0]=I=>U("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...i[9]||(i[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",on,e.toDisplayString(W(w.value.year,w.value.month)),1),e.createElementVNode("button",{onClick:i[1]||(i[1]=I=>U("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...i[10]||(i[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",ln,[e.createElementVNode("table",an,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,I=>e.createElementVNode("th",{key:I,class:"nh-date-table-th"},e.toDisplayString(I),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(I,Q)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${Q}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I,(Z,J)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${Q}-${J}`,class:e.normalizeClass(O(Z)),onClick:ae=>P(Z,"start")},[e.createElementVNode("div",rn,[Z?(e.openBlock(),e.createElementBlock("span",cn,e.toDisplayString(Z.day),1)):e.createCommentVNode("",!0)])],10,sn))),128))]))),128))])])])])]),e.createElementVNode("div",dn,[e.createElementVNode("div",un,[e.createElementVNode("div",fn,[e.createElementVNode("button",{onClick:i[2]||(i[2]=I=>U("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...i[11]||(i[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",mn,e.toDisplayString(W(d.value.year,d.value.month)),1),e.createElementVNode("button",{onClick:i[3]||(i[3]=I=>U("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...i[12]||(i[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",hn,[e.createElementVNode("table",vn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,I=>e.createElementVNode("th",{key:I,class:"nh-date-table-th"},e.toDisplayString(I),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,(I,Q)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${Q}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I,(Z,J)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${Q}-${J}`,class:e.normalizeClass(O(Z)),onClick:ae=>P(Z,"end")},[e.createElementVNode("div",yn,[Z?(e.openBlock(),e.createElementBlock("span",gn,e.toDisplayString(Z.day),1)):e.createCommentVNode("",!0)])],10,pn))),128))]))),128))])])])])])]),e.createElementVNode("div",kn,[t.clearable?(e.openBlock(),e.createBlock(V,{key:0,onClick:fe,variant:"secondary",size:t.size},{default:e.withCtx(()=>[...i[13]||(i[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(V,{onClick:re,disabled:!$.value,variant:"primary",size:t.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.value&&!B.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),be=le(wn,[["__scopeId","data-v-e5ef63b1"]]),bn=["aria-checked","aria-disabled","disabled","onKeydown"],En={class:"yswitch__thumb"},Bn={key:0,class:"yswitch__spinner","aria-hidden":"true"},Cn=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(t,{emit:g}){const n=t,o=g,v=e.ref(),f=e.computed(()=>n.modelValue===n.trueValue),m=e.computed(()=>{const k={};return k.background=f.value?n.activeColor:n.inactiveColor,k});function N(){if(n.disabled||n.loading)return;const k=f.value?n.falseValue:n.trueValue;o("update:modelValue",k),o("change",k)}return e.onMounted(()=>{const k=v.value;k&&(k.addEventListener("focus",x=>o("focus",x)),k.addEventListener("blur",x=>o("blur",x)))}),(k,x)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:v,class:e.normalizeClass(["yswitch",[`yswitch--${t.size}`,{"yswitch--checked":f.value,"yswitch--disabled":t.disabled,"yswitch--loading":t.loading}]]),style:e.normalizeStyle(m.value),role:"switch","aria-checked":f.value,"aria-disabled":t.disabled,disabled:t.disabled||t.loading,onClick:N,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[x[0]||(x[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",En,[t.loading?(e.openBlock(),e.createElementBlock("span",Bn)):e.createCommentVNode("",!0)]),t.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?t.activeText:t.inactiveText),3)):e.createCommentVNode("",!0)],46,bn))}}),Se=le(Cn,[["__scopeId","data-v-0b157fc4"]]),xn=["src","alt"],Vn=["src","alt"],Nn=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:{}},emits:["load","error","preview"],setup(t,{expose:g,emit:n}){const o=t,v=n,f=e.ref(),m=e.ref(),N=e.ref(),k=e.ref(!1),x=e.ref(!1),p=e.ref(!1),w=e.ref(!1),d=e.ref(!1),b=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),R=e.ref(""),A=e.ref(1),L=e.ref(!1),B=e.ref({overflow:"",paddingRight:""}),S=e.computed(()=>[o.className,"overflow-hidden"].filter(Boolean).join(" ")),D=e.computed(()=>[W(),q()].filter(Boolean).join(" ")),M=e.computed(()=>["w-full h-full bg-white",ee(),q(),o.preview?"cursor-pointer hover:opacity-90 transition-opacity duration-200":""].filter(Boolean).join(" ")),H=e.computed(()=>[W(),q()].filter(Boolean).join(" ")),j=e.computed(()=>{const y={};return o.width&&(y.width=typeof o.width=="number"?`${o.width}px`:o.width),o.height&&(y.height=typeof o.height=="number"?`${o.height}px`:o.height),y}),W=()=>o.width&&o.height?"":"w-full h-full",ee=()=>({cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"})[o.fit]||"object-cover",q=()=>typeof o.radius=="number"?`rounded-${o.radius}`:typeof o.radius=="string"?o.radius.includes("px")?"":`rounded-${o.radius}`:"",X=()=>{const y=document.createElement("div");y.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(y);const z=y.offsetWidth-y.clientWidth;return document.body.removeChild(y),z},oe=()=>{if(B.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const z=X();document.body.style.paddingRight=`${z}px`}document.body.style.overflow="hidden"},ne=()=>{document.body.style.overflow=B.value.overflow,document.body.style.paddingRight=B.value.paddingRight};let G=null;const K=()=>{!o.lazy||!f.value||(G=new IntersectionObserver(y=>{y.forEach(z=>{z.isIntersecting&&(w.value=!0,b.value=o.src,G==null||G.unobserve(z.target))})},{rootMargin:"50px"}),G.observe(f.value))},Y=y=>{k.value=!0,x.value=!1,p.value=!1,v("load",y)},u=y=>{p.value=!0,x.value=!1,k.value=!1,v("error",y)},c=()=>{p.value=!1,x.value=!0,k.value=!1,e.nextTick(()=>{m.value&&(m.value.src=o.src)})},l=()=>{if(!o.preview||p.value)return;A.value=1;const y=new Image;y.onload=()=>{R.value=o.src,e.nextTick(()=>{d.value=!0,oe(),v("preview",o.src)})},y.onerror=()=>{R.value=o.src,d.value=!0,oe(),v("preview",o.src)},y.src=o.src},s=()=>{d.value=!1,setTimeout(()=>{ne()},300)},r=y=>{const z=y.deltaY<0?1:-1;let O=A.value+z*.1;O=Math.max(.5,Math.min(2,O)),A.value=O};e.onMounted(()=>{o.lazy?K():w.value=!0,w.value&&(x.value=!0),L.value=!0}),e.onUnmounted(()=>{G&&G.disconnect(),d.value&&ne()});const h=()=>{o.src&&w.value&&(x.value=!0,p.value=!1,k.value=!1)};return e.watch(()=>b.value,h),e.watch(()=>o.src,y=>{b.value=y||""}),g({retryLoad:c,closePreview:s}),(y,z)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:f,class:e.normalizeClass(["relative inline-block",S.value])},[!k.value&&!p.value&&!w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["bg-gray-200 animate-pulse rounded",D.value])},[...z[1]||(z[1]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("svg",{class:"w-6 h-6 text-gray-400",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)])],2)):e.createCommentVNode("",!0),x.value&&!p.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded",M.value])},[...z[2]||(z[2]=[e.createElementVNode("div",{class:"flex flex-col items-center space-y-2"},[e.createElementVNode("div",{class:"w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})],-1)])],2)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["bg-gray-100 rounded flex items-center justify-center",H.value]),onClick:c},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:e.normalizeClass(["w-[70%] h-[70%] object-contain cursor-pointer",q()])},null,2)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:m,src:b.value,alt:t.alt,class:e.normalizeClass(M.value),onLoad:Y,onError:u,onClick:l,style:e.normalizeStyle(j.value)},null,46,xn),[[e.vShow,k.value&&!p.value]]),L.value?(e.openBlock(),e.createBlock(e.Teleport,{key:3,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/75 flex items-center justify-center",style:{"z-index":"99999"},onClick:e.withModifiers(s,["self"]),onWheel:e.withModifiers(r,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300",{"scale-100":d.value,"scale-95":!d.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:N,src:o.previewSrcList||R.value||o.src,alt:t.alt,class:"max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",style:e.normalizeStyle({transform:`scale(${A.value})`}),onClick:z[0]||(z[0]=e.withModifiers(()=>{},["stop"]))},null,12,Vn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),_e=le(Nn,[["__scopeId","data-v-bb70f12d"]]),Dn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(t){const g=t,n=e.ref(!1),o=e.ref();let v=null;const f=e.computed(()=>`y-dropdown__menu--${g.placement}`),m=e.computed(()=>{if(!g.menuWidth)return{};const d=typeof g.menuWidth=="number"?`${g.menuWidth}px`:g.menuWidth;return{width:d,minWidth:d,maxWidth:d}}),N=()=>{console.log("显示下拉菜单",n.value),!g.disabled&&(v&&(clearTimeout(v),v=null),n.value=!0,console.log("设置 visible 为 true",n.value),e.nextTick(()=>{x()}))},k=()=>{console.log("隐藏下拉菜单"),v=setTimeout(()=>{n.value=!1,console.log("设置 visible 为 false",n.value)},150)},x=()=>{if(!o.value)return;const d=o.value.querySelector(".y-dropdown__trigger"),b=o.value.querySelector(".y-dropdown__menu");if(!d||!b)return;const R=d.getBoundingClientRect(),A=b.getBoundingClientRect(),L=window.innerWidth,B=window.innerHeight;b.style.top="",b.style.left="",b.style.right="",b.style.bottom="",b.style.transform="";let S=0,D=0;switch(g.placement){case"bottom":S=R.height+4,D=0;break;case"top":S=-(A.height+4),D=0;break;case"right":S=0,D=R.width+4;break;case"left":S=0,D=-(A.width+4);break}let M=R.top+S,H=R.left+D;if(g.placement==="bottom"||g.placement==="top"){const j=A.width||260;H+j>L-10&&(H=L-j-10),H<10&&(H=10)}if(g.placement==="left"||g.placement==="right"){const j=A.height||200;M+j>B-10&&(M=B-j-10),M<10&&(M=10)}b.style.top=`${M}px`,b.style.left=`${H}px`},p=d=>{g.trigger==="click"&&o.value&&!o.value.contains(d.target)&&(n.value=!1)},w=()=>{n.value&&x()};return e.onMounted(()=>{g.trigger==="click"&&document.addEventListener("click",p),window.addEventListener("resize",w),window.addEventListener("scroll",w)}),e.onUnmounted(()=>{g.trigger==="click"&&document.removeEventListener("click",p),v&&clearTimeout(v),window.removeEventListener("resize",w),window.removeEventListener("scroll",w)}),e.watch(()=>g.menuWidth,()=>{n.value&&e.nextTick(()=>{x()})}),(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:o},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:N,onMouseleave:k},[e.renderSlot(d.$slots,"trigger",{},()=>[b[0]||(b[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(m.value),onMouseenter:N,onMouseleave:k},[e.renderSlot(d.$slots,"default",{},()=>[b[1]||(b[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),b[2]||(b[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,n.value]])]),_:3})],512))}}),Me=le(Dn,[["__scopeId","data-v-ada3172a"]]),$n=["aria-hidden"],Sn=["onKeydown"],_n={key:0,class:"y-drawer-header"},Mn={class:"y-drawer-title"},zn={class:"y-drawer-body"},Ln={key:1,class:"y-drawer-footer"},Tn=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(t,{emit:g}){const n=t,o=g,v=e.computed({get:()=>n.modelValue,set:b=>o("update:modelValue",b)}),f=e.ref(null),m=e.computed(()=>n.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),N=e.computed(()=>n.placement==="right"?"rounded-left":"rounded-top"),k=e.computed(()=>{const b={};return n.placement==="right"?(b.width=typeof n.width=="number"?`${n.width}px`:String(n.width),b.height="100%",b.right="0",b.top="0"):(b.height=typeof n.height=="number"?`${n.height}px`:String(n.height),b.width="100%",b.bottom="0",b.left="0"),b});function x(){n.maskClosable&&p()}function p(){v.value&&(v.value=!1,o("close"))}function w(){n.closable&&p()}function d(b){b.key==="Escape"&&w()}return e.watch(()=>n.modelValue,b=>{b?(o("open"),requestAnimationFrame(()=>{var R;return(R=f.value)==null?void 0:R.focus()}),document.addEventListener("keydown",d),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",d),document.body.style.overflow="")}),e.onMounted(()=>{n.modelValue&&(document.addEventListener("keydown",d),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}),(b,R)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!v.value,style:e.normalizeStyle({zIndex:String(t.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:x}),e.createVNode(e.Transition,{name:m.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:f,class:e.normalizeClass(["y-drawer-panel",[`is-${t.placement}`,N.value]]),style:e.normalizeStyle(k.value),onKeydown:e.withKeys(e.withModifiers(w,["prevent","stop"]),["esc"]),tabindex:"-1"},[t.showHeader?(e.openBlock(),e.createElementBlock("div",_n,[e.createElementVNode("div",Mn,e.toDisplayString(t.title),1),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:p}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",zn,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),b.$slots.footer?(e.openBlock(),e.createElementBlock("div",Ln,[e.renderSlot(b.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Sn),[[e.vShow,v.value]])]),_:3},8,["name"])],12,$n),[[e.vShow,v.value]])]))}}),ze=le(Tn,[["__scopeId","data-v-b2797950"]]),In={class:"ytree__container"},Kn=["data-level","onClick","onContextmenu"],Hn=["onClick"],Fn={key:1,class:"w-[16px]"},Rn=["onClick"],Yn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},An={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Wn=["src","alt"],Pn={class:"ytree-node__custom-content"},On={key:0,class:"ytree-node__children"},jn=["data-level","onClick","onContextmenu"],qn=["onClick"],Un={key:1,class:"w-[16px]"},Zn=["onClick"],Qn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Jn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Xn=["src","alt"],Gn={class:"ytree-node__custom-content"},eo={key:0,class:"ytree-node__children"},to=["data-level","onClick","onContextmenu"],no=["onClick"],oo={key:1,class:"w-[16px]"},lo=["onClick"],ao={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},so={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},ro=["src","alt"],io={class:"ytree-node__custom-content"},co={key:0,class:"ytree-node__children"},uo=["data-level","onClick","onContextmenu"],fo=["onClick"],mo={key:1,class:"w-[16px]"},ho=["onClick"],vo={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},po={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},yo=["src","alt"],go={class:"ytree-node__custom-content"},ko={key:0,class:"ytree-node__children"},wo=["data-level","onClick","onContextmenu"],bo=["onClick"],Eo={key:1,class:"w-[16px]"},Bo=["onClick"],Co={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},xo={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Vo=["src","alt"],No={class:"ytree-node__custom-content"},Do="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",$o="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",So=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(t,{expose:g,emit:n}){const o=t,v=n,f=e.computed(()=>(console.log("ytree 组件接收到的数据:",o.data),o.data||[])),m=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set});e.provide("treeStore",m);const N=e.computed(()=>o.restrictAutoExpandFromLevel&&o.restrictAutoExpandFromLevel>0?o.restrictAutoExpandFromLevel:void 0);function k(u){return u[o.nodeKey]||u.id||Math.random()}function x(u){var c;return((c=o.props)!=null&&c.label?u[o.props.label]:void 0)||u.label||""}function p(u){var c;return!!((c=u==null?void 0:u.data)!=null&&c.isEmployee)}function w(u,c){var y;const l=o.deptIconUrl||Do,s=o.personIconUrl||$o,r=o.buttonIconUrl||"",h=o.childStyleIconUrl||"";return c&&h&&A(u,c)?h:(y=u==null?void 0:u.data)!=null&&y.isButton&&r?r:p(u)?s:l}function d(u){var l;const c=((l=o.props)!=null&&l.children?u[o.props.children]:void 0)||u.children;return c&&c.length>0}function b(u){var c;return((c=o.props)!=null&&c.children?u[o.props.children]:void 0)||u.children||[]}function R(u,c,l=1){if(u===c)return l;const s=b(u);for(const r of s){const h=R(r,c,l+1);if(h>0)return h}return 0}function A(u,c){return!o.childStyleLevel||o.childStyleLevel<1?!1:R(c,u)===o.childStyleLevel}function L(u){const c=k(u);return m.value.expandedKeys.has(c)}function B(u){const c=k(u);if(m.value.checkedKeys.has(c)){if(d(u)){const s=b(u),r=s.filter(y=>B(y)),h=s.filter(y=>S(y));return r.length===s.length&&h.length===0}return!0}if(d(u)){const s=b(u);return s.some(h=>S(h))?!1:s.length>0&&s.every(h=>B(h))}return!1}function S(u){if(!d(u))return!1;const c=b(u),l=c.filter(r=>B(r)),s=c.filter(r=>S(r));return l.length===c.length?!1:l.length>0||s.length>0}function D(u){const c=k(u);return m.value.currentKey===c}function M(u){const c=k(u);return m.value.highlightedKeys.has(c)}function H(u){if(o.disabled)return;const c=k(u),s=!m.value.checkedKeys.has(c),r=new Set(m.value.expandedKeys);s?m.value.checkedKeys.add(c):m.value.checkedKeys.delete(c);function h(y,z){y.forEach(P=>{const O=k(P);z?m.value.checkedKeys.add(O):m.value.checkedKeys.delete(O),d(P)&&h(b(P),z)})}h(b(u),s),s&&j(),ee(),m.value.expandedKeys=r,v("check-change",u,s,!1),v("check",u,s,!1),v("checked-keys-change",Array.from(m.value.checkedKeys))}function j(u){N.value&&console.log(`已启用从第${N.value}级开始不默认展开的限制(不主动收起已展开节点)`)}function W(u){const c=k(u);m.value.expandedKeys.has(c)?(m.value.expandedKeys.delete(c),v("node-collapse",u,u,null)):(m.value.expandedKeys.add(c),v("node-expand",u,u,null))}function ee(){const u=[];function c(s){s.forEach(r=>{u.push(r),d(r)&&c(b(r))})}c(f.value);function l(s){if(d(s)){const r=b(s),h=k(s),y=r.filter(P=>B(P)),z=r.filter(P=>S(P));y.length===r.length&&z.length===0||y.length>0||z.length>0?m.value.checkedKeys.add(h):m.value.checkedKeys.delete(h)}}for(let s=u.length-1;s>=0;s--)l(u[s])}function q(u,c,l,s){if(o.disabled)return;const r=s?A(u,s):!1;if(o.enableChildStyleCustomClick&&r){v("child-node-click",u,c,l);return}if(o.expandOnClickNode&&d(u)){W(u);return}m.value.currentNode=u,m.value.currentKey=k(u),o.showCheckbox&&H(u),v("node-click",u,c,l)}function X(u,c,l,s){o.disabled||v("node-contextmenu",u,c,l,s)}e.watch(()=>o.defaultExpandedKeys,u=>{if(u){const c=N.value;if(c){let l=function(y,z,P=1){for(const O of z){if(k(O)===y)return P;if(d(O)){const re=l(y,b(O),P+1);if(re>0)return re}}return 0},s=function(y,z,P){y.forEach(O=>{z<P&&d(O)?(h.add(k(O)),s(b(O),z+1,P)):z<P&&d(O)})};const r=(u||[]).filter(y=>{const z=l(y,f.value,1);return z>0&&z<c}),h=new Set(r);s(f.value,1,c),m.value.expandedKeys.forEach(y=>{l(y,f.value,1)>=c&&h.add(y)}),m.value.expandedKeys=h}else m.value.expandedKeys=new Set(u)}},{immediate:!0});function oe(){if(o.defaultExpandAll){let u=function(s,r=1){s.forEach(h=>{if(!d(h))return;const y=b(h);if(l){if(r>=l)return;r+1===l||c.add(k(h)),u(y,r+1)}else c.add(k(h)),u(y,r+1)})};const c=new Set,l=N.value;u(f.value,1),m.value.expandedKeys=c}}function ne(){if(o.defaultCheckedKeys&&o.defaultCheckedKeys.length>0){let u=function(r,h=[]){r.forEach(y=>{const z=k(y),P=[...h,z];c.has(z)&&h.forEach(O=>l.add(O)),d(y)&&u(b(y),P)})};const c=new Set(o.defaultCheckedKeys),l=new Set;u(f.value);const s=N.value;if(s){console.log(`已启用从第${s}级开始不默认展开:保持当前展开状态不变`);return}m.value.expandedKeys=l}}e.watch(()=>o.defaultExpandAll,oe,{immediate:!0}),e.watch(()=>f.value,oe,{deep:!0}),e.watch(()=>o.defaultCheckedKeys,u=>{u?(m.value.checkedKeys=new Set(u),o.enableFourthLevelSpecialHandling?console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态"):ne()):m.value.checkedKeys.clear()},{immediate:!0});function G(u){try{let c=function(r,h,y=[]){for(const z of r){const P=k(z),O=[...y,P];if(P===h)return O;if(d(z)){const re=c(b(z),h,O);if(re)return re}}return null};const l=Array.isArray(u)?u:[];if(l.length===0)return;m.value.highlightedKeys.clear();const s=new Set(m.value.expandedKeys);l.forEach(r=>{const h=c(f.value,r);h&&h.length>0&&(h.slice(0,-1).forEach(y=>s.add(y)),m.value.highlightedKeys.add(h[h.length-1]))}),m.value.expandedKeys=s}catch(c){console.warn("highlightAndExpandByIds 执行失败",c)}}function K(){m.value.highlightedKeys.clear()}function Y(){m.value.currentNode=null,m.value.currentKey=null}return g({highlightAndExpandByIds:G,clearHighlights:K,clearCurrentNode:Y}),e.watch(()=>o.defaultSelectedKeys,u=>{u&&(m.value.selectedKeys=new Set(u))},{immediate:!0}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${t.size}`,{"ytree--disabled":t.disabled}]])},[e.createElementVNode("div",In,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,l=>(e.openBlock(),e.createElementBlock("div",{key:k(l),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(l),"ytree-node--highlight":M(l)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A(l,l)}]),style:{paddingLeft:"8px"},"data-level":R(l,l),onClick:s=>q(l,l,null,l),onContextmenu:s=>X(s,l,l,null)},[d(l)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(l)}]),onClick:e.withModifiers(s=>W(l),["stop"])},[...c[0]||(c[0]=[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)])],10,Hn)):(e.openBlock(),e.createElementBlock("span",Fn)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(l),"is-indeterminate":S(l)}]),onClick:e.withModifiers(s=>H(l),["stop"])},[B(l)?(e.openBlock(),e.createElementBlock("svg",Yn,[...c[1]||(c[1]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(l)?(e.openBlock(),e.createElementBlock("svg",An,[...c[2]||(c[2]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Rn)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(l,l),alt:p(l)?"person":"dept"},null,8,Wn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(l)}])},e.toDisplayString(x(l)),3),e.createElementVNode("div",Pn,[e.renderSlot(u.$slots,"node-content",{node:l,isCurrent:D(l),isExpanded:L(l),hasChildren:d(l)},void 0,!0)])],42,Kn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(l)&&L(l)?(e.openBlock(),e.createElementBlock("div",On,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(l),s=>(e.openBlock(),e.createElementBlock("div",{key:k(s),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(s),"ytree-node--highlight":M(s)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A(s,l)}]),style:{paddingLeft:"22px"},"data-level":R(l,s),onClick:r=>q(s,s,null,l),onContextmenu:r=>X(r,s,s,null)},[d(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(s)}]),onClick:e.withModifiers(r=>W(s),["stop"])},[...c[3]||(c[3]=[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)])],10,qn)):(e.openBlock(),e.createElementBlock("span",Un)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(s),"is-indeterminate":S(s)}]),onClick:e.withModifiers(r=>H(s),["stop"])},[B(s)?(e.openBlock(),e.createElementBlock("svg",Qn,[...c[4]||(c[4]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(s)?(e.openBlock(),e.createElementBlock("svg",Jn,[...c[5]||(c[5]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Zn)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(s,l),alt:p(s)?"person":"dept"},null,8,Xn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(s)}])},e.toDisplayString(x(s)),3),e.createElementVNode("div",Gn,[e.renderSlot(u.$slots,"node-content",{node:s,isCurrent:D(s),isExpanded:L(s),hasChildren:d(s)},void 0,!0)])],42,jn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(s)&&L(s)?(e.openBlock(),e.createElementBlock("div",eo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(s),r=>(e.openBlock(),e.createElementBlock("div",{key:k(r),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(r),"ytree-node--highlight":M(r)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A(r,l)}]),style:{paddingLeft:"38px"},"data-level":R(l,r),onClick:h=>q(r,r,null,l),onContextmenu:h=>X(h,r,r,null)},[d(r)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(r)}]),onClick:e.withModifiers(h=>W(r),["stop"])},[...c[6]||(c[6]=[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)])],10,no)):(e.openBlock(),e.createElementBlock("span",oo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(r),"is-indeterminate":S(r)}]),onClick:e.withModifiers(h=>H(r),["stop"])},[B(r)?(e.openBlock(),e.createElementBlock("svg",ao,[...c[7]||(c[7]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(r)?(e.openBlock(),e.createElementBlock("svg",so,[...c[8]||(c[8]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,lo)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(r,l),alt:p(r)?"person":"dept"},null,8,ro),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(r)}])},e.toDisplayString(x(r)),3),e.createElementVNode("div",io,[e.renderSlot(u.$slots,"node-content",{node:r,isCurrent:D(r),isExpanded:L(r),hasChildren:d(r)},void 0,!0)])],42,to),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(r)&&L(r)?(e.openBlock(),e.createElementBlock("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(r),h=>(e.openBlock(),e.createElementBlock("div",{key:k(h),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(h),"ytree-node--highlight":M(h)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A(h,l)}]),style:{paddingLeft:"54px"},"data-level":R(l,h),onClick:y=>q(h,h,null,l),onContextmenu:y=>X(y,h,h,null)},[d(h)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(h)}]),onClick:e.withModifiers(y=>W(h),["stop"])},[...c[9]||(c[9]=[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)])],10,fo)):(e.openBlock(),e.createElementBlock("span",mo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(h),"is-indeterminate":S(h)}]),onClick:e.withModifiers(y=>H(h),["stop"])},[B(h)?(e.openBlock(),e.createElementBlock("svg",vo,[...c[10]||(c[10]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(h)?(e.openBlock(),e.createElementBlock("svg",po,[...c[11]||(c[11]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,ho)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(h,l),alt:p(h)?"person":"dept"},null,8,yo),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(h)}])},e.toDisplayString(x(h)),3),e.createElementVNode("div",go,[e.renderSlot(u.$slots,"node-content",{node:h,isCurrent:D(h),isExpanded:L(h),hasChildren:d(h)},void 0,!0)])],42,uo),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(h)&&L(h)?(e.openBlock(),e.createElementBlock("div",ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(h),y=>(e.openBlock(),e.createElementBlock("div",{key:k(y),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(y)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":A(y,l)}]),style:{paddingLeft:"70px"},"data-level":R(l,y),onClick:z=>q(y,y,null,l),onContextmenu:z=>X(z,y,y,null)},[d(y)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(y)}]),onClick:e.withModifiers(z=>W(y),["stop"])},[...c[12]||(c[12]=[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)])],10,bo)):(e.openBlock(),e.createElementBlock("span",Eo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(y),"is-indeterminate":S(y)}]),onClick:e.withModifiers(z=>H(y),["stop"])},[B(y)?(e.openBlock(),e.createElementBlock("svg",Co,[...c[13]||(c[13]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(y)?(e.openBlock(),e.createElementBlock("svg",xo,[...c[14]||(c[14]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Bo)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(y,l),alt:p(y)?"person":"dept"},null,8,Vo),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(y)}])},e.toDisplayString(x(y)),3),e.createElementVNode("div",No,[e.renderSlot(u.$slots,"node-content",{node:y,isCurrent:D(y),isExpanded:L(y),hasChildren:d(y)},void 0,!0)])],42,wo)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])],2))}}),Le=le(So,[["__scopeId","data-v-6ab410ed"]]),_o={class:"query-encapsulation"},Mo={class:"query-encapsulation__container"},zo={class:"query-encapsulation__content"},Lo={class:"query-encapsulation__fields"},To={class:"query-encapsulation__field-wrapper"},Io={class:"query-encapsulation__field-label"},Ko={key:0,class:"query-encapsulation__toggle"},Ho={class:"query-encapsulation__actions"},Fo={class:"query-encapsulation__actions-group"},Ro=e.defineComponent({__name:"QueryEncapsulation",props:{fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),f=e.reactive({}),m=e.computed(()=>n.fields.filter(B=>!B.hidden)),N=e.computed(()=>v.value?m.value:m.value.slice(0,n.maxVisibleFields)),k=e.computed(()=>m.value.length>n.maxVisibleFields);function x(B){switch(B){case"select":return we;case"date":case"daterange":return be;case"input":default:return ke}}function p(B){o("field-change",B,f[B.key]),o("update:modelValue",{...f})}function w(){const B=R(f),S=A(B);o("search",{data:S})}function d(){Object.keys(f).forEach(B=>{const S=n.fields.find(D=>D.key===B);(S==null?void 0:S.type)==="daterange"?f[B]={startDate:null,endDate:null}:(S==null?void 0:S.type)==="date"?f[B]=null:f[B]=""}),o("reset"),o("update:modelValue",{...f})}function b(){v.value=!v.value}function R(B){const S={};return Object.keys(B).forEach(D=>{const M=B[D],H=n.fields.find(j=>j.key===D);M!=null&&M!==""&&(typeof M=="object"&&M.startDate&&M.endDate?M.startDate&&M.endDate&&(S[D]=M):H&&(H.type==="date"||H.type==="daterange")?M!==0&&(S[D]=M):S[D]=M)}),S}function A(B){const S={};return Object.keys(B).forEach(D=>{const M=B[D],H=n.fields.find(j=>j.key===D);if(H)if(H.type==="daterange"&&typeof M=="object"){const j=H.startKey||`${D}Start`,W=H.endKey||`${D}End`;M.startDate&&M.endDate&&M.startDate!==0&&M.endDate!==0&&(H.format==="timestamp"?(S[j]=new Date(M.startDate).getTime(),S[W]=new Date(M.endDate).getTime()):(S[j]=M.startDate,S[W]=M.endDate))}else H.type==="date"&&M&&M!==0&&H.format==="timestamp"?S[D]=new Date(M).getTime():S[D]=M;else S[D]=M}),S}function L(){n.fields.forEach(B=>{var S,D,M;f[B.key]===void 0&&(B.type==="daterange"?f[B.key]=((S=n.modelValue)==null?void 0:S[B.key])||{startDate:null,endDate:null}:B.type==="date"?f[B.key]=((D=n.modelValue)==null?void 0:D[B.key])||null:f[B.key]=((M=n.modelValue)==null?void 0:M[B.key])||"")})}return e.watch(()=>n.modelValue,B=>{B&&Object.assign(f,B)},{deep:!0,immediate:!0}),e.onMounted(()=>{L()}),(B,S)=>(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("div",Mo,[e.createElementVNode("div",zo,[e.createElementVNode("div",Lo,[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(N.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.key,class:"query-encapsulation__field-item"},[e.createElementVNode("div",To,[e.createElementVNode("label",Io,e.toDisplayString(D.label),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x(D.type)),{modelValue:f[D.key],"onUpdate:modelValue":M=>f[D.key]=M,placeholder:D.placeholder||`请输入${D.label}`,options:D.options,clearable:D.clearable!==!1,size:D.size||"small",width:D.width||"180px",format:D.format||"timestamp","include-time":D.includeTime||!1,filterable:D.filterable===!0,onInput:M=>p(D),onChange:M=>p(D)},null,40,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","onInput","onChange"]))])]))),128))]),_:1}),k.value?(e.openBlock(),e.createElementBlock("div",Ko,[e.createVNode(me,{variant:"secondary",size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":v.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.createElementVNode("div",Fo,[e.createVNode(me,{variant:"primary",size:"small",onClick:w,loading:t.loading},{default:e.withCtx(()=>[...S[0]||(S[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(me,{variant:"secondary",size:"small",onClick:d,loading:t.loading},{default:e.withCtx(()=>[...S[1]||(S[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(B.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),Te=le(Ro,[["__scopeId","data-v-b7c459de"]]),Yo={class:"y-msg__icon","aria-hidden":"true"},Ao={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Wo={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Po={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Oo=["textContent"],jo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(t){const g=t,n=e.ref(!1);let o;e.onMounted(()=>{requestAnimationFrame(()=>{n.value=!0,g.duration&&g.duration>0&&(o=window.setTimeout(()=>v(),g.duration))})}),e.onBeforeUnmount(()=>{o&&window.clearTimeout(o)});function v(){n.value=!1}function f(){var m;(m=g.onClose)==null||m.call(g,g.id)}return(m,N)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:f},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${t.type}`]]),style:e.normalizeStyle({zIndex:t.zIndex}),role:"status","aria-live":"polite"},[e.createElementVNode("span",Yo,[t.type==="success"?(e.openBlock(),e.createElementBlock("svg",Ao,[...N[0]||(N[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):t.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Wo,[...N[1]||(N[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",Po,[...N[2]||(N[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)])]))]),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(t.message)},null,8,Oo),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:v},"✕")):e.createCommentVNode("",!0)],6),[[e.vShow,n.value]])]),_:1}))}}),qo=le(jo,[["__scopeId","data-v-ceac9e81"]]);let Uo=1;const ge=12,ce=[];function Zo(){let t=20;return ce.forEach(g=>{t+=g.height+ge}),t}function Be(t){const g=ce.findIndex(f=>f.id===t);if(g===-1)return;const{el:n}=ce[g],o=n.firstElementChild;if(o){const f=window.getComputedStyle(o).top;o.style.top=f,o.classList.add("is-leaving"),o.style.willChange="opacity, transform"}ce[g].leaving=!0,ve(),setTimeout(()=>{e.render(null,n),n.parentNode&&n.parentNode.removeChild(n);const f=ce.findIndex(m=>m.id===t);f!==-1&&ce.splice(f,1),ve()},260)}function ye(t){var f;const g=Uo++,n=document.createElement("div");document.body.appendChild(n);const o=e.createVNode(qo,{id:g,type:t.type||"success",message:t.message,duration:t.duration??2500,offset:Zo(),zIndex:3e3+g,closable:t.closable??!1,onClose:m=>Be(m)});e.render(o,n);const v=((f=n.firstElementChild)==null?void 0:f.offsetHeight)||0;return ce.push({id:g,el:n,vm:o,height:v,leaving:!1}),ve(),requestAnimationFrame(()=>{const m=n.firstElementChild;if(!m)return;const N=m.offsetHeight||v||0,k=ce.find(x=>x.id===g);k&&(k.height=N,ve())}),{close:()=>Be(g)}}const he={success(t,g={}){return ye({...g,type:"success",message:t})},warning(t,g={}){return ye({...g,type:"warning",message:t})},error(t,g={}){return ye({...g,type:"error",message:t})}};typeof window<"u"&&(window.YMessage=he,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=he));function ve(){let t=20;ce.forEach(g=>{const n=g.el.firstElementChild;if(!n)return;const o=t;if(n.style.transform=`translate(-50%, ${o}px)`,n.style.top||(n.style.top="0px"),!g.leaving)t+=(n.offsetHeight||g.height)+ge;else{const v=n.offsetHeight||g.height;t+=v+ge}})}const Ce={YButton:me,YInput:ke,YTable:xe,YSelect:we,YPagination:Ve,YBadge:Ne,YDialog:De,YPopover:$e,YTime:be,YSwitch:Se,YImage:_e,YDropdown:Me,YDrawer:ze,YTree:Le,QueryEncapsulation:Te},Qo={install(t){Object.keys(Ce).forEach(g=>{t.component(g,Ce[g])}),t.config.globalProperties.$message=he,typeof window<"u"&&(window.YMessage=he)}};exports.QueryEncapsulation=Te;exports.YBadge=Ne;exports.YButton=me;exports.YDialog=De;exports.YDrawer=ze;exports.YDropdown=Me;exports.YImage=_e;exports.YInput=ke;exports.YMessage=he;exports.YPagination=Ve;exports.YPopover=$e;exports.YSelect=we;exports.YSwitch=Se;exports.YTable=xe;exports.YTime=be;exports.YTree=Le;exports.default=Qo;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),He=["type","disabled","aria-busy","aria-disabled"],Fe={class:"content"},Re={key:1,class:"y-btn-group",role:"group"},Ye=["type","disabled","aria-busy","aria-disabled","aria-label","onClick"],Ae={class:"content"},We={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Pe={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},Oe={key:2},je=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(t,{emit:g}){const n=t,o=g;function v(k){if(n.disabled||n.loading){k.preventDefault(),k.stopPropagation();return}o("click",k)}const m=e.computed(()=>{switch(n.groupPosition){case"start":return"group-pos-start";case"middle":return"group-pos-middle";case"end":return"group-pos-end";default:return"group-pos-single"}}),f=e.computed(()=>Array.isArray(n.groupItems)&&n.groupItems.length>0);function N(k,C){if(n.disabled||n.loading||k.disabled||k.loading){C.preventDefault(),C.stopPropagation();return}o("group-click",k.value,C)}return(k,C)=>f.value?(e.openBlock(),e.createElementBlock("div",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.groupItems,(p,w)=>{var d;return e.openBlock(),e.createElementBlock("button",{key:p.value??w,class:e.normalizeClass(["y-btn",[`y-btn--${p.variant??t.variant}`,`y-btn--${p.size??t.size}`,"is-grouped",w===0?"group-pos-start":w===(((d=t.groupItems)==null?void 0:d.length)||0)-1?"group-pos-end":"group-pos-middle",{"is-loading":p.loading||t.loading}]]),type:t.htmlType,disabled:(p.disabled??!1)||t.disabled||t.loading||p.loading,"aria-busy":p.loading||t.loading?"true":"false","aria-disabled":(p.disabled??!1)||t.disabled||t.loading||p.loading?"true":"false","aria-label":p.ariaLabel||p.label,onClick:b=>N(p,b)},[e.createElementVNode("span",Ae,[p.icon==="chevron-left"?(e.openBlock(),e.createElementBlock("svg",We,[...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)])])):p.icon==="chevron-right"?(e.openBlock(),e.createElementBlock("svg",Pe,[...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),p.label&&!p.onlyIcon?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(p.label),1)):e.createCommentVNode("",!0)])],10,Ye)}),128))])):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["y-btn",[`y-btn--${t.variant}`,`y-btn--${t.size}`,{"is-block":t.block,"is-loading":t.loading},t.groupPosition!=="single"?"is-grouped":"",m.value]]),type:t.htmlType,disabled:t.disabled||t.loading,"aria-busy":t.loading?"true":"false","aria-disabled":t.disabled||t.loading?"true":"false",onClick:v},[e.createElementVNode("span",Fe,[e.renderSlot(k.$slots,"default",{},void 0,!0)])],10,He))}}),le=(t,g)=>{const n=t.__vccOpts||t;for(const[o,v]of g)n[o]=v;return n},me=le(je,[["__scopeId","data-v-40819241"]]),qe=["id","name","type","placeholder","autocomplete","inputmode","disabled","required","value"],Ue=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"},clearOnFocus:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(null),m=e.ref(""),f=e.ref(!1),N=e.ref(!1),k=e.ref(n.placeholder||"");e.watch(()=>n.placeholder,d=>{N.value||(k.value=d||"")});function C(d){const b=d.target;f.value=!0,o("update:modelValue",b.value)}function p(){N.value=!0,n.clearOnFocus&&(m.value=n.modelValue||"",f.value=!1,k.value=m.value||n.placeholder||"",o("update:modelValue",""))}function w(){N.value=!1,n.clearOnFocus&&!f.value&&(!n.modelValue||n.modelValue==="")&&o("update:modelValue",m.value),k.value=n.placeholder||""}return(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["y-input-wrap",{"is-block":t.block}]),style:e.normalizeStyle({width:t.width})},[e.createElementVNode("input",{ref_key:"inputRef",ref:v,class:e.normalizeClass(["y-input",`y-input--${t.size}`]),id:t.id,name:t.name,type:t.type,placeholder:k.value,autocomplete:t.autocomplete,inputmode:t.inputmode,disabled:t.disabled,required:t.required,value:t.modelValue,onInput:C,onFocus:p,onBlur:w},null,42,qe)],6))}}),ke=le(Ue,[["__scopeId","data-v-e4bfe1f3"]]),Ze={key:0,class:"bulk-bar"},Qe={class:"bulk-left"},Je={class:"bulk-actions"},Xe={class:"card"},Ge={class:"table"},et={key:0,style:{width:"40px","min-width":"40px"}},tt={key:0,class:"col-select"},nt=["checked"],ot={key:0,class:"loading-overlay"},lt={key:1,class:"empty-overlay"},at={key:0,style:{width:"40px","min-width":"40px"}},st={key:0,class:"col-select"},rt=["value","checked","onChange"],it=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}},emits:["edit","select","update:selectedItems","page-change","page-size-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(n.currentPage||1),m=e.ref(n.pageSize),f=e.ref([]),N=e.ref("none"),k=e.ref(),C=e.ref(),p=e.ref(),w=e.ref(),d=e.ref([]),b=e.ref(),R=e.ref({show:!1,thumbHeight:40,thumbTop:0});let W=!1,L=0,B=0;const S=e.ref(0),D=e.computed(()=>{if(!n.searchKeyword||!n.searchFields.length)return n.data;const E=n.searchKeyword.toLowerCase();return n.data.filter(x=>n.searchFields.some(_=>{const $=X(x,_);return String($).toLowerCase().includes(E)}))}),M=e.computed(()=>(n.pagination,D.value)),H=e.computed(()=>{if(!n.selectable)return!1;const E=M.value.map((x,_)=>q(x,_));return E.length>0&&E.every(x=>f.value.includes(x))}),j=e.computed(()=>{const E=[];let x=n.selectable?40:0;for(let _=0;_<n.columns.length;_++){const $=n.columns[_];if($.fixed==="left"){let T=80;if($.width){const F=parseFloat($.width);T=isNaN(F)?80:F}else if(d.value[_]){const F=parseFloat(d.value[_]);T=isNaN(F)?80:F}E.push(x),x+=T}}return E}),O=e.computed(()=>{const E=[];let x=0;const _=[];for(let $=n.columns.length-1;$>=0;$--){const T=n.columns[$];if(T.fixed==="right"){let F=80;if(T.width){const U=parseFloat(T.width);F=isNaN(U)?80:U}else if(d.value[$]){const U=parseFloat(d.value[$]);F=isNaN(U)?80:U}_.push({index:$,width:F})}}for(let $=0;$<_.length;$++)E.push(x),x+=_[$].width;return E});function ee(E,x){if(x==="left"){let _=0;for(let $=0;$<E;$++)n.columns[$].fixed==="left"&&_++;return _}else{let _=0;for(let $=n.columns.length-1;$>E;$--)n.columns[$].fixed==="right"&&_++;return _}}function q(E,x){return typeof n.rowKey=="function"?n.rowKey(E):E[n.rowKey]||x}function X(E,x){return x.split(".").reduce((_,$)=>_==null?void 0:_[$],E)}function oe(E,x=!1){const _=[];return E.align&&_.push(`text-${E.align}`),E.fixed==="right"&&(_.push("col-fixed-right"),x&&_.push("col-fixed-right-header")),E.fixed==="left"&&(_.push("col-fixed-left"),x&&_.push("col-fixed-left-header")),_.join(" ")}function ne(E,x,_){const $={};if(E.width?($.width=E.width,$.minWidth=E.width,$.maxWidth=E.width):($.width="auto",$.minWidth="80px",$.maxWidth="none"),E.fixed==="left"){const T=ee(x,"left"),F=j.value[T]||0;$.left=`${F}px`,$.zIndex=_?`${10+T}`:`${5+T}`}else if(E.fixed==="right"){const T=ee(x,"right"),F=O.value[T]||0;_?$.right=`${F-3}px`:$.right=`${F}px`,$.zIndex=_?`${10+T}`:`${5+T}`}return $}function G(E,x){const _=X(E,x.key);return x.formatter?x.formatter(_,E):_||""}function K(E){f.value.includes(E)?f.value=f.value.filter(x=>x!==E):f.value=[...f.value,E],o("select",f.value),o("update:selectedItems",f.value)}function Y(){const E=M.value.map((x,_)=>q(x,_));if(E.every(x=>f.value.includes(x)))f.value=f.value.filter(x=>!E.includes(x));else{const x=new Set([...f.value,...E]);f.value=Array.from(x)}o("select",f.value),o("update:selectedItems",f.value)}function u(){f.value=[],o("select",f.value),o("update:selectedItems",f.value)}e.watch(()=>n.searchKeyword,()=>{v.value=1}),e.watch(()=>n.data,()=>{n.total||(v.value=1)},{deep:!0});function c(E){v.value=E,o("page-change",E)}function l(E){m.value=E,v.value=1,o("page-size-change",E)}e.watch(()=>n.currentPage,E=>{const x=typeof E=="number"&&E>0?E:1;v.value!==x&&(v.value=x)}),e.watch(()=>n.pageSize,E=>{const x=typeof E=="number"&&E>0?E:10;m.value!==x&&(m.value=x)});function s(){k.value&&e.nextTick(()=>{const E=k.value.getBoundingClientRect(),x=window.innerHeight,_=E.top,$=k.value.querySelector(".table-header"),T=$?$.offsetHeight:40,F=k.value.querySelector(".ypagination"),U=F?F.offsetHeight:60,a=k.value.querySelector(".bulk-bar"),i=a?a.offsetHeight:0,V=T+U+i+20,I=x-_-V,Z=Math.max(200,I),J=k.value.querySelector(".table-body-wrap .table");J&&(J.offsetHeight>I?N.value=`${Z}px`:N.value="none")})}let r=!1;function h(){!C.value||!p.value||r||C.value.scrollLeft!==p.value.scrollLeft&&(r=!0,C.value.scrollLeft=p.value.scrollLeft,requestAnimationFrame(()=>{r=!1}))}function y(){!C.value||!p.value||r||p.value.scrollLeft!==C.value.scrollLeft&&(r=!0,p.value.scrollLeft=C.value.scrollLeft,requestAnimationFrame(()=>{r=!1}))}function z(){e.nextTick(()=>{if(!p.value)return;const E=p.value,x=E.scrollHeight,_=E.clientHeight,$=E.scrollTop,T=x>_+1;if(R.value.show=T,!T)return;const F=24,U=_/x,a=b.value?b.value.clientHeight:_,i=Math.max(F,Math.floor(a*U));R.value.thumbHeight=i;const V=Math.max(0,a-i),I=Math.max(1,x-_);R.value.thumbTop=Math.min(V,Math.floor($/I*V))})}function A(E){if(!W||!p.value||!b.value)return;E.preventDefault();const x=b.value.clientHeight,_=Math.max(0,x-R.value.thumbHeight),$=p.value,T=$.scrollHeight,F=$.clientHeight,U=Math.max(1,T-F),i=(E.clientY-L)/Math.max(1,_)*U;$.scrollTop=Math.min(U,Math.max(0,B+i)),z()}function P(){W=!1,window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",P)}function ae(){e.nextTick(()=>{var _;if(d.value.length===n.columns.length&&d.value.every($=>!!$))return;const E=[];for(const $ of n.columns)if($.width&&typeof $.width=="string"&&$.width.trim())E.push($.width);else{const T=d.value[E.length];E.push(T||"")}const x=(_=w.value)==null?void 0:_.querySelector("tbody tr");if(x){const $=n.selectable?1:0,T=Array.from(x.children);for(let F=0;F<n.columns.length;F++)if(!E[F]){const U=T[$+F];if(U){const a=U.clientWidth;E[F]=(a>0?a:80)+"px"}else E[F]="80px"}}else for(let $=0;$<E.length;$++)E[$]||(E[$]=d.value[$]||"80px");d.value=E})}function fe(){s(),re()}e.watch(()=>n.data,()=>{e.nextTick(()=>{s(),h(),re()})},{deep:!0}),e.watch([v,m],()=>{e.nextTick(()=>{s(),h(),re()})}),e.watch(()=>n.columns,()=>{d.value=[],e.nextTick(()=>{ae(),h(),re()})},{deep:!0}),e.watch(()=>f.value,()=>{e.nextTick(()=>{s(),re()})},{deep:!0}),e.watch(()=>n.loading,()=>{e.nextTick(()=>{re()})}),e.onMounted(()=>{var E,x;e.nextTick(()=>{s(),ae(),re(),z()}),window.addEventListener("resize",fe),window.addEventListener("scroll",fe,!0),(E=p.value)==null||E.addEventListener("scroll",()=>{h(),z(),re()},{passive:!0}),(x=C.value)==null||x.addEventListener("scroll",()=>{y()},{passive:!0}),e.nextTick(()=>h()),p.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(()=>{re()}),ue.observe(p.value))}),e.onUnmounted(()=>{var E,x;window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe,!0),(E=p.value)==null||E.removeEventListener("scroll",h),(x=C.value)==null||x.removeEventListener("scroll",y),window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",P),ue&&(ue.disconnect(),ue=null)});let de=-1;function re(){!C.value||!p.value||requestAnimationFrame(()=>{if(!C.value||!p.value)return;const E=p.value,x=Math.ceil(E.offsetWidth-E.clientWidth);if(S.value=x,x!==de){de=x;const _=C.value.querySelector(".table"),$=w.value;_&&$&&(C.value.style.paddingRight="0px",_.style.width="",_.style.marginRight="",x>0?(C.value.style.paddingRight=`${x}px`,_.style.width="100%",_.style.marginRight=`-${x}px`):(C.value.style.paddingRight="0px",_.style.width="100%",_.style.marginRight="0px"))}})}let ue=null;return(E,x)=>{const _=e.resolveComponent("YButton"),$=e.resolveComponent("YPagination");return e.openBlock(),e.createElementBlock("div",{class:"ytable-container",ref_key:"tableContainer",ref:k},[e.createVNode(e.Transition,{name:"bulk-slide"},{default:e.withCtx(()=>[f.value.length&&t.showBulkActions?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",Qe,"已选择 "+e.toDisplayString(f.value.length)+" 项",1),e.createElementVNode("div",Je,[e.renderSlot(E.$slots,"bulk-actions",{selectedItems:f.value,clearSelection:u},()=>[e.createVNode(_,{size:"small",class:"btn",onClick:u},{default:e.withCtx(()=>[...x[2]||(x[2]=[e.createTextVNode("清除选择",-1)])]),_:1})],!0)])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",Xe,[e.createElementVNode("div",{class:"table-header",ref_key:"headerRef",ref:C},[e.createElementVNode("table",Ge,[e.createElementVNode("colgroup",null,[t.selectable?(e.openBlock(),e.createElementBlock("col",et)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("col",{key:T.key,style:e.normalizeStyle({width:d.value[F]||void 0,minWidth:d.value[F]||"80px"})},null,4))),128))]),e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",tt,[e.createElementVNode("input",{type:"checkbox",checked:H.value,onChange:Y},null,40,nt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("th",{key:T.key,class:e.normalizeClass(oe(T,!0)),style:e.normalizeStyle(ne(T,F,!0))},e.toDisplayString(T.title),7))),128))])])])],512),e.createElementVNode("div",{class:e.normalizeClass(["table-body-wrap",{"is-loading":t.loading,"is-empty":!M.value.length&&!t.loading}]),ref_key:"bodyWrapRef",ref:p,style:e.normalizeStyle({maxHeight:N.value})},[t.loading?(e.openBlock(),e.createElementBlock("div",ot,[...x[3]||(x[3]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("div",{class:"loading-text"},"加载中...",-1)])])):e.createCommentVNode("",!0),!M.value.length&&!t.loading?(e.openBlock(),e.createElementBlock("div",lt,[e.renderSlot(E.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(t.emptyText),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass(["table",{"loading-table":t.loading}]),ref_key:"bodyTableRef",ref:w},[e.createElementVNode("colgroup",null,[t.selectable?(e.openBlock(),e.createElementBlock("col",at)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(T,F)=>(e.openBlock(),e.createElementBlock("col",{key:T.key,style:e.normalizeStyle({width:d.value[F]||void 0,minWidth:d.value[F]||"80px"})},null,4))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(T,F)=>(e.openBlock(),e.createElementBlock("tr",{key:q(T,F)},[t.selectable?(e.openBlock(),e.createElementBlock("td",st,[e.createElementVNode("input",{type:"checkbox",value:q(T,F),checked:f.value.includes(q(T,F)),onChange:U=>K(q(T,F))},null,40,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(U,a)=>(e.openBlock(),e.createElementBlock("td",{key:U.key,class:e.normalizeClass(oe(U)),style:e.normalizeStyle(ne(U,a,!1))},[e.renderSlot(E.$slots,`cell-${U.key}`,{item:T,value:X(T,U.key),index:F},()=>[e.createTextVNode(e.toDisplayString(G(T,U)),1)],!0)],6))),128))]))),128))])],2)],6),t.pagination?(e.openBlock(),e.createBlock($,{key:0,class:"align-right","current-page":v.value,"onUpdate:currentPage":x[0]||(x[0]=T=>v.value=T),"page-size":m.value,"onUpdate:pageSize":x[1]||(x[1]=T=>m.value=T),loading:n.loading,"page-size-options":t.pageSizeOptions,onPageChange:c,onPageSizeChange:l},null,8,["current-page","page-size","loading","page-size-options"])):e.createCommentVNode("",!0)])],512)}}}),xe=le(it,[["__scopeId","data-v-9d7d4151"]]),ct=["onKeydown","aria-expanded"],dt=["src"],ut=["placeholder","onKeydown"],ft=["onClick","onMouseenter"],mt=["src"],ht=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},valueKey:{default:"value"},labelKey:{default:"label"},disabledKey:{default:"disabled"},size:{default:"medium"},width:{default:"200px"}},emits:["update:modelValue","change","focus","blur","clear"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),m=e.ref(-1),f=e.ref(),N=e.ref(),k=e.ref(),C=e.ref(),p=e.ref(!1),w=e.ref(),d=e.ref(""),b=e.computed(()=>n.options.find(l=>S(l)===n.modelValue)||null),R=e.computed(()=>b.value?D(b.value):""),W=e.computed(()=>{if(!n.filterable)return n.options;const l=d.value.trim().toLowerCase();return l?n.options.filter(s=>{const r=D(s);return String(r).toLowerCase().includes(l)}):n.options}),L=e.computed(()=>{var y;const l={position:"fixed",zIndex:"4000"},s=N.value;if(!s)return l;const r=s.getBoundingClientRect(),h=((y=k.value)==null?void 0:y.getBoundingClientRect().width)||r.width;return l.left=`${r.left}px`,l.width=`${h}px`,p.value?(l.bottom=`${window.innerHeight-r.top+4}px`,l.top="auto"):l.top=`${r.bottom+4}px`,l});function B(){!v.value||!N.value||e.nextTick(()=>{const l=N.value;if(!l)return;const s=l.getBoundingClientRect(),r=window.innerHeight,h=200,y=s.bottom+h+4,z=s.top-h-4,A=y<=r-20,P=z>=20;p.value=!A&&P})}function S(l){return typeof l=="object"&&l!==null?l[n.valueKey]:l}function D(l){return typeof l=="object"&&l!==null?l[n.labelKey]||String(l[n.valueKey]):String(l)}function M(l,s){return typeof l=="object"&&l!==null&&l.id!==void 0?l.id:S(l)||s}function H(l){return S(l)===n.modelValue}function j(l){return typeof l=="object"&&l!==null?l[n.disabledKey]===!0:!1}function O(){n.disabled||(v.value?q():ee())}function ee(){n.disabled||(v.value=!0,e.nextTick(()=>{B(),K(),n.filterable&&w.value&&(w.value.focus(),d.value="")}))}function q(){v.value=!1,m.value=-1,p.value=!1,n.filterable&&(d.value="")}function X(l,s){if(j(l))return;const r=S(l);o("update:modelValue",r),o("change",r,l),q()}function oe(){if(!n.clearable||n.disabled)return;const l=n.clearTo;o("update:modelValue",l),o("change",l,null),o("clear"),q()}function ne(l){if(!W.value||W.value.length===0){m.value=-1;return}let s=m.value;const r=W.value.length;s===-1?s=l>0?0:r-1:s=(s+l+r)%r;let h=0;for(;h<r&&j(W.value[s]);)s=(s+l+r)%r,h++;m.value=h>=r?-1:s,Y()}function G(){if(m.value<0)return;const l=W.value[m.value];!l||j(l)||X(l,m.value)}function K(){if(!f.value)return;const l=f.value.querySelector(".yselect__option--selected");l&&l.scrollIntoView({block:"nearest"})}function Y(){if(!f.value||m.value<0)return;const s=f.value.querySelectorAll(".yselect__option")[m.value];s&&s.scrollIntoView({block:"nearest"})}function u(l){const s=l.target;(!k.value||!k.value.contains(s))&&q()}e.watch(()=>n.modelValue,()=>{m.value=-1});function c(){v.value&&B()}return e.onMounted(()=>{document.addEventListener("click",u),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",u),window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["yselect",{"yselect--disabled":t.disabled,[`yselect--${t.size}`]:!0}]),style:e.normalizeStyle({width:t.width}),ref_key:"selectContainer",ref:k},[e.createElementVNode("div",{ref_key:"triggerElement",ref:N,class:e.normalizeClass(["yselect__trigger",{"yselect__trigger--open":v.value,"yselect__trigger--disabled":t.disabled,"yselect__trigger--error":t.error}]),onMousedown:e.withModifiers(O,["prevent","stop"]),onKeydown:[e.withKeys(e.withModifiers(O,["prevent"]),["enter"]),e.withKeys(e.withModifiers(O,["prevent"]),["space"]),e.withKeys(q,["escape"]),e.withKeys(e.withModifiers(ee,["prevent"]),["arrow-down"]),e.withKeys(e.withModifiers(ee,["prevent"]),["arrow-up"])],tabindex:"0",role:"combobox","aria-expanded":v.value,"aria-haspopup":!0},[!t.filterable||!v.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yselect__value",{yselect__placeholder:!R.value}])},[e.renderSlot(l.$slots,"value",{value:b.value,label:R.value},()=>{var r;return[b.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(r=b.value)!=null&&r.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:b.value.flagImg,alt:"flag"},null,8,dt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(R.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.placeholder),1)],64))]},!0)],2)):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputElement",ref:w,class:"yselect__input",type:"text",placeholder:R.value||t.placeholder,"onUpdate:modelValue":s[0]||(s[0]=r=>d.value=r),onKeydown:[s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),s[2]||(s[2]=e.withKeys(e.withModifiers(r=>ne(1),["prevent"]),["arrow-down"])),s[3]||(s[3]=e.withKeys(e.withModifiers(r=>ne(-1),["prevent"]),["arrow-up"])),s[4]||(s[4]=e.withKeys(e.withModifiers(r=>G(),["prevent"]),["enter"])),e.withKeys(e.withModifiers(q,["prevent"]),["esc"]),e.withKeys(e.withModifiers(oe,["prevent"]),["delete"])]},null,40,ut)),[[e.vModelText,d.value]]),t.clearable&&!t.disabled&&b.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"yselect__clear",title:"清空",onClick:e.withModifiers(oe,["stop"])},[...s[8]||(s[8]=[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":v.value}])},[...s[9]||(s[9]=[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,ct),e.createVNode(e.Transition,{name:"yselect-dropdown"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownEl",ref:C,class:e.normalizeClass(["yselect__dropdown yselect__dropdown--portal",{"yselect__dropdown--top":p.value}]),style:e.normalizeStyle(L.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:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(r,h)=>(e.openBlock(),e.createElementBlock("div",{key:M(r,h),class:e.normalizeClass(["yselect__option",{"yselect__option--selected":H(r),"yselect__option--disabled":j(r),"yselect__option--hover":m.value===h}]),onClick:y=>X(r),onMouseenter:y=>m.value=h,onMouseleave:s[5]||(s[5]=y=>m.value=-1)},[e.renderSlot(l.$slots,"option",{option:r,index:h,selected:H(r)},()=>[r!=null&&r.flagImg?(e.openBlock(),e.createElementBlock("img",{key:0,class:"yselect__flag",src:r.flagImg,alt:"flag"},null,8,mt)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(D(r)),1)],!0)],42,ft))),128))],512)],38)):e.createCommentVNode("",!0)]))]),_:3})],6))}}),we=le(ht,[["__scopeId","data-v-6cd47cb7"]]),vt={class:"ypagination"},pt={class:"page-actions"},yt={class:"page-size-select"},gt=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}]}},emits:["update:currentPage","update:pageSize","page-change","page-size-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(n.pageSize),m=e.computed(()=>n.pageSizeOptions),f=e.computed({get:()=>n.currentPage,set:p=>{o("update:currentPage",p),o("page-change",p)}});function N(p){n.loading||p>=1&&p!==n.currentPage&&(f.value=p)}function k(p){n.loading||(v.value=p,o("update:pageSize",p),o("page-size-change",p),f.value=1)}function C(p){n.loading||(p==="prev"?N(f.value-1):p==="next"&&N(f.value+1))}return v.value=n.pageSize,e.watch(()=>n.pageSize,p=>{typeof p=="number"&&v.value!==p&&(v.value=p)}),(p,w)=>{const d=e.resolveComponent("YButton"),b=e.resolveComponent("YSelect");return e.openBlock(),e.createElementBlock("div",vt,[e.createElementVNode("div",pt,[e.createVNode(d,{size:"small",variant:"secondary",disabled:f.value===1||t.loading,onClick:w[0]||(w[0]=R=>N(1))},{default:e.withCtx(()=>[...w[2]||(w[2]=[e.createTextVNode("首页",-1)])]),_:1},8,["disabled"]),e.createVNode(d,{class:"ml-1",variant:"secondary",size:"small",groupItems:[{label:"上一页",value:"prev",disabled:f.value===1||t.loading,icon:"chevron-left",onlyIcon:!0,ariaLabel:"上一页"},{label:"下一页",value:"next",disabled:t.loading,icon:"chevron-right",onlyIcon:!0,ariaLabel:"下一页"}],onGroupClick:C},null,8,["groupItems"]),e.createElementVNode("div",yt,[e.createVNode(b,{modelValue:v.value,"onUpdate:modelValue":w[1]||(w[1]=R=>v.value=R),options:m.value,size:"small",width:"105px",clearable:!1,disabled:t.loading,onChange:k},null,8,["modelValue","options","disabled"])])])])}}}),Ve=le(gt,[["__scopeId","data-v-b8406406"]]),kt=["aria-label"],wt={class:"y-badge__inner"},bt={key:0,class:"y-badge__progress","aria-hidden":"true"},Et={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Bt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Ct={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},xt={key:1,class:"y-badge__icon","aria-hidden":"true"},Vt={key:0,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Nt={key:1,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},Dt={key:2,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},$t={key:3,class:"icon",viewBox:"0 0 20 20",fill:"currentColor"},St={class:"y-badge__label"},_t=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(t){const g=t,n=e.computed(()=>g.tone||"default"),o=e.computed(()=>{const v=(g.label||"").trim(),m=g.tone,f=g.progress;if(f){const N={incomplete:"未完成",partiallyComplete:"部分完成",complete:"已完成"};return v?`${v},进度:${N[f]||f}`:`进度:${N[f]||f}`}if(m&&m!=="default"){const N={informational:"信息",success:"成功",attention:"注意",warning:"警告",critical:"严重",default:"默认"};return v?`${v},语气:${N[m]||m}`:`语气:${N[m]||m}`}return v||"标记"});return(v,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["y-badge",[`y-badge--${n.value}`,`y-badge--${t.size}`,{"is-outline":t.outline,"is-pill":t.pill},t.progress?`y-badge--progress-${t.progress}`:""]]),role:"status","aria-label":o.value},[e.createElementVNode("span",wt,[t.progress?(e.openBlock(),e.createElementBlock("span",bt,[t.progress==="incomplete"?(e.openBlock(),e.createElementBlock("svg",Et,[...m[0]||(m[0]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"5"},null,-1)])])):t.progress==="partiallyComplete"?(e.openBlock(),e.createElementBlock("svg",Bt,[...m[1]||(m[1]=[e.createElementVNode("path",{d:"M10 5a5 5 0 100 10V5z"},null,-1),e.createElementVNode("circle",{cx:"10",cy:"10",r:"5",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1)])])):t.progress==="complete"?(e.openBlock(),e.createElementBlock("svg",Ct,[...m[2]||(m[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):e.createCommentVNode("",!0)])):t.icon?(e.openBlock(),e.createElementBlock("span",xt,[t.icon==="dot"?(e.openBlock(),e.createElementBlock("svg",Vt,[...m[3]||(m[3]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])])):t.icon==="check"?(e.openBlock(),e.createElementBlock("svg",Nt,[...m[4]||(m[4]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):t.icon==="alert"?(e.openBlock(),e.createElementBlock("svg",Dt,[...m[5]||(m[5]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",$t,[...m[6]||(m[6]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"4"},null,-1)])]))])):e.createCommentVNode("",!0),e.createElementVNode("span",St,[e.renderSlot(v.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)],!0)])])],10,kt))}}),Ne=le(_t,[["__scopeId","data-v-ce819797"]]),Mt=["aria-hidden"],zt=["onKeydown"],Lt={key:0,class:"y-dialog-header"},Tt={class:"y-dialog-title"},It={class:"y-dialog-body"},Kt={key:1,class:"y-dialog-footer"},Ht=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(t,{emit:g}){const n=t,o=g,v=e.computed({get:()=>n.modelValue,set:w=>o("update:modelValue",w)}),m=e.ref(null),f=e.computed(()=>{const w={};return w.width=typeof n.width=="number"?`${n.width}px`:String(n.width),w.margin="0 auto",w.top=n.top,w});function N(){n.maskClosable&&k()}function k(){v.value&&(v.value=!1,o("close"))}function C(){n.closable&&k()}function p(w){w.key==="Escape"&&C()}return e.watch(()=>n.modelValue,w=>{w?(o("open"),requestAnimationFrame(()=>{var d;return(d=m.value)==null?void 0:d.focus()}),document.addEventListener("keydown",p),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",p),document.body.style.overflow="")}),e.onMounted(()=>{n.modelValue&&(document.addEventListener("keydown",p),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",p),document.body.style.overflow=""}),(w,d)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-dialog-root",role:"dialog","aria-modal":!0,"aria-hidden":!v.value,style:e.normalizeStyle({zIndex:String(t.zIndex)})},[e.createElementVNode("div",{class:"y-dialog-mask",onClick:N}),e.createVNode(e.Transition,{name:"dialog-zoom-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-dialog-panel",[t.center?"is-center":""]]),style:e.normalizeStyle(f.value),onKeydown:e.withKeys(e.withModifiers(C,["prevent","stop"]),["esc"]),tabindex:"-1"},[t.showHeader?(e.openBlock(),e.createElementBlock("div",Lt,[e.renderSlot(w.$slots,"header",{},()=>[e.createElementVNode("div",Tt,e.toDisplayString(t.title),1)],!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-dialog-close","aria-label":"Close",onClick:k}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",It,[e.renderSlot(w.$slots,"default",{},void 0,!0)]),w.$slots.footer?(e.openBlock(),e.createElementBlock("div",Kt,[e.renderSlot(w.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,zt),[[e.vShow,v.value]])]),_:3})],12,Mt),[[e.vShow,v.value]])]))}}),De=le(Ht,[["__scopeId","data-v-a7acc6dc"]]),Ft={class:"ypopover__inner"},Rt=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(t,{expose:g,emit:n}){const o=t,v=n,m=e.ref(),f=e.ref(),N=e.ref(),k=e.ref(!1),C=e.ref(),p=e.ref(),w=e.ref({});let d=null,b=null;const R=e.computed(()=>{if(!k.value||!C.value)return{};const K={};o.width!=="auto"&&(K.width=typeof o.width=="number"?`${o.width}px`:o.width),o.maxWidth&&(K.maxWidth=typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth);const{top:Y,left:u}=L();return K.top=`${Y}px`,K.left=`${u}px`,K}),W=e.computed(()=>{if(!o.showArrow)return{};if(Object.keys(w.value).length>0)return w.value;const K={};return o.placement.startsWith("top")||o.placement.startsWith("bottom")?K.left="50%":K.top="50%",K});function L(){var A,P;if(!C.value)return{top:0,left:0};const{width:K,height:Y,top:u,left:c}=C.value,l=((A=N.value)==null?void 0:A.offsetWidth)||200,s=((P=N.value)==null?void 0:P.offsetHeight)||100;let r=0,h=0;switch(o.placement){case"top":r=u-s-o.offset,h=c+(K-l)/2;break;case"top-start":r=u-s-o.offset,h=c;break;case"top-end":r=u-s-o.offset,h=c+K-l;break;case"bottom":r=u+Y+o.offset,h=c+(K-l)/2;break;case"bottom-start":r=u+Y+o.offset,h=c;break;case"bottom-end":r=u+Y+o.offset,h=c+K-l;break;case"left":r=u+(Y-s)/2,h=c-l-o.offset;break;case"left-start":r=u,h=c-l-o.offset;break;case"left-end":r=u+Y-s,h=c-l-o.offset;break;case"right":r=u+(Y-s)/2,h=c+K+o.offset;break;case"right-start":r=u,h=c+K+o.offset;break;case"right-end":r=u+Y-s,h=c+K+o.offset;break}const y=window.innerWidth,z=window.innerHeight;return h<8&&(h=8),h+l>y-8&&(h=y-l-8),r<8&&(r=8),r+s>z-8&&(r=z-s-8),{top:r,left:h}}function B(){o.disabled||k.value||(H(),o.openDelay>0?d=setTimeout(()=>{S()},o.openDelay):S())}function S(){v("before-show"),k.value=!0,v("update:modelValue",!0),v("show"),e.nextTick(()=>{e.nextTick(()=>{O()})})}function D(){k.value&&(H(),o.closeDelay>0?b=setTimeout(()=>{M()},o.closeDelay):M())}function M(){v("before-hide"),k.value=!1,v("update:modelValue",!1),v("hide")}function H(){d&&(clearTimeout(d),d=null),b&&(clearTimeout(b),b=null)}function j(){if(!o.showArrow||!C.value||!N.value){w.value={};return}const K=C.value,Y=N.value.getBoundingClientRect();if(Y.width===0||Y.height===0){const c={};o.placement.startsWith("top")||o.placement.startsWith("bottom")?c.left="50%":c.top="50%",w.value=c;return}const u={};if(o.placement.startsWith("top")){u.bottom="-6px";const c=K.left+K.width/2,l=Y.left,s=c-l;u.left=`${Math.max(12,Math.min(s,Y.width-12))}px`}else if(o.placement.startsWith("bottom")){u.top="-6px";const c=K.left+K.width/2,l=Y.left,s=c-l;u.left=`${Math.max(12,Math.min(s,Y.width-12))}px`}else if(o.placement.startsWith("left")){u.right="-6px";const c=K.top+K.height/2,l=Y.top,s=c-l;u.top=`${Math.max(12,Math.min(s,Y.height-12))}px`}else if(o.placement.startsWith("right")){u.left="-6px";const c=K.top+K.height/2,l=Y.top,s=c-l;u.top=`${Math.max(12,Math.min(s,Y.height-12))}px`}w.value=u}function O(){f.value&&(C.value=f.value.getBoundingClientRect(),N.value&&(p.value=N.value.getBoundingClientRect(),j(),k.value&&requestAnimationFrame(()=>{N.value&&(p.value=N.value.getBoundingClientRect(),j())})))}function ee(){o.disabled||o.trigger==="click"&&(k.value?D():B())}function q(){o.disabled||o.trigger!=="hover"||(H(),B())}function X(){o.disabled||o.trigger!=="hover"||D()}function oe(){o.disabled||o.trigger!=="hover"||H()}function ne(){o.disabled||o.trigger!=="hover"||D()}function G(K){if(!o.closeOnClickOutside||!k.value)return;const Y=K.target;m.value&&!m.value.contains(Y)&&N.value&&!N.value.contains(Y)&&D()}return e.watch(()=>o.modelValue,K=>{K!==k.value&&(K?B():D())}),e.watch(k,K=>{K?(document.addEventListener("click",G),window.addEventListener("resize",O),window.addEventListener("scroll",O,!0),e.nextTick(()=>{O(),requestAnimationFrame(()=>{O()}),setTimeout(()=>{O()},0)})):(document.removeEventListener("click",G),window.removeEventListener("resize",O),window.removeEventListener("scroll",O,!0))}),e.onMounted(()=>{o.modelValue&&B()}),e.onUnmounted(()=>{H(),document.removeEventListener("click",G),window.removeEventListener("resize",O),window.removeEventListener("scroll",O,!0)}),g({show:B,hide:D,updatePosition:O}),(K,Y)=>(e.openBlock(),e.createElementBlock("div",{class:"ypopover",ref_key:"popoverRef",ref:m},[e.createElementVNode("div",{ref_key:"triggerRef",ref:f,onClick:ee,onMouseenter:q,onMouseleave:X},[e.renderSlot(K.$slots,"reference",{},void 0,!0)],544),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"ypopover-fade"},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contentRef",ref:N,class:e.normalizeClass(["ypopover__content",[`ypopover__content--${t.placement}`,{"ypopover__content--dark":t.dark,"ypopover__content--no-padding":!t.showPadding}]]),style:e.normalizeStyle(R.value),onClick:Y[0]||(Y[0]=e.withModifiers(()=>{},["stop"])),onMouseenter:oe,onMouseleave:ne},[t.showArrow?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["ypopover__arrow",`ypopover__arrow--${t.placement}`]),style:e.normalizeStyle(W.value)},null,6)):e.createCommentVNode("",!0),e.createElementVNode("div",Ft,[e.renderSlot(K.$slots,"default",{},void 0,!0)])],38)):e.createCommentVNode("",!0)]),_:3})]))],512))}}),$e=le(Rt,[["__scopeId","data-v-be755399"]]),Yt={class:"relative"},At=["value","placeholder"],Wt={class:"nh-time-suffix"},Pt={class:"nh-time-shortcuts"},Ot={class:"nh-time-shortcuts-list"},jt=["onClick","onKeydown","onMouseenter"],qt={class:"nh-time-custom"},Ut={class:"nh-time-custom-header"},Zt={class:"nh-time-selection-status"},Qt={key:0,class:"status-text"},Jt={key:1,class:"status-text"},Xt={key:2,class:"status-text status-complete"},Gt={class:"nh-time-pickers"},en={class:"nh-time-picker"},tn={class:"nh-date-picker"},nn={class:"nh-date-picker-header"},on={class:"nh-date-picker-header-label"},ln={class:"nh-date-picker-content"},an={class:"nh-date-table"},sn=["onClick"],rn={class:"nh-date-table-cell"},cn={key:0},dn={class:"nh-time-picker"},un={class:"nh-date-picker"},fn={class:"nh-date-picker-header"},mn={class:"nh-date-picker-header-label"},hn={class:"nh-date-picker-content"},vn={class:"nh-date-table"},pn=["onClick"],yn={class:"nh-date-table-cell"},gn={key:0},kn={class:"nh-time-actions"},wn=e.defineComponent({__name:"ytime",props:{modelValue:{default:()=>({startDate:null,endDate:null})},placeholder:{default:"请选择日期范围"},shortcuts:{default:()=>[{label:"今天",getValue:()=>{const t=new Date,g=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{startDate:g,endDate:n}}},{label:"昨天",getValue:()=>{const t=new Date;t.setDate(t.getDate()-1);const g=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),23,59,59);return{startDate:g,endDate:n}}},{label:"近7天",getValue:()=>{const t=new Date,g=new Date;return g.setDate(g.getDate()-6),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}},{label:"近30天",getValue:()=>{const t=new Date,g=new Date;return g.setDate(g.getDate()-29),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}},{label:"近3个月",getValue:()=>{const t=new Date,g=new Date;return g.setMonth(g.getMonth()-3),g.setHours(0,0,0,0),t.setHours(23,59,59,999),{startDate:g,endDate:t}}}]},clearable:{type:Boolean,default:!0},format:{default:"timestamp"},includeTime:{type:Boolean,default:!1},size:{default:"small"}},emits:["update:modelValue","change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),m=e.ref(-1),f=e.ref(-1),N=e.ref(null),k=e.ref(),C=e.ref(),p=e.ref({top:!0,left:!0}),w=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()}),d=e.ref({year:new Date().getFullYear(),month:new Date().getMonth()+1}),b=()=>{const a=new Date(w.value.year,w.value.month).getTime(),i=new Date(d.value.year,d.value.month).getTime();if(a>=i){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}},R=()=>{const a=new Date(w.value.year,w.value.month).getTime();if(new Date(d.value.year,d.value.month).getTime()<=a){const V=new Date(d.value.year,d.value.month-1);w.value.year=V.getFullYear(),w.value.month=V.getMonth()}},W=["一","二","三","四","五","六","日"],L=e.ref(null),B=e.ref(null),S=a=>{if(!a)return null;if(a instanceof Date)return a;if(typeof a=="number")return new Date(a);if(typeof a=="string"){const i=new Date(a);return isNaN(i.getTime())?null:i}return null},D=a=>{if(!a)return null;const i=a.getFullYear(),V=String(a.getMonth()+1).padStart(2,"0"),I=String(a.getDate()).padStart(2,"0");if(n.includeTime){const Q=String(a.getHours()).padStart(2,"0"),Z=String(a.getMinutes()).padStart(2,"0"),J=String(a.getSeconds()).padStart(2,"0");return`${i}-${V}-${I} ${Q}:${Z}:${J}`}else return`${i}-${V}-${I}`},M=a=>a?a.getTime():null,H=a=>a?{startDate:S(a.startDate),endDate:S(a.endDate)}:{startDate:null,endDate:null},j=a=>n.format==="string"?{startDate:D(a.startDate),endDate:D(a.endDate)}:n.format==="timestamp"?{startDate:M(a.startDate),endDate:M(a.endDate)}:a,O=(a,i)=>`${String(i+1).padStart(2,"0")}/${a}`,ee=(a,i)=>a.getFullYear()===i.getFullYear()&&a.getMonth()===i.getMonth()&&a.getDate()===i.getDate(),q=(a,i,V)=>!i||!V?!1:a>=i&&a<=V,X=a=>{const i=H(a);if(!(i!=null&&i.startDate)||!(i!=null&&i.endDate))return-1;for(let V=0;V<n.shortcuts.length;V++){const I=n.shortcuts[V].getValue();if(I.startDate&&I.endDate&&i.startDate&&i.endDate){const Q=new Date(i.startDate.getFullYear(),i.startDate.getMonth(),i.startDate.getDate()),Z=new Date(i.endDate.getFullYear(),i.endDate.getMonth(),i.endDate.getDate()),J=new Date(I.startDate.getFullYear(),I.startDate.getMonth(),I.startDate.getDate()),se=new Date(I.endDate.getFullYear(),I.endDate.getMonth(),I.endDate.getDate());if(Q.getTime()===J.getTime()&&Z.getTime()===se.getTime())return V}}return-1},oe=(a,i)=>{const V=new Date(a,i,1),I=new Date(a,i+1,0),Q=V.getDay(),Z=I.getDate(),J=[],se=new Date,pe=Q===0?6:Q-1,Ie=new Date(a,i,0);for(let te=pe-1;te>=0;te--){const ie=new Date(a,i-1,Ie.getDate()-te);J.push({date:ie,day:ie.getDate(),isCurrentMonth:!1,isToday:ee(ie,se),isSelected:!1,isInRange:!1,isDisabled:!0})}for(let te=1;te<=Z;te++){const ie=new Date(a,i,te);J.push({date:ie,day:te,isCurrentMonth:!0,isToday:ee(ie,se),isSelected:!1,isInRange:!1,isDisabled:!1})}const Ke=42-J.length;for(let te=1;te<=Ke;te++){const ie=new Date(a,i+1,te);J.push({date:ie,day:te,isCurrentMonth:!1,isToday:ee(ie,se),isSelected:!1,isInRange:!1,isDisabled:!0})}const Ee=[];for(let te=0;te<J.length;te+=7)Ee.push(J.slice(te,te+7));return Ee},ne=a=>{const i=j(a);o("update:modelValue",i),o("change",i)},G=()=>{if(!k.value||!C.value)return;const a=k.value.getBoundingClientRect(),i=C.value.getBoundingClientRect(),V=window.innerWidth,Q=window.innerHeight-a.bottom,Z=a.top,J=i.height||400;Q<J&&Z>J?p.value.top=!1:p.value.top=!0;const se=V-a.left,pe=i.width||640;se<pe?p.value.left=!1:p.value.left=!0},K=()=>{if(v.value=!v.value,v.value){const a=H(n.modelValue);if(L.value=(a==null?void 0:a.startDate)||null,B.value=(a==null?void 0:a.endDate)||null,f.value=X(n.modelValue),m.value=-1,a!=null&&a.startDate&&(w.value.year=a.startDate.getFullYear(),w.value.month=a.startDate.getMonth()),a!=null&&a.endDate)d.value.year=a.endDate.getFullYear(),d.value.month=a.endDate.getMonth();else{const i=new Date(w.value.year,w.value.month+1);d.value.year=i.getFullYear(),d.value.month=i.getMonth()}b(),e.nextTick(()=>{G()})}},Y=a=>{const i=a.target,V=k.value,I=C.value;V&&I&&!V.contains(i)&&!I.contains(i)&&(v.value=!1,m.value=-1)},u=a=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),K()):a.key==="ArrowDown"&&(a.preventDefault(),v.value=!0,e.nextTick(()=>{G(),h()}))},c=a=>{var i;a.key==="Escape"&&(v.value=!1,m.value=-1,(i=k.value)==null||i.focus())},l=(a,i)=>{a.key==="ArrowDown"?(a.preventDefault(),m.value=Math.min(i+1,n.shortcuts.length-1),y(m.value)):a.key==="ArrowUp"?(a.preventDefault(),m.value=Math.max(i-1,0),y(m.value)):(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),z(n.shortcuts[i]))},s=a=>{m.value=a},r=()=>{m.value=-1},h=()=>{m.value=0,y(0)},y=a=>{if(C.value){const V=C.value.querySelectorAll(".nh-time-shortcut")[a];V&&V.focus()}},z=a=>{const i=a.getValue();n.includeTime&&i.startDate&&i.endDate&&(i.startDate.setHours(0,0,0,0),i.endDate.setHours(23,59,59,999)),ne(i),f.value=n.shortcuts.findIndex(V=>V.label===a.label),m.value=-1,v.value=!1},A=(a,i)=>{if(!a||a.isDisabled)return;let V;if(n.includeTime?(V=new Date(a.date),i==="start"||!L.value?V.setHours(0,0,0,0):V.setHours(23,59,59,999)):V=new Date(a.date.getFullYear(),a.date.getMonth(),a.date.getDate()),!L.value&&!B.value)L.value=V,B.value=null;else if(L.value&&!B.value)if(V>=L.value)n.includeTime&&V.setHours(23,59,59,999),B.value=V;else{const I=L.value;n.includeTime&&I.setHours(23,59,59,999),B.value=I,L.value=V}else L.value=V,B.value=null;if(f.value=-1,L.value&&B.value){const I=new Date(B.value);n.includeTime&&I.setHours(23,59,59,999),N.value={startDate:L.value,endDate:I}}else N.value=null},P=(a,i)=>{if(!a)return["nh-date-table-td"];const V=["nh-date-table-td"];return a.isCurrentMonth||V.push("is-prev-month"),a.isToday&&V.push("is-today"),a.isDisabled&&V.push("is-disabled"),L.value&&ee(a.date,L.value)&&V.push("is-selected","is-start"),B.value&&ee(a.date,B.value)&&V.push("is-selected","is-end"),L.value&&B.value&&q(a.date,L.value,B.value)&&V.push("is-in-range"),V},ae=()=>{N.value&&(n.includeTime&&N.value.endDate&&N.value.endDate.setHours(23,59,59,999),ne(N.value),f.value=X(N.value),v.value=!1)},fe=()=>{ne({startDate:null,endDate:null}),T(),m.value=-1,v.value=!1},de=()=>{v.value&&e.nextTick(()=>{G()})},re=e.computed(()=>oe(w.value.year,w.value.month)),ue=e.computed(()=>oe(d.value.year,d.value.month)),E=e.computed(()=>{const a=H(n.modelValue);if(!a||!a.startDate||!a.endDate)return"";const i=Q=>{const Z=String(Q.getFullYear()),J=String(Q.getMonth()+1).padStart(2,"0"),se=String(Q.getDate()).padStart(2,"0");return`${Z}/${J}/${se}`},V=i(a.startDate),I=i(a.endDate);return!n.includeTime&&V===I?V:`${V} - ${I}`}),x=e.computed(()=>["nh-time-dropdown",{"nh-time-dropdown-top":!p.value.top,"nh-time-dropdown-right":!p.value.left}]),_=e.computed(()=>{const a=H(n.modelValue);return!!(a!=null&&a.startDate&&(a!=null&&a.endDate))}),$=e.computed(()=>!!(L.value&&B.value)),T=()=>{L.value=null,B.value=null,N.value=null,f.value=-1};e.watch(()=>n.modelValue,a=>{const i=H(a);if(i!=null&&i.startDate){const V=i.startDate;w.value.year=V.getFullYear(),w.value.month=V.getMonth()}if(i!=null&&i.endDate){const V=i.endDate;d.value.year=V.getFullYear(),d.value.month=V.getMonth()}else if(i!=null&&i.startDate){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}(i!=null&&i.startDate||i!=null&&i.endDate)&&b(),v.value||(f.value=X(a))},{immediate:!0,deep:!0}),e.watch([w,d],()=>{const a=new Date(w.value.year,w.value.month).getTime(),i=new Date(d.value.year,d.value.month).getTime();if(a===i){const V=new Date(w.value.year,w.value.month+1);d.value.year=V.getFullYear(),d.value.month=V.getMonth()}},{deep:!0}),e.onMounted(()=>{document.addEventListener("click",Y),window.addEventListener("resize",de),window.addEventListener("scroll",de),f.value=X(n.modelValue);const a=H(n.modelValue);if(a!=null&&a.startDate&&(w.value.year=a.startDate.getFullYear(),w.value.month=a.startDate.getMonth()),a!=null&&a.endDate)d.value.year=a.endDate.getFullYear(),d.value.month=a.endDate.getMonth();else{const i=new Date(w.value.year,w.value.month+1);d.value.year=i.getFullYear(),d.value.month=i.getMonth()}b()}),e.onUnmounted(()=>{document.removeEventListener("click",Y),window.removeEventListener("resize",de),window.removeEventListener("scroll",de)});const F=()=>{n.clearable&&(ne({startDate:null,endDate:null}),T(),m.value=-1)},U=(a,i)=>{if(a==="start"){const V=new Date(w.value.year,w.value.month+i,1);w.value.year=V.getFullYear(),w.value.month=V.getMonth(),b()}else{const V=new Date(d.value.year,d.value.month+i,1);d.value.year=V.getFullYear(),d.value.month=V.getMonth(),R()}};return(a,i)=>{const V=e.resolveComponent("YButton");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["nh-time-search",[`nh-time--${t.size}`]])},[e.createElementVNode("div",Yt,[e.createElementVNode("div",{ref_key:"trigger",ref:k,onClick:K,onKeydown:u,class:e.normalizeClass(["nh-time-trigger",{"is-focus":v.value,"has-value":_.value}]),tabindex:"0"},[e.createElementVNode("input",{readonly:"",value:E.value,placeholder:t.placeholder,class:"nh-time-input"},null,8,At),e.createElementVNode("span",Wt,[t.clearable&&_.value?(e.openBlock(),e.createElementBlock("i",{key:0,onClick:e.withModifiers(F,["stop"]),class:"nh-time-clear"},[...i[4]||(i[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),i[6]||(i[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":v.value}])},[...i[5]||(i[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(()=>[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdown",ref:C,class:e.normalizeClass(x.value),onKeydown:c},[e.createElementVNode("div",Pt,[i[7]||(i[7]=e.createElementVNode("div",{class:"nh-time-shortcuts-title"},"快捷选项",-1)),e.createElementVNode("ul",Ot,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shortcuts,(I,Q)=>(e.openBlock(),e.createElementBlock("li",{key:I.label,onClick:Z=>z(I),onKeydown:Z=>l(Z,Q),onMouseenter:Z=>s(Q),onMouseleave:r,class:e.normalizeClass(["nh-time-shortcut",{"is-active":m.value===Q,"is-selected":f.value===Q}]),tabindex:"0"},e.toDisplayString(I.label),43,jt))),128))])]),e.createElementVNode("div",qt,[e.createElementVNode("div",Ut,[i[8]||(i[8]=e.createElementVNode("span",null,"自定义时间",-1)),e.createElementVNode("div",Zt,[!L.value&&!B.value?(e.openBlock(),e.createElementBlock("span",Qt," 请选择开始日期 ")):L.value&&!B.value?(e.openBlock(),e.createElementBlock("span",Jt," 请选择结束日期 ")):L.value&&B.value?(e.openBlock(),e.createElementBlock("span",Xt," 已选择完整范围 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Gt,[e.createElementVNode("div",en,[e.createElementVNode("div",tn,[e.createElementVNode("div",nn,[e.createElementVNode("button",{onClick:i[0]||(i[0]=I=>U("start",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...i[9]||(i[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",on,e.toDisplayString(O(w.value.year,w.value.month)),1),e.createElementVNode("button",{onClick:i[1]||(i[1]=I=>U("start",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...i[10]||(i[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",ln,[e.createElementVNode("table",an,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,I=>e.createElementVNode("th",{key:I,class:"nh-date-table-th"},e.toDisplayString(I),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(I,Q)=>(e.openBlock(),e.createElementBlock("tr",{key:`start-week-${Q}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I,(Z,J)=>(e.openBlock(),e.createElementBlock("td",{key:`start-day-${Q}-${J}`,class:e.normalizeClass(P(Z)),onClick:se=>A(Z,"start")},[e.createElementVNode("div",rn,[Z?(e.openBlock(),e.createElementBlock("span",cn,e.toDisplayString(Z.day),1)):e.createCommentVNode("",!0)])],10,sn))),128))]))),128))])])])])]),e.createElementVNode("div",dn,[e.createElementVNode("div",un,[e.createElementVNode("div",fn,[e.createElementVNode("button",{onClick:i[2]||(i[2]=I=>U("end",-1)),class:"nh-date-picker-btn nh-date-picker-prev-btn",type:"button"},[...i[11]||(i[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",mn,e.toDisplayString(O(d.value.year,d.value.month)),1),e.createElementVNode("button",{onClick:i[3]||(i[3]=I=>U("end",1)),class:"nh-date-picker-btn nh-date-picker-next-btn",type:"button"},[...i[12]||(i[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",hn,[e.createElementVNode("table",vn,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(W,I=>e.createElementVNode("th",{key:I,class:"nh-date-table-th"},e.toDisplayString(I),1)),64))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,(I,Q)=>(e.openBlock(),e.createElementBlock("tr",{key:`end-week-${Q}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I,(Z,J)=>(e.openBlock(),e.createElementBlock("td",{key:`end-day-${Q}-${J}`,class:e.normalizeClass(P(Z)),onClick:se=>A(Z,"end")},[e.createElementVNode("div",yn,[Z?(e.openBlock(),e.createElementBlock("span",gn,e.toDisplayString(Z.day),1)):e.createCommentVNode("",!0)])],10,pn))),128))]))),128))])])])])])]),e.createElementVNode("div",kn,[t.clearable?(e.openBlock(),e.createBlock(V,{key:0,onClick:fe,variant:"secondary",size:t.size},{default:e.withCtx(()=>[...i[13]||(i[13]=[e.createTextVNode(" 清空 ",-1)])]),_:1},8,["size"])):e.createCommentVNode("",!0),e.createVNode(V,{onClick:ae,disabled:!$.value,variant:"primary",size:t.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.value&&!B.value?"继续选择结束日期":"确认"),1)]),_:1},8,["disabled","size"])])])],34)):e.createCommentVNode("",!0)]),_:1})])],2)}}}),be=le(wn,[["__scopeId","data-v-e5ef63b1"]]),bn=["aria-checked","aria-disabled","disabled","onKeydown"],En={class:"yswitch__thumb"},Bn={key:0,class:"yswitch__spinner","aria-hidden":"true"},Cn=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(t,{emit:g}){const n=t,o=g,v=e.ref(),m=e.computed(()=>n.modelValue===n.trueValue),f=e.computed(()=>{const k={};return k.background=m.value?n.activeColor:n.inactiveColor,k});function N(){if(n.disabled||n.loading)return;const k=m.value?n.falseValue:n.trueValue;o("update:modelValue",k),o("change",k)}return e.onMounted(()=>{const k=v.value;k&&(k.addEventListener("focus",C=>o("focus",C)),k.addEventListener("blur",C=>o("blur",C)))}),(k,C)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"rootEl",ref:v,class:e.normalizeClass(["yswitch",[`yswitch--${t.size}`,{"yswitch--checked":m.value,"yswitch--disabled":t.disabled,"yswitch--loading":t.loading}]]),style:e.normalizeStyle(f.value),role:"switch","aria-checked":m.value,"aria-disabled":t.disabled,disabled:t.disabled||t.loading,onClick:N,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[C[0]||(C[0]=e.createElementVNode("span",{class:"yswitch__track"},null,-1)),e.createElementVNode("span",En,[t.loading?(e.openBlock(),e.createElementBlock("span",Bn)):e.createCommentVNode("",!0)]),t.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["yswitch__label",{"yswitch__label--left":!m.value,"yswitch__label--right":m.value}])},e.toDisplayString(m.value?t.activeText:t.inactiveText),3)):e.createCommentVNode("",!0)],46,bn))}}),Se=le(Cn,[["__scopeId","data-v-0b157fc4"]]),xn=["src","alt"],Vn=["src","alt"],Nn=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:{}},emits:["load","error","preview"],setup(t,{expose:g,emit:n}){const o=t,v=n,m=e.ref(),f=e.ref(),N=e.ref(),k=e.ref(!1),C=e.ref(!1),p=e.ref(!1),w=e.ref(!1),d=e.ref(!1),b=e.ref("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),R=e.ref(""),W=e.ref(1),L=e.ref(!1),B=e.ref({overflow:"",paddingRight:""}),S=e.computed(()=>[o.className,"overflow-hidden"].filter(Boolean).join(" ")),D=e.computed(()=>[O(),q()].filter(Boolean).join(" ")),M=e.computed(()=>["w-full h-full bg-white",ee(),q(),o.preview?"cursor-pointer hover:opacity-90 transition-opacity duration-200":""].filter(Boolean).join(" ")),H=e.computed(()=>[O(),q()].filter(Boolean).join(" ")),j=e.computed(()=>{const y={};return o.width&&(y.width=typeof o.width=="number"?`${o.width}px`:o.width),o.height&&(y.height=typeof o.height=="number"?`${o.height}px`:o.height),y}),O=()=>o.width&&o.height?"":"w-full h-full",ee=()=>({cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"})[o.fit]||"object-cover",q=()=>typeof o.radius=="number"?`rounded-${o.radius}`:typeof o.radius=="string"?o.radius.includes("px")?"":`rounded-${o.radius}`:"",X=()=>{const y=document.createElement("div");y.style.cssText="width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(y);const z=y.offsetWidth-y.clientWidth;return document.body.removeChild(y),z},oe=()=>{if(B.value={overflow:document.body.style.overflow||"",paddingRight:document.body.style.paddingRight||""},document.body.scrollHeight>window.innerHeight){const z=X();document.body.style.paddingRight=`${z}px`}document.body.style.overflow="hidden"},ne=()=>{document.body.style.overflow=B.value.overflow,document.body.style.paddingRight=B.value.paddingRight};let G=null;const K=()=>{!o.lazy||!m.value||(G=new IntersectionObserver(y=>{y.forEach(z=>{z.isIntersecting&&(w.value=!0,b.value=o.src,G==null||G.unobserve(z.target))})},{rootMargin:"50px"}),G.observe(m.value))},Y=y=>{k.value=!0,C.value=!1,p.value=!1,v("load",y)},u=y=>{p.value=!0,C.value=!1,k.value=!1,v("error",y)},c=()=>{p.value=!1,C.value=!0,k.value=!1,e.nextTick(()=>{f.value&&(f.value.src=o.src)})},l=()=>{if(!o.preview||p.value)return;W.value=1;const y=o.previewSrcList||o.src;if(f.value&&f.value.complete&&f.value.naturalWidth>0){R.value=y,e.nextTick(()=>{d.value=!0,oe(),v("preview",y)});return}const z=new Image;let A=null,P=!1;const ae=()=>{P||(P=!0,A&&(clearTimeout(A),A=null),R.value=y,e.nextTick(()=>{d.value=!0,oe(),v("preview",y)}))};A=setTimeout(()=>{ae()},500),z.onload=()=>{ae()},z.onerror=()=>{ae()},z.src=y,z.complete&&ae()},s=()=>{d.value=!1,setTimeout(()=>{ne()},300)},r=y=>{const z=y.deltaY<0?1:-1;let P=W.value+z*.1;P=Math.max(.5,Math.min(2,P)),W.value=P};e.onMounted(()=>{o.lazy?K():w.value=!0,w.value&&(C.value=!0),L.value=!0}),e.onUnmounted(()=>{G&&G.disconnect(),d.value&&ne()});const h=()=>{o.src&&w.value&&(C.value=!0,p.value=!1,k.value=!1)};return e.watch(()=>b.value,h),e.watch(()=>o.src,y=>{b.value=y||""}),g({retryLoad:c,closePreview:s}),(y,z)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:m,class:e.normalizeClass(["relative inline-block",S.value])},[!k.value&&!p.value&&!w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["bg-gray-200 animate-pulse rounded",D.value])},[...z[1]||(z[1]=[e.createElementVNode("div",{class:"flex items-center justify-center h-full"},[e.createElementVNode("svg",{class:"w-6 h-6 text-gray-400",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)])],2)):e.createCommentVNode("",!0),C.value&&!p.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none",M.value])},[...z[2]||(z[2]=[e.createElementVNode("div",{class:"flex flex-col items-center space-y-2"},[e.createElementVNode("div",{class:"w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})],-1)])],2)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["bg-gray-100 rounded flex items-center justify-center",H.value]),onClick:c},[e.createElementVNode("img",{src:"https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",alt:"Error Image",class:e.normalizeClass(["w-[70%] h-[70%] object-contain cursor-pointer",q()])},null,2)],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("img",{ref_key:"imageRef",ref:f,src:b.value,alt:t.alt,class:e.normalizeClass(M.value),onLoad:Y,onError:u,onClick:e.withModifiers(l,["stop"]),style:e.normalizeStyle(j.value)},null,46,xn),[[e.vShow,k.value&&!p.value]]),o.preview&&w.value&&!p.value&&(!k.value||C.value)?(e.openBlock(),e.createElementBlock("div",{key:3,class:"absolute inset-0 cursor-pointer z-10",onClick:e.withModifiers(l,["stop"])})):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createBlock(e.Teleport,{key:4,to:"body"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/75 flex items-center justify-center",style:{"z-index":"99999"},onClick:e.withModifiers(s,["self"]),onWheel:e.withModifiers(r,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300",{"scale-100":d.value,"scale-95":!d.value}])},[e.createElementVNode("img",{ref_key:"previewImageRef",ref:N,src:o.previewSrcList||R.value||o.src,alt:t.alt,class:"max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",style:e.normalizeStyle({transform:`scale(${W.value})`}),onClick:z[0]||(z[0]=e.withModifiers(()=>{},["stop"]))},null,12,Vn)],2)],32)):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)],2))}}),_e=le(Nn,[["__scopeId","data-v-bc0053ca"]]),Dn=e.defineComponent({__name:"ydropdown",props:{trigger:{default:"hover"},placement:{default:"bottom"},disabled:{type:Boolean,default:!1},menuWidth:{default:void 0}},setup(t){const g=t,n=e.ref(!1),o=e.ref();let v=null;const m=e.computed(()=>`y-dropdown__menu--${g.placement}`),f=e.computed(()=>{if(!g.menuWidth)return{};const d=typeof g.menuWidth=="number"?`${g.menuWidth}px`:g.menuWidth;return{width:d,minWidth:d,maxWidth:d}}),N=()=>{console.log("显示下拉菜单",n.value),!g.disabled&&(v&&(clearTimeout(v),v=null),n.value=!0,console.log("设置 visible 为 true",n.value),e.nextTick(()=>{C()}))},k=()=>{console.log("隐藏下拉菜单"),v=setTimeout(()=>{n.value=!1,console.log("设置 visible 为 false",n.value)},150)},C=()=>{if(!o.value)return;const d=o.value.querySelector(".y-dropdown__trigger"),b=o.value.querySelector(".y-dropdown__menu");if(!d||!b)return;const R=d.getBoundingClientRect(),W=b.getBoundingClientRect(),L=window.innerWidth,B=window.innerHeight;b.style.top="",b.style.left="",b.style.right="",b.style.bottom="",b.style.transform="";let S=0,D=0;switch(g.placement){case"bottom":S=R.height+4,D=0;break;case"top":S=-(W.height+4),D=0;break;case"right":S=0,D=R.width+4;break;case"left":S=0,D=-(W.width+4);break}let M=R.top+S,H=R.left+D;if(g.placement==="bottom"||g.placement==="top"){const j=W.width||260;H+j>L-10&&(H=L-j-10),H<10&&(H=10)}if(g.placement==="left"||g.placement==="right"){const j=W.height||200;M+j>B-10&&(M=B-j-10),M<10&&(M=10)}b.style.top=`${M}px`,b.style.left=`${H}px`},p=d=>{g.trigger==="click"&&o.value&&!o.value.contains(d.target)&&(n.value=!1)},w=()=>{n.value&&C()};return e.onMounted(()=>{g.trigger==="click"&&document.addEventListener("click",p),window.addEventListener("resize",w),window.addEventListener("scroll",w)}),e.onUnmounted(()=>{g.trigger==="click"&&document.removeEventListener("click",p),v&&clearTimeout(v),window.removeEventListener("resize",w),window.removeEventListener("scroll",w)}),e.watch(()=>g.menuWidth,()=>{n.value&&e.nextTick(()=>{C()})}),(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"y-dropdown",ref_key:"dropdownRef",ref:o},[e.createElementVNode("div",{class:"y-dropdown__trigger",onMouseenter:N,onMouseleave:k},[e.renderSlot(d.$slots,"trigger",{},()=>[b[0]||(b[0]=e.createElementVNode("button",{class:"y-dropdown__button"}," 下拉菜单 ",-1))],!0)],32),e.createVNode(e.Transition,{name:"dropdown-fade",appear:""},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-dropdown__menu",m.value]),style:e.normalizeStyle(f.value),onMouseenter:N,onMouseleave:k},[e.renderSlot(d.$slots,"default",{},()=>[b[1]||(b[1]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 1",-1)),b[2]||(b[2]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 2",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"y-dropdown__item"},"选项 3",-1))],!0)],38),[[e.vShow,n.value]])]),_:3})],512))}}),Me=le(Dn,[["__scopeId","data-v-ada3172a"]]),$n=["aria-hidden"],Sn=["onKeydown"],_n={key:0,class:"y-drawer-header"},Mn={class:"y-drawer-title"},zn={class:"y-drawer-body"},Ln={key:1,class:"y-drawer-footer"},Tn=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(t,{emit:g}){const n=t,o=g,v=e.computed({get:()=>n.modelValue,set:b=>o("update:modelValue",b)}),m=e.ref(null),f=e.computed(()=>n.placement==="right"?"drawer-slide-right":"drawer-slide-bottom"),N=e.computed(()=>n.placement==="right"?"rounded-left":"rounded-top"),k=e.computed(()=>{const b={};return n.placement==="right"?(b.width=typeof n.width=="number"?`${n.width}px`:String(n.width),b.height="100%",b.right="0",b.top="0"):(b.height=typeof n.height=="number"?`${n.height}px`:String(n.height),b.width="100%",b.bottom="0",b.left="0"),b});function C(){n.maskClosable&&p()}function p(){v.value&&(v.value=!1,o("close"))}function w(){n.closable&&p()}function d(b){b.key==="Escape"&&w()}return e.watch(()=>n.modelValue,b=>{b?(o("open"),requestAnimationFrame(()=>{var R;return(R=m.value)==null?void 0:R.focus()}),document.addEventListener("keydown",d),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",d),document.body.style.overflow="")}),e.onMounted(()=>{n.modelValue&&(document.addEventListener("keydown",d),document.body.style.overflow="hidden")}),e.onUnmounted(()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}),(b,R)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{class:"y-drawer-root",role:"dialog","aria-modal":!0,"aria-hidden":!v.value,style:e.normalizeStyle({zIndex:String(t.zIndex)})},[e.createElementVNode("div",{class:"y-drawer-mask",onClick:C}),e.createVNode(e.Transition,{name:f.value},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"panelRef",ref:m,class:e.normalizeClass(["y-drawer-panel",[`is-${t.placement}`,N.value]]),style:e.normalizeStyle(k.value),onKeydown:e.withKeys(e.withModifiers(w,["prevent","stop"]),["esc"]),tabindex:"-1"},[t.showHeader?(e.openBlock(),e.createElementBlock("div",_n,[e.createElementVNode("div",Mn,e.toDisplayString(t.title),1),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"y-drawer-close","aria-label":"Close",onClick:p}," ✕ ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",zn,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),b.$slots.footer?(e.openBlock(),e.createElementBlock("div",Ln,[e.renderSlot(b.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],46,Sn),[[e.vShow,v.value]])]),_:3},8,["name"])],12,$n),[[e.vShow,v.value]])]))}}),ze=le(Tn,[["__scopeId","data-v-b2797950"]]),In={class:"ytree__container"},Kn=["data-level","onClick","onContextmenu"],Hn=["onClick"],Fn={key:1,class:"w-[16px]"},Rn=["onClick"],Yn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},An={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Wn=["src","alt"],Pn={class:"ytree-node__custom-content"},On={key:0,class:"ytree-node__children"},jn=["data-level","onClick","onContextmenu"],qn=["onClick"],Un={key:1,class:"w-[16px]"},Zn=["onClick"],Qn={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Jn={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Xn=["src","alt"],Gn={class:"ytree-node__custom-content"},eo={key:0,class:"ytree-node__children"},to=["data-level","onClick","onContextmenu"],no=["onClick"],oo={key:1,class:"w-[16px]"},lo=["onClick"],ao={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},so={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},ro=["src","alt"],io={class:"ytree-node__custom-content"},co={key:0,class:"ytree-node__children"},uo=["data-level","onClick","onContextmenu"],fo=["onClick"],mo={key:1,class:"w-[16px]"},ho=["onClick"],vo={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},po={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},yo=["src","alt"],go={class:"ytree-node__custom-content"},ko={key:0,class:"ytree-node__children"},wo=["data-level","onClick","onContextmenu"],bo=["onClick"],Eo={key:1,class:"w-[16px]"},Bo=["onClick"],Co={key:0,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},xo={key:1,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},Vo=["src","alt"],No={class:"ytree-node__custom-content"},Do="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png",$o="https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png",So=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(t,{expose:g,emit:n}){const o=t,v=n,m=e.computed(()=>(console.log("ytree 组件接收到的数据:",o.data),o.data||[])),f=e.ref({currentNode:null,currentKey:null,checkedKeys:new Set,expandedKeys:new Set,selectedKeys:new Set,highlightedKeys:new Set});e.provide("treeStore",f);const N=e.computed(()=>o.restrictAutoExpandFromLevel&&o.restrictAutoExpandFromLevel>0?o.restrictAutoExpandFromLevel:void 0);function k(u){return u[o.nodeKey]||u.id||Math.random()}function C(u){var c;return((c=o.props)!=null&&c.label?u[o.props.label]:void 0)||u.label||""}function p(u){var c;return!!((c=u==null?void 0:u.data)!=null&&c.isEmployee)}function w(u,c){var y;const l=o.deptIconUrl||Do,s=o.personIconUrl||$o,r=o.buttonIconUrl||"",h=o.childStyleIconUrl||"";return c&&h&&W(u,c)?h:(y=u==null?void 0:u.data)!=null&&y.isButton&&r?r:p(u)?s:l}function d(u){var l;const c=((l=o.props)!=null&&l.children?u[o.props.children]:void 0)||u.children;return c&&c.length>0}function b(u){var c;return((c=o.props)!=null&&c.children?u[o.props.children]:void 0)||u.children||[]}function R(u,c,l=1){if(u===c)return l;const s=b(u);for(const r of s){const h=R(r,c,l+1);if(h>0)return h}return 0}function W(u,c){return!o.childStyleLevel||o.childStyleLevel<1?!1:R(c,u)===o.childStyleLevel}function L(u){const c=k(u);return f.value.expandedKeys.has(c)}function B(u){const c=k(u);if(f.value.checkedKeys.has(c)){if(d(u)){const s=b(u),r=s.filter(y=>B(y)),h=s.filter(y=>S(y));return r.length===s.length&&h.length===0}return!0}if(d(u)){const s=b(u);return s.some(h=>S(h))?!1:s.length>0&&s.every(h=>B(h))}return!1}function S(u){if(!d(u))return!1;const c=b(u),l=c.filter(r=>B(r)),s=c.filter(r=>S(r));return l.length===c.length?!1:l.length>0||s.length>0}function D(u){const c=k(u);return f.value.currentKey===c}function M(u){const c=k(u);return f.value.highlightedKeys.has(c)}function H(u){if(o.disabled)return;const c=k(u),s=!f.value.checkedKeys.has(c),r=new Set(f.value.expandedKeys);s?f.value.checkedKeys.add(c):f.value.checkedKeys.delete(c);function h(y,z){y.forEach(A=>{const P=k(A);z?f.value.checkedKeys.add(P):f.value.checkedKeys.delete(P),d(A)&&h(b(A),z)})}h(b(u),s),s&&j(),ee(),f.value.expandedKeys=r,v("check-change",u,s,!1),v("check",u,s,!1),v("checked-keys-change",Array.from(f.value.checkedKeys))}function j(u){N.value&&console.log(`已启用从第${N.value}级开始不默认展开的限制(不主动收起已展开节点)`)}function O(u){const c=k(u);f.value.expandedKeys.has(c)?(f.value.expandedKeys.delete(c),v("node-collapse",u,u,null)):(f.value.expandedKeys.add(c),v("node-expand",u,u,null))}function ee(){const u=[];function c(s){s.forEach(r=>{u.push(r),d(r)&&c(b(r))})}c(m.value);function l(s){if(d(s)){const r=b(s),h=k(s),y=r.filter(A=>B(A)),z=r.filter(A=>S(A));y.length===r.length&&z.length===0||y.length>0||z.length>0?f.value.checkedKeys.add(h):f.value.checkedKeys.delete(h)}}for(let s=u.length-1;s>=0;s--)l(u[s])}function q(u,c,l,s){if(o.disabled)return;const r=s?W(u,s):!1;if(o.enableChildStyleCustomClick&&r){v("child-node-click",u,c,l);return}if(o.expandOnClickNode&&d(u)){O(u);return}f.value.currentNode=u,f.value.currentKey=k(u),o.showCheckbox&&H(u),v("node-click",u,c,l)}function X(u,c,l,s){o.disabled||v("node-contextmenu",u,c,l,s)}e.watch(()=>o.defaultExpandedKeys,u=>{if(u){const c=N.value;if(c){let l=function(y,z,A=1){for(const P of z){if(k(P)===y)return A;if(d(P)){const ae=l(y,b(P),A+1);if(ae>0)return ae}}return 0},s=function(y,z,A){y.forEach(P=>{z<A&&d(P)?(h.add(k(P)),s(b(P),z+1,A)):z<A&&d(P)})};const r=(u||[]).filter(y=>{const z=l(y,m.value,1);return z>0&&z<c}),h=new Set(r);s(m.value,1,c),f.value.expandedKeys.forEach(y=>{l(y,m.value,1)>=c&&h.add(y)}),f.value.expandedKeys=h}else f.value.expandedKeys=new Set(u)}},{immediate:!0});function oe(){if(o.defaultExpandAll){let u=function(s,r=1){s.forEach(h=>{if(!d(h))return;const y=b(h);if(l){if(r>=l)return;r+1===l||c.add(k(h)),u(y,r+1)}else c.add(k(h)),u(y,r+1)})};const c=new Set,l=N.value;u(m.value,1),f.value.expandedKeys=c}}function ne(){if(o.defaultCheckedKeys&&o.defaultCheckedKeys.length>0){let u=function(r,h=[]){r.forEach(y=>{const z=k(y),A=[...h,z];c.has(z)&&h.forEach(P=>l.add(P)),d(y)&&u(b(y),A)})};const c=new Set(o.defaultCheckedKeys),l=new Set;u(m.value);const s=N.value;if(s){console.log(`已启用从第${s}级开始不默认展开:保持当前展开状态不变`);return}f.value.expandedKeys=l}}e.watch(()=>o.defaultExpandAll,oe,{immediate:!0}),e.watch(()=>m.value,oe,{deep:!0}),e.watch(()=>o.defaultCheckedKeys,u=>{u?(f.value.checkedKeys=new Set(u),o.enableFourthLevelSpecialHandling?console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态"):ne()):f.value.checkedKeys.clear()},{immediate:!0});function G(u){try{let c=function(r,h,y=[]){for(const z of r){const A=k(z),P=[...y,A];if(A===h)return P;if(d(z)){const ae=c(b(z),h,P);if(ae)return ae}}return null};const l=Array.isArray(u)?u:[];if(l.length===0)return;f.value.highlightedKeys.clear();const s=new Set(f.value.expandedKeys);l.forEach(r=>{const h=c(m.value,r);h&&h.length>0&&(h.slice(0,-1).forEach(y=>s.add(y)),f.value.highlightedKeys.add(h[h.length-1]))}),f.value.expandedKeys=s}catch(c){console.warn("highlightAndExpandByIds 执行失败",c)}}function K(){f.value.highlightedKeys.clear()}function Y(){f.value.currentNode=null,f.value.currentKey=null}return g({highlightAndExpandByIds:G,clearHighlights:K,clearCurrentNode:Y}),e.watch(()=>o.defaultSelectedKeys,u=>{u&&(f.value.selectedKeys=new Set(u))},{immediate:!0}),(u,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ytree",[`ytree--${t.size}`,{"ytree--disabled":t.disabled}]])},[e.createElementVNode("div",In,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("div",{key:k(l),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(l),"ytree-node--highlight":M(l)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(l,l)}]),style:{paddingLeft:"8px"},"data-level":R(l,l),onClick:s=>q(l,l,null,l),onContextmenu:s=>X(s,l,l,null)},[d(l)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(l)}]),onClick:e.withModifiers(s=>O(l),["stop"])},[...c[0]||(c[0]=[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)])],10,Hn)):(e.openBlock(),e.createElementBlock("span",Fn)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(l),"is-indeterminate":S(l)}]),onClick:e.withModifiers(s=>H(l),["stop"])},[B(l)?(e.openBlock(),e.createElementBlock("svg",Yn,[...c[1]||(c[1]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(l)?(e.openBlock(),e.createElementBlock("svg",An,[...c[2]||(c[2]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Rn)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(l,l),alt:p(l)?"person":"dept"},null,8,Wn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(l)}])},e.toDisplayString(C(l)),3),e.createElementVNode("div",Pn,[e.renderSlot(u.$slots,"node-content",{node:l,isCurrent:D(l),isExpanded:L(l),hasChildren:d(l)},void 0,!0)])],42,Kn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(l)&&L(l)?(e.openBlock(),e.createElementBlock("div",On,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(l),s=>(e.openBlock(),e.createElementBlock("div",{key:k(s),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(s),"ytree-node--highlight":M(s)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(s,l)}]),style:{paddingLeft:"22px"},"data-level":R(l,s),onClick:r=>q(s,s,null,l),onContextmenu:r=>X(r,s,s,null)},[d(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(s)}]),onClick:e.withModifiers(r=>O(s),["stop"])},[...c[3]||(c[3]=[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)])],10,qn)):(e.openBlock(),e.createElementBlock("span",Un)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(s),"is-indeterminate":S(s)}]),onClick:e.withModifiers(r=>H(s),["stop"])},[B(s)?(e.openBlock(),e.createElementBlock("svg",Qn,[...c[4]||(c[4]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(s)?(e.openBlock(),e.createElementBlock("svg",Jn,[...c[5]||(c[5]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Zn)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(s,l),alt:p(s)?"person":"dept"},null,8,Xn),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(s)}])},e.toDisplayString(C(s)),3),e.createElementVNode("div",Gn,[e.renderSlot(u.$slots,"node-content",{node:s,isCurrent:D(s),isExpanded:L(s),hasChildren:d(s)},void 0,!0)])],42,jn),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(s)&&L(s)?(e.openBlock(),e.createElementBlock("div",eo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(s),r=>(e.openBlock(),e.createElementBlock("div",{key:k(r),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(r),"ytree-node--highlight":M(r)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(r,l)}]),style:{paddingLeft:"38px"},"data-level":R(l,r),onClick:h=>q(r,r,null,l),onContextmenu:h=>X(h,r,r,null)},[d(r)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(r)}]),onClick:e.withModifiers(h=>O(r),["stop"])},[...c[6]||(c[6]=[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)])],10,no)):(e.openBlock(),e.createElementBlock("span",oo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(r),"is-indeterminate":S(r)}]),onClick:e.withModifiers(h=>H(r),["stop"])},[B(r)?(e.openBlock(),e.createElementBlock("svg",ao,[...c[7]||(c[7]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(r)?(e.openBlock(),e.createElementBlock("svg",so,[...c[8]||(c[8]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,lo)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(r,l),alt:p(r)?"person":"dept"},null,8,ro),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(r)}])},e.toDisplayString(C(r)),3),e.createElementVNode("div",io,[e.renderSlot(u.$slots,"node-content",{node:r,isCurrent:D(r),isExpanded:L(r),hasChildren:d(r)},void 0,!0)])],42,to),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(r)&&L(r)?(e.openBlock(),e.createElementBlock("div",co,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(r),h=>(e.openBlock(),e.createElementBlock("div",{key:k(h),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(h),"ytree-node--highlight":M(h)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(h,l)}]),style:{paddingLeft:"54px"},"data-level":R(l,h),onClick:y=>q(h,h,null,l),onContextmenu:y=>X(y,h,h,null)},[d(h)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(h)}]),onClick:e.withModifiers(y=>O(h),["stop"])},[...c[9]||(c[9]=[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)])],10,fo)):(e.openBlock(),e.createElementBlock("span",mo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(h),"is-indeterminate":S(h)}]),onClick:e.withModifiers(y=>H(h),["stop"])},[B(h)?(e.openBlock(),e.createElementBlock("svg",vo,[...c[10]||(c[10]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(h)?(e.openBlock(),e.createElementBlock("svg",po,[...c[11]||(c[11]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,ho)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(h,l),alt:p(h)?"person":"dept"},null,8,yo),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(h)}])},e.toDisplayString(C(h)),3),e.createElementVNode("div",go,[e.renderSlot(u.$slots,"node-content",{node:h,isCurrent:D(h),isExpanded:L(h),hasChildren:d(h)},void 0,!0)])],42,uo),e.createVNode(e.Transition,{name:"ytree-node"},{default:e.withCtx(()=>[d(h)&&L(h)?(e.openBlock(),e.createElementBlock("div",ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b(h),y=>(e.openBlock(),e.createElementBlock("div",{key:k(y),class:e.normalizeClass(["ytree-node",{"ytree-node--current":D(y)}])},[e.createElementVNode("div",{class:e.normalizeClass(["ytree-node__content",{"is-child-style":W(y,l)}]),style:{paddingLeft:"70px"},"data-level":R(l,y),onClick:z=>q(y,y,null,l),onContextmenu:z=>X(z,y,y,null)},[d(y)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["ytree-node__expand-icon",{"is-expanded":L(y)}]),onClick:e.withModifiers(z=>O(y),["stop"])},[...c[12]||(c[12]=[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)])],10,bo)):(e.openBlock(),e.createElementBlock("span",Eo)),t.showCheckbox?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["ytree-node__checkbox",{"is-checked":B(y),"is-indeterminate":S(y)}]),onClick:e.withModifiers(z=>H(y),["stop"])},[B(y)?(e.openBlock(),e.createElementBlock("svg",Co,[...c[13]||(c[13]=[e.createElementVNode("path",{d:"M2 6L4.5 8.5L10 3",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):S(y)?(e.openBlock(),e.createElementBlock("svg",xo,[...c[14]||(c[14]=[e.createElementVNode("path",{d:"M2 6L10 6",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},null,-1)])])):e.createCommentVNode("",!0)],10,Bo)):e.createCommentVNode("",!0),t.iconClass?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(["ytree-node__icon",t.iconClass])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("img",{class:"ytree-node__avatar",src:w(y,l),alt:p(y)?"person":"dept"},null,8,Vo),e.createElementVNode("span",{class:e.normalizeClass(["ytree-node__label",{"is-employee":p(y)}])},e.toDisplayString(C(y)),3),e.createElementVNode("div",No,[e.renderSlot(u.$slots,"node-content",{node:y,isCurrent:D(y),isExpanded:L(y),hasChildren:d(y)},void 0,!0)])],42,wo)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))])],2))}}),Le=le(So,[["__scopeId","data-v-6ab410ed"]]),_o={class:"query-encapsulation"},Mo={class:"query-encapsulation__container"},zo={class:"query-encapsulation__content"},Lo={class:"query-encapsulation__fields"},To={class:"query-encapsulation__field-wrapper"},Io={class:"query-encapsulation__field-label"},Ko={key:0,class:"query-encapsulation__toggle"},Ho={class:"query-encapsulation__actions"},Fo={class:"query-encapsulation__actions-group"},Ro=e.defineComponent({__name:"QueryEncapsulation",props:{fields:{},maxVisibleFields:{default:5},loading:{type:Boolean,default:!1},modelValue:{default:()=>({})}},emits:["update:modelValue","search","reset","field-change"],setup(t,{emit:g}){const n=t,o=g,v=e.ref(!1),m=e.reactive({}),f=e.computed(()=>n.fields.filter(B=>!B.hidden)),N=e.computed(()=>v.value?f.value:f.value.slice(0,n.maxVisibleFields)),k=e.computed(()=>f.value.length>n.maxVisibleFields);function C(B){switch(B){case"select":return we;case"date":case"daterange":return be;case"input":default:return ke}}function p(B){o("field-change",B,m[B.key]),o("update:modelValue",{...m})}function w(){const B=R(m),S=W(B);o("search",{data:S})}function d(){Object.keys(m).forEach(B=>{const S=n.fields.find(D=>D.key===B);(S==null?void 0:S.type)==="daterange"?m[B]={startDate:null,endDate:null}:(S==null?void 0:S.type)==="date"?m[B]=null:m[B]=""}),o("reset"),o("update:modelValue",{...m})}function b(){v.value=!v.value}function R(B){const S={};return Object.keys(B).forEach(D=>{const M=B[D],H=n.fields.find(j=>j.key===D);M!=null&&M!==""&&(typeof M=="object"&&M.startDate&&M.endDate?M.startDate&&M.endDate&&(S[D]=M):H&&(H.type==="date"||H.type==="daterange")?M!==0&&(S[D]=M):S[D]=M)}),S}function W(B){const S={};return Object.keys(B).forEach(D=>{const M=B[D],H=n.fields.find(j=>j.key===D);if(H)if(H.type==="daterange"&&typeof M=="object"){const j=H.startKey||`${D}Start`,O=H.endKey||`${D}End`;M.startDate&&M.endDate&&M.startDate!==0&&M.endDate!==0&&(H.format==="timestamp"?(S[j]=new Date(M.startDate).getTime(),S[O]=new Date(M.endDate).getTime()):(S[j]=M.startDate,S[O]=M.endDate))}else H.type==="date"&&M&&M!==0&&H.format==="timestamp"?S[D]=new Date(M).getTime():S[D]=M;else S[D]=M}),S}function L(){n.fields.forEach(B=>{var S,D,M;m[B.key]===void 0&&(B.type==="daterange"?m[B.key]=((S=n.modelValue)==null?void 0:S[B.key])||{startDate:null,endDate:null}:B.type==="date"?m[B.key]=((D=n.modelValue)==null?void 0:D[B.key])||null:m[B.key]=((M=n.modelValue)==null?void 0:M[B.key])||"")})}return e.watch(()=>n.modelValue,B=>{B&&Object.assign(m,B)},{deep:!0,immediate:!0}),e.onMounted(()=>{L()}),(B,S)=>(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("div",Mo,[e.createElementVNode("div",zo,[e.createElementVNode("div",Lo,[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(N.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.key,class:"query-encapsulation__field-item"},[e.createElementVNode("div",To,[e.createElementVNode("label",Io,e.toDisplayString(D.label),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C(D.type)),{modelValue:m[D.key],"onUpdate:modelValue":M=>m[D.key]=M,placeholder:D.placeholder||`请输入${D.label}`,options:D.options,clearable:D.clearable!==!1,size:D.size||"small",width:D.width||"180px",format:D.format||"timestamp","include-time":D.includeTime||!1,filterable:D.filterable===!0,onInput:M=>p(D),onChange:M=>p(D)},null,40,["modelValue","onUpdate:modelValue","placeholder","options","clearable","size","width","format","include-time","filterable","onInput","onChange"]))])]))),128))]),_:1}),k.value?(e.openBlock(),e.createElementBlock("div",Ko,[e.createVNode(me,{variant:"secondary",size:"small",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v.value?"收起":"展开")+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["query-encapsulation__toggle-icon",{"is-expanded":v.value}])},"▼",2)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.createElementVNode("div",Fo,[e.createVNode(me,{variant:"primary",size:"small",onClick:w,loading:t.loading},{default:e.withCtx(()=>[...S[0]||(S[0]=[e.createTextVNode(" 搜索 ",-1)])]),_:1},8,["loading"]),e.createVNode(me,{variant:"secondary",size:"small",onClick:d,loading:t.loading},{default:e.withCtx(()=>[...S[1]||(S[1]=[e.createTextVNode(" 重置 ",-1)])]),_:1},8,["loading"]),e.renderSlot(B.$slots,"extra-actions",{},void 0,!0)])])])])])]))}}),Te=le(Ro,[["__scopeId","data-v-b7c459de"]]),Yo={class:"y-msg__icon","aria-hidden":"true"},Ao={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Wo={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Po={key:2,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},Oo=["textContent"],jo=e.defineComponent({__name:"ymessageToast",props:{id:{},type:{default:"success"},message:{},duration:{default:3e3},offset:{},zIndex:{},closable:{type:Boolean,default:!1},onClose:{}},setup(t){const g=t,n=e.ref(!1);let o;e.onMounted(()=>{requestAnimationFrame(()=>{n.value=!0,g.duration&&g.duration>0&&(o=window.setTimeout(()=>v(),g.duration))})}),e.onBeforeUnmount(()=>{o&&window.clearTimeout(o)});function v(){n.value=!1}function m(){var f;(f=g.onClose)==null||f.call(g,g.id)}return(f,N)=>(e.openBlock(),e.createBlock(e.Transition,{name:"y-msg-fade",onAfterLeave:m},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["y-msg",[`y-msg--${t.type}`]]),style:e.normalizeStyle({zIndex:t.zIndex}),role:"status","aria-live":"polite"},[e.createElementVNode("span",Yo,[t.type==="success"?(e.openBlock(),e.createElementBlock("svg",Ao,[...N[0]||(N[0]=[e.createElementVNode("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):t.type==="warning"?(e.openBlock(),e.createElementBlock("svg",Wo,[...N[1]||(N[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",Po,[...N[2]||(N[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)])]))]),e.createElementVNode("div",{class:"y-msg__content",textContent:e.toDisplayString(t.message)},null,8,Oo),t.closable?(e.openBlock(),e.createElementBlock("button",{key:0,class:"y-msg__close",type:"button",onClick:v},"✕")):e.createCommentVNode("",!0)],6),[[e.vShow,n.value]])]),_:1}))}}),qo=le(jo,[["__scopeId","data-v-ceac9e81"]]);let Uo=1;const ge=12,ce=[];function Zo(){let t=20;return ce.forEach(g=>{t+=g.height+ge}),t}function Be(t){const g=ce.findIndex(m=>m.id===t);if(g===-1)return;const{el:n}=ce[g],o=n.firstElementChild;if(o){const m=window.getComputedStyle(o).top;o.style.top=m,o.classList.add("is-leaving"),o.style.willChange="opacity, transform"}ce[g].leaving=!0,ve(),setTimeout(()=>{e.render(null,n),n.parentNode&&n.parentNode.removeChild(n);const m=ce.findIndex(f=>f.id===t);m!==-1&&ce.splice(m,1),ve()},260)}function ye(t){var m;const g=Uo++,n=document.createElement("div");document.body.appendChild(n);const o=e.createVNode(qo,{id:g,type:t.type||"success",message:t.message,duration:t.duration??2500,offset:Zo(),zIndex:3e3+g,closable:t.closable??!1,onClose:f=>Be(f)});e.render(o,n);const v=((m=n.firstElementChild)==null?void 0:m.offsetHeight)||0;return ce.push({id:g,el:n,vm:o,height:v,leaving:!1}),ve(),requestAnimationFrame(()=>{const f=n.firstElementChild;if(!f)return;const N=f.offsetHeight||v||0,k=ce.find(C=>C.id===g);k&&(k.height=N,ve())}),{close:()=>Be(g)}}const he={success(t,g={}){return ye({...g,type:"success",message:t})},warning(t,g={}){return ye({...g,type:"warning",message:t})},error(t,g={}){return ye({...g,type:"error",message:t})}};typeof window<"u"&&(window.YMessage=he,typeof globalThis.YMessage>"u"&&(globalThis.YMessage=he));function ve(){let t=20;ce.forEach(g=>{const n=g.el.firstElementChild;if(!n)return;const o=t;if(n.style.transform=`translate(-50%, ${o}px)`,n.style.top||(n.style.top="0px"),!g.leaving)t+=(n.offsetHeight||g.height)+ge;else{const v=n.offsetHeight||g.height;t+=v+ge}})}const Ce={YButton:me,YInput:ke,YTable:xe,YSelect:we,YPagination:Ve,YBadge:Ne,YDialog:De,YPopover:$e,YTime:be,YSwitch:Se,YImage:_e,YDropdown:Me,YDrawer:ze,YTree:Le,QueryEncapsulation:Te},Qo={install(t){Object.keys(Ce).forEach(g=>{t.component(g,Ce[g])}),t.config.globalProperties.$message=he,typeof window<"u"&&(window.YMessage=he)}};exports.QueryEncapsulation=Te;exports.YBadge=Ne;exports.YButton=me;exports.YDialog=De;exports.YDrawer=ze;exports.YDropdown=Me;exports.YImage=_e;exports.YInput=ke;exports.YMessage=he;exports.YPagination=Ve;exports.YPopover=$e;exports.YSelect=we;exports.YSwitch=Se;exports.YTable=xe;exports.YTime=be;exports.YTree=Le;exports.default=Qo;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|