-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FluentProgress] Add Width, Stroke, Color and BackgroundColor attribu…
…tes (#1121) - v3 * Add Width, Stroke and Color * Add Stroke for ProgressBar * Add Unit Tests * Update doc * Remove one crazy test (onl on server) --------- Co-authored-by: Vincent Baaij <[email protected]>
- Loading branch information
Showing
30 changed files
with
453 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
examples/Demo/Shared/Pages/Progress/Examples/ProgressStroke.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<h4>Stroke and Color</h4> | ||
|
||
<FluentSelect Label="Width" Items="@(new [] { ProgressStrokes.Thin, ProgressStrokes.Normal, ProgressStrokes.Large })" @bind-SelectedOption="@Stroke" Width="60px" /> | ||
<FluentCheckbox Label="Indeterminate" @bind-Value="@Indeterminate" /> | ||
<FluentSelect Label="Color" Items="@(Enum.GetValues<OfficeColor>())" @bind-SelectedOption="@Color" Width="100px" Height="200px" /> | ||
<FluentSlider Min="0" Max="100" Step="5" @bind-Value="@Percentage" Style="max-width: 200px; margin: 20px 0px;" Disabled="@Indeterminate" /> | ||
|
||
<FluentStack Style="margin: 30px;"> | ||
<FluentLabel Style="width: 20px;">@Percentage</FluentLabel> | ||
|
||
<FluentProgress Min="0" Max="100" Value="@(Indeterminate ? null : Percentage)" | ||
Width="200px" | ||
Stroke="@Stroke" | ||
Color="@(Color.ToAttributeValue())" /> | ||
</FluentStack> | ||
|
||
@code | ||
{ | ||
ProgressStrokes Stroke = ProgressStrokes.Normal; | ||
int Percentage = 30; | ||
bool Indeterminate = false; | ||
OfficeColor Color = OfficeColor.Default; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
examples/Demo/Shared/Pages/ProgressRing/Examples/ProgressRingCustomSizes.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<h4>Custom Sizes</h4> | ||
<div style="display: grid; grid-gap: 12px; grid-auto-flow: column;"> | ||
<FluentStack> | ||
<FluentProgressRing Min="0" Max="100" Value="20"></FluentProgressRing> | ||
<FluentProgressRing Min="0" Max="100" Value="40" style="width: 42px; height: 42px;"></FluentProgressRing> | ||
<FluentProgressRing Min="0" Max="100" Value="60" style="width: 62px; height: 62px;"></FluentProgressRing> | ||
<FluentProgressRing Min="0" Max="100" Value="80" style="width: 82px; height: 82px;"></FluentProgressRing> | ||
<FluentProgressRing Min="0" Max="100" Value="100" style="width: 102px; height: 102px;"></FluentProgressRing> | ||
</div> | ||
<div style="display: grid; grid-gap: 12px; grid-auto-flow: column;"> | ||
</FluentStack> | ||
<FluentStack> | ||
<FluentProgressRing></FluentProgressRing> | ||
<FluentProgressRing style="width: 42px; height: 42px;"></FluentProgressRing> | ||
<FluentProgressRing style="width: 62px; height: 62px;"></FluentProgressRing> | ||
<FluentProgressRing style="width: 82px; height: 82px;"></FluentProgressRing> | ||
<FluentProgressRing style="width: 102px; height: 102px;"></FluentProgressRing> | ||
</div> | ||
</FluentStack> |
4 changes: 2 additions & 2 deletions
4
examples/Demo/Shared/Pages/ProgressRing/Examples/ProgressRingPaused.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<h4>Paused</h4> | ||
<div style="width: 300px; display: grid; grid-gap: 12px; grid-auto-flow: column;"> | ||
<FluentStack> | ||
<FluentProgressRing Paused="true" Min="0" Max="100" Value="75"></FluentProgressRing> | ||
<FluentProgressRing Paused="true"></FluentProgressRing> | ||
</div> | ||
</FluentStack> |
33 changes: 33 additions & 0 deletions
33
examples/Demo/Shared/Pages/ProgressRing/Examples/ProgressRingStroke.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<h4>Stroke and Color</h4> | ||
|
||
<FluentSelect Label="Width" Items="@(new [] { ProgressStrokes.Thin, ProgressStrokes.Normal, ProgressStrokes.Large })" @bind-SelectedOption="@Stroke" Width="60px" /> | ||
<FluentCheckbox Label="Indeterminate" @bind-Value="@Indeterminate" /> | ||
<FluentSelect Label="Color" Items="@(Enum.GetValues<OfficeColor>())" @bind-SelectedOption="@Color" Width="100px" Height="200px" /> | ||
<FluentSlider Min="0" Max="100" Step="5" @bind-Value="@Percentage" Style="max-width: 200px; margin: 20px 0px;" Disabled="@Indeterminate" /> | ||
|
||
<FluentStack Style="margin: 30px;"> | ||
<FluentLabel Style="width: 20px;">@Percentage</FluentLabel> | ||
|
||
<FluentProgressRing Value="@(Indeterminate ? null : Percentage)" | ||
Width="32px" | ||
Stroke="@Stroke" | ||
Color="@(Color.ToAttributeValue())" /> | ||
|
||
<FluentProgressRing Value="@(Indeterminate ? null : Percentage)" | ||
Width="64px" | ||
Stroke="@Stroke" | ||
Color="@(Color.ToAttributeValue())" /> | ||
|
||
<FluentProgressRing Value="@(Indeterminate ? null : Percentage)" | ||
Width="128px" | ||
Stroke="@Stroke" | ||
Color="@(Color.ToAttributeValue())" /> | ||
</FluentStack> | ||
|
||
@code | ||
{ | ||
ProgressStrokes Stroke = ProgressStrokes.Normal; | ||
int Percentage = 30; | ||
bool Indeterminate = false; | ||
OfficeColor Color = OfficeColor.Default; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Microsoft.FluentUI.AspNetCore.Components; | ||
|
||
public enum ProgressStrokes | ||
{ | ||
Normal, | ||
Thin, | ||
Large, | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/Core/Progress/FluentProgressRingTests.FluentProgressRing_Colors.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
<style> | ||
#f29effe6b::part(background) { stroke-width: 2px; r: 7px; } | ||
#f29effe6b::part(determinate) { stroke-width: 2px; r: 7px; stroke-dashoffset: 0px; stroke: red; } | ||
</style> | ||
<fluent-progress-ring id="xxx" min="0" max="100" value="30" backgroundcolor="gray" blazor:elementreference="xxx"></fluent-progress-ring> |
2 changes: 2 additions & 0 deletions
2
tests/Core/Progress/FluentProgressRingTests.FluentProgressRing_Content.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
<fluent-progress-ring id="xxx" min="10" max="80" blazor:elementreference="xxx">My content</fluent-progress-ring> |
2 changes: 2 additions & 0 deletions
2
tests/Core/Progress/FluentProgressRingTests.FluentProgressRing_Default.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
<fluent-progress-ring id="xxx" min="0" max="100" value="30" blazor:elementreference="xxx"></fluent-progress-ring> |
2 changes: 2 additions & 0 deletions
2
tests/Core/Progress/FluentProgressRingTests.FluentProgressRing_Paused.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
<fluent-progress-ring id="xxx" min="0" max="100" value="30" paused="" blazor:elementreference="xxx"></fluent-progress-ring> |
6 changes: 6 additions & 0 deletions
6
tests/Core/Progress/FluentProgressRingTests.FluentProgressRing_Stroke.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
<style> | ||
#f6525a78d::part(background) { stroke-width: 4px; r: 6px; } | ||
#f6525a78d::part(determinate) { stroke-width: 4px; r: 6px; stroke-dashoffset: 2px; stroke: var(--accent-fill-rest); } | ||
</style> | ||
<fluent-progress-ring id="xxx" min="0" max="100" value="30" blazor:elementreference="xxx"></fluent-progress-ring> |
Oops, something went wrong.