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 @@ -8427,7 +8427,7 @@
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSliderLabel`1.Disabled">
<summary>
Gets or sets disabled state of the label. This is generally controlled by the parent.
Gets the disabled state of the label. This is controlled by the owning <see cref="T:Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1"/>.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentSliderLabel`1.ChildContent">
Expand Down Expand Up @@ -8833,16 +8833,19 @@
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.HorizontalAlignment">
<summary>
Gets or sets the horizontal alignment of the components in the stack.
Default is <see cref="F:Microsoft.FluentUI.AspNetCore.Components.HorizontalAlignment.Left"/>
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.VerticalAlignment">
<summary>
Gets or sets the vertical alignment of the components in the stack.
Default is <see cref="F:Microsoft.FluentUI.AspNetCore.Components.VerticalAlignment.Top"/>
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.Orientation">
<summary>
Gets or sets the orientation of the stacked components.
Default is <see cref="F:Microsoft.FluentUI.AspNetCore.Components.Orientation.Horizontal"/>.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.Width">
Expand Down
38 changes: 20 additions & 18 deletions src/Core/Components/Slider/FluentSlider.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
@inherits FluentInputBase<TValue>
@typeparam TValue
@attribute [CascadingTypeParameter(nameof(TValue))]
<FluentInputLabel ForId="@Id" Label="@Label" AriaLabel="@AriaLabel" ChildContent="@LabelTemplate" Required="@Required" style="margin-bottom: calc(var(--design-unit) * 3px);" />
<fluent-slider @ref=Element
class="@ClassValue"
style="@StyleValue"
readonly="@ReadOnly"
min="@FormatValueAsString(Min)"
max="@FormatValueAsString(Max)"
step="@FormatValueAsString(Step)"
orientation="@Orientation.ToAttributeValue()"
mode="@Mode.ToAttributeValue()"
id="@Id"
value="@FormatValueAsString(Value)"
disabled="@Disabled"
name=@Name
required=@Required
@onsliderchange="@ChangeHandlerAsync">
@ChildContent
</fluent-slider>
<CascadingValue Value="this" IsFixed="true">
<FluentInputLabel ForId="@Id" Label="@Label" AriaLabel="@AriaLabel" ChildContent="@LabelTemplate" Required="@Required" style="margin-bottom: calc(var(--design-unit) * 3px);" />
<fluent-slider @ref=Element
class="@ClassValue"
style="@StyleValue"
readonly="@ReadOnly"
min="@FormatValueAsString(Min)"
max="@FormatValueAsString(Max)"
step="@FormatValueAsString(Step)"
orientation="@Orientation.ToAttributeValue()"
mode="@Mode.ToAttributeValue()"
id="@Id"
value="@FormatValueAsString(Value)"
disabled="@Disabled"
name=@Name
required=@Required
@onsliderchange="@ChangeHandlerAsync">
@ChildContent
</fluent-slider>
</CascadingValue>
4 changes: 2 additions & 2 deletions src/Core/Components/Slider/FluentSliderLabel.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase
@typeparam TValue
@typeparam TValue where TValue : System.Numerics.INumber<TValue>
<fluent-slider-label @ref=Element
id="@Id"
class="@Class"
Expand Down
12 changes: 10 additions & 2 deletions src/Core/Components/Slider/FluentSliderLabel.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace Microsoft.FluentUI.AspNetCore.Components;
public partial class FluentSliderLabel<TValue> : FluentComponentBase, IAsyncDisposable
{
private const string JAVASCRIPT_FILE = "./_content/Microsoft.FluentUI.AspNetCore.Components/Components/Slider/FluentSliderLabel.razor.js";
private bool? _disabled;

public FluentSliderLabel()
{
Expand Down Expand Up @@ -38,10 +39,17 @@ public FluentSliderLabel()
public bool? HideMark { get; set; }

/// <summary>
/// Gets or sets disabled state of the label. This is generally controlled by the parent.
/// Gets the disabled state of the label. This is controlled by the owning <see cref="FluentSlider{TValue}"/>.
/// </summary>
[Parameter]
public bool? Disabled { get; set; }
public bool? Disabled
{
get => Owner is null ? _disabled : Owner.Disabled;
set => _disabled = Owner is null ? value : Owner.Disabled;
}

[CascadingParameter]
internal FluentSlider<TValue> Owner { get; set; } = default!;

/// <summary>
/// Gets or sets the content to be rendered inside the component.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<fluent-slider-label id="xxx" position="0" blazor:elementreference="xxx">
<b>render me</b>
</fluent-slider-label>
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ public FluentSliderLabelTests()
}

[Fact]
public void FluentSliderLaber_Default()
public void FluentSliderLabel_Default()
{

//Arrange
FluentSlider<int> slider = new();
var childContent = "<b>render me</b>";
int position = default!;
bool? hideMark = default!;
bool? disabled = default!;

var cut = TestContext.RenderComponent<FluentSliderLabel<int>>(parameters => parameters
.Add(p => p.Position, position)
.Add(p => p.HideMark, hideMark)
.Add(p => p.Disabled, disabled)
.AddCascadingValue(slider)
.AddChildContent(childContent)
);
//Act
Expand Down

This file was deleted.