mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["cb120b59"],{"0ce23469":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return d;}});var n=l("f19d2b93");l("4ccd0c13");var a=l("e22febe0"),o=l("a9d1a279"),d=()=>(0,n.jsxs)(o.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(o.Tag,{closable:!0,closeIcon:"\u5173 \u95ED",children:"Tag1"}),(0,n.jsx)(o.Tag,{closable:!0,closeIcon:(0,n.jsx)(a.CloseCircleOutlined,{}),children:"Tag2"})]});},"1f3986f6":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return c;}});var n=l("777fffbe"),a=l("f19d2b93");l("108c25ad");var o=n._(l("5b220c3d")),d=l("a9d1a279");let s=["Movies","Books","Music","Sports"];var c=()=>{let[e,r]=o.default.useState(["Movies"]),l=(l,n)=>{let a=n?[...e,l]:e.filter(e=>e!==l);console.log("You are interested in: ",a),r(a);};return(0,a.jsxs)(d.Flex,{gap:4,wrap:!0,align:"center",children:[(0,a.jsx)("span",{children:"Categories:"}),s.map(r=>(0,a.jsx)(d.Tag.CheckableTag,{checked:e.includes(r),onChange:e=>l(r,e),children:r},r))]});};},"24c1ffe2":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return c;}});var n=l("f19d2b93");l("f19ccb9a");var a=l("5b220c3d"),o=l("e22febe0"),d=l("a9d1a279");let s={width:64,height:22,marginInlineEnd:8,verticalAlign:"top"};var c=()=>{let{token:e}=d.theme.useToken(),[r,l]=(0,a.useState)(["Unremovable","Tag 2","Tag 3"]),[c,i]=(0,a.useState)(!1),[t,g]=(0,a.useState)(""),[u,x]=(0,a.useState)(-1),[h,j]=(0,a.useState)(""),b=(0,a.useRef)(null),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(c){var e;null===(e=b.current)||void 0===e||e.focus();}},[c]),(0,a.useEffect)(()=>{var e;null===(e=f.current)||void 0===e||e.focus();},[h]);let T=e=>{let n=r.filter(r=>r!==e);console.log(n),l(n);},p=()=>{t&&!r.includes(t)&&l([...r,t]),i(!1),g("");},v=e=>{j(e.target.value);},m=()=>{let e=[...r];e[u]=h,l(e),x(-1),j("");},y={height:22,background:e.colorBgContainer,borderStyle:"dashed"};return(0,n.jsxs)(d.Flex,{gap:"4px 0",wrap:!0,children:[r.map((e,r)=>{if(u===r)return(0,n.jsx)(d.Input,{ref:f,size:"small",style:s,value:h,onChange:v,onBlur:m,onPressEnter:m},e);let l=e.length>20,a=(0,n.jsx)(d.Tag,{closable:0!==r,style:{userSelect:"none"},onClose:()=>T(e),children:(0,n.jsx)("span",{onDoubleClick:l=>{0!==r&&(x(r),j(e),l.preventDefault());},children:l?`${e.slice(0,20)}...`:e})},e);return l?(0,n.jsx)(d.Tooltip,{title:e,children:a},e):a;}),c?(0,n.jsx)(d.Input,{ref:b,type:"text",size:"small",style:s,value:t,onChange:e=>{g(e.target.value);},onBlur:p,onPressEnter:p}):(0,n.jsx)(d.Tag,{style:y,icon:(0,n.jsx)(o.PlusOutlined,{}),onClick:()=>{i(!0);},children:"New Tag"})]});};},"354f8d98":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return s;}});var n=l("f19d2b93");l("8f172e36");var a=l("e22febe0"),o=l("a9d1a279");let d=e=>{e.preventDefault(),console.log("Clicked! But prevent default.");};var s=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Tag,{children:"Tag 1"}),(0,n.jsx)(o.Tag,{children:(0,n.jsx)("a",{href:"https://github.com/ant-design/ant-design/issues/1862",children:"Link"})}),(0,n.jsx)(o.Tag,{closeIcon:!0,onClose:d,children:"Prevent Default"}),(0,n.jsx)(o.Tag,{closeIcon:(0,n.jsx)(a.CloseCircleOutlined,{}),onClose:console.log,children:"Tag 2"})]});},"3c645939":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return o;}});var n=l("f19d2b93");l("c08e0e64");var a=l("a9d1a279"),o=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.Divider,{orientation:"left",children:"Presets"}),(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{color:"magenta",children:"magenta"}),(0,n.jsx)(a.Tag,{color:"red",children:"red"}),(0,n.jsx)(a.Tag,{color:"volcano",children:"volcano"}),(0,n.jsx)(a.Tag,{color:"orange",children:"orange"}),(0,n.jsx)(a.Tag,{color:"gold",children:"gold"}),(0,n.jsx)(a.Tag,{color:"lime",children:"lime"}),(0,n.jsx)(a.Tag,{color:"green",children:"green"}),(0,n.jsx)(a.Tag,{color:"cyan",children:"cyan"}),(0,n.jsx)(a.Tag,{color:"blue",children:"blue"}),(0,n.jsx)(a.Tag,{color:"geekblue",children:"geekblue"}),(0,n.jsx)(a.Tag,{color:"purple",children:"purple"})]}),(0,n.jsx)(a.Divider,{orientation:"left",children:"Custom"}),(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{color:"#f50",children:"#f50"}),(0,n.jsx)(a.Tag,{color:"#2db7f5",children:"#2db7f5"}),(0,n.jsx)(a.Tag,{color:"#87d068",children:"#87d068"}),(0,n.jsx)(a.Tag,{color:"#108ee9",children:"#108ee9"})]})]});},"3d0e16e7":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return d;}});var n=l("f19d2b93");l("71da1883");var a=l("e22febe0"),o=l("a9d1a279"),d=()=>(0,n.jsxs)(o.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.TwitterOutlined,{}),color:"#55acee",children:"Twitter"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.YoutubeOutlined,{}),color:"#cd201f",children:"Youtube"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.FacebookOutlined,{}),color:"#3b5999",children:"Facebook"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.LinkedinOutlined,{}),color:"#55acee",children:"LinkedIn"})]});},"572c627a":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return c;}});var n=l("f19d2b93");l("e3a2c367");var a=l("5b220c3d"),o=l("e22febe0"),d=l("a9d1a279"),s=l("cd662710"),c=()=>{let{token:e}=d.theme.useToken(),[r,l]=(0,a.useState)(["Tag 1","Tag 2","Tag 3"]),[c,i]=(0,a.useState)(!1),[t,g]=(0,a.useState)(""),u=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(c){var e;null===(e=u.current)||void 0===e||e.focus();}},[c]);let x=e=>{let n=r.filter(r=>r!==e);console.log(n),l(n);},h=()=>{t&&-1===r.indexOf(t)&&l([...r,t]),i(!1),g("");},j=r.map(e=>(0,n.jsx)("span",{style:{display:"inline-block"},children:(0,n.jsx)(d.Tag,{closable:!0,onClose:r=>{r.preventDefault(),x(e);},children:e})},e)),b={background:e.colorBgContainer,borderStyle:"dashed"};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsx)(s.TweenOneGroup,{appear:!1,enter:{scale:.8,opacity:0,type:"from",duration:100},leave:{opacity:0,width:0,scale:0,duration:200},onEnd:e=>{("appear"===e.type||"enter"===e.type)&&(e.target.style="display: inline-block");},children:j})}),c?(0,n.jsx)(d.Input,{ref:u,type:"text",size:"small",style:{width:78},value:t,onChange:e=>{g(e.target.value);},onBlur:h,onPressEnter:h}):(0,n.jsxs)(d.Tag,{onClick:()=>{i(!0);},style:b,children:[(0,n.jsx)(o.PlusOutlined,{})," New Tag"]})]});};},"87d6b282":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return o;}});var n=l("f19d2b93");l("fd75a8bb");var a=l("a9d1a279"),o=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{bordered:!1,children:"Tag 1"}),(0,n.jsx)(a.Tag,{bordered:!1,children:"Tag 2"}),(0,n.jsx)(a.Tag,{bordered:!1,closable:!0,children:"Tag 3"}),(0,n.jsx)(a.Tag,{bordered:!1,closable:!0,children:"Tag 4"})]}),(0,n.jsx)(a.Divider,{}),(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{bordered:!1,color:"processing",children:"processing"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"success",children:"success"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"error",children:"error"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"warning",children:"warning"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"magenta",children:"magenta"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"red",children:"red"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"volcano",children:"volcano"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"orange",children:"orange"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"gold",children:"gold"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"lime",children:"lime"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"green",children:"green"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"cyan",children:"cyan"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"blue",children:"blue"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"geekblue",children:"geekblue"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"purple",children:"purple"})]})]});},"9a8b8ad2":function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return d;}});var n=l("f19d2b93");l("c610d4fd");var a=l("e22febe0"),o=l("a9d1a279"),d=()=>(0,n.jsx)(o.ConfigProvider,{theme:{components:{Tag:{defaultBg:"#f9f0ff",defaultColor:"#4b34d3"}}},children:(0,n.jsxs)(o.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(o.Tag,{children:(0,n.jsx)("a",{href:"https://github.com/ant-design/ant-design/issues/1862",children:"Link"})}),(0,n.jsx)(o.Tag,{bordered:!1,children:(0,n.jsx)("a",{href:"https://github.com/ant-design/ant-design/issues/1862",children:"Link"})}),(0,n.jsx)(o.Tag,{closable:!0,color:"magenta",children:"Tag 2"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.CloseCircleOutlined,{}),color:"error",children:"error"}),(0,n.jsx)(o.Tag,{color:"red-inverse",children:"red"}),(0,n.jsx)(o.Tag,{bordered:!1,color:"magenta",children:"magenta"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.SyncOutlined,{spin:!0}),color:"processing",children:"processing"})]})});},b8fc936b:function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return o;}});var n=l("f19d2b93");l("48eac933");var a=l("a9d1a279"),o=()=>(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{color:"magenta-inverse",children:"magenta"}),(0,n.jsx)(a.Tag,{color:"red-inverse",children:"red"}),(0,n.jsx)(a.Tag,{color:"volcano-inverse",children:"volcano"}),(0,n.jsx)(a.Tag,{color:"orange-inverse",children:"orange"}),(0,n.jsx)(a.Tag,{color:"gold-inverse",children:"gold"}),(0,n.jsx)(a.Tag,{color:"lime-inverse",children:"lime"}),(0,n.jsx)(a.Tag,{color:"green-inverse",children:"green"}),(0,n.jsx)(a.Tag,{color:"cyan-inverse",children:"cyan"}),(0,n.jsx)(a.Tag,{color:"blue-inverse",children:"blue"}),(0,n.jsx)(a.Tag,{color:"geekblue-inverse",children:"geekblue"}),(0,n.jsx)(a.Tag,{color:"purple-inverse",children:"purple"})]});},cde8a87c:function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return d;}});var n=l("f19d2b93");l("fab0dc7b");var a=l("e22febe0"),o=l("a9d1a279"),d=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.Divider,{orientation:"left",children:"Without icon"}),(0,n.jsxs)(o.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(o.Tag,{color:"success",children:"success"}),(0,n.jsx)(o.Tag,{color:"processing",children:"processing"}),(0,n.jsx)(o.Tag,{color:"error",children:"error"}),(0,n.jsx)(o.Tag,{color:"warning",children:"warning"}),(0,n.jsx)(o.Tag,{color:"default",children:"default"})]}),(0,n.jsx)(o.Divider,{orientation:"left",children:"With icon"}),(0,n.jsxs)(o.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.CheckCircleOutlined,{}),color:"success",children:"success"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.SyncOutlined,{spin:!0}),color:"processing",children:"processing"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.CloseCircleOutlined,{}),color:"error",children:"error"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.ExclamationCircleOutlined,{}),color:"warning",children:"warning"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.ClockCircleOutlined,{}),color:"default",children:"waiting"}),(0,n.jsx)(o.Tag,{icon:(0,n.jsx)(a.MinusCircleOutlined,{}),color:"default",children:"stop"})]})]});},cebe60b7:function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return t;}});var n=l("f19d2b93");l("3d8b5c5b");var a=l("5b220c3d"),o=l("915a4463"),d=l("9944ffaa"),s=l("a9d1a279");let c={cursor:"move",transition:"unset"},i=e=>{let{tag:r}=e,{listeners:l,transform:a,transition:o,isDragging:i,setNodeRef:t}=(0,d.useSortable)({id:r.id}),g=a?{...c,transform:`translate3d(${a.x}px, ${a.y}px, 0)`,transition:i?"unset":o}:c;return(0,n.jsx)(s.Tag,{style:g,ref:t,...l,children:r.text});};var t=()=>{let[e,r]=(0,a.useState)([{id:1,text:"Tag 1"},{id:2,text:"Tag 2"},{id:3,text:"Tag 3"}]),l=(0,o.useSensors)((0,o.useSensor)(o.PointerSensor));return(0,n.jsx)(o.DndContext,{sensors:l,onDragEnd:e=>{let{active:l,over:n}=e;n&&l.id!==n.id&&r(e=>{let r=e.findIndex(e=>e.id===l.id),a=e.findIndex(e=>e.id===n.id);return(0,d.arrayMove)(e,r,a);});},collisionDetection:o.closestCenter,children:(0,n.jsx)(d.SortableContext,{items:e,strategy:d.horizontalListSortingStrategy,children:(0,n.jsx)(s.Flex,{gap:"4px 0",wrap:!0,children:e.map(e=>(0,n.jsx)(i,{tag:e},e.id))})})});};},e08035ac:function(e,r,l){"use strict";l.d(r,"__esModule",{value:!0}),l.d(r,"default",{enumerable:!0,get:function(){return o;}});var n=l("f19d2b93");l("d8f94afb");var a=l("a9d1a279"),o=()=>{let{token:e}=a.theme.useToken();return(0,n.jsxs)("div",{style:{backgroundColor:e.colorBgLayout,padding:e.padding},children:[(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{bordered:!1,children:"Tag 1"}),(0,n.jsx)(a.Tag,{bordered:!1,children:"Tag 2"}),(0,n.jsx)(a.Tag,{bordered:!1,closable:!0,children:"Tag 3"}),(0,n.jsx)(a.Tag,{bordered:!1,closable:!0,children:"Tag 4"})]}),(0,n.jsx)(a.Divider,{}),(0,n.jsxs)(a.Flex,{gap:"4px 0",wrap:!0,children:[(0,n.jsx)(a.Tag,{bordered:!1,color:"magenta",children:"magenta"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"red",children:"red"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"volcano",children:"volcano"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"orange",children:"orange"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"gold",children:"gold"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"lime",children:"lime"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"green",children:"green"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"cyan",children:"cyan"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"blue",children:"blue"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"geekblue",children:"geekblue"}),(0,n.jsx)(a.Tag,{bordered:!1,color:"purple",children:"purple"})]})]});};}}]); |