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
28 changes: 14 additions & 14 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
</ItemGroup>
<!-- .NET 8.0 packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.24" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.24" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.24" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
</ItemGroup>
<!-- .NET 9.0 packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.3" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.13" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.13" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.13" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.13" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.13" />
</ItemGroup>
<!-- .NET 10.0 packages -->
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
Expand Down
16 changes: 10 additions & 6 deletions FormCraft.DemoBlazorApp/Components/Pages/TabbedForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
Elevation="2"
Rounded="true"
ApplyEffectsToContainer="true"
PanelClass="pa-4">
>
<MudTabPanel
Text="Personal Info"
PanelClass="pa-4"
Text="Personal Info"
Icon="@Icons.Material.Filled.Person"
BadgeData="@GetPersonalInfoBadge()"
BadgeColor="@GetTabBadgeColor(IsPersonalInfoComplete(), HasPersonalInfoData())"
Expand All @@ -46,7 +47,8 @@
</MudTabPanel>

<MudTabPanel
Text="Contact Details"
PanelClass="pa-4"
Text="Contact Details"
Icon="@Icons.Material.Filled.ContactMail"
BadgeData="@GetContactInfoBadge()"
BadgeColor="@GetTabBadgeColor(IsContactInfoComplete(), HasContactInfoData())"
Expand All @@ -67,7 +69,8 @@
</MudTabPanel>

<MudTabPanel
Text="Professional Info"
PanelClass="pa-4"
Text="Professional Info"
Icon="@Icons.Material.Filled.Work"
BadgeData="@GetProfessionalInfoBadge()"
BadgeColor="@GetTabBadgeColor(IsProfessionalInfoComplete(), HasProfessionalInfoData())"
Expand All @@ -84,8 +87,9 @@
ShowSubmitButton="false" />
</MudTabPanel>

<MudTabPanel
Text="Review & Submit"
<MudTabPanel
PanelClass="pa-4"
Text="Review & Submit"
Icon="@Icons.Material.Filled.CheckCircle"
BadgeData="@GetValidationBadge()"
BadgeColor="@GetBadgeColor()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
<DemoPageHeader Title="@Title" Icon="@Icon" Description="@Description" />

<MudPaper Elevation="2" Class="pa-0">
<MudTabs Elevation="0" Rounded="false" PanelClass="pa-6">
<MudTabPanel Text="Form Demo" Icon="@FormDemoIcon">
<MudTabs Elevation="0" Rounded="false">
<MudTabPanel PanelClass="pa-6" Text="Form Demo" Icon="@FormDemoIcon">
@FormDemoContent
</MudTabPanel>

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

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

Expand Down
10 changes: 5 additions & 5 deletions FormCraft.DemoBlazorApp/Components/Shared/FeatureShowcase.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

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

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

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

<MudTabPanel Text="Layouts" Icon="@Icons.Material.Filled.GridView">
<MudTabPanel PanelClass="pa-6" Text="Layouts" Icon="@Icons.Material.Filled.GridView">
<MudGrid>
<MudItem xs="12" md="6">
<MudText Typo="Typo.h6" Class="mb-3">Flexible Layouts</MudText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public async Task TextField_Should_Update_Model_On_Input()
mudTextField.ShouldNotBeNull();

// Act
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("John Doe"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("John Doe"));

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

// Act - Simulate typing character by character
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("H"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("He"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hel"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hell"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Hello"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("H"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("He"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hel"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hell"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Hello"));

// Assert
model.Name.ShouldBe("Hello");
Expand All @@ -359,7 +359,7 @@ public async Task PasswordField_Should_Update_Model_On_Input()
mudTextField.ShouldNotBeNull();

// Act
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("secret123"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("secret123"));

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

