Browse Source

Apply MudBlazor 9 runtime fixes and QA polish

- MudMenu: switch ActivatorContent to MenuContext.ToggleAsync pattern (v9 breaking)
- MudForm: rename Validate to ValidateAsync (v9.1 obsoletion)
- MudInput: replace AutoGrow with Sizing for textarea
- DataGrid: add white-space:nowrap on header to prevent CJK characters stacking vertically
- BlockUI: shrink loading spinner inside mud-dialog
- Search field: switch Label to Placeholder so the text shows next to the magnifier icon
pull/25393/head
maliming 5 months ago
parent
commit
3d391fb8aa
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 4
      framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs
  2. 2
      framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor
  3. 27
      framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css
  4. 4
      modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs
  5. 4
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor
  6. 4
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor
  7. 4
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor
  8. 4
      modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor
  9. 2
      modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor
  10. 2
      modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/PermissionManagementModal.razor
  11. 4
      modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs
  12. 4
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs
  13. 4
      modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs

4
framework/src/Volo.Abp.MudBlazorUI/AbpMudCrudPageBase.cs

@ -469,7 +469,7 @@ public abstract class AbpMudCrudPageBase<
var isValid = true;
if (CreateFormRef != null)
{
await CreateFormRef.Validate();
await CreateFormRef.ValidateAsync();
isValid = CreateFormRef.IsValid;
}
@ -527,7 +527,7 @@ public abstract class AbpMudCrudPageBase<
var isValid = true;
if (EditFormRef != null)
{
await EditFormRef.Validate();
await EditFormRef.ValidateAsync();
isValid = EditFormRef.IsValid;
}

2
framework/src/Volo.Abp.MudBlazorUI/Components/ObjectExtending/MudTextAreaExtensionProperty.razor

@ -9,7 +9,7 @@
Label="@PropertyInfo.GetLocalizedDisplayName(StringLocalizerFactory)"
@bind-Value="@Value"
Lines="3"
AutoGrow="true"
Sizing="InputSizing.Auto"
Disabled="IsReadonlyField"
Validation="@((Func<string?, string?>)Validate)"
Immediate="true" />

27
framework/src/Volo.Abp.MudBlazorUI/wwwroot/volo.abp.mudblazorui.css

@ -57,4 +57,29 @@
.abp-crud-page-header-actions {
display: flex;
gap: 8px;
}
}
/* BlockUI spinner inside mud-dialog: shrink to fit short modal bodies (e.g. file upload modal).
abp.css defines a 150px x 150px spinner via .abp-block-area-busy:before, which gets clipped
by mud-dialog's overflow when the modal content is short. */
.mud-dialog .abp-block-area.abp-block-area-busy:before {
width: 48px;
height: 48px;
top: calc(50% - 24px);
left: calc(50% - 24px);
}
.mud-dialog .abp-block-area.abp-block-area-busy:after {
font-size: 12px;
}
/* DataGrid header: prevent CJK characters from breaking one-per-line when column is narrow.
v9 column-header is a flex container with flex item width:100%; without nowrap, CJK
(no word boundary) collapses to min-content = single character width, stacking each
header character vertically. */
.mud-data-grid .mud-table-cell .column-header .sortable-column-header,
.mud-data-grid .mud-table-cell .column-header > span:not(.column-options),
.mud-data-grid .mud-table-head .mud-table-cell {
white-space: nowrap;
}

4
modules/account/src/Volo.Abp.Account.Blazor.MudBlazor/Pages/Account/AccountManage.razor.cs

