ant-design/154b4dae-async.87c1488e.js
2024-11-20 18:30:54 +00:00

1 line
11 KiB
JavaScript

(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["154b4dae"],{"01f4dce4":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return o;}});var l=n("f19d2b93");n("ab3a465c");var r=n("5b220c3d"),a=n("a9d1a279"),o=()=>{let[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)([]),s=()=>{let e=[],n=[];for(let t=0;t<20;t++){let l={key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,chosen:t%2==0};l.chosen&&e.push(l.key),n.push(l);}t(n),o(e);};return(0,r.useEffect)(()=>{s();},[]),(0,l.jsx)(a.Transfer,{dataSource:e,showSearch:!0,filterOption:(e,t)=>t.description.indexOf(e)>-1,targetKeys:n,onChange:e=>{o(e);},onSearch:(e,t)=>{console.log("search:",e,t);},render:e=>e.title});};},"13abed98":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return o;}});var l=n("f19d2b93");n("b7d39d86");var r=n("5b220c3d"),a=n("a9d1a279"),o=()=>{let[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)([]),s=()=>{let e=[],n=[];for(let t=0;t<20;t++){let l={key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,chosen:t%2==0};l.chosen&&e.push(l.key),n.push(l);}t(n),o(e);};return(0,r.useEffect)(()=>{s();},[]),(0,l.jsx)(a.Transfer,{dataSource:e,showSearch:!0,listStyle:{width:250,height:300},operations:["to right","to left"],targetKeys:n,onChange:e=>{o(e);},render:e=>`${e.title}-${e.description}`,footer:(e,t)=>(null==t?void 0:t.direction)==="left"?(0,l.jsx)(a.Button,{size:"small",style:{display:"flex",margin:8,marginInlineEnd:"auto"},onClick:s,children:"Left button reload"}):(0,l.jsx)(a.Button,{size:"small",style:{display:"flex",margin:8,marginInlineStart:"auto"},onClick:s,children:"Right button reload"})});};},"4434d702":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return u;}});var l=n("f19d2b93");n("0de3bac3");var r=n("5b220c3d"),a=n("a9d1a279");let o=e=>{let{leftColumns:t,rightColumns:n,...r}=e;return(0,l.jsx)(a.Transfer,{style:{width:"100%"},...r,children:({direction:e,filteredItems:r,onItemSelect:o,onItemSelectAll:s,selectedKeys:d,disabled:i})=>{let c={getCheckboxProps:()=>({disabled:i}),onChange(e){s(e,"replace");},selectedRowKeys:d,selections:[a.Table.SELECTION_ALL,a.Table.SELECTION_INVERT,a.Table.SELECTION_NONE]};return(0,l.jsx)(a.Table,{rowSelection:c,columns:"left"===e?t:n,dataSource:r,size:"small",style:{pointerEvents:i?"none":void 0},onRow:({key:e,disabled:t})=>({onClick:()=>{t||i||o(e,!d.includes(e));}})});}});},s=["cat","dog","bird"],d=Array.from({length:20}).map((e,t)=>({key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,tag:s[t%3]})),i=[{dataIndex:"title",title:"Name"},{dataIndex:"tag",title:"Tag",render:e=>(0,l.jsx)(a.Tag,{style:{marginInlineEnd:0},color:"cyan",children:e.toUpperCase()})},{dataIndex:"description",title:"Description"}],c=(e,t)=>{var n,l;return(null===(n=t.title)||void 0===n?void 0:n.includes(e))||(null===(l=t.tag)||void 0===l?void 0:l.includes(e));};var u=()=>{let[e,t]=(0,r.useState)([]),[n,s]=(0,r.useState)(!1);return(0,l.jsxs)(a.Flex,{align:"start",gap:"middle",vertical:!0,children:[(0,l.jsx)(o,{dataSource:d,targetKeys:e,disabled:n,showSearch:!0,showSelectAll:!1,onChange:e=>{t(e);},filterOption:c,leftColumns:i,rightColumns:i}),(0,l.jsx)(a.Switch,{unCheckedChildren:"disabled",checkedChildren:"disabled",checked:n,onChange:e=>{s(e);}})]});};},"4c688ad7":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return f;}});var l=n("777fffbe"),r=n("f19d2b93");n("93c45ef3");var a=n("5b220c3d"),o=n("a9d1a279"),s=l._(n("de3ef184"));let d=({leftColumns:e,rightColumns:t,...n})=>(0,r.jsx)(o.Transfer,{...n,children:({direction:n,filteredItems:l,onItemSelectAll:a,onItemSelect:d,selectedKeys:i,disabled:c})=>(0,r.jsx)(o.Table,{rowSelection:{getCheckboxProps:e=>({disabled:c||e.disabled}),onSelectAll(e,t){let n=t.filter(e=>!e.disabled).map(({key:e})=>e);a(e?(0,s.default)(n,i):(0,s.default)(i,n),e);},onSelect({key:e},t){d(e,t);},selectedRowKeys:i},columns:"left"===n?e:t,dataSource:l,size:"small",style:{pointerEvents:c?"none":void 0},onRow:({key:e,disabled:t})=>({onClick:()=>{t||c||d(e,!i.includes(e));}})})}),i=["cat","dog","bird"],c=Array.from({length:20}).map((e,t)=>({key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,disabled:t%4==0,tag:i[t%3]})),u=[{dataIndex:"title",title:"Name"},{dataIndex:"tag",title:"Tag",render:e=>(0,r.jsx)(o.Tag,{children:e})},{dataIndex:"description",title:"Description"}],h=[{dataIndex:"title",title:"Name"}],g=c.filter(e=>Number(e.key)>10).map(e=>e.key);var f=()=>{let[e,t]=(0,a.useState)(g),[n,l]=(0,a.useState)([]),[s,i]=(0,a.useState)(!1),[f,b]=(0,a.useState)(!1);return(0,r.jsxs)(o.ConfigProvider,{theme:{components:{Transfer:{listWidth:40,listWidthLG:50,listHeight:30,itemHeight:20,itemPaddingBlock:10,headerHeight:18}}},children:[(0,r.jsx)(o.Transfer,{dataSource:c,titles:["Source","Target"],targetKeys:e,selectedKeys:n,onChange:(e,n,l)=>{console.log("targetKeys:",e),console.log("direction:",n),console.log("moveKeys:",l),t(e);},onSelectChange:(e,t)=>{console.log("sourceSelectedKeys:",e),console.log("targetSelectedKeys:",t),l([...e,...t]);},onScroll:(e,t)=>{console.log("direction:",e),console.log("target:",t.target);},render:e=>e.title}),(0,r.jsx)(o.Transfer,{status:"error"}),(0,r.jsx)(o.Transfer,{status:"warning",showSearch:!0}),(0,r.jsx)(d,{dataSource:c,targetKeys:e,disabled:s,showSearch:f,onChange:e=>{t(e);},filterOption:(e,t)=>-1!==t.title.indexOf(e)||-1!==t.tag.indexOf(e),leftColumns:u,rightColumns:h}),(0,r.jsxs)(o.Space,{style:{marginTop:16},children:[(0,r.jsx)(o.Switch,{unCheckedChildren:"disabled",checkedChildren:"disabled",checked:s,onChange:e=>{i(e);}}),(0,r.jsx)(o.Switch,{unCheckedChildren:"showSearch",checkedChildren:"showSearch",checked:f,onChange:e=>{b(e);}})]})]});};},"4d9f1fd3":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return c;}});var l=n("f19d2b93");n("1614b34c");var r=n("5b220c3d"),a=n("a9d1a279");let o=(e,t)=>e.includes(t),s=(e=[],t=[])=>e.map(({children:e,...n})=>({...n,disabled:t.includes(n.key),children:s(e,t)})),d=({dataSource:e,targetKeys:t=[],...n})=>{let{token:r}=a.theme.useToken(),d=[];return!function e(t=[]){t.forEach(t=>{d.push(t),e(t.children);});}(e),(0,l.jsx)(a.Transfer,{...n,targetKeys:t,dataSource:d,className:"tree-transfer",render:e=>e.title,showSelectAll:!1,children:({direction:n,onItemSelect:d,selectedKeys:i})=>{if("left"===n){let n=[...i,...t];return(0,l.jsx)("div",{style:{padding:r.paddingXS},children:(0,l.jsx)(a.Tree,{blockNode:!0,checkable:!0,checkStrictly:!0,defaultExpandAll:!0,checkedKeys:n,treeData:s(e,t),onCheck:(e,{node:{key:t}})=>{d(t,!o(n,t));},onSelect:(e,{node:{key:t}})=>{d(t,!o(n,t));}})});}}});},i=[{key:"0-0",title:"0-0"},{key:"0-1",title:"0-1",children:[{key:"0-1-0",title:"0-1-0"},{key:"0-1-1",title:"0-1-1"}]},{key:"0-2",title:"0-2"},{key:"0-3",title:"0-3"},{key:"0-4",title:"0-4"}];var c=()=>{let[e,t]=(0,r.useState)([]);return(0,l.jsx)(d,{dataSource:i,targetKeys:e,onChange:e=>{t(e);}});};},"5360d3cc":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return a;}});var l=n("f19d2b93");n("29b35957");var r=n("a9d1a279"),a=()=>(0,l.jsxs)(r.Flex,{gap:"middle",vertical:!0,children:[(0,l.jsx)(r.Transfer,{status:"error"}),(0,l.jsx)(r.Transfer,{status:"warning",showSearch:!0})]});},"58cb66eb":function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return i;}});var l=n("f19d2b93");n("f32ecf9e");var r=n("5b220c3d"),a=n("a9d1a279");let o=Array.from({length:10}).map((e,t)=>({key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`})),s=o.filter(e=>Number(e.key)%3>1).map(e=>e.key),d=["Select All",({selectedCount:e,totalCount:t})=>`${e}/${t}`];var i=()=>{let[e,t]=(0,r.useState)(s);return(0,l.jsx)(a.Transfer,{dataSource:o,targetKeys:e,onChange:t,render:e=>e.title,selectAllLabels:d});};},a8ffb7bf:function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return d;}});var l=n("f19d2b93");n("54a4af1b");var r=n("5b220c3d"),a=n("a9d1a279");let o=Array.from({length:20}).map((e,t)=>({key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`})),s=o.filter(e=>Number(e.key)>10).map(e=>e.key);var d=()=>{let[e,t]=(0,r.useState)(s),[n,d]=(0,r.useState)([]);return(0,l.jsx)(a.Transfer,{dataSource:o,titles:["Source","Target"],targetKeys:e,selectedKeys:n,onChange:(e,n,l)=>{console.log("targetKeys:",e),console.log("direction:",n),console.log("moveKeys:",l),t(e);},onSelectChange:(e,t)=>{console.log("sourceSelectedKeys:",e),console.log("targetSelectedKeys:",t),d([...e,...t]);},onScroll:(e,t)=>{console.log("direction:",e),console.log("target:",t.target);},render:e=>e.title});};},b32c2526:function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return o;}});var l=n("f19d2b93");n("66ebc567");var r=n("5b220c3d"),a=n("a9d1a279"),o=()=>{let[e,t]=(0,r.useState)(!1),[n,o]=(0,r.useState)([]),[s,d]=(0,r.useState)([]);return(0,r.useEffect)(()=>{let e=[],t=[];for(let n=0;n<2e3;n++){let l={key:n.toString(),title:`content${n+1}`,description:`description of content${n+1}`,chosen:n%2==0};l.chosen&&e.push(l.key),t.push(l);}d(e),o(t);},[]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Transfer,{dataSource:n,targetKeys:s,onChange:(e,t,n)=>{console.log(e,t,n),d(e);},render:e=>e.title,oneWay:e,pagination:!0}),(0,l.jsx)("br",{}),(0,l.jsx)(a.Switch,{unCheckedChildren:"one way",checkedChildren:"one way",checked:e,onChange:t})]});};},eab948dc:function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return o;}});var l=n("f19d2b93");n("9f5ee73a");var r=n("5b220c3d"),a=n("a9d1a279"),o=()=>{let[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)([]),s=()=>{let e=[],n=[];for(let t=0;t<20;t++){let l={key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,chosen:t%2==0};l.chosen&&e.push(l.key),n.push(l);}t(n),o(e);};return(0,r.useEffect)(()=>{s();},[]),(0,l.jsx)(a.Transfer,{dataSource:e,listStyle:{width:300,height:300},targetKeys:n,onChange:(e,t,n)=>{console.log(e,t,n),o(e);},render:e=>({label:(0,l.jsxs)("span",{className:"custom-item",children:[e.title," - ",e.description]}),value:e.title})});};},fac84097:function(e,t,n){"use strict";n.d(t,"__esModule",{value:!0}),n.d(t,"default",{enumerable:!0,get:function(){return d;}});var l=n("f19d2b93");n("ec7caa41");var r=n("5b220c3d"),a=n("a9d1a279");let o=Array.from({length:20}).map((e,t)=>({key:t.toString(),title:`content${t+1}`,description:`description of content${t+1}`,disabled:t%3<1})),s=o.filter(e=>Number(e.key)%3>1).map(e=>e.key);var d=()=>{let[e,t]=(0,r.useState)(s),[n,d]=(0,r.useState)([]),[i,c]=(0,r.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Transfer,{dataSource:o,titles:["Source","Target"],targetKeys:e,selectedKeys:n,onChange:(e,n,l)=>{t(e),console.log("targetKeys: ",e),console.log("direction: ",n),console.log("moveKeys: ",l);},onSelectChange:(e,t)=>{d([...e,...t]),console.log("sourceSelectedKeys: ",e),console.log("targetSelectedKeys: ",t);},onScroll:(e,t)=>{console.log("direction:",e),console.log("target:",t.target);},render:e=>e.title,disabled:i,oneWay:!0,style:{marginBottom:16}}),(0,l.jsx)(a.Switch,{unCheckedChildren:"disabled",checkedChildren:"disabled",checked:i,onChange:e=>{c(e);}})]});};}}]);