Skip to content

Commit eedd854

Browse files
authored
Merge pull request #116 from phmatray/develop
fix: resolve package compatibility and MudBlazor v9 breaking changes
2 parents 31bd810 + 9d9885b commit eedd854

12 files changed

Lines changed: 58 additions & 56 deletions

File tree

Directory.Packages.props

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@
3131
</ItemGroup>
3232
<!-- .NET 8.0 packages -->
3333
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
34-
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3" />
35-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3" />
36-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" />
37-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
38-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
39-
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.3" />
40-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3" />
34+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.24" />
35+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.24" />
36+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.24" />
37+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
38+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
39+
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
40+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
4141
</ItemGroup>
4242
<!-- .NET 9.0 packages -->
4343
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
44-
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3" />
45-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3" />
46-
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" />
47-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
48-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
49-
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.3" />
50-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3" />
44+
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.13" />
45+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.13" />
46+
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.13" />
47+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.13" />
48+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.13" />
49+
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.13" />
50+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.13" />
5151
</ItemGroup>
5252
<!-- .NET 10.0 packages -->
5353
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">

FormCraft.DemoBlazorApp/Components/Pages/TabbedForm.razor

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
Elevation="2"
2727
Rounded="true"
2828
ApplyEffectsToContainer="true"
29-
PanelClass="pa-4">
29+
>
3030
<MudTabPanel
31-
Text="Personal Info"
31+
PanelClass="pa-4"
32+
Text="Personal Info"
3233
Icon="@Icons.Material.Filled.Person"
3334
BadgeData="@GetPersonalInfoBadge()"
3435
BadgeColor="@GetTabBadgeColor(IsPersonalInfoComplete(), HasPersonalInfoData())"
@@ -46,7 +47,8 @@
4647
</MudTabPanel>
4748

4849
<MudTabPanel
49-
Text="Contact Details"
50+
PanelClass="pa-4"
51+
Text="Contact Details"
5052
Icon="@Icons.Material.Filled.ContactMail"
5153
BadgeData="@GetContactInfoBadge()"
5254
BadgeColor="@GetTabBadgeColor(IsContactInfoComplete(), HasContactInfoData())"
@@ -67,7 +69,8 @@
6769
</MudTabPanel>
6870

6971
<MudTabPanel
70-
Text="Professional Info"
72+
PanelClass="pa-4"
73+
Text="Professional Info"
7174
Icon="@Icons.Material.Filled.Work"
7275
BadgeData="@GetProfessionalInfoBadge()"
7376
BadgeColor="@GetTabBadgeColor(IsProfessionalInfoComplete(), HasProfessionalInfoData())"
@@ -84,8 +87,9 @@
8487
ShowSubmitButton="false" />
8588
</MudTabPanel>
8689

87-
<MudTabPanel
88-
Text="Review & Submit"
90+
<MudTabPanel
91+
PanelClass="pa-4"
92+
Text="Review & Submit"
8993
Icon="@Icons.Material.Filled.CheckCircle"
9094
BadgeData="@GetValidationBadge()"
9195
BadgeColor="@GetBadgeColor()"

FormCraft.DemoBlazorApp/Components/Shared/DemoPageLayout.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
<DemoPageHeader Title="@Title" Icon="@Icon" Description="@Description" />
1111

1212
<MudPaper Elevation="2" Class="pa-0">
13-
<MudTabs Elevation="0" Rounded="false" PanelClass="pa-6">
14-
<MudTabPanel Text="Form Demo" Icon="@FormDemoIcon">
13+
<MudTabs Elevation="0" Rounded="false">
14+
<MudTabPanel PanelClass="pa-6" Text="Form Demo" Icon="@FormDemoIcon">
1515
@FormDemoContent
1616
</MudTabPanel>
1717

18-
<MudTabPanel Text="Code Example" Icon="@Icons.Material.Filled.Code">
18+
<MudTabPanel PanelClass="pa-6" Text="Code Example" Icon="@Icons.Material.Filled.Code">
1919
@CodeExampleContent
2020
</MudTabPanel>
2121

