diff --git a/src/MatBlazor.Demo/Demo/DemoMatSlider.razor b/src/MatBlazor.Demo/Demo/DemoMatSlider.razor index f10d6233..2ff2e0e0 100644 --- a/src/MatBlazor.Demo/Demo/DemoMatSlider.razor +++ b/src/MatBlazor.Demo/Demo/DemoMatSlider.razor @@ -3,7 +3,7 @@
Continuous Slider: @Val
- + @code { @@ -50,7 +50,7 @@
Initializing the slider with custom ranges/values: @Val2
- + @code { @@ -71,7 +71,7 @@ + @code { @@ -98,7 +98,7 @@

Pin will round to nearest 3 digit. Pin only works with Discrete.

- + @code { @@ -119,7 +119,7 @@ + @code { @@ -145,7 +145,7 @@

Markers only work with Discrete

- + @code { @@ -166,7 +166,7 @@ + @code { @@ -193,7 +193,7 @@

Changes to the slider will immediately reflect in changes to the value.

- + @code { @@ -214,7 +214,7 @@ + @code { @@ -288,16 +288,16 @@ - - - + + + @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) { @@ -310,16 +310,16 @@ - - - + + + @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) { diff --git a/src/MatBlazor.Demo/Demo/DemoNumericUpDownField.razor b/src/MatBlazor.Demo/Demo/DemoNumericUpDownField.razor index 444fd55c..e6d70590 100644 --- a/src/MatBlazor.Demo/Demo/DemoNumericUpDownField.razor +++ b/src/MatBlazor.Demo/Demo/DemoNumericUpDownField.razor @@ -18,7 +18,7 @@ + Min=null Max=null>

@@ -35,7 +35,7 @@ @bind-Value=@testingNullableDecimal1 FieldType="MatNumericUpDownFieldType.Percent" DecimalPlaces=0 - Minimum=null Maximum=null> + Min=null Max=null>

@@ -44,7 +44,7 @@ @bind-Value=@testingNullableDecimal2 DecimalPlaces=0 Disabled=true - Minimum=null Maximum=null> + Min=null Max=null>

@@ -53,7 +53,7 @@ @bind-Value=@testingNullableDecimal3 DecimalPlaces=0 Icon="favorite" - Minimum=null Maximum=null> + Min=null Max=null>

@@ -62,7 +62,7 @@ @bind-Value=@testingNullableDecimal4 DecimalPlaces=0 Outlined="true" - Minimum=null Maximum=null> + Min=null Max=null>

@@ -79,7 +79,7 @@ DecimalPlaces=0 Outlined="true" FullWidth="true" - Minimum=null Maximum=null> + Min=null Max=null>

@@ -122,7 +122,7 @@ + Min=null Max=null>

@@ -139,7 +139,7 @@ @bind-Value=@testingNullableDecimal1 FieldType=""MatNumericUpDownFieldType.Percent"" DecimalPlaces=0 - Minimum=null Maximum=null> + Minimum=null Max=null>

@@ -148,7 +148,7 @@ @bind-Value=@testingNullableDecimal2 DecimalPlaces=0 Disabled=true - Minimum=null Maximum=null> + Min=null Max=null>

@@ -157,7 +157,7 @@ @bind-Value=@testingNullableDecimal3 DecimalPlaces=0 Icon=""favorite"" - Minimum=null Maximum=null> + Min=null Max=null>

@@ -166,7 +166,7 @@ @bind-Value=@testingNullableDecimal4 DecimalPlaces=0 Outlined=""true"" - Minimum=null Maximum=null> + Min=null Max=null>

@@ -183,7 +183,7 @@ DecimalPlaces=0 Outlined=""true"" FullWidth=""true"" - Minimum=null Maximum=null> + Min=null Max=null>

diff --git a/src/MatBlazor.Demo/Doc/DocMatNumericUpDownField.razor b/src/MatBlazor.Demo/Doc/DocMatNumericUpDownField.razor index c57918fe..01ef41e1 100644 --- a/src/MatBlazor.Demo/Doc/DocMatNumericUpDownField.razor +++ b/src/MatBlazor.Demo/Doc/DocMatNumericUpDownField.razor @@ -135,12 +135,12 @@ - Maximum + Max TValue - Minimum + Min TValue diff --git a/src/MatBlazor.Demo/Doc/DocMatSlider.razor b/src/MatBlazor.Demo/Doc/DocMatSlider.razor index 55901e4b..4b6378c5 100644 --- a/src/MatBlazor.Demo/Doc/DocMatSlider.razor +++ b/src/MatBlazor.Demo/Doc/DocMatSlider.razor @@ -105,12 +105,12 @@ Gets or sets an expression that identifies the bound value. - ValueMax + Max TValue - ValueMin + Min TValue diff --git a/src/MatBlazor/Components/MatButton/MatButton.razor.cs b/src/MatBlazor/Components/MatButton/MatButton.razor.cs index 9c99bb61..d8ae180b 100644 --- a/src/MatBlazor/Components/MatButton/MatButton.razor.cs +++ b/src/MatBlazor/Components/MatButton/MatButton.razor.cs @@ -142,6 +142,7 @@ public MatButton() protected async Task OnClickHandler(MouseEventArgs ev) { + if (Disabled) return; if (Link != null) { if (!string.IsNullOrEmpty(Target)) diff --git a/src/MatBlazor/Components/MatNumericUpDownField/BaseMatNumericUpDownFieldInternal.cs b/src/MatBlazor/Components/MatNumericUpDownField/BaseMatNumericUpDownFieldInternal.cs index 1ef3fa4b..b514762e 100644 --- a/src/MatBlazor/Components/MatNumericUpDownField/BaseMatNumericUpDownFieldInternal.cs +++ b/src/MatBlazor/Components/MatNumericUpDownField/BaseMatNumericUpDownFieldInternal.cs @@ -18,12 +18,12 @@ protected override EventCallback 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 @@ -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; @@ -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"); @@ -148,8 +148,8 @@ protected override bool TryParseValueFromString(string value, out TValue result, if (result != null) // Snap to Min/Max { var comparer = Comparer.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; diff --git a/src/MatBlazor/Components/MatSlider/BaseMatSlider.cs b/src/MatBlazor/Components/MatSlider/BaseMatSlider.cs index 9ece8463..23ef94c5 100644 --- a/src/MatBlazor/Components/MatSlider/BaseMatSlider.cs +++ b/src/MatBlazor/Components/MatSlider/BaseMatSlider.cs @@ -21,8 +21,8 @@ public BaseMatSlider() { jsHelper = new MatDotNetObjectReference(new MatSliderJsHelper()); jsHelper.Value.OnChangeEvent += Value_OnChangeEvent; - ValueMin = SwitchT.GetMinimum(); - ValueMax = SwitchT.GetMaximum(); + Min = SwitchT.GetMinimum(); + Max = SwitchT.GetMaximum(); Step = SwitchT.GetStep(); ClassMapper @@ -67,7 +67,7 @@ public override void Dispose() [Parameter] - public TValue ValueMin + public TValue Min { get => valueMin; set @@ -91,7 +91,7 @@ public TValue ValueMin } [Parameter] - public TValue ValueMax + public TValue Max { get => valueMax; set @@ -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; diff --git a/src/MatBlazor/Components/MatSlider/MatSlider.razor b/src/MatBlazor/Components/MatSlider/MatSlider.razor index e47fafb5..58c366ad 100644 --- a/src/MatBlazor/Components/MatSlider/MatSlider.razor +++ b/src/MatBlazor/Components/MatSlider/MatSlider.razor @@ -4,7 +4,7 @@
diff --git a/src/MatBlazor/Components/MatTable/MatTable.razor b/src/MatBlazor/Components/MatTable/MatTable.razor index f3e07d73..a4203be4 100644 --- a/src/MatBlazor/Components/MatTable/MatTable.razor +++ b/src/MatBlazor/Components/MatTable/MatTable.razor @@ -141,7 +141,7 @@ var lastComma = tempPlaceholder.LastIndexOf(","); - if (lastComma != -1) + if (lastComma != -1 && SearchTermFieldPlaceHolder == null) { SearchTermFieldPlaceHolder = tempPlaceholder.Remove(lastComma, 1).Insert(lastComma, " and"); } @@ -164,7 +164,7 @@ if (PageSize <= 0) PageSize = 5; } - + StartPage = 1; CurrentPage = StartPage; @@ -283,14 +283,14 @@ var doc = JsonDocument.Parse(pagedData); var root = doc.RootElement; string itemsString = root.GetProperty(PagingDataPropertyName).GetRawText(); - + var opt = new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - + var items = JsonSerializer.Deserialize>(itemsString, opt); - + Items = items; int count = root.GetProperty(PagingRecordsCountPropertyName).GetInt32(); RecordsFrom = (CurrentPage - 1) * PageSize; @@ -341,13 +341,18 @@ ItemList = PageSize <= 0 ? filteredCollection : filteredCollection.Skip(RecordsFrom).Take(PageSize); } - else + else if (Items != null) { ItemList = PageSize <= 0 ? Items : Items.Skip(RecordsFrom).Take(PageSize); RecordsTo = (RecordsFrom + PageSize < Items.Count()) ? RecordsFrom + PageSize : Items.Count(); TotalPages = Math.Max(1, (int)Math.Ceiling(Items.Count() / (decimal)PageSize)); EndPage = TotalPages; } + else + { + ItemList = null; + } + SetPageSize(PageDirection.Next); StateHasChanged(); }