@ -59,7 +59,7 @@ public partial class AccountManage
return;
}
await _changePasswordForm.Validate();
await _changePasswordForm.ValidateAsync();
if (!_changePasswordForm.IsValid)
{
return;
@ -100,7 +100,7 @@ public partial class AccountManage
return;
}
await _personalInfoForm.Validate();
await _personalInfoForm.ValidateAsync();
if (!_personalInfoForm.IsValid)
{

4
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor

@ -9,8 +9,8 @@
@if (_otherLanguages != null && _otherLanguages.Any())
{
<MudMenu>
<ActivatorContent>
<MudIconButton Icon="@Icons.Material.Outlined.Translate" Color="Color.Inherit" />
<ActivatorContent Context="menuCtx">
<MudIconButton OnClick="@(async () => await menuCtx.ToggleAsync())" Icon="@Icons.Material.Outlined.Translate" Color="Color.Inherit" />
</ActivatorContent>
<ChildContent>
<MudMenuItem Disabled="true">@_currentLanguage.DisplayName</MudMenuItem>

4
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor

@ -14,8 +14,8 @@
<AuthorizeView>
<Authorized>
<MudMenu>
<ActivatorContent Context="menuActivator">
<MudIconButton Icon="@Icons.Material.Outlined.AccountCircle" Color="Color.Inherit" />
<ActivatorContent Context="menuCtx">
<MudIconButton OnClick="@(async () => await menuCtx.ToggleAsync())" Icon="@Icons.Material.Outlined.AccountCircle" Color="Color.Inherit" />
</ActivatorContent>
<ChildContent>
<MudMenuItem>

4
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LanguageSwitch.razor

@ -11,8 +11,8 @@
@if (_otherLanguages != null && _otherLanguages.Any())
{
<MudMenu>
<ActivatorContent>
<MudIconButton Icon="@Icons.Material.Outlined.Translate" Color="Color.Inherit" />
<ActivatorContent Context="menuCtx">
<MudIconButton OnClick="@(async () => await menuCtx.ToggleAsync())" Icon="@Icons.Material.Outlined.Translate" Color="Color.Inherit" />
</ActivatorContent>
<ChildContent>
<MudMenuItem Disabled="true">@_currentLanguage.DisplayName</MudMenuItem>

4
modules/basic-theme/src/Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme/Themes/Basic/LoginDisplay.razor

@ -17,8 +17,8 @@
<AuthorizeView>
<Authorized>
<MudMenu>
<ActivatorContent Context="menuActivator">
<MudIconButton Icon="@Icons.Material.Outlined.AccountCircle" Color="Color.Inherit" />
<ActivatorContent Context="menuCtx">
<MudIconButton OnClick="@(async () => await menuCtx.ToggleAsync())" Icon="@Icons.Material.Outlined.AccountCircle" Color="Color.Inherit" />
</ActivatorContent>
<ChildContent>
<MudMenuItem>

2
modules/identity/src/Volo.Abp.Identity.Blazor.MudBlazor/Pages/Identity/UserManagement.razor

@ -23,7 +23,7 @@
<MudItem xs="12" sm="8"></MudItem>
<MudItem xs="12" sm="4">
<MudTextField Margin="Margin.Dense" @bind-Value="GetListInput.Filter"
Label="@L["Search"]"
Placeholder="@L["Search"]"
Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Search"
Immediate="true"

2
modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/PermissionManagementModal.razor

@ -12,7 +12,7 @@
<MudItem xs="12" sm="8">
<MudTextField Margin="Margin.Dense" Value="@_permissionGroupSearchText"
ValueChanged="@(async ([CanBeNull] string b) => await OnPermissionGroupSearchTextChangedAsync(b))"
Label="@L["Search"]"
Placeholder="@L["Search"]"
Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Search"
Immediate="true" />

4
modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor.cs

@ -231,7 +231,7 @@ public partial class ResourcePermissionManagementModal
return;
}
await _createFormRef.Validate();
await _createFormRef.ValidateAsync();
if (!_createFormRef.IsValid)
{
return;
@ -266,7 +266,7 @@ public partial class ResourcePermissionManagementModal
return;
}
await _editFormRef.Validate();
await _editFormRef.ValidateAsync();
if (!_editFormRef.IsValid)
{
return;

4
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor.MudBlazor/Pages/SettingManagement/EmailSettingGroup/EmailSettingGroupViewComponent.razor.cs

@ -68,7 +68,7 @@ public partial class EmailSettingGroupViewComponent
return;
}
await _emailFormRef.Validate();
await _emailFormRef.ValidateAsync();
if (!_emailFormRef.IsValid)
{
return;
@ -132,7 +132,7 @@ public partial class EmailSettingGroupViewComponent
return;
}
await _testEmailFormRef.Validate();
await _testEmailFormRef.ValidateAsync();
if (!_testEmailFormRef.IsValid)
{
return;

4
modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor.MudBlazor/Pages/TenantManagement/TenantManagement.razor.cs

@ -163,7 +163,7 @@ public partial class TenantManagement
return;
}
await _createFormRef.Validate();
await _createFormRef.ValidateAsync();
if (!_createFormRef.IsValid)
{
return;
@ -179,7 +179,7 @@ public partial class TenantManagement
return;
}
await _editFormRef.Validate();
await _editFormRef.ValidateAsync();
if (!_editFormRef.IsValid)
{
return;

Loading…
Cancel
Save