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.
 
 
 

2 lines
16 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8691],{66247:function(){},77933:function(Ee,de,c){"use strict";c.d(de,{Z:function(){return je}});var L=c(96156),w=c(85061),S=c(22122),J=c(6610),Q=c(5991),X=c(10379),Y=c(44144),ue=c(94184),M=c.n(ue),i=c(67294),Ke=c(53124),Re=c(88258),Ae=c(65223),ve=c(42051),he=c(85636),fe=c(9708),Le=c(57254),Ze=c(98423),me=c(9676),Te=c(13013),xe=c(96159),be=c(90484),ke=c(36138),$e=c(93355),De=c(73171),Pe=c(34952),Oe=function(h){var m,v=h.renderedText,e=h.renderedEl,r=h.item,a=h.checked,n=h.disabled,o=h.prefixCls,t=h.onClick,l=h.onRemove,s=h.showRemove,u=M()((m={},(0,L.Z)(m,"".concat(o,"-content-item"),!0),(0,L.Z)(m,"".concat(o,"-content-item-disabled"),n||r.disabled),(0,L.Z)(m,"".concat(o,"-content-item-checked"),a),m)),f;return(typeof v=="string"||typeof v=="number")&&(f=String(v)),i.createElement(ve.Z,{componentName:"Transfer",defaultLocale:he.Z.Transfer},function(d){var p={className:u,title:f},y=i.createElement("span",{className:"".concat(o,"-content-item-text")},e);return s?i.createElement("li",(0,S.Z)({},p),y,i.createElement(Pe.Z,{disabled:n||r.disabled,className:"".concat(o,"-content-item-remove"),"aria-label":d.remove,onClick:function(){l==null||l(r)}},i.createElement(De.Z,null))):(p.onClick=n||r.disabled?void 0:function(){return t(r)},i.createElement("li",(0,S.Z)({},p),i.createElement(me.Z,{className:"".concat(o,"-checkbox"),checked:a,disabled:n||r.disabled}),y))})},Ne=i.memo(Oe),Fe=(0,$e.b)("handleFilter","handleClear","checkedKeys");function le(g){if(!g)return null;var h={pageSize:10,simple:!0,showSizeChanger:!1,showLessItems:!1};return(0,be.Z)(g)==="object"?(0,S.Z)((0,S.Z)({},h),g):h}var Be=function(g){(0,X.Z)(m,g);var h=(0,Y.Z)(m);function m(){var v;return(0,J.Z)(this,m),v=h.apply(this,arguments),v.state={current:1},v.onItemSelect=function(e){var r=v.props,a=r.onItemSelect,n=r.selectedKeys,o=n.includes(e.key);a(e.key,!o)},v.onItemRemove=function(e){var r=v.props.onItemRemove;r==null||r([e.key])},v.onPageChange=function(e){v.setState({current:e})},v.getItems=function(){var e=v.state.current,r=v.props,a=r.pagination,n=r.filteredRenderItems,o=le(a),t=n;return o&&(t=n.slice((e-1)*o.pageSize,e*o.pageSize)),t},v}return(0,Q.Z)(m,[{key:"render",value:function(){var e=this,r=this.state.current,a=this.props,n=a.prefixCls,o=a.onScroll,t=a.filteredRenderItems,l=a.selectedKeys,s=a.disabled,u=a.showRemove,f=a.pagination,d=le(f),p=null;return d&&(p=i.createElement(ke.Z,{simple:d.simple,showSizeChanger:d.showSizeChanger,showLessItems:d.showLessItems,size:"small",disabled:s,className:"".concat(n,"-pagination"),total:t.length,pageSize:d.pageSize,current:r,onChange:this.onPageChange})),i.createElement(i.Fragment,null,i.createElement("ul",{className:M()("".concat(n,"-content"),(0,L.Z)({},"".concat(n,"-content-show-remove"),u)),onScroll:o},this.getItems().map(function(y){var I=y.renderedEl,Z=y.renderedText,K=y.item,E=K.disabled,T=l.includes(K.key);return i.createElement(Ne,{disabled:s||E,key:K.key,item:K,renderedText:Z,renderedEl:I,checked:T,prefixCls:n,onClick:e.onItemSelect,onRemove:e.onItemRemove,showRemove:u})})),p)}}],[{key:"getDerivedStateFromProps",value:function(e,r){var a=e.filteredRenderItems,n=e.pagination,o=r.current,t=le(n);if(t){var l=Math.ceil(a.length/t.pageSize);if(o>l)return{current:l}}return null}}]),m}(i.Component),we=Be,Me=c(76570),ze=c(4107);function ge(g){var h=g.placeholder,m=h===void 0?"":h,v=g.value,e=g.prefixCls,r=g.disabled,a=g.onChange,n=g.handleClear,o=i.useCallback(function(t){a==null||a(t),t.target.value===""&&(n==null||n())},[a]);return i.createElement(ze.Z,{placeholder:m,className:e,value:v,onChange:o,disabled:r,allowClear:!0,prefix:i.createElement(Me.Z,null)})}var Ue=function(){return null};function We(g){return!!(g&&!(0,xe.l$)(g)&&Object.prototype.toString.call(g)==="[object Object]")}function z(g){return g.filter(function(h){return!h.disabled}).map(function(h){return h.key})}var ae=function(g){(0,X.Z)(m,g);var h=(0,Y.Z)(m);function m(v){var e;return(0,J.Z)(this,m),e=h.call(this,v),e.defaultListBodyRef=i.createRef(),e.handleFilter=function(r){var a=e.props.handleFilter,n=r.target.value;e.setState({filterValue:n}),a(r)},e.handleClear=function(){var r=e.props.handleClear;e.setState({filterValue:""}),r()},e.matchFilter=function(r,a){var n=e.state.filterValue,o=e.props.filterOption;return o?o(n,a):r.includes(n)},e.renderListBody=function(r,a){var n=r?r(a):null,o=!!n;return o||(n=i.createElement(we,(0,S.Z)({ref:e.defaultListBodyRef},a))),{customize:o,bodyContent:n}},e.renderItem=function(r){var a=e.props.render,n=a===void 0?Ue:a,o=n(r),t=We(o);return{renderedText:t?o.value:o,renderedEl:t?o.label:o,item:r}},e.getSelectAllLabel=function(r,a){var n=e.props,o=n.itemsUnit,t=n.itemUnit,l=n.selectAllLabel;if(l)return typeof l=="function"?l({selectedCount:r,totalCount:a}):l;var s=a>1?o:t;return i.createElement(i.Fragment,null,(r>0?"".concat(r,"/"):"")+a," ",s)},e.state={filterValue:""},e}return(0,Q.Z)(m,[{key:"componentWillUnmount",value:function(){clearTimeout(this.triggerScrollTimer)}},{key:"getCheckStatus",value:function(e){var r=this.props.checkedKeys;return r.length===0?"none":e.every(function(a){return r.includes(a.key)||!!a.disabled})?"all":"part"}},{key:"getFilteredItems",value:function(e,r){var a=this,n=[],o=[];return e.forEach(function(t){var l=a.renderItem(t),s=l.renderedText;if(r&&!a.matchFilter(s,t))return null;n.push(t),o.push(l)}),{filteredItems:n,filteredRenderItems:o}}},{key:"getListBody",value:function(e,r,a,n,o,t,l,s,u,f){var d=this,p=u?i.createElement("div",{className:"".concat(e,"-body-search-wrapper")},i.createElement(ge,{prefixCls:"".concat(e,"-search"),onChange:this.handleFilter,handleClear:this.handleClear,placeholder:r,value:a,disabled:f})):null,y=this.renderListBody(s,(0,S.Z)((0,S.Z)({},(0,Ze.Z)(this.props,Fe)),{filteredItems:n,filteredRenderItems:t,selectedKeys:l})),I=y.bodyContent,Z=y.customize,K=function(){var x=d.props.direction==="left"?0:1;return Array.isArray(o)?o[x]:o},E;return Z?E=i.createElement("div",{className:"".concat(e,"-body-customize-wrapper")},I):E=n.length?I:i.createElement("div",{className:"".concat(e,"-body-not-found")},K()),i.createElement("div",{className:M()(u?"".concat(e,"-body ").concat(e,"-body-with-search"):"".concat(e,"-body"))},p,E)}},{key:"getCheckBox",value:function(e){var r=e.filteredItems,a=e.onItemSelectAll,n=e.disabled,o=e.prefixCls,t=this.getCheckStatus(r),l=t==="all",s=i.createElement(me.Z,{disabled:n,checked:l,indeterminate:t==="part",className:"".concat(o,"-checkbox"),onChange:function(){a(r.filter(function(f){return!f.disabled}).map(function(f){var d=f.key;return d}),!l)}});return s}},{key:"render",value:function(){var e,r=this,a=this.state.filterValue,n=this.props,o=n.prefixCls,t=n.dataSource,l=t===void 0?[]:t,s=n.titleText,u=s===void 0?"":s,f=n.checkedKeys,d=n.disabled,p=n.footer,y=n.showSearch,I=y===void 0?!1:y,Z=n.style,K=n.searchPlaceholder,E=n.notFoundContent,T=n.selectAll,x=n.selectCurrent,O=n.selectInvert,N=n.removeAll,_=n.removeCurrent,oe=n.renderList,D=n.onItemSelectAll,b=n.onItemRemove,F=n.showSelectAll,ee=F===void 0?!0:F,U=n.showRemove,B=n.pagination,ie=n.direction,R=p&&(p.length<2?p(this.props):p(this.props,{direction:ie})),W=M()(o,(e={},(0,L.Z)(e,"".concat(o,"-with-pagination"),!!B),(0,L.Z)(e,"".concat(o,"-with-footer"),!!R),e)),V=this.getFilteredItems(l,a),k=V.filteredItems,te=V.filteredRenderItems,se=this.getListBody(o,K,a,k,E,te,f,oe,I,d),ne=R?i.createElement("div",{className:"".concat(o,"-footer")},R):null,re=!U&&!B&&this.getCheckBox({filteredItems:k,onItemSelectAll:D,disabled:d,prefixCls:o}),j;U?j=[B?{key:"removeCurrent",onClick:function(){var C,$=z((((C=r.defaultListBodyRef.current)===null||C===void 0?void 0:C.getItems())||[]).map(function(A){return A.item}));b==null||b($)},label:_}:null,{key:"removeAll",onClick:function(){b==null||b(z(k))},label:N}].filter(function(P){return P}):j=[{key:"selectAll",onClick:function(){var C=z(k);D(C,C.length!==f.length)},label:T},B?{key:"selectCurrent",onClick:function(){var C,$=((C=r.defaultListBodyRef.current)===null||C===void 0?void 0:C.getItems())||[];D(z($.map(function(A){return A.item})),!0)},label:x}:null,{key:"selectInvert",onClick:function(){var C,$;B?$=z((((C=r.defaultListBodyRef.current)===null||C===void 0?void 0:C.getItems())||[]).map(function(H){return H.item})):$=z(k);var A=new Set(f),G=[],Ie=[];$.forEach(function(H){A.has(H)?Ie.push(H):G.push(H)}),D(G,!0),D(Ie,!1)},label:O}];var ce=i.createElement(Te.Z,{className:"".concat(o,"-header-dropdown"),menu:{items:j},disabled:d},i.createElement(Le.Z,null));return i.createElement("div",{className:W,style:Z},i.createElement("div",{className:"".concat(o,"-header")},ee?i.createElement(i.Fragment,null,re,ce):null,i.createElement("span",{className:"".concat(o,"-header-selected")},this.getSelectAllLabel(f.length,k.length)),i.createElement("span",{className:"".concat(o,"-header-title")},u)),se,ne)}}]),m}(i.PureComponent),pe=c(67724),ye=c(8812),Se=c(71577),Ve=function(h){var m=h.disabled,v=h.moveToLeft,e=h.moveToRight,r=h.leftArrowText,a=r===void 0?"":r,n=h.rightArrowText,o=n===void 0?"":n,t=h.leftActive,l=h.rightActive,s=h.className,u=h.style,f=h.direction,d=h.oneWay;return i.createElement("div",{className:s,style:u},i.createElement(Se.Z,{type:"primary",size:"small",disabled:m||!l,onClick:e,icon:f!=="rtl"?i.createElement(ye.Z,null):i.createElement(pe.Z,null)},o),!d&&i.createElement(Se.Z,{type:"primary",size:"small",disabled:m||!t,onClick:v,icon:f!=="rtl"?i.createElement(pe.Z,null):i.createElement(ye.Z,null)},a))},Ce=Ve,q=function(g){(0,X.Z)(m,g);var h=(0,Y.Z)(m);function m(v){var e;(0,J.Z)(this,m),e=h.call(this,v),e.separatedDataSource=null,e.setStateKeys=function(t,l){t==="left"?e.setState(function(s){var u=s.sourceSelectedKeys;return{sourceSelectedKeys:typeof l=="function"?l(u||[]):l}}):e.setState(function(s){var u=s.targetSelectedKeys;return{targetSelectedKeys:typeof l=="function"?l(u||[]):l}})},e.getLocale=function(t,l){var s=e.props.locale,u=s===void 0?{}:s;return(0,S.Z)((0,S.Z)((0,S.Z)({},t),{notFoundContent:l("Transfer")}),u)},e.moveTo=function(t){var l=e.props,s=l.targetKeys,u=s===void 0?[]:s,f=l.dataSource,d=f===void 0?[]:f,p=l.onChange,y=e.state,I=y.sourceSelectedKeys,Z=y.targetSelectedKeys,K=t==="right"?I:Z,E=K.filter(function(O){return!d.some(function(N){return!!(O===N.key&&N.disabled)})}),T=t==="right"?E.concat(u):u.filter(function(O){return!E.includes(O)}),x=t==="right"?"left":"right";e.setStateKeys(x,[]),e.handleSelectChange(x,[]),p==null||p(T,t,E)},e.moveToLeft=function(){return e.moveTo("left")},e.moveToRight=function(){return e.moveTo("right")},e.onItemSelectAll=function(t,l,s){e.setStateKeys(t,function(u){var f=[];return s?f=Array.from(new Set([].concat((0,w.Z)(u),(0,w.Z)(l)))):f=u.filter(function(d){return!l.includes(d)}),e.handleSelectChange(t,f),f})},e.onLeftItemSelectAll=function(t,l){return e.onItemSelectAll("left",t,l)},e.onRightItemSelectAll=function(t,l){return e.onItemSelectAll("right",t,l)},e.handleFilter=function(t,l){var s=e.props.onSearch,u=l.target.value;s==null||s(t,u)},e.handleLeftFilter=function(t){return e.handleFilter("left",t)},e.handleRightFilter=function(t){return e.handleFilter("right",t)},e.handleClear=function(t){var l=e.props.onSearch;l==null||l(t,"")},e.handleLeftClear=function(){return e.handleClear("left")},e.handleRightClear=function(){return e.handleClear("right")},e.onItemSelect=function(t,l,s){var u=e.state,f=u.sourceSelectedKeys,d=u.targetSelectedKeys,p=t==="left"?(0,w.Z)(f):(0,w.Z)(d),y=p.indexOf(l);y>-1&&p.splice(y,1),s&&p.push(l),e.handleSelectChange(t,p),e.props.selectedKeys||e.setStateKeys(t,p)},e.onLeftItemSelect=function(t,l){return e.onItemSelect("left",t,l)},e.onRightItemSelect=function(t,l){return e.onItemSelect("right",t,l)},e.onRightItemRemove=function(t){var l=e.props,s=l.targetKeys,u=s===void 0?[]:s,f=l.onChange;e.setStateKeys("right",[]),f==null||f(u.filter(function(d){return!t.includes(d)}),"left",(0,w.Z)(t))},e.handleScroll=function(t,l){var s=e.props.onScroll;s==null||s(t,l)},e.handleLeftScroll=function(t){return e.handleScroll("left",t)},e.handleRightScroll=function(t){return e.handleScroll("right",t)},e.handleListStyle=function(t,l){return typeof t=="function"?t({direction:l}):t};var r=v.selectedKeys,a=r===void 0?[]:r,n=v.targetKeys,o=n===void 0?[]:n;return e.state={sourceSelectedKeys:a.filter(function(t){return!o.includes(t)}),targetSelectedKeys:a.filter(function(t){return o.includes(t)})},e}return(0,Q.Z)(m,[{key:"getTitles",value:function(e){var r,a;return(a=(r=this.props.titles)!==null&&r!==void 0?r:e.titles)!==null&&a!==void 0?a:[]}},{key:"handleSelectChange",value:function(e,r){var a=this.state,n=a.sourceSelectedKeys,o=a.targetSelectedKeys,t=this.props.onSelectChange;!t||(e==="left"?t(r,o):t(n,r))}},{key:"separateDataSource",value:function(){var e=this.props,r=e.dataSource,a=r===void 0?[]:r,n=e.rowKey,o=e.targetKeys,t=o===void 0?[]:o,l=[],s=new Array(t.length);return a.forEach(function(u){n&&(u=(0,S.Z)((0,S.Z)({},u),{key:n(u)}));var f=t.indexOf(u.key);f!==-1?s[f]=u:l.push(u)}),{leftDataSource:l,rightDataSource:s}}},{key:"render",value:function(){var e=this;return i.createElement(ve.Z,{componentName:"Transfer",defaultLocale:he.Z.Transfer},function(r){return i.createElement(Ke.C,null,function(a){var n=a.getPrefixCls,o=a.renderEmpty,t=a.direction;return i.createElement(Ae.aM.Consumer,null,function(l){var s,u=l.hasFeedback,f=l.status,d=e.props,p=d.prefixCls,y=d.className,I=d.disabled,Z=d.operations,K=Z===void 0?[]:Z,E=d.showSearch,T=E===void 0?!1:E,x=d.footer,O=d.style,N=d.listStyle,_=N===void 0?{}:N,oe=d.operationStyle,D=d.filterOption,b=d.render,F=d.children,ee=d.showSelectAll,U=d.oneWay,B=d.pagination,ie=d.status,R=n("transfer",p),W=e.getLocale(r,o||Re.Z),V=e.state,k=V.sourceSelectedKeys,te=V.targetSelectedKeys,se=(0,fe.F)(f,ie),ne=!F&&B,re=e.separateDataSource(),j=re.leftDataSource,ce=re.rightDataSource,P=te.length>0,C=k.length>0,$=M()(R,(s={},(0,L.Z)(s,"".concat(R,"-disabled"),I),(0,L.Z)(s,"".concat(R,"-customize-list"),!!F),(0,L.Z)(s,"".concat(R,"-rtl"),t==="rtl"),s),(0,fe.Z)(R,se,u),y),A=e.getTitles(W),G=e.props.selectAllLabels||[];return i.createElement("div",{className:$,style:O},i.createElement(ae,(0,S.Z)({prefixCls:"".concat(R,"-list"),titleText:A==null?void 0:A[0],dataSource:j,filterOption:D,style:e.handleListStyle(_,"left"),checkedKeys:k,handleFilter:e.handleLeftFilter,handleClear:e.handleLeftClear,onItemSelect:e.onLeftItemSelect,onItemSelectAll:e.onLeftItemSelectAll,render:b,showSearch:T,renderList:F,footer:x,onScroll:e.handleLeftScroll,disabled:I,direction:t==="rtl"?"right":"left",showSelectAll:ee,selectAllLabel:G[0],pagination:ne},W)),i.createElement(Ce,{className:"".concat(R,"-operation"),rightActive:C,rightArrowText:K[0],moveToRight:e.moveToRight,leftActive:P,leftArrowText:K[1],moveToLeft:e.moveToLeft,style:oe,disabled:I,direction:t,oneWay:U}),i.createElement(ae,(0,S.Z)({prefixCls:"".concat(R,"-list"),titleText:A==null?void 0:A[1],dataSource:ce,filterOption:D,style:e.handleListStyle(_,"right"),checkedKeys:te,handleFilter:e.handleRightFilter,handleClear:e.handleRightClear,onItemSelect:e.onRightItemSelect,onItemSelectAll:e.onRightItemSelectAll,onItemRemove:e.onRightItemRemove,render:b,showSearch:T,renderList:F,footer:x,onScroll:e.handleRightScroll,disabled:I,direction:t==="rtl"?"left":"right",showSelectAll:ee,selectAllLabel:G[1],showRemove:U,pagination:ne},W)))})})})}}],[{key:"getDerivedStateFromProps",value:function(e){var r=e.selectedKeys,a=e.targetKeys,n=e.pagination,o=e.children;if(r){var t=a||[];return{sourceSelectedKeys:r.filter(function(l){return!t.includes(l)}),targetSelectedKeys:r.filter(function(l){return t.includes(l)})}}return null}}]),m}(i.Component);q.List=ae,q.Operation=Ce,q.Search=ge;var je=q},58996:function(Ee,de,c){"use strict";var L=c(38663),w=c.n(L),S=c(66247),J=c.n(S),Q=c(57663),X=c(63185),Y=c(59250),ue=c(13254),M=c(47673),i=c(14781)}}]);