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 regels
16 KiB

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