mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +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
|