22-
<MudTabPanel Text="Guidelines" Icon="@Icons.Material.Filled.Lightbulb">
22+
<MudTabPanel PanelClass="pa-6" Text="Guidelines" Icon="@Icons.Material.Filled.Lightbulb">
2323
@GuidelinesContent
2424
</MudTabPanel>
2525

FormCraft.DemoBlazorApp/Components/Shared/FeatureShowcase.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
<MudPaper Elevation="3" Class="rounded-lg overflow-hidden">
1212
<MudTabs Elevation="0" Rounded="false" Centered="true" Color="Color.Primary"
13-
PanelClass="pa-6" ApplyEffectsToContainer="true">
14-
<MudTabPanel Text="Validation" Icon="@Icons.Material.Filled.CheckCircle">
13+
ApplyEffectsToContainer="true">
14+
<MudTabPanel PanelClass="pa-6" Text="Validation" Icon="@Icons.Material.Filled.CheckCircle">
1515
<MudGrid>
1616
<MudItem xs="12" md="6">
1717
<MudText Typo="Typo.h6" Class="mb-3">Try Invalid Input</MudText>
@@ -45,7 +45,7 @@
4545
</MudGrid>
4646
</MudTabPanel>
4747

48-
<MudTabPanel Text="Dependencies" Icon="@Icons.Material.Filled.AccountTree">
48+
<MudTabPanel PanelClass="pa-6" Text="Dependencies" Icon="@Icons.Material.Filled.AccountTree">
4949
<MudGrid>
5050
<MudItem xs="12" md="6">
5151
<MudText Typo="Typo.h6" Class="mb-3">Cascading Fields</MudText>
@@ -67,7 +67,7 @@
6767
</MudGrid>
6868
</MudTabPanel>
6969

70-
<MudTabPanel Text="Field Types" Icon="@Icons.Material.Filled.Palette">
70+
<MudTabPanel PanelClass="pa-6" Text="Field Types" Icon="@Icons.Material.Filled.Palette">
7171
<MudGrid>
7272
<MudItem xs="12" md="6">
7373
<MudText Typo="Typo.h6" Class="mb-3">Various Input Types</MudText>
@@ -94,7 +94,7 @@
9494
</MudGrid>
9595
</MudTabPanel>
9696

97-
<MudTabPanel Text="Layouts" Icon="@Icons.Material.Filled.GridView">
97+
<MudTabPanel PanelClass="pa-6" Text="Layouts" Icon="@Icons.Material.Filled.GridView">
9898
<MudGrid>
9999
<MudItem xs="12" md="6">
100100
<MudText Typo="Typo.h6" Class="mb-3">Flexible Layouts</MudText>

FormCraft.ForMudBlazor.UnitTests/Fields/MudBlazorTextFieldComponentTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public async Task TextField_Should_Update_Model_On_Input()
278278
mudTextField.ShouldNotBeNull();
279279

280280
// Act
281-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("John Doe"));
281+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("John Doe"));
282282

283283
// Assert
284284
model.Name.ShouldBe("John Doe");
@@ -328,11 +328,11 @@ public async Task TextField_Should_Preserve_Value_After_Multiple_Inputs()
328328
var mudTextField = component.FindComponent<MudTextField<string>>();
329329

330330
// Act - Simulate typing character by character
331-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("H"));
332-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("He"));
333-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hel"));
334-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hell"));
335-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hello"));
331+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("H"));
332+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("He"));
333+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hel"));
334+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hell"));
335+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hello"));
336336

337337
// Assert
338338
model.Name.ShouldBe("Hello");
@@ -359,7 +359,7 @@ public async Task PasswordField_Should_Update_Model_On_Input()
359359
mudTextField.ShouldNotBeNull();
360360

361361
// Act
362-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("secret123"));
362+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("secret123"));
363363

364364
// Assert
365365
model.Password.ShouldBe("secret123");
@@ -384,10 +384,10 @@ public async Task PasswordField_Should_Preserve_Value_After_Multiple_Inputs()
384384
var mudTextField = component.FindComponent<MudTextField<string>>();
385385

386386
// Act - Simulate typing character by character
387-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("p"));
388-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pa"));
389-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pas"));
390-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pass"));
387+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("p"));
388+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pa"));
389+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pas"));
390+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pass"));
391391

