Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adameste develop #913

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
38 changes: 19 additions & 19 deletions src/MatBlazor.Demo/Demo/DemoMatSlider.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h5 class="mat-h5">Continuous Slider: @Val</h5>
<DemoContainer>
<Content>
<MatSlider @bind-Value="@Val"></MatSlider>
<MatSlider @bind-Value="@Val" ></MatSlider>

@code
{
Expand Down Expand Up @@ -50,7 +50,7 @@
<h5 class="mat-h5">Initializing the slider with custom ranges/values: @Val2</h5>
<DemoContainer>
<Content>
<MatSlider @bind-Value="@Val2" ValueMin="-10" ValueMax="20"></MatSlider>
<MatSlider @bind-Value="@Val2" Min="-10" Max="20"></MatSlider>

@code
{
Expand All @@ -71,7 +71,7 @@
</Content>
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatSlider @bind-Value=""@Val2"" ValueMin=""-10"" ValueMax=""20""></MatSlider>
<MatSlider @bind-Value=""@Val2"" Min=""-10"" Max=""20""></MatSlider>

@code
{
Expand All @@ -98,7 +98,7 @@
<p>Pin will round to nearest 3 digit. Pin only works with Discrete.</p>
<DemoContainer>
<Content>
<MatSlider @bind-Value="@Val3" Discrete="true" Pin="true" TValue="int" ValueMin="0" ValueMax="50"></MatSlider>
<MatSlider @bind-Value="@Val3" Discrete="true" Pin="true" TValue="int" Min="0" Max="50"></MatSlider>

@code
{
Expand All @@ -119,7 +119,7 @@
</Content>
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatSlider @bind-Value=""@Val3"" Discrete=""true"" Pin=""true"" TValue=""int"" ValueMin=""0"" ValueMax=""50""></MatSlider>
<MatSlider @bind-Value=""@Val3"" Discrete=""true"" Pin=""true"" TValue=""int"" Min=""0"" Max=""50""></MatSlider>

@code
{
Expand All @@ -145,7 +145,7 @@
<p>Markers only work with Discrete</p>
<DemoContainer>
<Content>
<MatSlider @bind-Value="@Val4" Step="5" EnableStep="true" ValueMin="0" ValueMax="100" Markers="true" Pin="true" TValue="int" Discrete="true"></MatSlider>
<MatSlider @bind-Value="@Val4" Step="5" EnableStep="true" Min="0" Max="100" Markers="true" Pin="true" TValue="int" Discrete="true"></MatSlider>

@code
{
Expand All @@ -166,7 +166,7 @@
</Content>
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatSlider @bind-Value=""@Val4"" Step=""5"" EnableStep=""true"" ValueMin=""0"" ValueMax=""100"" Markers=""true"" Pin=""true"" TValue=""int"" Discrete=""true""></MatSlider>
<MatSlider @bind-Value=""@Val4"" Step=""5"" EnableStep=""true"" Min=""0"" Max=""100"" Markers=""true"" Pin=""true"" TValue=""int"" Discrete=""true""></MatSlider>

@code
{
Expand All @@ -193,7 +193,7 @@
<p>Changes to the slider will immediately reflect in changes to the value.</p>
<DemoContainer>
<Content>
<MatSlider @bind-Value="@Val5" Immediate="true" Discrete="true" Pin="true" TValue="int" ValueMin="0" ValueMax="50"></MatSlider>
<MatSlider @bind-Value="@Val5" Immediate="true" Discrete="true" Pin="true" TValue="int" Min="0" Max="50"></MatSlider>

@code
{
Expand All @@ -214,7 +214,7 @@
</Content>
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatSlider @bind-Value=""@Val5"" Immediate=""true"" Discrete=""true"" Pin=""true"" TValue=""int"" ValueMin=""0"" ValueMax=""50""></MatSlider>
<MatSlider @bind-Value=""@Val5"" Immediate=""true"" Discrete=""true"" Pin=""true"" TValue=""int"" Min=""0"" Max=""50""></MatSlider>

@code
{
Expand Down Expand Up @@ -288,16 +288,16 @@
<DemoContainer>
<Content>
<MatTextField @bind-Value="@Value" Label="Value"></MatTextField>
<MatTextField @bind-Value="@ValueMin" Label="ValueMin"></MatTextField>
<MatTextField @bind-Value="@ValueMax" Label="ValueMax"></MatTextField>
<MatSlider TValue="decimal" Value="@Value" ValueMin="@ValueMin" ValueMax="@ValueMax" ValueChanged="@OnValueChanged2"></MatSlider>
<MatTextField @bind-Value="@Min" Label="Min"></MatTextField>
<MatTextField @bind-Value="@Max" Label="Max"></MatTextField>
<MatSlider TValue="decimal" Value="@Value" Min="@Min" Max="@Max" ValueChanged="@OnValueChanged2"></MatSlider>

@code
{

public decimal Value { get; set; } = 50;
public decimal ValueMin { get; set; } = 0;
public decimal ValueMax { get; set; } = 100;
public decimal Min { get; set; } = 0;
public decimal Max { get; set; } = 100;

public void OnValueChanged2(decimal val)
{
Expand All @@ -310,16 +310,16 @@
<SourceContent>
<BlazorFiddle Template="MatBlazor" Code=@(@"
<MatTextField @bind-Value=""@Value"" Label=""Value""></MatTextField>
<MatTextField @bind-Value=""@ValueMin"" Label=""ValueMin""></MatTextField>
<MatTextField @bind-Value=""@ValueMax"" Label=""ValueMax""></MatTextField>
<MatSlider TValue=""decimal"" Value=""@Value"" ValueMin=""@ValueMin"" ValueMax=""@ValueMax"" ValueChanged=""@OnValueChanged2""></MatSlider>
<MatTextField @bind-Value=""@Min"" Label=""Min""></MatTextField>
<MatTextField @bind-Value=""@Max"" Label=""Max""></MatTextField>
<MatSlider TValue=""decimal"" Value=""@Value"" Min=""@Min"" Max=""@Max"" ValueChanged=""@OnValueChanged2""></MatSlider>

@code
{

public decimal Value { get; set; } = 50;
public decimal ValueMin { get; set; } = 0;
public decimal ValueMax { get; set; } = 100;
public decimal Min { get; set; } = 0;
public decimal Max { get; set; } = 100;

public void OnValueChanged2(decimal val)
{
Expand Down
24 changes: 12 additions & 12 deletions src/MatBlazor.Demo/Demo/DemoNumericUpDownField.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<MatNumericUpDownField Label="No decimal places"
@bind-Value=@testingNullableDecimal2
DecimalPlaces=0
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -35,7 +35,7 @@
@bind-Value=@testingNullableDecimal1
FieldType="MatNumericUpDownFieldType.Percent"
DecimalPlaces=0
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -44,7 +44,7 @@
@bind-Value=@testingNullableDecimal2
DecimalPlaces=0
Disabled=true
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -53,7 +53,7 @@
@bind-Value=@testingNullableDecimal3
DecimalPlaces=0
Icon="favorite"
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -62,7 +62,7 @@
@bind-Value=@testingNullableDecimal4
DecimalPlaces=0
Outlined="true"
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -79,7 +79,7 @@
DecimalPlaces=0
Outlined="true"
FullWidth="true"
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand Down Expand Up @@ -122,7 +122,7 @@
<MatNumericUpDownField Label=""No decimal places""
@bind-Value=@testingNullableDecimal2
DecimalPlaces=0
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -139,7 +139,7 @@
@bind-Value=@testingNullableDecimal1
FieldType=""MatNumericUpDownFieldType.Percent""
DecimalPlaces=0
Minimum=null Maximum=null>
Minimum=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -148,7 +148,7 @@
@bind-Value=@testingNullableDecimal2
DecimalPlaces=0
Disabled=true
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -157,7 +157,7 @@
@bind-Value=@testingNullableDecimal3
DecimalPlaces=0
Icon=""favorite""
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -166,7 +166,7 @@
@bind-Value=@testingNullableDecimal4
DecimalPlaces=0
Outlined=""true""
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand All @@ -183,7 +183,7 @@
DecimalPlaces=0
Outlined=""true""
FullWidth=""true""
Minimum=null Maximum=null>
Min=null Max=null>
</MatNumericUpDownField>
</p>

Expand Down
4 changes: 2 additions & 2 deletions src/MatBlazor.Demo/Doc/DocMatNumericUpDownField.razor
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@
<td></td>
</tr>
<tr>
<td>Maximum</td>
<td>Max</td>
<td>TValue</td>
<td></td>
</tr>
<tr>
<td>Minimum</td>
<td>Min</td>
<td>TValue</td>
<td></td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/MatBlazor.Demo/Doc/DocMatSlider.razor
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@
<td>Gets or sets an expression that identifies the bound value.</td>
</tr>
<tr>
<td>ValueMax</td>
<td>Max</td>
<td>TValue</td>
<td></td>
</tr>
<tr>
<td>ValueMin</td>
<td>Min</td>
<td>TValue</td>
<td></td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions src/MatBlazor/Components/MatButton/MatButton.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public MatButton()

protected async Task OnClickHandler(MouseEventArgs ev)
{
if (Disabled) return;
if (Link != null)
{
if (!string.IsNullOrEmpty(Target))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ protected override EventCallback<KeyboardEventArgs> OnKeyDownEvent()

protected void Increase()
{
CurrentValue = SwitchT.Increase(CurrentValue, Step, Maximum);
CurrentValue = SwitchT.Increase(CurrentValue, Step, Max);
}

protected void Decrease()
{
CurrentValue = SwitchT.Decrease(CurrentValue, Step, Minimum);
CurrentValue = SwitchT.Decrease(CurrentValue, Step, Min);
}

protected override TValue CurrentValue
Expand All @@ -37,10 +37,10 @@ protected override TValue CurrentValue


[Parameter]
public TValue Maximum { get; set; }
public TValue Max { get; set; }

[Parameter]
public TValue Minimum { get; set; }
public TValue Min { get; set; }

[Parameter]
public int DecimalPlaces { get; set; } = 0;
Expand Down Expand Up @@ -77,8 +77,8 @@ public BaseMatNumericUpDownFieldInternal()
Decrease();
}
});
Maximum = SwitchT.GetMaximum();
Minimum = SwitchT.GetMinimum();
Max = SwitchT.GetMaximum();
Min = SwitchT.GetMinimum();

ClassMapper.Add("mat-numeric-up-down-field");
ClassMapper.Add("mat-text-field-with-actions-container");
Expand Down Expand Up @@ -148,8 +148,8 @@ protected override bool TryParseValueFromString(string value, out TValue result,
if (result != null) // Snap to Min/Max
{
var comparer = Comparer<TValue>.Default;
if (Maximum != null && comparer.Compare(result, Maximum) > 0) result = Maximum;
if (Minimum != null && comparer.Compare(result, Minimum) < 0) result = Minimum;
if (Max != null && comparer.Compare(result, Max) > 0) result = Max;
if (Min != null && comparer.Compare(result, Min) < 0) result = Min;
}

return success;
Expand Down
12 changes: 6 additions & 6 deletions src/MatBlazor/Components/MatSlider/BaseMatSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public BaseMatSlider()
{
jsHelper = new MatDotNetObjectReference<MatSliderJsHelper>(new MatSliderJsHelper());
jsHelper.Value.OnChangeEvent += Value_OnChangeEvent;
ValueMin = SwitchT.GetMinimum();
ValueMax = SwitchT.GetMaximum();
Min = SwitchT.GetMinimum();
Max = SwitchT.GetMaximum();
Step = SwitchT.GetStep();

ClassMapper
Expand Down Expand Up @@ -67,7 +67,7 @@ public override void Dispose()


[Parameter]
public TValue ValueMin
public TValue Min
{
get => valueMin;
set
Expand All @@ -91,7 +91,7 @@ public TValue ValueMin
}

[Parameter]
public TValue ValueMax
public TValue Max
{
get => valueMax;
set
Expand Down Expand Up @@ -168,8 +168,8 @@ public string MarkerStyle
{
try
{
decimal.TryParse(ValueMin.ToString(), out var min);
decimal.TryParse(ValueMax.ToString(), out var max);
decimal.TryParse(Min.ToString(), out var min);
decimal.TryParse(Max.ToString(), out var max);
if (!decimal.TryParse(Step.ToString(), out var step))
{
step = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/MatBlazor/Components/MatSlider/MatSlider.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


<div @ref="Ref" class="@ClassMapper.AsString()" style="@StyleMapper.AsString()" tabindex="0" role="slider"
aria-valuemin="@ValueMin" aria-valuemax="@ValueMax" aria-valuenow="@Value"
aria-valuemin="@Min" aria-valuemax="@Max" aria-valuenow="@Value"
data-step="@(EnableStep ? Step?.ToString() : null)" aria-label="@Label" aria-disabled="@Disabled"
@attributes="Attributes" Id="@Id">
<div class="mdc-slider__track-container">
Expand Down
Loading