Skip to content

Commit

Permalink
Merge pull request #4 from stavroskasidis/release/1.0
Browse files Browse the repository at this point in the history
Release/1.0
  • Loading branch information
stavroskasidis authored Oct 17, 2020
2 parents c89d9b1 + b2e86b3 commit 3c8aa27
Show file tree
Hide file tree
Showing 101 changed files with 3,128 additions and 997 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.min.css
*.min.js


/Artifacts/
/Artifacts/
/DemoApp/BlazorDialog.DemoApp/Server/ClientSources/
/BlazorDialog/wwwroot/styles.min.css
78 changes: 48 additions & 30 deletions BlazorDialog.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DA8334A6
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestApps", "TestApps", "{99A35E68-10F9-4BDB-AB82-DEEEBAFA5581}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor", "Blazor", "{7E1980A3-6F6D-4073-8AA8-88860C0F8B57}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Wasm", "Wasm", "{7E1980A3-6F6D-4073-8AA8-88860C0F8B57}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.BlazorTestApp.Client", "TestApps\Blazor\BlazorDialog.BlazorTestApp.Client\BlazorDialog.BlazorTestApp.Client.csproj", "{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.TestAppsCommon", "TestApps\BlazorDialog.TestAppsCommon\BlazorDialog.TestAppsCommon.csproj", "{9BFF377B-EA6D-4161-B9FE-4463764E79E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.BlazorTestApp.Server", "TestApps\Blazor\BlazorDialog.BlazorTestApp.Server\BlazorDialog.BlazorTestApp.Server.csproj", "{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Server", "Server", "{52E5CEEB-C2A8-42AD-868E-7E186FBBD4A7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.TestAppsCommon", "TestApps\BlazorDialog.TestAppsCommon\BlazorDialog.TestAppsCommon.csproj", "{9BFF377B-EA6D-4161-B9FE-4463764E79E1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.BlazorTestApp.Server", "TestApps\Wasm\BlazorDialog.BlazorTestApp.Server\BlazorDialog.BlazorTestApp.Server.csproj", "{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorDialog.BlazorTestApp.Client", "TestApps\Wasm\BlazorDialog.BlazorTestApp.Client\BlazorDialog.BlazorTestApp.Client.csproj", "{90954557-FBC5-4942-AB51-828A4D00A3F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorDialog.BlazorServerTestApp", "TestApps\Server\BlazorDialog.BlazorServerTestApp\BlazorDialog.BlazorServerTestApp.csproj", "{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -48,30 +52,6 @@ Global
{D6A05A5B-2A9D-43A8-B949-272147D62E52}.Release|x64.Build.0 = Release|Any CPU
{D6A05A5B-2A9D-43A8-B949-272147D62E52}.Release|x86.ActiveCfg = Release|Any CPU
{D6A05A5B-2A9D-43A8-B949-272147D62E52}.Release|x86.Build.0 = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|x64.ActiveCfg = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|x64.Build.0 = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|x86.ActiveCfg = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Debug|x86.Build.0 = Debug|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|Any CPU.Build.0 = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|x64.ActiveCfg = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|x64.Build.0 = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|x86.ActiveCfg = Release|Any CPU
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721}.Release|x86.Build.0 = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|x64.ActiveCfg = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|x64.Build.0 = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|x86.ActiveCfg = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Debug|x86.Build.0 = Debug|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|Any CPU.Build.0 = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|x64.ActiveCfg = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|x64.Build.0 = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|x86.ActiveCfg = Release|Any CPU
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8}.Release|x86.Build.0 = Release|Any CPU
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -84,15 +64,53 @@ Global
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Release|x64.Build.0 = Release|Any CPU
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Release|x86.ActiveCfg = Release|Any CPU
{9BFF377B-EA6D-4161-B9FE-4463764E79E1}.Release|x86.Build.0 = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|x64.ActiveCfg = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|x64.Build.0 = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|x86.ActiveCfg = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Debug|x86.Build.0 = Debug|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|Any CPU.Build.0 = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|x64.ActiveCfg = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|x64.Build.0 = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|x86.ActiveCfg = Release|Any CPU
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4}.Release|x86.Build.0 = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|x64.ActiveCfg = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|x64.Build.0 = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|x86.ActiveCfg = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Debug|x86.Build.0 = Debug|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|Any CPU.Build.0 = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|x64.ActiveCfg = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|x64.Build.0 = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|x86.ActiveCfg = Release|Any CPU
{90954557-FBC5-4942-AB51-828A4D00A3F1}.Release|x86.Build.0 = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|x64.ActiveCfg = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|x64.Build.0 = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|x86.ActiveCfg = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Debug|x86.Build.0 = Debug|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|Any CPU.Build.0 = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|x64.ActiveCfg = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|x64.Build.0 = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|x86.ActiveCfg = Release|Any CPU
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7E1980A3-6F6D-4073-8AA8-88860C0F8B57} = {99A35E68-10F9-4BDB-AB82-DEEEBAFA5581}
{1A4C24B7-8B7D-4C3A-8D1D-71CC23669721} = {7E1980A3-6F6D-4073-8AA8-88860C0F8B57}
{D5494F0E-1D2B-4FA3-BAC4-96A2695DC8A8} = {7E1980A3-6F6D-4073-8AA8-88860C0F8B57}
{9BFF377B-EA6D-4161-B9FE-4463764E79E1} = {99A35E68-10F9-4BDB-AB82-DEEEBAFA5581}
{52E5CEEB-C2A8-42AD-868E-7E186FBBD4A7} = {99A35E68-10F9-4BDB-AB82-DEEEBAFA5581}
{5C6C9DA6-B2E6-440A-9C53-3CF031C5B6D4} = {7E1980A3-6F6D-4073-8AA8-88860C0F8B57}
{90954557-FBC5-4942-AB51-828A4D00A3F1} = {7E1980A3-6F6D-4073-8AA8-88860C0F8B57}
{A8D3328C-CBCC-4EDE-88BB-F77FD113ACCC} = {52E5CEEB-C2A8-42AD-868E-7E186FBBD4A7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F6D16D50-B899-4FB4-BB9C-1ECDD5D38570}
Expand Down
9 changes: 4 additions & 5 deletions BlazorDialog/BlazorDialog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<IsPackable>true</IsPackable>
<RazorLangVersion>3.0</RazorLangVersion>


<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
Expand All @@ -17,7 +16,7 @@
<Copyright />
<PackageTags>blazor blazor-component blazor-dialog dialog modal blazor-modal blazordialog blazormodaldialog blazormodal razor razor-components razorcomponents</PackageTags>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Version>0.3.0</Version>
<Version>1.0.0</Version>
<Version Condition=" '$(VersionSuffix)' != '' ">$(Version)-$(VersionSuffix)</Version>
<Product>BlazorDialog</Product>
</PropertyGroup>
Expand All @@ -36,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
</ItemGroup>
</Project>
24 changes: 6 additions & 18 deletions BlazorDialog/BlazorDialogService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,21 @@ namespace BlazorDialog
{
public class BlazorDialogService : IBlazorDialogService
{
private Dictionary<string, Dialog> registeredDialogs = new Dictionary<string, Dialog>();
private readonly IBlazorDialogStore _blazorDialogStore;

public void Register(Dialog blazorDialog)
public BlazorDialogService(IBlazorDialogStore blazorDialogStore)
{
if(blazorDialog?.Id == null)
{
throw new ArgumentException("BlazorDialog Id is null", nameof(blazorDialog));
}
registeredDialogs[blazorDialog.Id] = blazorDialog;
}

public void Unregister(Dialog blazorDialog)
{
if (blazorDialog.Id != null && registeredDialogs.ContainsKey(blazorDialog.Id))
{
registeredDialogs.Remove(blazorDialog.Id);
}
_blazorDialogStore = blazorDialogStore;
}

public async Task HideDialog(string dialogId)
{
await registeredDialogs[dialogId].Hide();
await _blazorDialogStore.GetById(dialogId).Hide();
}

public async Task HideDialog(string dialogId, object result)
{
await registeredDialogs[dialogId].Hide(result);
await _blazorDialogStore.GetById(dialogId).Hide(result);
}

public async Task ShowDialog(string dialogId)
Expand All @@ -53,7 +41,7 @@ public async Task ShowDialog(string dialogId, object input)

public async Task<TResult> ShowDialog<TResult>(string dialogId, object input)
{
return await registeredDialogs[dialogId].Show<TResult>(input);
return await _blazorDialogStore.GetById(dialogId).Show<TResult>(input);
}
}
}
38 changes: 38 additions & 0 deletions BlazorDialog/BlazorDialogStore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace BlazorDialog
{
internal class BlazorDialogStore : IBlazorDialogStore
{
private Dictionary<string, Dialog> registeredDialogs = new Dictionary<string, Dialog>();

public Dialog GetById(string id)
{
if (registeredDialogs.ContainsKey(id))
{
return registeredDialogs[id];
}

throw new ArgumentException($"No dialog found for id '{id}'", nameof(id));
}

public void Register(Dialog blazorDialog)
{
if (blazorDialog?.Id == null)
{
throw new ArgumentException("BlazorDialog Id is null", nameof(blazorDialog));
}
registeredDialogs[blazorDialog.Id] = blazorDialog;
}

public void Unregister(Dialog blazorDialog)
{
if (blazorDialog.Id != null && registeredDialogs.ContainsKey(blazorDialog.Id))
{
registeredDialogs.Remove(blazorDialog.Id);
}
}
}
}
Loading

0 comments on commit 3c8aa27

Please sign in to comment.