392392
// Assert
393393
model.Password.ShouldBe("pass");
@@ -412,7 +412,7 @@ public async Task TextField_Value_Should_Reflect_In_Component_After_Update()
412412
var mudTextField = component.FindComponent<MudTextField<string>>();
413413

414414
// Act
415-
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Updated"));
415+
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Updated"));
416416

417417
// Re-render to ensure component state is synced
418418
component.Render();

FormCraft.ForMudBlazor.UnitTests/FormCraft.ForMudBlazor.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<TargetFramework>net10.0</TargetFramework>
99
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
1010
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
11-
<NoWarn>$(NoWarn);BL0005</NoWarn>
11+
<NoWarn>$(NoWarn);BL0005;MUD0012</NoWarn>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

FormCraft.ForMudBlazor/Features/FormContainer/FormCraftComponent.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ private void RenderFileUploadField(RenderTreeBuilder builder, IFieldConfiguratio
265265
builder.AddAttribute(2, "Accept",
266266
field.AdditionalAttributes.GetValueOrDefault("Accept", "*/*"));
267267
builder.AddAttribute(3, "Disabled", field.IsDisabled);
268-
builder.AddAttribute(4, "ActivatorContent", RenderFileUploadButton(field));
268+
builder.AddAttribute(4, "CustomContent", RenderFileUploadButton(field));
269269
builder.CloseComponent();
270270
}
271271

FormCraft.ForMudBlazor/Fields/FileUploadField/MudBlazorFileUploadFieldComponent.razor

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
Accept="@Accept"
1616
MaximumFileCount="1"
1717
Hidden="@false"
18-
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10"
19-
InputStyle="opacity:0"
18+
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10 opacity-0"
2019
ErrorText="@string.Empty"
2120
tabindex="-1"
2221
@ondrop="@ClearDragClass"
2322
@ondragenter="@SetDragClass"
2423
@ondragleave="@ClearDragClass"
2524
@ondragend="@ClearDragClass">
26-
<ActivatorContent>
25+
<CustomContent>
2726
<MudPaper
2827
Height="@GetHeight()"
2928
Outlined="true"
@@ -46,7 +45,7 @@
4645
}
4746
</MudStack>
4847
</MudPaper>
49-
</ActivatorContent>
48+
</CustomContent>
5049
</MudFileUpload>
5150

5251
<MudToolBar Gutters="@false" Class="relative d-flex justify-end gap-4 mt-2">

FormCraft.ForMudBlazor/Fields/FileUploadField/MudBlazorMultipleFileUploadComponent.razor

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
Accept="@Accept"
1414
MaximumFileCount="@MaxFiles"
1515
Hidden="@false"
16-
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10"
17-
InputStyle="opacity:0"
16+
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10 opacity-0"
1817
ErrorText="@string.Empty"
1918
tabindex="-1"
2019
@ondrop="@ClearDragClass"
2120
@ondragenter="@SetDragClass"
2221
@ondragleave="@ClearDragClass"
2322
@ondragend="@ClearDragClass">
24-
<ActivatorContent>
23+
<CustomContent>
2524
<MudPaper Height="@GetHeight()"
2625
Outlined="true"
2726
Class="@_dragClass">
@@ -61,7 +60,7 @@
6160
}
6261
</MudStack>
6362
</MudPaper>
64-
</ActivatorContent>
63+
</CustomContent>
6564
</MudFileUpload>
6665

6766
<MudToolBar Gutters="@false" Class="relative d-flex justify-end gap-4 mt-2">

FormCraft.ForMudBlazor/Fields/LovField/LovSelectionDialog.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected override void OnInitialized()
6767
/// <summary>
6868
/// Server data callback for MudDataGrid virtualization.
6969
/// </summary>
70-
private async Task<GridData<TItem>> ServerDataFunc(GridState<TItem> gridState)
70+
private async Task<GridData<TItem>> ServerDataFunc(GridState<TItem> gridState, CancellationToken cancellationToken)
7171
{
7272
if (DataProvider == null)
7373
{

0 commit comments

Comments
 (0)