Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

@if (Range)
{
<input class="mud-slider-input" aria-valuenow="@UpperValue" aria-valuemin="@_min" aria-valuemax="@_max" role="slider" @attributes="UserAttributes" type="range" min="@_min" max="@_max" step="@_step" disabled="@(Disabled || _userInvalidatedRange)"
<input class="mud-slider-input" aria-valuenow="@UpperValue" aria-valuemin="@_min" aria-valuemax="@_max" role="slider" @attributes="UserAttributes" type="range" min="@_min" max="@_max" step="@_step" disabled="@(Disabled || _userInvalidatedRange || (Range && DisableMax))"
@bind-value="@UpperText" @bind-value:event="@((Immediate ? "oninput" : "onchange"))" />

@SliderValueLabel(upperLeft, UpperValue?.ToString())
}

<input class="mud-slider-input" aria-valuenow="@Value" aria-valuemin="@_min" aria-valuemax="@_max" role="slider" @attributes="UserAttributes" type="range" min="@_min" max="@_max" step="@_step" disabled="@(Disabled || _userInvalidatedRange)"
<input class="mud-slider-input" aria-valuenow="@Value" aria-valuemin="@_min" aria-valuemax="@_max" role="slider" @attributes="UserAttributes" type="range" min="@_min" max="@_max" step="@_step" disabled="@(Disabled || _userInvalidatedRange || (Range && DisableMin))"
@bind-value="@Text" @bind-value:event="@((Immediate ? "oninput" : "onchange"))" />

@SliderValueLabel(left, Value?.ToString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,34 @@ public T? Step
set => _step = Converter.Set(value);
}

/// <summary>
/// If true, the slider will be disabled.
/// </summary>
///
[Parameter]
[Category(CategoryTypes.Slider.Behavior)]
public bool Disabled { get; set; } = false;

/// <summary>
/// Child content of component.
/// </summary>
[Parameter]
/// <summary>
/// If true, the slider will be disabled.
/// </summary>
///
[Parameter]
[Category(CategoryTypes.Slider.Behavior)]
public bool Disabled { get; set; } = false;

/// <summary>
/// If true and <seealso cref="Range"/>, the slider's min value will be disabled.
/// </summary>
///
[Parameter]
[Category(CategoryTypes.Slider.Behavior)]
public bool DisableMin { get; set; } = false;

/// <summary>
/// If true and <seealso cref="Range"/>, the slider's max value will be disabled.
/// </summary>
///
[Parameter]
[Category(CategoryTypes.Slider.Behavior)]
public bool DisableMax { get; set; } = false;

/// <summary>
/// Child content of component.
/// </summary>
[Parameter]
[Category(CategoryTypes.Slider.Behavior)]
public RenderFragment? ChildContent { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<MudGrid>
<MudItem xs="12" sm="8">
<MudRangeSlider @bind-Value="@_value" @bind-UpperValue="@_upperValue" Size="Size.Large" Variant="Variant.Filled" ValueLabel="_valueLabel" Range="_range" TickMarks="_tickmarks"
Min="_min" Max="_max" Step="_step" Display="_display" MinDistance="_minDistance">@_label</MudRangeSlider>
Min="_min" Max="_max" Step="_step" Display="_display" MinDistance="_minDistance" DisableMin="_disableMin" DisableMax="_disableMax">@_label</MudRangeSlider>
</MudItem>

<MudItem xs="12" sm="4">
Expand All @@ -16,6 +16,8 @@
<MudSwitchM3 @bind-Checked="_valueLabel" Label="ValueLabel" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="_range" Label="Range" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="_tickmarks" Label="Tickmarks" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="_disableMin" Label="DisableMin" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="_disableMax" Label="DisableMax" Color="Color.Secondary" />
<MudSwitchM3 @bind-Checked="_display" Label="Display" Color="Color.Secondary" />
<MudNumericField @bind-Value="_min" Label="Min" Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudNumericField @bind-Value="_max" Label="Max" Variant="Variant.Outlined" Margin="Margin.Dense" />
Expand All @@ -34,6 +36,8 @@
bool _display = true;
bool _range = true;
bool _tickmarks = false;
bool _disableMin = false;
bool _disableMax = false;
int _min = 0;
int _max = 100;
int _step = 1;
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"sdk": {
"version": "7.0.203"
}
}
}