mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
47 lines
2.5 KiB
JavaScript
47 lines
2.5 KiB
JavaScript
(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["75801792"],{75801792:function(e,i,n){"use strict";n.d(i,"__esModule",{value:!0}),n.e(i,{default:function(){return p;},useStyle:function(){return s;}});var t=n("777fffbe"),a=n("f19d2b93"),d=t._(n("5b220c3d")),r=n("a9d1a279"),l=n("3835a2b7"),o=t._(n("600aabe0")),c=n("9c86e52a");let s=(0,l.createStyles)(({token:e,css:i})=>{let{antCls:n}=e;return{anchorToc:i`
|
|
scrollbar-width: thin;
|
|
scrollbar-gutter: stable;
|
|
${n}-anchor {
|
|
${n}-anchor-link-title {
|
|
font-size: ${e.fontSizeSM}px;
|
|
}
|
|
}
|
|
`,tocWrapper:i`
|
|
position: fixed;
|
|
top: ${e.headerHeight+e.contentMarginTop-4}px;
|
|
inset-inline-end: 0;
|
|
width: 148px;
|
|
padding: 0;
|
|
border-radius: ${e.borderRadius}px;
|
|
box-sizing: border-box;
|
|
margin-inline-end: calc(8px - 100vw + 100%);
|
|
z-index: 10;
|
|
.toc-debug {
|
|
color: ${e.purple6};
|
|
&:hover {
|
|
color: ${e.purple5};
|
|
}
|
|
}
|
|
> div {
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
max-height: calc(100vh - ${e.headerHeight+e.contentMarginTop+24}px) !important;
|
|
margin: auto;
|
|
overflow: auto;
|
|
padding: ${e.paddingXXS}px;
|
|
backdrop-filter: blur(8px);
|
|
}
|
|
|
|
@media only screen and (max-width: ${e.screenLG}px) {
|
|
display: none;
|
|
}
|
|
`,articleWrapper:i`
|
|
padding-inline: 48px 164px;
|
|
padding-block: 0 32px;
|
|
|
|
@media only screen and (max-width: ${e.screenLG}px) {
|
|
& {
|
|
padding: 0 ${2*e.paddingLG}px;
|
|
}
|
|
}
|
|
`};});var p=({showDebug:e,debugDemos:i=[]})=>{let{styles:n}=s(),t=(0,l.useTheme)(),p=(0,c.useRouteMeta)(),u=(0,c.useTabMeta)(),h=d.default.useMemo(()=>((null==u?void 0:u.toc)||p.toc).reduce((e,i)=>{if(2===i.depth)e.push({...i});else if(3===i.depth){let n=e[e.length-1];n&&(n.children=n.children||[],n.children.push({...i}));}return e;},[]),[null==u?void 0:u.toc,p.toc]);return p.frontmatter.toc?(0,a.jsx)("section",{className:n.tocWrapper,children:(0,a.jsx)(r.Anchor,{affix:!1,className:n.anchorToc,targetOffset:t.anchorTop,showInkInFixed:!0,items:h.map(n=>{var t;return{href:`#${n.id}`,title:n.title,key:n.id,children:null===(t=n.children)||void 0===t?void 0:t.filter(n=>e||!i.includes(n.id)).map(e=>({key:e.id,href:`#${e.id}`,title:(0,a.jsx)("span",{className:(0,o.default)({"toc-debug":i.includes(e.id)}),children:null==e?void 0:e.title})}))};})})}):null;};}}]); |