-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🆕 feat(Slider): support for other numeric types including double (#327)
- Loading branch information
Showing
26 changed files
with
75 additions
and
95 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
5 changes: 2 additions & 3 deletions
5
...Component/Components/RangeSlider/Children/TrackContainer/BRangeSliderTrackContainer.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,13 +1,12 @@ | ||
@namespace BlazorComponent | ||
@typeparam TValue | ||
@typeparam TRangeSlider | ||
@inherits BSliderTrackContainer<IList<TValue>,TRangeSlider> | ||
@inherits BSliderTrackContainer<IList<TValue>, TValue, TRangeSlider> | ||
|
||
<div class="@CssProvider.GetClass("track-container")" @ref="TrackElement"> | ||
@for (var i = 0; i < 3; i++) | ||
{ | ||
var index = i; | ||
<div class="@CssProvider.GetClass("range-track-background",index)" style="@CssProvider.GetStyle("range-track-background",index)"></div> | ||
<div class="@CssProvider.GetClass("range-track-background", index)" style="@CssProvider.GetStyle("range-track-background", index)"></div> | ||
} | ||
</div> | ||
|
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
13 changes: 13 additions & 0 deletions
13
...Component/BlazorComponent/Components/RangeSlider/RangeSliderAbstractProviderExtensions.cs
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,13 @@ | ||
namespace BlazorComponent | ||
{ | ||
public static class RangeSliderAbstractProviderExtensions | ||
{ | ||
public static ComponentAbstractProvider ApplyRangeSliderDefault<TValue>(this ComponentAbstractProvider abstractProvider) | ||
{ | ||
return abstractProvider | ||
.Merge(typeof(BSliderThumbContainer<,,>), typeof(BRangeSliderThumbContainer<TValue, IRangeSlider<TValue>>)) | ||
.Merge(typeof(BSliderInput<,,>), typeof(BRangeSliderInput<TValue, IRangeSlider<TValue>>)) | ||
.Merge(typeof(BSliderTrackContainer<,,>), typeof(BRangeSliderTrackContainer<TValue, IRangeSlider<TValue>>)); | ||
} | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
...mponent/BlazorComponent/Components/RangeSlider/RangeSliderAbstractProviderExtensitions.cs
This file was deleted.
Oops, something went wrong.
5 changes: 3 additions & 2 deletions
5
src/Component/BlazorComponent/Components/Slider/DefaultSlot/BSliderDefaultSlot.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
2 changes: 1 addition & 1 deletion
2
src/Component/BlazorComponent/Components/Slider/DefaultSlot/BSliderDefaultSlot.razor.cs
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
7 changes: 2 additions & 5 deletions
7
src/Component/BlazorComponent/Components/Slider/DefaultSlot/Slider/BSliderSlider.razor.cs
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
9 changes: 5 additions & 4 deletions
9
...onent/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/BSliderChildren.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,10 +1,11 @@ | ||
@namespace BlazorComponent | ||
@typeparam TValue | ||
@typeparam TNumeric | ||
@typeparam TInput | ||
@inherits ComponentPartBase<TInput> | ||
|
||
@RenderPart(typeof(BSliderInput<,>)) | ||
@RenderPart(typeof(BSliderTrackContainer<,>)) | ||
@RenderPart(typeof(BSliderSteps<,>)) | ||
@RenderPart(typeof(BSliderThumbContainer<,>)) | ||
@RenderPart(typeof(BSliderInput<,,>)) | ||
@RenderPart(typeof(BSliderTrackContainer<,,>)) | ||
@RenderPart(typeof(BSliderSteps<,,>)) | ||
@RenderPart(typeof(BSliderThumbContainer<,,>)) | ||
|
4 changes: 1 addition & 3 deletions
4
...nt/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/BSliderChildren.razor.cs
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,8 +1,6 @@ | ||
namespace BlazorComponent | ||
{ | ||
public partial class BSliderChildren<TValue, TInput> where TInput : ISlider<TValue> | ||
public partial class BSliderChildren<TValue, TNumeric, TInput> where TInput : ISlider<TValue, TNumeric> | ||
{ | ||
|
||
} | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
...nt/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Input/BSliderInput.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
3 changes: 1 addition & 2 deletions
3
...BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Input/BSliderInput.razor.cs
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,10 +1,9 @@ | ||
namespace BlazorComponent | ||
{ | ||
public partial class BSliderInput<TValue, TInput> where TInput : ISlider<TValue> | ||
public partial class BSliderInput<TValue, TNumeric, TInput> where TInput : ISlider<TValue, TNumeric> | ||
{ | ||
public TValue InternalValue => Component.InternalValue; | ||
|
||
public Dictionary<string, object> InputAttrs => Component.InputAttrs; | ||
} | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
...nt/BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Steps/BSliderSteps.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
4 changes: 2 additions & 2 deletions
4
...BlazorComponent/Components/Slider/DefaultSlot/Slider/Children/Steps/BSliderSteps.razor.cs
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
1 change: 1 addition & 0 deletions
1
...ent/Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/Thumb/BSliderThumb.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
2 changes: 1 addition & 1 deletion
2
.../Components/Slider/DefaultSlot/Slider/Children/ThumbContainer/Thumb/BSliderThumb.razor.cs
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,6 +1,6 @@ | ||
namespace BlazorComponent | ||
{ | ||
public partial class BSliderThumb<TValue, TInput> where TInput : ISlider<TValue> | ||
public partial class BSliderThumb<TValue, TNumeric, TInput> where TInput : ISlider<TValue, TNumeric> | ||
{ | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
...ents/Slider/DefaultSlot/Slider/Children/ThumbContainer/ThumbLabel/BSliderThumbLabel.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,14 +1,13 @@ | ||
@namespace BlazorComponent | ||
@typeparam TValue | ||
@typeparam TNumeric | ||
@typeparam TInput | ||
@inherits ComponentPartBase<TInput> | ||
|
||
<ScaleTransition Origin="bottom center"> | ||
<ShowTransitionElement Value="ShowThumbLabelContainer" class="@CssProvider.GetClass("thumb-label-container")" style="@CssProvider.GetStyle("thumb-label-container")"> | ||
<div class="@CssProvider.GetClass("thumb-label")"> | ||
<div>@ThumbLabelContent(Index)</div> | ||
<div>@ComputedThumbLabelContent</div> | ||
</div> | ||
</ShowTransitionElement> | ||
</ScaleTransition> | ||
|
||
|
8 changes: 3 additions & 5 deletions
8
...s/Slider/DefaultSlot/Slider/Children/ThumbContainer/ThumbLabel/BSliderThumbLabel.razor.cs
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
1 change: 1 addition & 0 deletions
1
.../Components/Slider/DefaultSlot/Slider/Children/TrackContainer/BSliderTrackContainer.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
12 changes: 3 additions & 9 deletions
12
...mponents/Slider/DefaultSlot/Slider/Children/TrackContainer/BSliderTrackContainer.razor.cs
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,16 +1,10 @@ | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace BlazorComponent | ||
namespace BlazorComponent | ||
{ | ||
public partial class BSliderTrackContainer<TValue, TInput> where TInput : ISlider<TValue> | ||
public partial class BSliderTrackContainer<TValue, TNumeric, TInput> where TInput : ISlider<TValue, TNumeric> | ||
{ | ||
public ElementReference TrackElement | ||
{ | ||
set | ||
{ | ||
Component.TrackElement = value; | ||
} | ||
set { Component.TrackElement = value; } | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.