-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for EasyMicroservices.UI.BlazorComponents
- Loading branch information
1 parent
838b01d
commit f4b23fc
Showing
11 changed files
with
155 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/App.razor
This file was deleted.
Oops, something went wrong.
101 changes: 101 additions & 0 deletions
101
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/BaseDialog.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
@using EasyMicroservices.UI.Cores | ||
@using MudBlazor | ||
@inject BaseViewModel viewModel; | ||
@* Class="@DialogClass" *@ | ||
<MudRTLProvider RightToLeft="BaseViewModel.IsRightToLeft"> | ||
<MudDialog @ref="dialog" @bind-IsVisible="IsShowDialog"> | ||
<TitleContent> | ||
@TitleContent | ||
</TitleContent> | ||
<DialogContent> | ||
@DialogContent | ||
</DialogContent> | ||
<DialogActions> | ||
@DialogActions | ||
</DialogActions> | ||
</MudDialog> | ||
</MudRTLProvider> | ||
|
||
<style> | ||
.dialog-background-class { | ||
backdrop-filter: blur(10px); | ||
} | ||
</style> | ||
|
||
@code { | ||
public BaseViewModel ViewModel | ||
{ | ||
get | ||
{ | ||
return viewModel; | ||
} | ||
} | ||
bool IsShowDialog; | ||
MudDialog dialog; | ||
|
||
[Parameter] | ||
[Category("Behavior")] | ||
public RenderFragment TitleContent { get; set; } | ||
|
||
[Parameter] | ||
[Category("Behavior")] | ||
public RenderFragment DialogContent { get; set; } | ||
|
||
[Parameter] | ||
[Category("Behavior")] | ||
public RenderFragment DialogActions { get; set; } | ||
|
||
DialogOptions DialogOptions = new DialogOptions() | ||
{ | ||
ClassBackground = "dialog-background-class", | ||
CloseOnEscapeKey = true, | ||
MaxWidth = MaxWidth.ExtraSmall | ||
}; | ||
|
||
Func<Task> _onAfterLoadAsync; | ||
bool IsNeedToShow = false; | ||
protected override async Task OnAfterRenderAsync(bool firstRender) | ||
{ | ||
await base.OnAfterRenderAsync(firstRender); | ||
if (IsNeedToShow) | ||
{ | ||
_ = Task.Run(async () => | ||
{ | ||
await Task.Delay(500); | ||
await _onAfterLoadAsync?.Invoke(); | ||
}); | ||
IsNeedToShow = false; | ||
} | ||
} | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
await base.OnInitializedAsync(); | ||
} | ||
|
||
public void ShowDialog(Action onAfterLoad = default) | ||
{ | ||
if (onAfterLoad != null) | ||
{ | ||
_onAfterLoadAsync = () => | ||
{ | ||
onAfterLoad(); | ||
return Task.CompletedTask; | ||
}; | ||
} | ||
IsNeedToShow = true; | ||
IsShowDialog = true; | ||
} | ||
|
||
public void ShowDialog(Func<Task> onAfterLoad) | ||
{ | ||
_onAfterLoadAsync = onAfterLoad; | ||
IsNeedToShow = true; | ||
IsShowDialog = true; | ||
} | ||
|
||
public void CloseDialog() | ||
{ | ||
IsShowDialog = false; | ||
} | ||
} |
33 changes: 28 additions & 5 deletions
33
...onents/EasyMicroservices.UI.BlazorComponents/EasyMicroservices.UI.BlazorComponents.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> | ||
<Authors>EasyMicroservices</Authors> | ||
<IsPackable>true</IsPackable> | ||
<Version>0.0.0.1</Version> | ||
<Description>Core UI compoents.</Description> | ||
<Copyright>[email protected]</Copyright> | ||
<PackageTags>component,microcomponent,ui,core</PackageTags> | ||
<PackageProjectUrl>https://github.com/EasyMicroservices/UICores</PackageProjectUrl> | ||
<LangVersion>latest</LangVersion> | ||
<DocumentationFile>.\bin\$(Configuration)\$(TargetFramework)\EasyMicroservices.UI.BlazorComponents.xml</DocumentationFile> | ||
<IsPackable>true</IsPackable> | ||
<OutputType>Library</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.13" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.13" PrivateAssets="all" /> | ||
<PackageReference Include="MudBlazor" Version="6.11.2" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'"> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.14" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.14" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'"> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.25" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.25" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Cores\EasyMicroservices.UI.Cores.Mvvm\EasyMicroservices.UI.Cores.Mvvm.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
5 changes: 0 additions & 5 deletions
5
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/MainLayout.razor
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/Pages/Index.razor
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/Program.cs
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...arp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/Properties/launchSettings.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/_Imports.razor
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/wwwroot/css/app.css
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/CSharp/BlazorComponents/EasyMicroservices.UI.BlazorComponents/wwwroot/index.html
This file was deleted.
Oops, something went wrong.