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 @@ -8,9 +8,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="app.css" rel="stylesheet" />
<link href="ComponentViewer.styles.css" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700;900&display=swap" rel="stylesheet">
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.*" />
<PackageReference Include="MudBlazor" Version="7.12.1" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
<PackageReference Include="CsvHelper" Version="31.0.3" />
<PackageReference Include="MudBlazor" Version="7.12.1" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
<PackageReference Include="ZXing.Net" Version="0.16.9" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// Component that has select and autocomplete features.
/// </summary>
/// <typeparam name="T"></typeparam>
public partial class MudComboBox<T> : MudBaseInputExtended<T?>
public partial class MudComboBox<T> : MudBaseInputExtended<T>
{
#region Constructor, Injected Services, Parameters, Fields

Expand All @@ -38,7 +38,7 @@
private readonly string? multiSelectionText;
static readonly KeyInterceptorOptions _keyInterceptorOptions = new()
{
EnableLogging = true,
//EnableLogging = true,
TargetClass = "mud-input-control",
Keys =
{
Expand Down Expand Up @@ -576,7 +576,7 @@
return;
_comparer = value;
// Apply comparer and refresh selected values
_selectedValues = new HashSet<T?>(_selectedValues, _comparer);

Check warning on line 579 in CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'collection' in 'HashSet<T?>.HashSet(IEnumerable<T?> collection, IEqualityComparer<T?>? comparer)'.
SelectedValues = _selectedValues;
}
}
Expand All @@ -595,7 +595,7 @@
if (_toStringFunc == value)
return;
_toStringFunc = value;
Converter = new Converter<T?>

Check warning on line 598 in CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in value of type 'Converter<T?>' doesn't match target type 'Converter<T, string>'.
{
SetFunc = _toStringFunc ?? (x => x?.ToString()),
};
Expand Down Expand Up @@ -636,7 +636,7 @@

_selectedValues = new HashSet<T?>(set, _comparer);

SelectedValuesChanged.InvokeAsync(new HashSet<T?>(SelectedValues, _comparer)).CatchAndLog();

Check warning on line 639 in CodeBeam.MudBlazor.Extensions/Components/ComboBox/MudComboBox.razor.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'collection' in 'HashSet<T?>.HashSet(IEnumerable<T?> collection, IEqualityComparer<T?>? comparer)'.
ForceUpdateItems().CatchAndLog();
//Console.WriteLine("SelectedValues setter ended");
}
Expand Down Expand Up @@ -849,7 +849,6 @@

if (firstRender)
{
// TODO: Use Task for HandleKeyDown / HandleKeyDown
await KeyInterceptorService.SubscribeAsync(_elementId, _keyInterceptorOptions, keyDown: HandleKeyDown, keyUp: HandleKeyUp);
await UpdateDataVisualiserTextAsync();
_firstRendered = true;
Expand Down Expand Up @@ -888,7 +887,7 @@
/// Protected keydown event.
/// </summary>
/// <param name="obj"></param>
protected internal void HandleKeyDown(KeyboardEventArgs obj)
protected internal async Task HandleKeyDown(KeyboardEventArgs obj)
{
if (Disabled || ReadOnly)
return;
Expand Down Expand Up @@ -1011,7 +1010,7 @@
case "ArrowDown":
case "Enter":
case "NumpadEnter":
HandleKeyDown(obj);
await HandleKeyDown(obj);
return;

case "Tab":
Expand All @@ -1027,7 +1026,7 @@
/// Protected searchbox keyup event.
/// </summary>
/// <param name="obj"></param>
protected internal void SearchBoxHandleKeyUp(KeyboardEventArgs obj)
protected internal async Task SearchBoxHandleKeyUp(KeyboardEventArgs obj)
{
ForceRenderItems();
}
Expand All @@ -1036,7 +1035,7 @@
/// Protected keyup event.
/// </summary>
/// <param name="obj"></param>
protected internal async void HandleKeyUp(KeyboardEventArgs obj)
protected internal async Task HandleKeyUp(KeyboardEventArgs obj)
{
ForceRenderItems();
await OnKeyUp.InvokeAsync(obj);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// Select component with advanced features.
/// </summary>
/// <typeparam name="T"></typeparam>
public partial class MudSelectExtended<T> : MudBaseInputExtended<T?>, IMudSelectExtended, IMudShadowSelectExtended
public partial class MudSelectExtended<T> : MudBaseInputExtended<T>, IMudSelectExtended, IMudShadowSelectExtended
{

#region Constructor, Injected Services, Parameters, Fields
Expand Down Expand Up @@ -42,11 +42,11 @@
/// <summary>
///
/// </summary>
protected Dictionary<T, MudSelectItemExtended<T?>> _valueLookup = new();

Check warning on line 45 in CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor.cs

View workflow job for this annotation

GitHub Actions / build

The type 'T' cannot be used as type parameter 'TKey' in the generic type or method 'Dictionary<TKey, TValue>'. Nullability of type argument 'T' doesn't match 'notnull' constraint.
/// <summary>
///
/// </summary>
protected Dictionary<T, MudSelectItemExtended<T?>> _shadowLookup = new();

Check warning on line 49 in CodeBeam.MudBlazor.Extensions/Components/SelectExtended/MudSelectExtended.razor.cs

View workflow job for this annotation

GitHub Actions / build

The type 'T' cannot be used as type parameter 'TKey' in the generic type or method 'Dictionary<TKey, TValue>'. Nullability of type argument 'T' doesn't match 'notnull' constraint.
private MudInputExtended<string> _elementReference = new();
internal bool _isOpen;
/// <summary>
Expand Down Expand Up @@ -775,7 +775,6 @@

if (firstRender)
{
// TODO: Make HandleKeyDown / HandleKeyUp async Task
await KeyInterceptorService.SubscribeAsync(_elementId, new KeyInterceptorOptions()
{
//EnableLogging = true,
Expand Down Expand Up @@ -838,7 +837,7 @@
/// Keydown event.
/// </summary>
/// <param name="obj"></param>
protected internal async void HandleKeyDown(KeyboardEventArgs obj)
protected internal async Task HandleKeyDown(KeyboardEventArgs obj)
{
if (Disabled || ReadOnly)
return;
Expand Down Expand Up @@ -915,7 +914,7 @@
/// Keyup event.
/// </summary>
/// <param name="obj"></param>
protected internal async void HandleKeyUp(KeyboardEventArgs obj)
protected internal async Task HandleKeyUp(KeyboardEventArgs obj)
{
await OnKeyUp.InvokeAsync(obj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,29 @@ public partial class MudSwitchM3<T> : MudBooleanInput<T>
/// Keydown event.
/// </summary>
/// <param name="obj"></param>
protected internal void HandleKeyDown(KeyboardEventArgs obj)
protected internal async Task HandleKeyDown(KeyboardEventArgs obj)
{
if (Disabled || ReadOnly)
return;
switch (obj.Key)
{
case "ArrowLeft":
case "Delete":
SetBoolValueAsync(false);
await SetBoolValueAsync(false);
break;
case "ArrowRight":
case "Enter":
case "NumpadEnter":
SetBoolValueAsync(true);
await SetBoolValueAsync(true);
break;
case " ":
if (BoolValue == true)
{
SetBoolValueAsync(false);
await SetBoolValueAsync(false);
}
else
{
SetBoolValueAsync(true);
await SetBoolValueAsync(true);
}
break;
}
Expand Down
Loading