import{s as ie,ah as F,E as ae,G as le,aG as re,f as T,cH as se,bM as N,y as R,az as de,aN as ue,O as pe,z as f,P as S,Q as r,aZ as ve,bm as ce}from"./index-BPRWoLf4.js";import{BaseTransferRenderer as he}from"./Transfer-BzS7I0rL.js";var ge=function(m){ie(i,m);function i(){return m!==null&&m.apply(this,arguments)||this}return i.prototype.dispatchEvent=function(s){var o=this.props,e=o.dispatchEvent,a=o.value;e(s,F(this.props,{value:a}))},i.prototype.onItemClick=function(s){return ae(this,void 0,void 0,function(){var o,e;return le(this,function(a){switch(a.label){case 0:return o=this.props.dispatchEvent,[4,o("itemClick",F(this.props,{item:s}))];case 1:return e=a.sent(),e!=null&&e.prevented?[2]:[2]}})})},i.prototype.doAction=function(s){var o,e,a,u=this.props,g=u.resetValue,d=u.onChange,v=u.formStore,c=u.store,b=u.name;switch(s.actionType){case"clear":d==null||d("");break;case"reset":d==null||d((a=(e=re((o=v==null?void 0:v.pristine)!==null&&o!==void 0?o:c==null?void 0:c.pristine,b))!==null&&e!==void 0?e:g)!==null&&a!==void 0?a:"");break}},i.prototype.render=function(){var s=this,o,e=this.props,a=e.className;e.style;var u=e.classnames,g=e.selectedOptions,d=e.sortable,v=e.loading,c=e.searchable,b=e.searchResultMode,x=e.showArrow,A=e.deferLoad,V=e.disabled,z=e.selectTitle,B=e.resultTitle,D=e.pickerSize,H=e.columns,L=e.leftMode,h=e.selectMode,U=e.borderMode,_=e.itemHeight,G=e.virtualThreshold,$=e.loadingConfig,k=e.labelField,j=k===void 0?"label":k,O=e.valueField,Q=O===void 0?"value":O,P=e.deferField,Z=P===void 0?"defer":P,q=e.menuTpl,J=e.valueTpl,K=e.mobileUI,p=e.env,W=e.maxTagCount,X=e.overflowTagPopover,t=e.pagination,n=e.formItem,Y=e.data,C=e.popOverContainer,ee=e.placeholder,te=e.onlyChildren,E=e.autoCheckChildren,oe=E===void 0?!0:E,M=e.initiallyOpen,ne=M===void 0?!0:M,y=this.props,l=y.options,I=y.leftOptions,w=y.leftDefaultValue;return h==="associated"&&l&&l.length&&l[0].leftOptions&&Array.isArray(l[0].children)&&(I=l[0].leftOptions,w=(o=l[0].leftDefaultValue)!==null&&o!==void 0?o:w,l=l[0].children),T.createElement("div",{className:u("TransferControl",a)},T.createElement(se,{placeholder:ee,borderMode:U,selectMode:h,onlyChildren:te,value:g,disabled:V,options:l,onItemClick:this.onItemClick,onChange:this.handleChange,option2value:this.option2value,sortable:d,searchResultMode:b,onSearch:c?this.handleSearch:void 0,showArrow:x,onDeferLoad:A,selectTitle:z,resultTitle:B,size:D,columns:H,leftMode:L,leftOptions:I,optionItemRender:q?this.optionItemRender:void 0,resultItemRender:J?this.resultItemRender:void 0,onFocus:function(){return s.dispatchEvent("focus")},onBlur:function(){return s.dispatchEvent("blur")},labelField:j,valueField:Q,deferField:Z,itemHeight:N(_)>0?N(_):void 0,virtualThreshold:G,mobileUI:K,popOverContainer:p==null?void 0:p.getModalContainer,maxTagCount:W,overflowTagPopover:X,pagination:R(R({},de(t,["layout","perPageAvailable","popOverContainerSelector"])),{className:t==null?void 0:t.className,enable:(t&&t.enable!==void 0?!!(typeof t.enable=="string"?ue(t.enable,Y):t.enable):!!(n!=null&&n.enableSourcePagination))&&(!h||h==="list"||h==="table")&&l.length>0,maxButtons:Number.isInteger(t==null?void 0:t.maxButtons)?t==null?void 0:t.maxButtons:5,page:n==null?void 0:n.sourcePageNum,perPage:n==null?void 0:n.sourcePerPageNum,total:n==null?void 0:n.sourceTotalNum,popOverContainer:C??(p==null?void 0:p.getModalContainer)}),onPageChange:this.handlePageChange,autoCheckChildren:oe,initiallyOpen:ne}),T.createElement(pe,{loadingConfig:$,overlay:!0,key:"info",show:v}))},f([S,r("design:type",Function),r("design:paramtypes",[String]),r("design:returntype",void 0)],i.prototype,"dispatchEvent",null),f([S,r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",Promise)],i.prototype,"onItemClick",null),f([ve(),r("design:type",Function),r("design:paramtypes",[]),r("design:returntype",void 0)],i.prototype,"render",null),i=f([ce({type:"transfer-picker"})],i),i}(he);export{ge as TransferPickerRenderer};
