2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-07-15 20:02:39 +08:00
|
|
|
|
@typeparam TValue
|
|
|
|
|
@inherits AntInputComponentBase<TValue>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@using Microsoft.AspNetCore.Components.Web
|
2020-04-30 01:21:06 +08:00
|
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="@ClassMapper.Class" style="user-select:none;@Style" id="@Id" @ref="Ref"
|
|
|
|
|
@onmousedown="(e) => OnMouseDown(e)">
|
2020-04-30 01:21:06 +08:00
|
|
|
|
<div class="ant-slider-rail">
|
|
|
|
|
</div>
|
|
|
|
|
@if (Included)
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<div class="ant-slider-track @(Range ? "ant-slider-track-1" : string.Empty)" style="@_trackStyle">
|
2020-04-30 01:21:06 +08:00
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
<div class="ant-slider-step">
|
|
|
|
|
@if (Marks != null)
|
|
|
|
|
{
|
2020-05-28 16:56:52 +08:00
|
|
|
|
@foreach (SliderMark mark in Marks)
|
2020-04-30 01:21:06 +08:00
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<span class="ant-slider-dot @IsActiveMark(mark.Key)" style=@($"{(Vertical ? "bottom" : "left")}: {SetMarkPosition(mark.Key)};")></span>
|
2020-04-30 01:21:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
@if (Range)
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@if (HasTooltip)
|
|
|
|
|
{
|
|
|
|
|
<Tooltip Title="@TipFormatter(_leftValue)" Style="display: inline;" Visible="_tooltipLeftVisible" ArrowPointAtCenter="true" OverlayClassName="ant-slider-tooltip" Placement="@TooltipPlacement" @ref="_toolTipLeft">
|
|
|
|
|
<Unbound>
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle ant-slider-handle-1" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_leftHandleStyle" @ref="@context.Current" @onmousedown="(e) => OnMouseDownEdge(e, false)">
|
|
|
|
|
</div>
|
|
|
|
|
</Unbound>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
<Tooltip Title="@TipFormatter(_rightValue)" Style="display: inline;" Visible="_tooltipRightVisible" ArrowPointAtCenter="true" OverlayClassName="ant-slider-tooltip" Placement="@TooltipPlacement" @ref="_toolTipRight">
|
|
|
|
|
<Unbound>
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle ant-slider-handle-2" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_rightHandleStyle" @ref="@context.Current" @onmousedown="(e) => OnMouseDownEdge(e, true)">
|
|
|
|
|
</div>
|
|
|
|
|
</Unbound>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle ant-slider-handle-1" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_leftHandleStyle" @ref="_leftHandle" @onmousedown="(e) => OnMouseDownEdge(e, false)">
|
|
|
|
|
</div>
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle ant-slider-handle-2" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_rightHandleStyle" @ref="_rightHandle" @onmousedown="(e) => OnMouseDownEdge(e, true)">
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-04-30 01:21:06 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
|
|
|
|
|
@if (HasTooltip)
|
|
|
|
|
{
|
|
|
|
|
<Tooltip Title="@TipFormatter(_rightValue)" Style="display: inline;" Visible="_tooltipRightVisible" ArrowPointAtCenter="true" OverlayClassName="ant-slider-tooltip" Placement="@TooltipPlacement" @ref="_toolTipRight">
|
|
|
|
|
<Unbound>
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_rightHandleStyle" @ref="@context.Current" @onmousedown="(e)=>OnMouseDownEdge(e, true)">
|
|
|
|
|
</div>
|
|
|
|
|
</Unbound>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<div tabindex="0" class="ant-slider-handle" role="slider" aria-disabled="@Disabled.ToString()" aria-valuenow="30" aria-valuemin="0" aria-valuemax="100" style="@_rightHandleStyle" @ref="_rightHandle" @onmousedown="(e)=>OnMouseDownEdge(e, true)">
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2020-04-30 01:21:06 +08:00
|
|
|
|
}
|
|
|
|
|
<div class="ant-slider-mark">
|
|
|
|
|
@if (Marks != null)
|
|
|
|
|
{
|
2020-05-28 16:56:52 +08:00
|
|
|
|
@foreach (SliderMark mark in Marks)
|
2020-04-30 01:21:06 +08:00
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<span class="ant-slider-mark-text ant-slider-mark-text-active" style=@($"{(Vertical ? "bottom" : "left")}: {SetMarkPosition(mark.Key)}; {(Vertical ? "margin-bottom: -50%;" : "transform: translateX(-50%);")}" + mark.Style)>@mark.Value</span>
|
2020-04-30 01:21:06 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2021-01-21 17:20:10 +08:00
|
|
|
|
</div>
|
|
|
|
|
|