// Act - Simulate typing character by character
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("p"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pa"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pas"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("pass"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("p"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pa"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pas"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("pass"));

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

// Act
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("Updated"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("Updated"));

// Re-render to ensure component state is synced
component.Render();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<TargetFramework>net10.0</TargetFramework>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<NoWarn>$(NoWarn);BL0005</NoWarn>
<NoWarn>$(NoWarn);BL0005;MUD0012</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private void RenderFileUploadField(RenderTreeBuilder builder, IFieldConfiguratio
builder.AddAttribute(2, "Accept",
field.AdditionalAttributes.GetValueOrDefault("Accept", "*/*"));
builder.AddAttribute(3, "Disabled", field.IsDisabled);
builder.AddAttribute(4, "ActivatorContent", RenderFileUploadButton(field));
builder.AddAttribute(4, "CustomContent", RenderFileUploadButton(field));
builder.CloseComponent();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
Accept="@Accept"
MaximumFileCount="1"
Hidden="@false"
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10"
InputStyle="opacity:0"
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10 opacity-0"
ErrorText="@string.Empty"
tabindex="-1"
@ondrop="@ClearDragClass"
@ondragenter="@SetDragClass"
@ondragleave="@ClearDragClass"
@ondragend="@ClearDragClass">
<ActivatorContent>
<CustomContent>
<MudPaper
Height="@GetHeight()"
Outlined="true"
Expand All @@ -46,7 +45,7 @@
}
</MudStack>
</MudPaper>
</ActivatorContent>
</CustomContent>
</MudFileUpload>

<MudToolBar Gutters="@false" Class="relative d-flex justify-end gap-4 mt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
Accept="@Accept"
MaximumFileCount="@MaxFiles"
Hidden="@false"
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10"
InputStyle="opacity:0"
InputClass="absolute mud-width-full mud-height-full overflow-hidden z-10 opacity-0"
ErrorText="@string.Empty"
tabindex="-1"
@ondrop="@ClearDragClass"
@ondragenter="@SetDragClass"
@ondragleave="@ClearDragClass"
@ondragend="@ClearDragClass">
<ActivatorContent>
<CustomContent>
<MudPaper Height="@GetHeight()"
Outlined="true"
Class="@_dragClass">
Expand Down Expand Up @@ -61,7 +60,7 @@
}
</MudStack>
</MudPaper>
</ActivatorContent>
</CustomContent>
</MudFileUpload>

<MudToolBar Gutters="@false" Class="relative d-flex justify-end gap-4 mt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected override void OnInitialized()
/// <summary>
/// Server data callback for MudDataGrid virtualization.
/// </summary>
private async Task<GridData<TItem>> ServerDataFunc(GridState<TItem> gridState)
private async Task<GridData<TItem>> ServerDataFunc(GridState<TItem> gridState, CancellationToken cancellationToken)
{
if (DataProvider == null)
{
Expand Down
6 changes: 3 additions & 3 deletions FormCraft.UnitTests/ForMudBlazor/PasswordFieldTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public async Task Password_Field_Should_Update_Model_When_User_Types()

// Act - Simulate user typing in the password field by invoking ValueChanged
mudTextField.Instance.Value.ShouldBe(""); // Initially empty
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("MySecretPassword123"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("MySecretPassword123"));

// Assert - Model should be updated with the new value
model.Password.ShouldBe("MySecretPassword123");
Expand All @@ -215,7 +215,7 @@ public async Task Email_Field_Should_Update_Model_When_User_Types()

// Act - Simulate user typing in the email field
mudTextField.Instance.Value.ShouldBe(""); // Initially empty
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("user@example.com"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("user@example.com"));

// Assert - Model should be updated with the new value
model.Email.ShouldBe("user@example.com");
Expand All @@ -241,7 +241,7 @@ public async Task Username_Field_Should_Update_Model_When_User_Types()

// Act - Simulate user typing
mudTextField.Instance.Value.ShouldBe(""); // Initially empty
await mudTextField.InvokeAsync(() => mudTextField.Instance.SetText("john_doe"));
await mudTextField.InvokeAsync(() => mudTextField.Instance.ValueChanged.InvokeAsync("john_doe"));

// Assert - Model should be updated
model.Username.ShouldBe("john_doe");
Expand Down
2 changes: 1 addition & 1 deletion FormCraft.UnitTests/FormCraft.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<TargetFramework>net10.0</TargetFramework>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<NoWarn>$(NoWarn);BL0005</NoWarn>
<NoWarn>$(NoWarn);BL0005;MUD0012</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading