ant-design-blazor/components/layout/AntLayoutSider.razor

52 lines
1.4 KiB
Plaintext

@namespace AntBlazor
@inherits AntLayoutSiderBase
<div class="@ClassMapper.Class" @ref="Ref" style="@style @Style" @attributes="Attributes" Id="@Id">
<div class="ant-layout-sider-children">
@ChildContent
</div>
@if (isZeroTrigger)
{
<span class="ant-layout-sider-zero-width-trigger" @onclick="toggleCollapse">
@if (adZeroTrigger != null)
{
@adZeroTrigger
}
else
{
<AntIcon type="bars"></AntIcon>
}
</span>
}
@if (isSiderTrigger)
{
<div class="ant-layout-sider-trigger"
@onclick="toggleCollapse"
style="width: @widthSetting">
@trigger
</div>
}
</div>
@code {
bool isZeroTrigger => this.adCollapsible && this.trigger != null && this.adCollapsedWidth == 0 && ((this.adBreakpoint != null && this.below) || this.adBreakpoint == null);
bool isSiderTrigger => this.adCollapsible && this.trigger != null && this.adCollapsedWidth != 0;
RenderFragment trigger => adTrigger ?? defaultTrigger(this);
public RenderFragment<AntLayoutSider> defaultTrigger = (sider) =>
@<Template>
@if (!sider.adReverseArrow)
{
<AntIcon type="@(sider.adCollapsed ? "right" : "left")"></AntIcon>
}
else
{
<AntIcon type="@(sider.adCollapsed ? "left" : "right")"></AntIcon>
}
</Template>;
}