1 |
- System.register(["./index-legacy-f8e66744-1725962701482.js"],(function(e,n){"use strict";var l,t,o,a,r,i,s,d,u,c,h,v,p,f,m,g,b,y,w,k,x,C,R,S,M,T,P,N,F,O,K,A,B,L,z,I,$,j,D,V,H,U,E,q,_,W,G,J,Q,Z,X,Y,ee,ne,le,te,oe,ae,re,ie,se,de,ue,ce;return{setters:[e=>{l=e.af,t=e.de,o=e.d,a=e.df,r=e.al,i=e.r,s=e.p,d=e.ad,u=e._,c=e.dg,h=e.a5,v=e.dh,p=e.di,f=e.dj,m=e.dk,g=e.dl,b=e.aa,y=e.a8,w=e.U,k=e.dm,x=e.dn,C=e.dp,R=e.dq,S=e.dr,M=e.n,T=e.ds,P=e.dt,N=e.du,F=e.dv,O=e.dw,K=e.a0,A=e.dx,B=e.dy,L=e.dz,z=e.dA,I=e.dB,$=e.dC,j=e.dD,D=e.dE,V=e.ah,H=e.dF,U=e.ag,E=e.ai,q=e.ab,_=e.ao,W=e.b1,G=e.ak,J=e.dG,Q=e.dH,Z=e.bZ,X=e.A,Y=e.a7,ee=e.dI,ne=e.dJ,le=e.ap,te=e.dK,oe=e.dL,ae=e.dM,re=e.dN,ie=e.dO,se=e.av,de=e.dP,ue=e.dQ,ce=e.S}],execute:function(){const n=l("base-menu-mask","\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 14px;\n overflow: hidden;\n",[t()]),he=o({name:"BaseMenuMask",props:{clsPrefix:{type:String,required:!0}},setup(e){a("-base-menu-mask",n,r(e,"clsPrefix"));const l=i(null);let t=null;const o=i(!1);s((()=>{null!==t&&window.clearTimeout(t)}));const d={showOnce(e,n=1500){t&&window.clearTimeout(t),o.value=!0,l.value=e,t=window.setTimeout((()=>{o.value=!1,l.value=null}),n)}};return Object.assign({message:l,show:o},d)},render(){return d(u,{name:"fade-in-transition"},{default:()=>this.show?d("div",{class:`${this.clsPrefix}-base-menu-mask`},this.message):null})}}),ve=c({name:"Cascader",common:h,peers:{InternalSelectMenu:v,InternalSelection:p,Scrollbar:f,Checkbox:m,Empty:g},self:e=>{const{borderRadius:n,boxShadow2:l,popoverColor:t,textColor2:o,textColor3:a,primaryColor:r,textColorDisabled:i,dividerColor:s,hoverColor:d,fontSizeMedium:u,heightMedium:c}=e;return{menuBorderRadius:n,menuColor:t,menuBoxShadow:l,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:a,optionHeight:c,optionFontSize:u,optionColorHover:d,optionTextColor:o,optionTextColorActive:r,optionTextColorDisabled:i,optionCheckMarkColor:r,loadingColor:r,columnWidth:"180px"}}});function pe(e){return e?e.map((e=>e.rawNode)):null}function fe(e,n,l){const t=[];for(;e;)t.push(e.rawNode[l]),e=e.parent;return t.reverse().join(n)}const me=b("n-cascader"),ge=o({name:"NCascaderOption",props:{tmNode:{type:Object,required:!0}},setup(e){const{expandTriggerRef:n,remoteRef:l,multipleRef:t,mergedValueRef:o,checkedKeysRef:a,indeterminateKeysRef:r,hoverKeyPathRef:i,keyboardKeyRef:s,loadingKeySetRef:d,cascadeRef:u,mergedCheckStrategyRef:c,onLoadRef:h,mergedClsPrefixRef:v,mergedThemeRef:p,labelFieldRef:f,showCheckboxRef:m,updateHoverKey:g,updateKeyboardKey:b,addLoadingKey:x,deleteLoadingKey:C,closeMenu:R,doCheck:S,doUncheck:M,renderLabelRef:P}=y(me),N=w((()=>e.tmNode.key)),F=w((()=>{const{value:e}=n,{value:t}=l;return!t&&"hover"===e})),O=w((()=>{if(F.value)return H})),K=w((()=>{if(F.value)return U})),A=k((()=>{const{value:e}=t;return e?a.value.includes(N.value):o.value===N.value})),B=k((()=>!!t.value&&r.value.includes(N.value))),L=k((()=>i.value.includes(N.value))),z=k((()=>{const{value:e}=s;return null!==e&&e===N.value})),I=k((()=>!!l.value&&d.value.has(N.value))),$=w((()=>e.tmNode.isLeaf)),j=w((()=>e.tmNode.disabled)),D=w((()=>e.tmNode.rawNode[f.value])),V=w((()=>e.tmNode.shallowLoaded));function H(){if(!F.value||j.value)return;const{value:e}=N;g(e),b(e)}function U(){F.value&&H()}function E(){const{value:e}=t,{value:n}=N;e?B.value||A.value?M(n):S(n):(S(n),R(!0))}return{checkStrategy:c,multiple:t,cascade:u,checked:A,indeterminate:B,hoverPending:L,keyboardPending:z,isLoading:I,showCheckbox:m,isLeaf:$,disabled:j,label:D,mergedClsPrefix:v,mergedTheme:p,handleClick:function(n){if(j.value)return;const{value:t}=l,{value:o}=d,{value:a}=h,{value:r}=N,{value:i}=$,{value:s}=V;T(n,"checkbox")||(t&&!s&&!o.has(r)&&a&&(x(r),a(e.tmNode.rawNode).then((()=>{C(r)})).catch((()=>{C(r)}))),g(r),b(r)),i&&E()},handleCheckboxUpdateValue:function(){const{value:e}=$;e||E()},mergedHandleMouseEnter:O,mergedHandleMouseMove:K,renderLabel:P}},render(){const{mergedClsPrefix:e,renderLabel:n}=this;return d("div",{class:[`${e}-cascader-option`,{[`${e}-cascader-option--pending`]:this.keyboardPending||this.hoverPending,[`${e}-cascader-option--disabled`]:this.disabled,[`${e}-cascader-option--show-prefix`]:this.showCheckbox}],onMouseenter:this.mergedHandleMouseEnter,onMousemove:this.mergedHandleMouseMove,onClick:this.handleClick},this.showCheckbox?d("div",{class:`${e}-cascader-option__prefix`},d(M,{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,d("span",{class:`${e}-cascader-option__label`},n?n(this.tmNode.rawNode,this.checked):this.label),d("div",{class:`${e}-cascader-option__suffix`},d("div",{class:`${e}-cascader-option-icon-placeholder`},this.isLeaf?"child"!==this.checkStrategy||this.multiple&&this.cascade?null:d(u,{name:"fade-in-scale-up-transition"},{default:()=>this.checked?d(C,{clsPrefix:e,class:`${e}-cascader-option-icon ${e}-cascader-option-icon--checkmark`},{default:()=>d(S,null)}):null}):d(x,{clsPrefix:e,scale:.85,strokeWidth:24,show:this.isLoading,class:`${e}-cascader-option-icon`},{default:()=>d(C,{clsPrefix:e,key:"arrow",class:`${e}-cascader-option-icon ${e}-cascader-option-icon--arrow`},{default:()=>d(R,null)})}))))}}),be=o({name:"CascaderSubmenu",props:{depth:{type:Number,required:!0},tmNodes:{type:Array,required:!0}},setup(){const{virtualScrollRef:e,mergedClsPrefixRef:n,mergedThemeRef:l,optionHeightRef:t}=y(me),o=i(null),a=i(null),r={scroll(n,l){var t,r;e.value?null===(t=a.value)||void 0===t||t.scrollTo({index:n}):null===(r=o.value)||void 0===r||r.scrollTo({index:n,elSize:l})}};return Object.assign({mergedClsPrefix:n,mergedTheme:l,scrollbarInstRef:o,vlInstRef:a,virtualScroll:e,itemSize:w((()=>P(t.value))),handleVlScroll:()=>{var e;null===(e=o.value)||void 0===e||e.sync()},getVlContainer:()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.listElRef},getVlContent:()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.itemsElRef}},r)},render(){const{mergedClsPrefix:e,mergedTheme:n,virtualScroll:l}=this;return d("div",{class:[l&&`${e}-cascader-submenu--virtual`,`${e}-cascader-submenu`]},d(N,{ref:"scrollbarInstRef",theme:n.peers.Scrollbar,themeOverrides:n.peerOverrides.Scrollbar,container:l?this.getVlContainer:void 0,content:l?this.getVlContent:void 0},{default:()=>l?d(F,{items:this.tmNodes,itemSize:this.itemSize,onScroll:this.handleVlScroll,showScrollbar:!1,ref:"vlInstRef"},{default:({item:e})=>d(ge,{key:e.key,tmNode:e})}):this.tmNodes.map((e=>d(ge,{key:e.key,tmNode:e})))}))}}),ye=o({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(e){const{localeRef:n,isMountedRef:l,mergedClsPrefixRef:t,syncCascaderMenuPosition:o,handleCascaderMenuClickOutside:a,mergedThemeRef:r}=y(me),s=[],d=i(null),u=i(null);O(u,(function(){o()}));const c={scroll(e,n,l){const t=s[e];t&&t.scroll(n,l)},showErrorMessage:function(e){var l;const{value:{loadingRequiredMessage:t}}=n;null===(l=d.value)||void 0===l||l.showOnce(t(e))}};return Object.assign({isMounted:l,mergedClsPrefix:t,selfElRef:u,submenuInstRefs:s,maskInstRef:d,mergedTheme:r,handleFocusin:function(n){const{value:l}=u;l&&(l.contains(n.relatedTarget)||e.onFocus(n))},handleFocusout:function(n){const{value:l}=u;l&&(l.contains(n.relatedTarget)||e.onBlur(n))},handleClickOutside:function(e){a(e)}},c)},render(){const{submenuInstRefs:e,mergedClsPrefix:n,mergedTheme:l}=this;return d(u,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.show?K(d("div",{tabindex:"0",ref:"selfElRef",class:`${n}-cascader-menu`,onMousedown:this.onMousedown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeydown:this.onKeydown},this.menuModel[0].length?d("div",{class:`${n}-cascader-submenu-wrapper`},this.menuModel.map(((n,l)=>d(be,{ref:n=>{n&&(e[l]=n)},key:l,tmNodes:n,depth:l+1}))),d(he,{clsPrefix:n,ref:"maskInstRef"})):d("div",{class:`${n}-cascader-menu__empty`},B(this.$slots.empty,(()=>[d(L,{theme:l.peers.Empty,themeOverrides:l.peerOverrides.Empty})]))),z(this.$slots.action,(e=>e&&d("div",{class:`${n}-cascader-menu-action`,"data-action":!0},e))),d(I,{onFocus:this.onTabout})),[[A,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),we=o({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(e){const{isMountedRef:n,mergedValueRef:l,mergedClsPrefixRef:t,mergedThemeRef:o,mergedCheckStrategyRef:a,slots:r,syncSelectMenuPosition:s,closeMenu:d,handleSelectMenuClickOutside:u,doUncheck:c,doCheck:h,clearPattern:v}=y(me),p=i(null),f=w((()=>function(e,n,l,t){const o=[],a=[];return function e(r){for(const i of r){if(i.disabled)continue;const{rawNode:r}=i;a.push(r),!i.isLeaf&&n||o.push({label:fe(i,t,l),value:i.key,rawNode:i.rawNode,path:Array.from(a)}),!i.isLeaf&&i.children&&e(i.children),a.pop()}}(e),o}(e.tmNodes,"child"===a.value,e.labelField,e.separator))),m=w((()=>{const{filter:n}=e;if(n)return n;const{labelField:l}=e;return(e,n,t)=>t.some((n=>n[l]&&~n[l].indexOf(e)))})),g=w((()=>{const{pattern:n}=e,{value:l}=m;return(n?f.value.filter((e=>l(n,e.rawNode,e.path))):f.value).map((e=>({value:e.value,label:e.label})))})),b=w((()=>$(g.value,j("value","children"))));function k(n){if(e.multiple){const{value:e}=l;Array.isArray(e)?e.includes(n.key)?c(n.key):h(n.key):null===e&&h(n.key),v()}else h(n.key),d(!0)}const x={prev:function(){var e;null===(e=p.value)||void 0===e||e.prev()},next:function(){var e;null===(e=p.value)||void 0===e||e.next()},enter:function(){var e;if(p){const n=null===(e=p.value)||void 0===e?void 0:e.getPendingTmNode();return n&&k(n),!0}return!1}};return Object.assign({isMounted:n,mergedTheme:o,mergedClsPrefix:t,menuInstRef:p,selectTreeMate:b,handleResize:function(){s()},handleToggle:function(e){k(e)},handleClickOutside:function(e){u(e)},cascaderSlots:r},x)},render(){const{mergedClsPrefix:e,isMounted:n,mergedTheme:l,cascaderSlots:t}=this;return d(u,{name:"fade-in-scale-up-transition",appear:n},{default:()=>this.show?K(d(D,{ref:"menuInstRef",onResize:this.handleResize,clsPrefix:e,class:`${e}-cascader-menu`,autoPending:!0,themeOverrides:l.peerOverrides.InternalSelectMenu,theme:l.peers.InternalSelectMenu,treeMate:this.selectTreeMate,multiple:this.multiple,value:this.value,onToggle:this.handleToggle},{empty:()=>B(t["not-found"],(()=>[]))}),[[A,this.handleClickOutside,void 0,{capture:!0}]]):null})}}),ke=V([l("cascader-menu","\n outline: none;\n position: relative;\n margin: 4px 0;\n display: flex;\n flex-flow: column nowrap;\n border-radius: var(--n-menu-border-radius);\n overflow: hidden;\n box-shadow: var(--n-menu-box-shadow);\n color: var(--n-option-text-color);\n background-color: var(--n-menu-color);\n ",[H({transformOrigin:"inherit",duration:"0.2s"}),U("empty","\n display: flex;\n padding: 12px 32px;\n flex: 1;\n justify-content: center;\n "),l("scrollbar",{width:"100%"}),l("base-menu-mask",{backgroundColor:"var(--n-menu-mask-color)"}),l("base-loading",{color:"var(--n-loading-color)"}),l("cascader-submenu-wrapper","\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n "),l("cascader-submenu","\n height: var(--n-menu-height);\n min-width: var(--n-column-width);\n position: relative;\n ",[E("virtual","\n width: var(--n-column-width);\n "),l("scrollbar-content",{position:"relative"}),V("&:first-child","\n border-top-left-radius: var(--n-menu-border-radius);\n border-bottom-left-radius: var(--n-menu-border-radius);\n "),V("&:last-child","\n border-top-right-radius: var(--n-menu-border-radius);\n border-bottom-right-radius: var(--n-menu-border-radius);\n "),V("&:not(:first-child)","\n border-left: 1px solid var(--n-menu-divider-color);\n ")]),l("cascader-menu-action","\n box-sizing: border-box;\n padding: 8px;\n border-top: 1px solid var(--n-menu-divider-color);\n "),l("cascader-option","\n height: var(--n-option-height);\n line-height: var(--n-option-height);\n font-size: var(--n-option-font-size);\n padding: 0 0 0 18px;\n box-sizing: border-box;\n min-width: 182px;\n background-color: #0000;\n display: flex;\n align-items: center;\n white-space: nowrap;\n position: relative;\n cursor: pointer;\n transition:\n background-color .2s var(--n-bezier),\n color 0.2s var(--n-bezier);\n ",[E("show-prefix",{paddingLeft:0}),U("label","\n flex: 1 0 0;\n overflow: hidden;\n text-overflow: ellipsis;\n "),U("prefix",{width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}),U("suffix",{width:"32px",display:"flex",alignItems:"center",justifyContent:"center"}),l("cascader-option-icon-placeholder",{lineHeight:0,position:"relative",width:"16px",height:"16px",fontSize:"16px"},[l("cascader-option-icon",[E("checkmark",{color:"var(--n-option-check-mark-color)"},[H({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})]),E("arrow",{color:"var(--n-option-arrow-color)"})])]),E("selected",{color:"var(--n-option-text-color-active)"}),E("active",{color:"var(--n-option-text-color-active)",backgroundColor:"var(--n-option-color-hover)"}),E("pending",{backgroundColor:"var(--n-option-color-hover)"}),V("&:hover",{backgroundColor:"var(--n-option-color-hover)"}),E("disabled","\n color: var(--n-option-text-color-disabled);\n background-color: #0000;\n cursor: not-allowed;\n ",[l("cascader-option-icon",[E("arrow",{color:"var(--n-option-text-color-disabled)"})])])])]),l("cascader","\n z-index: auto;\n position: relative;\n width: 100%;\n ")]),xe=Object.assign(Object.assign({},_.props),{allowCheckingNotLoaded:Boolean,to:Q.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,onChange:[Function,Array]});e("N",o({name:"Cascader",props:xe,setup(e,{slots:n}){const{mergedBorderedRef:l,mergedClsPrefixRef:t,namespaceRef:o,inlineThemeDisabled:a}=q(e),s=_("Cascader","-cascader",ke,ve,e,t),{localeRef:d}=W("Cascader"),u=i(e.defaultValue),c=w((()=>e.value)),h=G(c,u),v=w((()=>e.leafOnly?"child":e.checkStrategy)),p=i(""),f=J(e),{mergedSizeRef:m,mergedDisabledRef:g,mergedStatusRef:b}=f,y=i(null),k=i(null),x=i(null),C=i(null),R=i(null),S=i(new Set),M=i(null),N=i(null),F=Q(e),O=i(!1),K=e=>{S.value.add(e)},A=e=>{S.value.delete(e)},B=w((()=>{const{valueField:n,childrenField:l,disabledField:t}=e;return $(e.options,{getDisabled:e=>e[t],getKey:e=>e[n],getChildren:e=>e[l]})})),L=w((()=>{const{cascade:n,multiple:l}=e;return l&&Array.isArray(h.value)?B.value.getCheckedKeys(h.value,{cascade:n,allowNotLoaded:e.allowCheckingNotLoaded}):{checkedKeys:[],indeterminateKeys:[]}})),z=w((()=>L.value.checkedKeys)),I=w((()=>L.value.indeterminateKeys)),j=w((()=>{const{treeNodePath:e,treeNode:n}=B.value.getPath(R.value);let l;return null===n?l=[B.value.treeNodes]:(l=e.map((e=>e.siblings)),n.isLeaf||S.value.has(n.key)||!n.children||l.push(n.children)),l})),D=w((()=>{const{keyPath:e}=B.value.getPath(R.value);return e})),V=w((()=>s.value.self.optionHeight));function H(n){const{onUpdateShow:l,"onUpdate:show":t}=e;l&&ue(l,n),t&&ue(t,n),be.value=n}function U(n,l,t){const{onUpdateValue:o,"onUpdate:value":a,onChange:r}=e,{nTriggerFormInput:i,nTriggerFormChange:s}=f;o&&ue(o,n,l,t),a&&ue(a,n,l,t),r&&ue(r,n,l,t),u.value=n,i(),s()}function E(e){C.value=e}function te(e){R.value=e}function oe(e){const{value:{getNode:n}}=B;return e.map((e=>{var l;return(null===(l=n(e))||void 0===l?void 0:l.rawNode)||null}))}function ae(n){var l;const{cascade:t,multiple:o,filterable:a}=e,{value:{check:r,getNode:i,getPath:s}}=B;if(o)try{const{checkedKeys:l}=r(n,L.value.checkedKeys,{cascade:t,checkStrategy:v.value,allowNotLoaded:e.allowCheckingNotLoaded});U(l,oe(l),l.map((e=>{var n;return pe(null===(n=s(e))||void 0===n?void 0:n.treeNodePath)}))),a&&Me(),C.value=n,R.value=n}catch(d){if(!(d instanceof ie))throw d;if(y.value){const l=i(n);null!==l&&y.value.showErrorMessage(l.rawNode[e.labelField])}}else if("child"===v.value){const e=i(n);if(!(null==e?void 0:e.isLeaf))return!1;U(n,e.rawNode,pe(s(n).treeNodePath))}else{const e=i(n);U(n,(null==e?void 0:e.rawNode)||null,pe(null===(l=s(n))||void 0===l?void 0:l.treeNodePath))}return!0}function re(n){const{cascade:l,multiple:t}=e;if(t){const{value:{uncheck:t,getNode:o,getPath:a}}=B,{checkedKeys:r}=t(n,L.value.checkedKeys,{cascade:l,checkStrategy:v.value,allowNotLoaded:e.allowCheckingNotLoaded});U(r,r.map((e=>{var n;return(null===(n=o(e))||void 0===n?void 0:n.rawNode)||null})),r.map((e=>{var n;return pe(null===(n=a(e))||void 0===n?void 0:n.treeNodePath)}))),C.value=n,R.value=n}}Z(e.options)&&X(e.options,((e,n)=>{e!==n&&(R.value=null,C.value=null)}));const he=w((()=>{if(e.multiple){const{showPath:n,separator:l,labelField:t,cascade:o}=e,{getCheckedKeys:a,getNode:r}=B.value;return a(z.value,{cascade:o,checkStrategy:v.value,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys.map((e=>{const o=r(e);return null===o?{label:String(e),value:e}:{label:n?fe(o,l,t):o.rawNode[t],value:o.key}}))}return[]})),ge=w((()=>{const{multiple:n,showPath:l,separator:t,labelField:o}=e,{value:a}=h;if(n||Array.isArray(a))return null;{const{getNode:e}=B.value;if(null===a)return null;const n=e(a);return null===n?{label:String(a),value:a}:{label:l?fe(n,t,o):n.rawNode[o],value:n.key}}})),be=i(!1),ye=r(e,"show"),we=G(ye,be),xe=w((()=>{const{placeholder:n}=e;return void 0!==n?n:d.value.placeholder})),Ce=w((()=>!(!e.filterable||!p.value)));function Re(n){const{onBlur:l}=e,{nTriggerFormBlur:t}=f;l&&ue(l,n),t()}function Se(n){const{onFocus:l}=e,{nTriggerFormFocus:t}=f;l&&ue(l,n),t()}function Me(){var e;null===(e=x.value)||void 0===e||e.focusInput()}function Te(){g.value||(p.value="",H(!0),e.filterable&&Me())}function Pe(e=!1){var n;e&&(null===(n=x.value)||void 0===n||n.focus()),H(!1),p.value=""}function Ne(e){var n;Ce.value||we.value&&((null===(n=x.value)||void 0===n?void 0:n.$el.contains(se(e)))||Pe())}function Fe(){e.clearFilterAfterSelect&&(p.value="")}function Oe(n){var l,t,o;const{value:a}=C,{value:r}=B;switch(n){case"prev":if(null!==a){const e=r.getPrev(a,{loop:!0});null!==e&&(E(e.key),null===(l=y.value)||void 0===l||l.scroll(e.level,e.index,P(V.value)))}break;case"next":if(null===a){const e=r.getFirstAvailableNode();null!==e&&(E(e.key),null===(t=y.value)||void 0===t||t.scroll(e.level,e.index,P(V.value)))}else{const e=r.getNext(a,{loop:!0});null!==e&&(E(e.key),null===(o=y.value)||void 0===o||o.scroll(e.level,e.index,P(V.value)))}break;case"child":if(null!==a){const n=r.getNode(a);if(null!==n)if(n.shallowLoaded){const e=r.getChild(a);null!==e&&(te(a),E(e.key))}else{const{value:l}=S;if(!l.has(a)){K(a),te(a);const{onLoad:l}=e;l&&l(n.rawNode).then((()=>{A(a)})).catch((()=>{A(a)}))}}}break;case"parent":if(null!==a){const e=r.getParent(a);if(null!==e){E(e.key);const n=e.getParent();te(null===n?null:n.key)}}}}function Ke(n){var l,t;switch(n.key){case" ":case"ArrowDown":case"ArrowUp":if(e.filterable&&we.value)break;n.preventDefault()}if(!T(n,"action"))switch(n.key){case" ":if(e.filterable)return;case"Enter":if(we.value){const{value:n}=Ce,{value:l}=C;if(n)k.value&&k.value.enter()&&Fe();else if(null!==l)if(z.value.includes(l)||I.value.includes(l))re(l);else{const n=ae(l);!e.multiple&&n&&Pe(!0)}}else Te();break;case"ArrowUp":n.preventDefault(),we.value&&(Ce.value?null===(l=k.value)||void 0===l||l.prev():Oe("prev"));break;case"ArrowDown":n.preventDefault(),we.value?Ce.value?null===(t=k.value)||void 0===t||t.next():Oe("next"):Te();break;case"ArrowLeft":n.preventDefault(),we.value&&!Ce.value&&Oe("parent");break;case"ArrowRight":n.preventDefault(),we.value&&!Ce.value&&Oe("child");break;case"Escape":we.value&&(de(n),Pe(!0))}}function Ae(){var e;null===(e=M.value)||void 0===e||e.syncPosition()}function Be(){var e;null===(e=N.value)||void 0===e||e.syncPosition()}X(we,(n=>{if(!n)return;if(e.multiple)return;const{value:l}=h;Array.isArray(l)||null===l?(C.value=null,R.value=null):(C.value=l,R.value=l,ce((()=>{var e;if(!we.value)return;const{value:n}=R;if(null!==h.value){const l=B.value.getNode(n);l&&(null===(e=y.value)||void 0===e||e.scroll(l.level,l.index,P(V.value)))}})))}),{immediate:!0});const Le=w((()=>!(!e.multiple||!e.cascade)||"child"!==v.value));Y(me,{slots:n,mergedClsPrefixRef:t,mergedThemeRef:s,mergedValueRef:h,checkedKeysRef:z,indeterminateKeysRef:I,hoverKeyPathRef:D,mergedCheckStrategyRef:v,showCheckboxRef:Le,cascadeRef:r(e,"cascade"),multipleRef:r(e,"multiple"),keyboardKeyRef:C,hoverKeyRef:R,remoteRef:r(e,"remote"),loadingKeySetRef:S,expandTriggerRef:r(e,"expandTrigger"),isMountedRef:ee(),onLoadRef:r(e,"onLoad"),virtualScrollRef:r(e,"virtualScroll"),optionHeightRef:V,localeRef:d,labelFieldRef:r(e,"labelField"),renderLabelRef:r(e,"renderLabel"),syncCascaderMenuPosition:Be,syncSelectMenuPosition:Ae,updateKeyboardKey:E,updateHoverKey:te,addLoadingKey:K,deleteLoadingKey:A,doCheck:ae,doUncheck:re,closeMenu:Pe,handleSelectMenuClickOutside:function(e){Ce.value&&Ne(e)},handleCascaderMenuClickOutside:Ne,clearPattern:Fe});const ze={focus:()=>{var e;null===(e=x.value)||void 0===e||e.focus()},blur:()=>{var e;null===(e=x.value)||void 0===e||e.blur()},getCheckedData:()=>{if(Le.value){const e=z.value;return{keys:e,options:oe(e)}}return{keys:[],options:[]}},getIndeterminateData:()=>{if(Le.value){const e=I.value;return{keys:e,options:oe(e)}}return{keys:[],options:[]}}},Ie=w((()=>{const{self:{optionArrowColor:e,optionTextColor:n,optionTextColorActive:l,optionTextColorDisabled:t,optionCheckMarkColor:o,menuColor:a,menuBoxShadow:r,menuDividerColor:i,menuBorderRadius:d,menuHeight:u,optionColorHover:c,optionHeight:h,optionFontSize:v,loadingColor:p,columnWidth:f},common:{cubicBezierEaseInOut:m}}=s.value;return{"--n-bezier":m,"--n-menu-border-radius":d,"--n-menu-box-shadow":r,"--n-menu-height":u,"--n-column-width":f,"--n-menu-color":a,"--n-menu-divider-color":i,"--n-option-height":h,"--n-option-font-size":v,"--n-option-text-color":n,"--n-option-text-color-disabled":t,"--n-option-text-color-active":l,"--n-option-color-hover":c,"--n-option-check-mark-color":o,"--n-option-arrow-color":e,"--n-menu-mask-color":ne(a,{alpha:.75}),"--n-loading-color":p}})),$e=a?le("cascader",void 0,Ie,e):void 0;return Object.assign(Object.assign({},ze),{handleTriggerResize:function(){we.value&&(Ce.value?Ae():Be())},mergedStatus:b,selectMenuFollowerRef:M,cascaderMenuFollowerRef:N,triggerInstRef:x,selectMenuInstRef:k,cascaderMenuInstRef:y,mergedBordered:l,mergedClsPrefix:t,namespace:o,mergedValue:h,mergedShow:we,showSelectMenu:Ce,pattern:p,treeMate:B,mergedSize:m,mergedDisabled:g,localizedPlaceholder:xe,selectedOption:ge,selectedOptions:he,adjustedTo:F,menuModel:j,handleMenuTabout:function(){Pe(!0)},handleMenuFocus:function(e){var n;(null===(n=x.value)||void 0===n?void 0:n.$el.contains(e.relatedTarget))||(O.value=!0,Se(e))},handleMenuBlur:function(e){var n;(null===(n=x.value)||void 0===n?void 0:n.$el.contains(e.relatedTarget))||(O.value=!1,Re(e))},handleMenuKeydown:function(e){Ke(e)},handleMenuMousedown:function(n){T(n,"action")||e.multiple&&e.filter&&(n.preventDefault(),Me())},handleTriggerFocus:function(e){var n;(null===(n=y.value)||void 0===n?void 0:n.$el.contains(e.relatedTarget))||(O.value=!0,Se(e))},handleTriggerBlur:function(e){var n;(null===(n=y.value)||void 0===n?void 0:n.$el.contains(e.relatedTarget))||(O.value=!1,Re(e),Pe())},handleTriggerClick:function(){e.filterable?Te():we.value?Pe(!0):Te()},handleClear:function(n){n.stopPropagation(),e.multiple?U([],[],[]):U(null,null,null)},handleDeleteOption:function(n){const{multiple:l}=e,{value:t}=h;l&&Array.isArray(t)&&void 0!==n.value?re(n.value):U(null,null,null)},handlePatternInput:function(e){p.value=e.target.value},handleKeydown:Ke,focused:O,optionHeight:V,mergedTheme:s,cssVars:a?void 0:Ie,themeClass:null==$e?void 0:$e.themeClass,onRender:null==$e?void 0:$e.onRender})},render(){const{mergedClsPrefix:e}=this;return d("div",{class:`${e}-cascader`},d(te,null,{default:()=>[d(oe,null,{default:()=>d(ae,{onResize:this.handleTriggerResize,ref:"triggerInstRef",status:this.mergedStatus,clsPrefix:e,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 e,n;return null===(n=(e=this.$slots).arrow)||void 0===n?void 0:n.call(e)}})}),d(re,{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===Q.tdkey,to:this.adjustedTo},{default:()=>{var e;null===(e=this.onRender)||void 0===e||e.call(this);const{menuProps:n}=this;return d(ye,Object.assign({},n,{ref:"cascaderMenuInstRef",class:[this.themeClass,null==n?void 0:n.class],value:this.mergedValue,show:this.mergedShow&&!this.showSelectMenu,menuModel:this.menuModel,style:[this.cssVars,null==n?void 0:n.style],onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onMousedown:this.handleMenuMousedown,onTabout:this.handleMenuTabout}),{action:()=>{var e,n;return null===(n=(e=this.$slots).action)||void 0===n?void 0:n.call(e)},empty:()=>{var e,n;return null===(n=(e=this.$slots).empty)||void 0===n?void 0:n.call(e)}})}}),d(re,{key:"selectMenu",ref:"selectMenuFollowerRef",show:this.mergedShow&&this.showSelectMenu,containerClass:this.namespace,width:"target",placement:this.placement,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Q.tdkey},{default:()=>{var e;null===(e=this.onRender)||void 0===e||e.call(this);const{filterMenuProps:n}=this;return d(we,Object.assign({},n,{ref:"selectMenuInstRef",class:[this.themeClass,null==n?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,null==n?void 0:n.style]}))}})]}))}}))}}}));
|