物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

120 lines
35 KiB

import{_ as Rt}from"./RelatedComps.vue_vue_type_script_setup_true_lang-DyVZQ5A1.js";import{c as xt,i as St,o as Ct,b as _t,d as Mt}from"./helpers-CjmtV6uB.js";import{d as le,O as $,s as M,S as Nt,G as c,T as Oe,i as Fe,c as b,y as Qe,ax as Tt,t as Pe,Q as Pt,P as Ot,o as Ft,b as Kt,q as I,w as q,J as _e,u as j,F as Lt}from"./index-bVOhw2NF.js";import{V as Bt,F as It}from"./FocusDetector-DcygY9Tk.js";import{c as zt}from"./context-KbjOeZY_.js";import{u as he}from"./use-memo-BgHp9YyU.js";import{_ as Xe}from"./Checkbox-DAl6jmZx.js";import{N as At}from"./Loading-CByrJVhO.js";import{N as He}from"./Icon-Ck7Ij_E6.js";import{C as Vt}from"./ChevronRight-DjG_plXV.js";import{F as $t,u as jt,d as Ut,c as Ye,a as Dt,N as Et,e as Ht,S as qt,_ as Wt}from"./Select-BpXzRZdb.js";import{h as ze}from"./happens-in-CM8LO42l.js";import{d as pe}from"./index-C-nsH7mf.js";import{S as Gt}from"./Scrollbar-DVK2lT9w.js";import{c as Ze}from"./clickoutside-CCtiUDaG.js";import{c as V,b as ve,a as Me,d as Q,u as Jt,f as et,z as Qt,h as Xt}from"./light-Cua7cqmF.js";import{f as Yt}from"./fade-in.cssr-CltBGdAW.js";import{u as Zt}from"./use-style-qLHIyj3D.js";import{a as tt,r as eo}from"./resolve-slot-Dzko3qih.js";import{f as qe}from"./fade-in-scale-up.cssr-CTZmXn_X.js";import{n as to}from"./dark-C1gkUD1h.js";import{u as oo}from"./use-locale-CFjRjALw.js";import{u as We}from"./use-merged-state-CzrzZJbg.js";import{u as no}from"./use-form-item-CNgNT5jP.js";import{i as lo}from"./use-is-mounted-wlrzLfZo.js";import{u as Te,B as ao,V as io,a as Ge}from"./Follower-DJGS5Fnl.js";import{g as ro}from"./get-precise-event-target-DhO46Lpt.js";import{m as so}from"./index-DsSU6HIH.js";import{c as ne}from"./call-f2ri57Kd.js";import{_ as uo}from"./text-ClDrYWYc.js";import{_ as co}from"./FormItem-Cp_SJVoE.js";import{_ as mo}from"./InputNumber-BUVD-lKD.js";import{_ as fo}from"./Form-BZRGTIxb.js";import"./index-DPltKIjj.js";import"./index-xXhpGjLP.js";import"./vue-repl-jaFwbjhK.js";import"./codemirror-editor-CFwWTn8s.js";import"./common-CalHcBJp.js";import"./index-C8mAaM2V.js";import"./editor-ouq_SSv2.js";import"./cloneDeep-C6NKQlMO.js";import"./_initCloneObject-K-Y0ueWp.js";import"./_getTag-BJ2nhJXz.js";import"./http-D9Asdp-z.js";import"./light-BKuBIbLH.js";import"./use-compitable-DMmt6sIs.js";import"./dayjs.min-tKPc2Ebd.js";import"./toggleHighContrast-BiNrcRtm.js";import"./editorWorker-UB-8rWUJ.js";import"./GridRect-B5GXph4N.js";import"./style-D4sssT3k.js";import"./upload-DeP_4dQB.js";import"./Scrollbar-Db3aKfvv.js";import"./use-rtl-CRyak7TN.js";import"./light-uWHRDFKR.js";import"./light-CE5Kvs_2.js";import"./light-B00G814I.js";import"./light-MOj96jwO.js";import"./Input-CFQSA5NN.js";import"./browser-DLIXj5nt.js";import"./is-browser-DqcmxZSF.js";import"./Suffix-BqBRFVnL.js";import"./icon-switch.cssr-BCTOxvoq.js";import"./VResizeObserver-Tzd5ds8d.js";import"./delegate-CI_DDEu_.js";import"./Forward-B4Y9XmRi.js";import"./Popover-DLIip8wF.js";import"./toString-eibgRg41.js";import"./_baseEach-BwxcRWC6.js";import"./get-BuNGRF3A.js";import"./_baseFor-mOzdmxoL.js";import"./format-length-B-p6aW7q.js";import"./index-C9vhMoZJ.js";import"./flatten-7z_8MaI9.js";import"./index-L98eAIry.js";import"./keep-B1eBS8j0.js";import"./keysOf-HiGXOwLp.js";import"./omit-DbnPTcif.js";import"./context-CNWzaUOd.js";import"./Button-B7xQqa1N.js";import"./color-to-class-B0iQgAn2.js";import"./Tree-CzaEbcLe.js";import"./render-BxFg9-7m.js";import"./fade-in-height-expand.cssr-Bx380MfO.js";import"./light-D6zEcTvP.js";import"./light-DU0-KyAX.js";import"./Modal-BHLPhdX-.js";import"./context-ELq7iLHP.js";import"./Card-BhgyLFi8.js";import"./light-BqIgj82_.js";import"./Close-D6FODkWY.js";import"./light-rvBL92Ju.js";import"./Warning-WCOp46KX.js";import"./utils-BKyMmInE.js";import"./Image-CAe7wDsQ.js";import"./light-jvBBpnb8.js";import"./light-C52Zdmem.js";import"./_createCompounder-D746aL6M.js";import"./Tooltip-C_3SXSAr.js";import"./download-C2161hUv.js";import"./noImage-CAsvTj-5.js";import"./light-Blmb_y9V.js";import"./Add-CgLKrdZy.js";import"./Progress-BpvQ1C2a.js";import"./light-DH15IGTV.js";import"./light-DWk6YUKo.js";import"./Icon-C8ZbiYW7.js";import"./light-DD97CHyt.js";import"./Switch-DWvSWYoO.js";import"./light-CdWU_bnm.js";import"./_common-CtIASumb.js";import"./Slider-C2GzLvgH.js";import"./light-CnxA-8p4.js";import"./_common-D9N4yDJ1.js";import"./CollapseItem-CnymMNIl.js";import"./light-BIogERFh.js";import"./use-false-until-truthy-BNJRTcsy.js";import"./Icon-B67kcA2X.js";import"./RadioGroup-5BphoArv.js";import"./light-CbIbiWrk.js";import"./get-slot-Bk_rJcZu.js";import"./use-keyboard-D_rBVq9u.js";import"./light-DGVaJDoA.js";import"./ButtonGroup-BHJkQOUq.js";import"./dashboard-YyjCL4ge.js";import"./ColorPicker-PXaqdINa.js";import"./InputGroup-CLUcMivF.js";import"./light-BJxzOxOf.js";import"./Divider-aR5nu9et.js";import"./light-DiXDfyIH.js";import"./Search-Bp-OOsbn.js";import"./Grid-C11Tqhv0.js";import"./componentList-BKZexaIE.js";import"./index.vue_vue_type_script_setup_true_lang-Q6sPmgzz.js";import"./ConfigProvider-DuxYoVXL.js";import"./light-D7R7aswA.js";import"./route-block-B_A1xBdJ.js";import"./cssr-CS9sbUmO.js";import"./upperFirst-Bq7Kgunw.js";import"./light-BOD3MGQo.js";import"./light-CVXL3bIM.js";import"./light-DhWiRhmf.js";import"./light-DjE_cXZL.js";import"./_common-h0mJDxlK.js";import"./light-CUlEsFk3.js";import"./light-DiBdiU84.js";import"./light-B52QuVq1.js";import"./index-Dn5RNViO.js";import"./light-BULoejUF.js";const ho=V("base-menu-mask",`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 14px;
overflow: hidden;
`,[Yt()]),vo=le({name:"BaseMenuMask",props:{clsPrefix:{type:String,required:!0}},setup(t){Zt("-base-menu-mask",ho,$(t,"clsPrefix"));const i=M(null);let n=null;const l=M(!1);return Nt(()=>{n!==null&&window.clearTimeout(n)}),Object.assign({message:i,show:l},{showOnce(g,k=1500){n&&window.clearTimeout(n),l.value=!0,i.value=g,n=window.setTimeout(()=>{l.value=!1,i.value=null},k)}})},render(){return c(Oe,{name:"fade-in-transition"},{default:()=>this.show?c("div",{class:`${this.clsPrefix}-base-menu-mask`},this.message):null})}});function Ne(t){return t?t.map(i=>i.rawNode):null}function po(t,i,n,l){const a=[],g=[];function k(p){for(const w of p){if(w.disabled)continue;const{rawNode:C}=w;g.push(C),(w.isLeaf||!i)&&a.push({label:Ae(w,l,n),value:w.key,rawNode:w.rawNode,path:Array.from(g)}),!w.isLeaf&&w.children&&k(w.children),g.pop()}}return k(t),a}function Ae(t,i,n){const l=[];for(;t;)l.push(t.rawNode[n]),t=t.parent;return l.reverse().join(i)}const ge=zt("n-cascader"),Je=le({name:"NCascaderOption",props:{tmNode:{type:Object,required:!0}},setup(t){const{expandTriggerRef:i,remoteRef:n,multipleRef:l,mergedValueRef:a,checkedKeysRef:g,indeterminateKeysRef:k,hoverKeyPathRef:p,keyboardKeyRef:w,loadingKeySetRef:C,cascadeRef:u,mergedCheckStrategyRef:O,onLoadRef:z,mergedClsPrefixRef:_,mergedThemeRef:D,labelFieldRef:U,showCheckboxRef:W,renderPrefixRef:y,renderSuffixRef:v,updateHoverKey:T,updateKeyboardKey:N,addLoadingKey:A,deleteLoadingKey:E,closeMenu:ae,doCheck:ee,doUncheck:be,renderLabelRef:m}=Fe(ge),R=b(()=>t.tmNode.key),F=b(()=>{const{value:P}=i,{value:J}=n;return!J&&P==="hover"}),L=b(()=>{if(F.value)return ue}),X=b(()=>{if(F.value)return ye}),H=he(()=>{const{value:P}=l;return P?g.value.includes(R.value):a.value===R.value}),ie=he(()=>l.value?k.value.includes(R.value):!1),Ke=he(()=>p.value.includes(R.value)),Le=he(()=>{const{value:P}=w;return P===null?!1:P===R.value}),Y=he(()=>n.value?C.value.has(R.value):!1),re=b(()=>t.tmNode.isLeaf),se=b(()=>t.tmNode.disabled),G=b(()=>t.tmNode.rawNode[U.value]),Z=b(()=>t.tmNode.shallowLoaded);function te(P){if(se.value)return;const{value:J}=n,{value:B}=C,{value:ke}=z,{value:K}=R,{value:Re}=re,{value:xe}=Z;ze(P,"checkbox")||(J&&!xe&&!B.has(K)&&ke&&(A(K),ke(t.tmNode.rawNode).then(()=>{E(K)}).catch(()=>{E(K)})),T(K),N(K)),Re&&we()}function ue(){if(!F.value||se.value)return;const{value:P}=R;T(P),N(P)}function ye(){F.value&&ue()}function me(){const{value:P}=re;P||we()}function we(){const{value:P}=l,{value:J}=R;P?ie.value||H.value?be(J):ee(J):(ee(J),ae(!0))}return{checkStrategy:O,multiple:l,cascade:u,checked:H,indeterminate:ie,hoverPending:Ke,keyboardPending:Le,isLoading:Y,showCheckbox:W,isLeaf:re,disabled:se,label:G,mergedClsPrefix:_,mergedTheme:D,handleClick:te,handleCheckboxUpdateValue:me,mergedHandleMouseEnter:L,mergedHandleMouseMove:X,renderLabel:m,renderPrefix:y,renderSuffix:v}},render(){const{mergedClsPrefix:t,showCheckbox:i,renderLabel:n,renderPrefix:l,renderSuffix:a}=this;let g=null;if(i||l){const w=this.showCheckbox?c(Xe,{focusable:!1,"data-checkbox":!0,disabled:this.disabled,checked:this.checked,indeterminate:this.indeterminate,theme:this.mergedTheme.peers.Checkbox,themeOverrides:this.mergedTheme.peerOverrides.Checkbox,onUpdateChecked:this.handleCheckboxUpdateValue}):null;g=c("div",{class:`${t}-cascader-option__prefix`},l?l({option:this.tmNode.rawNode,checked:this.checked,node:w}):w)}let k=null;const p=c("div",{class:`${t}-cascader-option-icon-placeholder`},this.isLeaf?this.checkStrategy==="child"&&!(this.multiple&&this.cascade)?c(Oe,{name:"fade-in-scale-up-transition"},{default:()=>this.checked?c(He,{clsPrefix:t,class:`${t}-cascader-option-icon ${t}-cascader-option-icon--checkmark`},{default:()=>c($t,null)}):null}):null:c(At,{clsPrefix:t,scale:.85,strokeWidth:24,show:this.isLoading,class:`${t}-cascader-option-icon`},{default:()=>c(He,{clsPrefix:t,key:"arrow",class:`${t}-cascader-option-icon ${t}-cascader-option-icon--arrow`},{default:()=>c(Vt,null)})}));return k=c("div",{class:`${t}-cascader-option__suffix`},a?a({option:this.tmNode.rawNode,checked:this.checked,node:p}):p),c("div",{class:[`${t}-cascader-option`,this.keyboardPending||this.hoverPending&&`${t}-cascader-option--pending`,this.disabled&&`${t}-cascader-option--disabled`,this.showCheckbox&&`${t}-cascader-option--show-prefix`],onMouseenter:this.mergedHandleMouseEnter,onMousemove:this.mergedHandleMouseMove,onClick:this.handleClick},g,c("span",{class:`${t}-cascader-option__label`},n?n(this.tmNode.rawNode,this.checked):this.label),k)}}),go=le({name:"CascaderSubmenu",props:{depth:{type:Number,required:!0},tmNodes:{type:Array,required:!0}},setup(){const{virtualScrollRef:t,mergedClsPrefixRef:i,mergedThemeRef:n,optionHeightRef:l}=Fe(ge),a=M(null),g=M(null),k={scroll(p,w){var C,u;t.value?(C=g.value)===null||C===void 0||C.scrollTo({index:p}):(u=a.value)===null||u===void 0||u.scrollTo({index:p,elSize:w})}};return Object.assign({mergedClsPrefix:i,mergedTheme:n,scrollbarInstRef:a,vlInstRef:g,virtualScroll:t,itemSize:b(()=>pe(l.value)),handleVlScroll:()=>{var p;(p=a.value)===null||p===void 0||p.sync()},getVlContainer:()=>{var p;return(p=g.value)===null||p===void 0?void 0:p.listElRef},getVlContent:()=>{var p;return(p=g.value)===null||p===void 0?void 0:p.itemsElRef}},k)},render(){const{mergedClsPrefix:t,mergedTheme:i,virtualScroll:n}=this;return c("div",{class:[n&&`${t}-cascader-submenu--virtual`,`${t}-cascader-submenu`]},c(Gt,{ref:"scrollbarInstRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:n?this.getVlContainer:void 0,content:n?this.getVlContent:void 0},{default:()=>n?c(Bt,{items:this.tmNodes,itemSize:this.itemSize,onScroll:this.handleVlScroll,showScrollbar:!1,ref:"vlInstRef"},{default:({item:l})=>c(Je,{key:l.key,tmNode:l})}):this.tmNodes.map(l=>c(Je,{key:l.key,tmNode:l}))}))}}),bo=le({name:"NCascaderMenu",props:{value:[String,Number,Array],placement:{type:String,default:"bottom-start"},show:Boolean,menuModel:{type:Array,required:!0},loading:Boolean,onFocus:{type:Function,required:!0},onBlur:{type:Function,required:!0},onKeydown:{type:Function,required:!0},onMousedown:{type:Function,required:!0},onTabout:{type:Function,required:!0}},setup(t){const{localeRef:i,isMountedRef:n,mergedClsPrefixRef:l,syncCascaderMenuPosition:a,handleCascaderMenuClickOutside:g,mergedThemeRef:k,getColumnStyleRef:p}=Fe(ge),w=[],C=M(null),u=M(null);function O(){a()}jt(u,O);function z(y){var v;const{value:{loadingRequiredMessage:T}}=i;(v=C.value)===null||v===void 0||v.showOnce(T(y))}function _(y){g(y)}function D(y){const{value:v}=u;v&&(v.contains(y.relatedTarget)||t.onFocus(y))}function U(y){const{value:v}=u;v&&(v.contains(y.relatedTarget)||t.onBlur(y))}return Object.assign({isMounted:n,mergedClsPrefix:l,selfElRef:u,submenuInstRefs:w,maskInstRef:C,mergedTheme:k,getColumnStyle:p,handleFocusin:D,handleFocusout:U,handleClickOutside:_},{scroll(y,v,T){const N=w[y];N&&N.scroll(v,T)},showErrorMessage:z})},render(){const{submenuInstRefs:t,mergedClsPrefix:i,mergedTheme:n}=this;return c(Oe,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.show?Qe(c("div",{tabindex:"0",ref:"selfElRef",class:`${i}-cascader-menu`,onMousedown:this.onMousedown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeydown:this.onKeydown},this.menuModel[0].length?c("div",{class:`${i}-cascader-submenu-wrapper`},this.menuModel.map((l,a)=>{var g;return c(go,{style:(g=this.getColumnStyle)===null||g===void 0?void 0:g.call(this,{level:a}),ref:k=>{k&&(t[a]=k)},key:a,tmNodes:l,depth:a+1})}),c(vo,{clsPrefix:i,ref:"maskInstRef"})):c("div",{class:`${i}-cascader-menu__empty`},tt(this.$slots.empty,()=>[c(Ut,{theme:n.peers.Empty,themeOverrides:n.peerOverrides.Empty})])),eo(this.$slots.action,l=>l&&c("div",{class:`${i}-cascader-menu-action`,"data-action":!0},l)),c(It,{onFocus:this.onTabout})),[[Ze,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),yo=le({name:"NCascaderSelectMenu",props:{value:{type:[String,Number,Array],default:null},show:Boolean,pattern:{type:String,default:""},multiple:Boolean,tmNodes:{type:Array,default:()=>[]},filter:Function,labelField:{type:String,required:!0},separator:{type:String,required:!0}},setup(t){const{isMountedRef:i,mergedValueRef:n,mergedClsPrefixRef:l,mergedThemeRef:a,mergedCheckStrategyRef:g,slots:k,syncSelectMenuPosition:p,closeMenu:w,handleSelectMenuClickOutside:C,doUncheck:u,doCheck:O,clearPattern:z}=Fe(ge),_=M(null),D=b(()=>po(t.tmNodes,g.value==="child",t.labelField,t.separator)),U=b(()=>{const{filter:m}=t;if(m)return m;const{labelField:R}=t;return(F,L,X)=>X.some(H=>H[R]&&~H[R].indexOf(F))}),W=b(()=>{const{pattern:m}=t,{value:R}=U;return(m?D.value.filter(F=>R(m,F.rawNode,F.path)):D.value).map(F=>({value:F.value,label:F.label}))}),y=b(()=>Ye(W.value,Dt("value","children")));function v(){p()}function T(m){N(m)}function N(m){if(t.multiple){const{value:R}=n;Array.isArray(R)?R.includes(m.key)?u(m.key):O(m.key):R===null&&O(m.key),z()}else O(m.key),w(!0)}function A(){var m;(m=_.value)===null||m===void 0||m.prev()}function E(){var m;(m=_.value)===null||m===void 0||m.next()}function ae(){var m;if(_){const R=(m=_.value)===null||m===void 0?void 0:m.getPendingTmNode();return R&&N(R),!0}return!1}function ee(m){C(m)}return Object.assign({isMounted:i,mergedTheme:a,mergedClsPrefix:l,menuInstRef:_,selectTreeMate:y,handleResize:v,handleToggle:T,handleClickOutside:ee,cascaderSlots:k},{prev:A,next:E,enter:ae})},render(){const{mergedClsPrefix:t,isMounted:i,mergedTheme:n,cascaderSlots:l}=this;return c(Oe,{name:"fade-in-scale-up-transition",appear:i},{default:()=>this.show?Qe(c(Et,{ref:"menuInstRef",onResize:this.handleResize,clsPrefix:t,class:`${t}-cascader-menu`,autoPending:!0,themeOverrides:n.peerOverrides.InternalSelectMenu,theme:n.peers.InternalSelectMenu,treeMate:this.selectTreeMate,multiple:this.multiple,value:this.value,onToggle:this.handleToggle},{empty:()=>tt(l["not-found"],()=>[])}),[[Ze,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),wo=ve([V("cascader-menu",`
outline: none;
position: relative;
margin: 4px 0;
display: flex;
flex-flow: column nowrap;
border-radius: var(--n-menu-border-radius);
overflow: hidden;
box-shadow: var(--n-menu-box-shadow);
color: var(--n-option-text-color);
background-color: var(--n-menu-color);
`,[qe({transformOrigin:"inherit",duration:"0.2s"}),Me("empty",`
display: flex;
padding: 12px 32px;
flex: 1;
justify-content: center;
`),V("scrollbar",`
width: 100%;
`),V("base-menu-mask",`
background-color: var(--n-menu-mask-color);
`),V("base-loading",`
color: var(--n-loading-color);
`),V("cascader-submenu-wrapper",`
position: relative;
display: flex;
flex-wrap: nowrap;
`),V("cascader-submenu",`
height: var(--n-menu-height);
min-width: var(--n-column-width);
position: relative;
`,[Q("virtual",`
width: var(--n-column-width);
`),V("scrollbar-content",`
position: relative;
`),ve("&:first-child",`
border-top-left-radius: var(--n-menu-border-radius);
border-bottom-left-radius: var(--n-menu-border-radius);
`),ve("&:last-child",`
border-top-right-radius: var(--n-menu-border-radius);
border-bottom-right-radius: var(--n-menu-border-radius);
`),ve("&:not(:first-child)",`
border-left: 1px solid var(--n-menu-divider-color);
`)]),V("cascader-menu-action",`
box-sizing: border-box;
padding: 8px;
border-top: 1px solid var(--n-menu-divider-color);
`),V("cascader-option",`
height: var(--n-option-height);
line-height: var(--n-option-height);
font-size: var(--n-option-font-size);
padding: 0 0 0 18px;
box-sizing: border-box;
min-width: 182px;
background-color: #0000;
display: flex;
align-items: center;
white-space: nowrap;
position: relative;
cursor: pointer;
transition:
background-color .2s var(--n-bezier),
color 0.2s var(--n-bezier);
`,[Q("show-prefix",`
padding-left: 0;
`),Me("label",`
flex: 1 0 0;
overflow: hidden;
text-overflow: ellipsis;
`),Me("prefix",`
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`),Me("suffix",`
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
`),V("cascader-option-icon-placeholder",`
line-height: 0;
position: relative;
width: 16px;
height: 16px;
font-size: 16px;
`,[V("cascader-option-icon",[Q("checkmark",`
color: var(--n-option-check-mark-color);
`,[qe({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})]),Q("arrow",`
color: var(--n-option-arrow-color);
`)])]),Q("selected",`
color: var(--n-option-text-color-active);
`),Q("active",`
color: var(--n-option-text-color-active);
background-color: var(--n-option-color-hover);
`),Q("pending",`
background-color: var(--n-option-color-hover);
`),ve("&:hover",`
background-color: var(--n-option-color-hover);
`),Q("disabled",`
color: var(--n-option-text-color-disabled);
background-color: #0000;
cursor: not-allowed;
`,[V("cascader-option-icon",[Q("arrow",`
color: var(--n-option-text-color-disabled);
`)])])])]),V("cascader",`
z-index: auto;
position: relative;
width: 100%;
`)]),ko=Object.assign(Object.assign({},et.props),{allowCheckingNotLoaded:Boolean,to:Te.propTo,bordered:{type:Boolean,default:void 0},options:{type:Array,default:()=>[]},value:[String,Number,Array],defaultValue:{type:[String,Number,Array],default:null},placeholder:String,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},disabledField:{type:String,default:"disabled"},expandTrigger:{type:String,default:"click"},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},remote:Boolean,onLoad:Function,separator:{type:String,default:" / "},filter:Function,placement:{type:String,default:"bottom-start"},cascade:{type:Boolean,default:!0},leafOnly:Boolean,showPath:{type:Boolean,default:!0},show:{type:Boolean,default:void 0},maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,menuProps:Object,filterMenuProps:Object,virtualScroll:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},valueField:{type:String,default:"value"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},renderLabel:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onBlur:Function,onFocus:Function,getColumnStyle:Function,renderPrefix:Function,renderSuffix:Function,onChange:[Function,Array]}),Ro=le({name:"Cascader",props:ko,setup(t,{slots:i}){const{mergedBorderedRef:n,mergedClsPrefixRef:l,namespaceRef:a,inlineThemeDisabled:g}=Jt(t),k=et("Cascader","-cascader",wo,to,t,l),{localeRef:p}=oo("Cascader"),w=M(t.defaultValue),C=b(()=>t.value),u=We(C,w),O=b(()=>t.leafOnly?"child":t.checkStrategy),z=M(""),_=no(t),{mergedSizeRef:D,mergedDisabledRef:U,mergedStatusRef:W}=_,y=M(null),v=M(null),T=M(null),N=M(null),A=M(null),E=M(new Set),ae=M(null),ee=M(null),be=Te(t),m=M(!1),R=e=>{E.value.add(e)},F=e=>{E.value.delete(e)},L=b(()=>{const{valueField:e,childrenField:o,disabledField:r}=t;return Ye(t.options,{getDisabled(f){return f[r]},getKey(f){return f[e]},getChildren(f){return f[o]}})}),X=b(()=>{const{cascade:e,multiple:o}=t;return o&&Array.isArray(u.value)?L.value.getCheckedKeys(u.value,{cascade:e,allowNotLoaded:t.allowCheckingNotLoaded}):{checkedKeys:[],indeterminateKeys:[]}}),H=b(()=>X.value.checkedKeys),ie=b(()=>X.value.indeterminateKeys),Ke=b(()=>{const{treeNodePath:e,treeNode:o}=L.value.getPath(A.value);let r;return o===null?r=[L.value.treeNodes]:(r=e.map(f=>f.siblings),!o.isLeaf&&!E.value.has(o.key)&&o.children&&r.push(o.children)),r}),Le=b(()=>{const{keyPath:e}=L.value.getPath(A.value);return e}),Y=b(()=>k.value.self.optionHeight);Tt(t.options)&&Pe(t.options,(e,o)=>{e!==o&&(A.value=null,N.value=null)});const re=M(!1);function se(e){const{onUpdateShow:o,"onUpdate:show":r}=t;o&&ne(o,e),r&&ne(r,e),re.value=e}function G(e,o,r){const{onUpdateValue:f,"onUpdate:value":s,onChange:x}=t,{nTriggerFormInput:d,nTriggerFormChange:S}=_;f&&ne(f,e,o,r),s&&ne(s,e,o,r),x&&ne(x,e,o,r),w.value=e,d(),S()}function Z(e){N.value=e}function te(e){A.value=e}function ue(e){const{value:{getNode:o}}=L;return e.map(r=>{var f;return((f=o(r))===null||f===void 0?void 0:f.rawNode)||null})}function ye(e){var o;const{cascade:r,multiple:f,filterable:s}=t,{value:{check:x,getNode:d,getPath:S}}=L;if(f)try{const{checkedKeys:h}=x(e,X.value.checkedKeys,{cascade:r,checkStrategy:O.value,allowNotLoaded:t.allowCheckingNotLoaded});G(h,ue(h),h.map(ce=>{var fe;return Ne((fe=S(ce))===null||fe===void 0?void 0:fe.treeNodePath)})),s&&Be(),N.value=e,A.value=e}catch(h){if(h instanceof qt){if(y.value){const ce=d(e);ce!==null&&y.value.showErrorMessage(ce.rawNode[t.labelField])}}else throw h}else if(O.value==="child"){const h=d(e);if(h!=null&&h.isLeaf)G(e,h.rawNode,Ne(S(e).treeNodePath));else return!1}else{const h=d(e);G(e,(h==null?void 0:h.rawNode)||null,Ne((o=S(e))===null||o===void 0?void 0:o.treeNodePath))}return!0}function me(e){const{cascade:o,multiple:r}=t;if(r){const{value:{uncheck:f,getNode:s,getPath:x}}=L,{checkedKeys:d}=f(e,X.value.checkedKeys,{cascade:o,checkStrategy:O.value,allowNotLoaded:t.allowCheckingNotLoaded});G(d,d.map(S=>{var h;return((h=s(S))===null||h===void 0?void 0:h.rawNode)||null}),d.map(S=>{var h;return Ne((h=x(S))===null||h===void 0?void 0:h.treeNodePath)})),N.value=e,A.value=e}}const we=b(()=>{if(t.multiple){const{showPath:e,separator:o,labelField:r,cascade:f}=t,{getCheckedKeys:s,getNode:x}=L.value;return s(H.value,{cascade:f,checkStrategy:O.value,allowNotLoaded:t.allowCheckingNotLoaded}).checkedKeys.map(S=>{const h=x(S);return h===null?{label:String(S),value:S}:{label:e?Ae(h,o,r):h.rawNode[r],value:h.key}})}else return[]}),P=b(()=>{const{multiple:e,showPath:o,separator:r,labelField:f}=t,{value:s}=u;if(!e&&!Array.isArray(s)){const{getNode:x}=L.value;if(s===null)return null;const d=x(s);return d===null?{label:String(s),value:s}:{label:o?Ae(d,r,f):d.rawNode[f],value:d.key}}else return null}),J=$(t,"show"),B=We(J,re),ke=b(()=>{const{placeholder:e}=t;return e!==void 0?e:p.value.placeholder}),K=b(()=>!!(t.filterable&&z.value));Pe(B,e=>{if(!e||t.multiple)return;const{value:o}=u;!Array.isArray(o)&&o!==null?(N.value=o,A.value=o,Pt(()=>{var r;if(!B.value)return;const{value:f}=A;if(u.value!==null){const s=L.value.getNode(f);s&&((r=y.value)===null||r===void 0||r.scroll(s.level,s.index,pe(Y.value)))}})):(N.value=null,A.value=null)},{immediate:!0});function Re(e){const{onBlur:o}=t,{nTriggerFormBlur:r}=_;o&&ne(o,e),r()}function xe(e){const{onFocus:o}=t,{nTriggerFormFocus:r}=_;o&&ne(o,e),r()}function Be(){var e;(e=T.value)===null||e===void 0||e.focusInput()}function ot(){var e;(e=T.value)===null||e===void 0||e.focus()}function Se(){U.value||(z.value="",se(!0),t.filterable&&Be())}function oe(e=!1){e&&ot(),se(!1),z.value=""}function Ve(e){var o;K.value||B.value&&(!((o=T.value)===null||o===void 0)&&o.$el.contains(ro(e))||oe())}function nt(e){K.value&&Ve(e)}function $e(){t.clearFilterAfterSelect&&(z.value="")}function Ce(e){var o,r,f;const{value:s}=N,{value:x}=L;switch(e){case"prev":if(s!==null){const d=x.getPrev(s,{loop:!0});d!==null&&(Z(d.key),(o=y.value)===null||o===void 0||o.scroll(d.level,d.index,pe(Y.value)))}break;case"next":if(s===null){const d=x.getFirstAvailableNode();d!==null&&(Z(d.key),(r=y.value)===null||r===void 0||r.scroll(d.level,d.index,pe(Y.value)))}else{const d=x.getNext(s,{loop:!0});d!==null&&(Z(d.key),(f=y.value)===null||f===void 0||f.scroll(d.level,d.index,pe(Y.value)))}break;case"child":if(s!==null){const d=x.getNode(s);if(d!==null)if(d.shallowLoaded){const S=x.getChild(s);S!==null&&(te(s),Z(S.key))}else{const{value:S}=E;if(!S.has(s)){R(s),te(s);const{onLoad:h}=t;h&&h(d.rawNode).then(()=>{F(s)}).catch(()=>{F(s)})}}}break;case"parent":if(s!==null){const d=x.getParent(s);if(d!==null){Z(d.key);const S=d.getParent();te(S===null?null:S.key)}}break}}function je(e){var o,r;switch(e.key){case" ":case"ArrowDown":case"ArrowUp":if(t.filterable&&B.value)break;e.preventDefault();break}if(!ze(e,"action"))switch(e.key){case" ":if(t.filterable)return;case"Enter":if(!B.value)Se();else{const{value:f}=K,{value:s}=N;if(f)v.value&&v.value.enter()&&$e();else if(s!==null)if(H.value.includes(s)||ie.value.includes(s))me(s);else{const x=ye(s);!t.multiple&&x&&oe(!0)}}break;case"ArrowUp":e.preventDefault(),B.value&&(K.value?(o=v.value)===null||o===void 0||o.prev():Ce("prev"));break;case"ArrowDown":e.preventDefault(),B.value?K.value?(r=v.value)===null||r===void 0||r.next():Ce("next"):Se();break;case"ArrowLeft":e.preventDefault(),B.value&&!K.value&&Ce("parent");break;case"ArrowRight":e.preventDefault(),B.value&&!K.value&&Ce("child");break;case"Escape":B.value&&(so(e),oe(!0))}}function lt(e){je(e)}function at(e){e.stopPropagation(),t.multiple?G([],[],[]):G(null,null,null)}function it(e){var o;!((o=y.value)===null||o===void 0)&&o.$el.contains(e.relatedTarget)||(m.value=!0,xe(e))}function rt(e){var o;!((o=y.value)===null||o===void 0)&&o.$el.contains(e.relatedTarget)||(m.value=!1,Re(e),oe())}function st(e){var o;!((o=T.value)===null||o===void 0)&&o.$el.contains(e.relatedTarget)||(m.value=!0,xe(e))}function ut(e){var o;!((o=T.value)===null||o===void 0)&&o.$el.contains(e.relatedTarget)||(m.value=!1,Re(e))}function dt(e){ze(e,"action")||t.multiple&&t.filter&&(e.preventDefault(),Be())}function ct(){oe(!0)}function mt(){t.filterable?Se():B.value?oe(!0):Se()}function ft(e){z.value=e.target.value}function ht(e){const{multiple:o}=t,{value:r}=u;o&&Array.isArray(r)&&e.value!==void 0?me(e.value):G(null,null,null)}function Ue(){var e;(e=ae.value)===null||e===void 0||e.syncPosition()}function De(){var e;(e=ee.value)===null||e===void 0||e.syncPosition()}function vt(){B.value&&(K.value?Ue():De())}const Ie=b(()=>!!(t.multiple&&t.cascade||O.value!=="child"));Ot(ge,{slots:i,mergedClsPrefixRef:l,mergedThemeRef:k,mergedValueRef:u,checkedKeysRef:H,indeterminateKeysRef:ie,hoverKeyPathRef:Le,mergedCheckStrategyRef:O,showCheckboxRef:Ie,cascadeRef:$(t,"cascade"),multipleRef:$(t,"multiple"),keyboardKeyRef:N,hoverKeyRef:A,remoteRef:$(t,"remote"),loadingKeySetRef:E,expandTriggerRef:$(t,"expandTrigger"),isMountedRef:lo(),onLoadRef:$(t,"onLoad"),virtualScrollRef:$(t,"virtualScroll"),optionHeightRef:Y,localeRef:p,labelFieldRef:$(t,"labelField"),renderLabelRef:$(t,"renderLabel"),getColumnStyleRef:$(t,"getColumnStyle"),renderPrefixRef:$(t,"renderPrefix"),renderSuffixRef:$(t,"renderSuffix"),syncCascaderMenuPosition:De,syncSelectMenuPosition:Ue,updateKeyboardKey:Z,updateHoverKey:te,addLoadingKey:R,deleteLoadingKey:F,doCheck:ye,doUncheck:me,closeMenu:oe,handleSelectMenuClickOutside:nt,handleCascaderMenuClickOutside:Ve,clearPattern:$e});const pt={focus:()=>{var e;(e=T.value)===null||e===void 0||e.focus()},blur:()=>{var e;(e=T.value)===null||e===void 0||e.blur()},getCheckedData:()=>{if(Ie.value){const e=H.value;return{keys:e,options:ue(e)}}return{keys:[],options:[]}},getIndeterminateData:()=>{if(Ie.value){const e=ie.value;return{keys:e,options:ue(e)}}return{keys:[],options:[]}}},Ee=b(()=>{const{self:{optionArrowColor:e,optionTextColor:o,optionTextColorActive:r,optionTextColorDisabled:f,optionCheckMarkColor:s,menuColor:x,menuBoxShadow:d,menuDividerColor:S,menuBorderRadius:h,menuHeight:ce,optionColorHover:fe,optionHeight:gt,optionFontSize:bt,loadingColor:yt,columnWidth:wt},common:{cubicBezierEaseInOut:kt}}=k.value;return{"--n-bezier":kt,"--n-menu-border-radius":h,"--n-menu-box-shadow":d,"--n-menu-height":ce,"--n-column-width":wt,"--n-menu-color":x,"--n-menu-divider-color":S,"--n-option-height":gt,"--n-option-font-size":bt,"--n-option-text-color":o,"--n-option-text-color-disabled":f,"--n-option-text-color-active":r,"--n-option-color-hover":fe,"--n-option-check-mark-color":s,"--n-option-arrow-color":e,"--n-menu-mask-color":Qt(x,{alpha:.75}),"--n-loading-color":yt}}),de=g?Xt("cascader",void 0,Ee,t):void 0;return Object.assign(Object.assign({},pt),{handleTriggerResize:vt,mergedStatus:W,selectMenuFollowerRef:ae,cascaderMenuFollowerRef:ee,triggerInstRef:T,selectMenuInstRef:v,cascaderMenuInstRef:y,mergedBordered:n,mergedClsPrefix:l,namespace:a,mergedValue:u,mergedShow:B,showSelectMenu:K,pattern:z,treeMate:L,mergedSize:D,mergedDisabled:U,localizedPlaceholder:ke,selectedOption:P,selectedOptions:we,adjustedTo:be,menuModel:Ke,handleMenuTabout:ct,handleMenuFocus:st,handleMenuBlur:ut,handleMenuKeydown:lt,handleMenuMousedown:dt,handleTriggerFocus:it,handleTriggerBlur:rt,handleTriggerClick:mt,handleClear:at,handleDeleteOption:ht,handlePatternInput:ft,handleKeydown:je,focused:m,optionHeight:Y,mergedTheme:k,cssVars:g?void 0:Ee,themeClass:de==null?void 0:de.themeClass,onRender:de==null?void 0:de.onRender})},render(){const{mergedClsPrefix:t}=this;return c("div",{class:`${t}-cascader`},c(ao,null,{default:()=>[c(io,null,{default:()=>c(Ht,{onResize:this.handleTriggerResize,ref:"triggerInstRef",status:this.mergedStatus,clsPrefix:t,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,active:this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,focused:this.focused,onFocus:this.handleTriggerFocus,onBlur:this.handleTriggerBlur,onClick:this.handleTriggerClick,onClear:this.handleClear,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onKeydown:this.handleKeydown},{arrow:()=>{var i,n;return(n=(i=this.$slots).arrow)===null||n===void 0?void 0:n.call(i)}})}),c(Ge,{key:"cascaderMenu",ref:"cascaderMenuFollowerRef",show:this.mergedShow&&!this.showSelectMenu,containerClass:this.namespace,placement:this.placement,width:this.options.length?void 0:"target",teleportDisabled:this.adjustedTo===Te.tdkey,to:this.adjustedTo},{default:()=>{var i;(i=this.onRender)===null||i===void 0||i.call(this);const{menuProps:n}=this;return c(bo,Object.assign({},n,{ref:"cascaderMenuInstRef",class:[this.themeClass,n==null?void 0:n.class],value:this.mergedValue,show:this.mergedShow&&!this.showSelectMenu,menuModel:this.menuModel,style:[this.cssVars,n==null?void 0:n.style],onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onMousedown:this.handleMenuMousedown,onTabout:this.handleMenuTabout}),{action:()=>{var l,a;return(a=(l=this.$slots).action)===null||a===void 0?void 0:a.call(l)},empty:()=>{var l,a;return(a=(l=this.$slots).empty)===null||a===void 0?void 0:a.call(l)}})}}),c(Ge,{key:"selectMenu",ref:"selectMenuFollowerRef",show:this.mergedShow&&this.showSelectMenu,containerClass:this.namespace,width:"target",placement:this.placement,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Te.tdkey},{default:()=>{var i;(i=this.onRender)===null||i===void 0||i.call(this);const{filterMenuProps:n}=this;return c(yo,Object.assign({},n,{ref:"selectMenuInstRef",class:[this.themeClass,n==null?void 0:n.class],value:this.mergedValue,show:this.mergedShow&&this.showSelectMenu,pattern:this.pattern,multiple:this.multiple,tmNodes:this.treeMate.treeNodes,filter:this.filter,labelField:this.labelField,separator:this.separator,style:[this.cssVars,n==null?void 0:n.style]}))}})]}))}}),ca=le({__name:"Animate",props:{modelValue:{default:()=>({})},currAction:{default:()=>({name:"",type:"animate",targetId:"",targetProps:{}})}},emits:["update:modelValue"],setup(t,{emit:i}){const n=t,l=i,a=M({animationEnabled:!0,animationOptions:{name:"lrd__opacity",iterationCount:1,timingFunction:"linear",direction:"normal",duration:.5,delay:0}}),g=[{label:"常用",value:"common",children:xt},{label:"入场",value:"in",children:St},{label:"出场",value:"out",children:Ct},{label:"强调",value:"attention",children:_t},{label:"特殊",value:"special",children:Mt}],k=[{label:"线性",value:"linear"},{label:"匀速",value:"ease"},{label:"加速",value:"ease-in"},{label:"减速",value:"ease-out"},{label:"先加速后减速",value:"ease-in-out"},{label:"初始速度",value:"initial"},{label:"结束速度",value:"inherit"},{label:"自定义",value:"cubic-bezier(0.42, 0, 0.58, 1)"}],p=[{label:"正向",value:"normal"},{label:"反向",value:"reverse"},{label:"奇数次正向",value:"alternate"},{label:"奇数次反向",value:"alternate-reverse"}];Pe(()=>n.modelValue,C=>{Object.assign(a.value,C)},{immediate:!0}),Pe(a,C=>{l("update:modelValue",C)},{deep:!0});function w(C){a.value.animationOptions.iterationCount=C?"infinite":1}return(C,u)=>{const O=uo,z=Xe,_=co,D=Ro,U=Wt,W=mo,y=fo;return Ft(),Kt(Lt,null,[I(Rt,{"curr-action":n.currAction},null,8,["curr-action"]),I(O,{class:"color-[#999]"},{default:q(()=>u[5]||(u[5]=[_e(" 设置动画配置 ")])),_:1}),I(y,{"label-width":"100px",model:j(a),size:"small","label-placement":"left","show-feedback":!1},{default:q(()=>[I(_,{label:"循环播放",path:"animationEnabled",class:"mb-4"},{default:q(()=>[I(z,{size:"small",checked:j(a).animationOptions.iterationCount==="infinite","on-update:checked":w,class:"mr-2"},null,8,["checked"]),u[6]||(u[6]=_e(" 启用 "))]),_:1}),I(_,{label:"动画类型",path:"animationOptions.name",class:"mb-4"},{default:q(()=>[I(D,{value:j(a).animationOptions.name,"onUpdate:value":u[0]||(u[0]=v=>j(a).animationOptions.name=v),placeholder:"请选择动画类型",size:"small",options:g,"check-strategy":"child","show-path":!1,filterable:!0,style:{width:"250px"}},null,8,["value"])]),_:1}),I(_,{label:"交替方向",path:"animationOptions.direction",class:"mb-4"},{default:q(()=>[I(U,{value:j(a).animationOptions.direction,"onUpdate:value":u[1]||(u[1]=v=>j(a).animationOptions.direction=v),options:p,size:"small",style:{width:"250px"}},null,8,["value"])]),_:1}),I(_,{label:"速度",path:"animationOptions.timingFunction",class:"mb-4"},{default:q(()=>[I(U,{value:j(a).animationOptions.timingFunction,"onUpdate:value":u[2]||(u[2]=v=>j(a).animationOptions.timingFunction=v),size:"small",options:k,style:{width:"250px"}},null,8,["value"])]),_:1}),I(_,{label:"时长",path:"animationOptions.duration",class:"mb-4"},{default:q(()=>[I(W,{value:j(a).animationOptions.duration,"onUpdate:value":u[3]||(u[3]=v=>j(a).animationOptions.duration=v),size:"small","show-button":!1,style:{width:"100px"}},{suffix:q(()=>u[7]||(u[7]=[_e(" 秒 ")])),_:1},8,["value"])]),_:1}),I(_,{label:"延迟",path:"animationOptions.delay",class:"mb-4"},{default:q(()=>[I(W,{value:j(a).animationOptions.delay,"onUpdate:value":u[4]||(u[4]=v=>j(a).animationOptions.delay=v),size:"small","show-button":!1,style:{width:"100px"}},{suffix:q(()=>u[8]||(u[8]=[_e(" 秒 ")])),_:1},8,["value"])]),_:1})]),_:1},8,["model"])],64)}}});export{ca as default};