Skip to content

Commit

Permalink
Merge pull request #75 from Blazored/vnext
Browse files Browse the repository at this point in the history
Next Release 3.0.0
  • Loading branch information
chrissainty authored Dec 6, 2019
2 parents 6d05827 + ec912e4 commit caa3875
Show file tree
Hide file tree
Showing 24 changed files with 128 additions and 132 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Add the `<BlazoredModal />` tag into your applications *MainLayout.razor*.

### 4. Add reference to style sheet

Add the following line to the `head` tag of your `_Host.cshtml` (Blazor Server app).
Add the following line to the `head` tag of your `_Host.cshtml` (Blazor Server) or `index.html` (Blazor WebAssembly).

```html
<link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet" />
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
- task: DotNetCoreInstaller@0
displayName: 'Installing .NET Core SDK...'
inputs:
version: 3.0.100
version: 3.1.100

- task: NuGetToolInstaller@0
displayName: 'Installing Nuget Tools...'
Expand Down
8 changes: 4 additions & 4 deletions samples/BlazorSample/BlazorSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<RestoreAdditionalProjectSources>
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
Expand All @@ -11,9 +11,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview3.19555.2" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview3.19555.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.1.0-preview3.19555.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="3.1.0-preview4.19579.2" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.DevServer" Version="3.1.0-preview4.19579.2" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/BlazorSample/Pages/BackGroundCancel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { DisableBackgroundCancel = false };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}

void BackgroundCancelDisabled()
Expand All @@ -29,7 +29,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { DisableBackgroundCancel = true };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

4 changes: 2 additions & 2 deletions samples/BlazorSample/Pages/CustomStyle.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
parameters.Add("FormId", 11);

Modal.OnClose += ModalClosed;
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters);
Modal.Show<SignUpForm>("Sign Up Form", parameters);
}

void ShowModalCustomStyle()
Expand All @@ -37,7 +37,7 @@
var options = new ModalOptions() { Style = "blazored-prompt-modal" };

Modal.OnClose += ModalClosed;
Modal.Show("Delete record?", typeof(YesNoPrompt), options);
Modal.Show<YesNoPrompt>("Delete record?", options);
}


Expand Down
4 changes: 2 additions & 2 deletions samples/BlazorSample/Pages/HideCloseButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
parameters.Add("FormId", 11);

var options = new ModalOptions() { HideCloseButton = false };
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}

void CloseButtonHidden()
Expand All @@ -30,7 +30,7 @@
parameters.Add("FormId", 11);

var options = new ModalOptions() { HideCloseButton = true };
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

2 changes: 1 addition & 1 deletion samples/BlazorSample/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
parameters.Add("FormId", 11);

Modal.OnClose += ModalClosed;
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters);
Modal.Show<SignUpForm>("Sign Up Form", parameters);
}

void ModalClosed(ModalResult modalResult)
Expand Down
4 changes: 2 additions & 2 deletions samples/BlazorSample/Pages/Position.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
var parameters = new ModalParameters();
parameters.Add("FormId", 11);

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters);
Modal.Show<SignUpForm>("Sign Up Form", parameters);
}

void PositionCustom(string position)
Expand All @@ -33,7 +33,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { Position = position };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

14 changes: 0 additions & 14 deletions samples/BlazorSample/Shared/SurveyPrompt.razor

This file was deleted.

1 change: 1 addition & 0 deletions samples/BlazorSample/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<title>Blazored Modal</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions samples/ServerSideblazor/Pages/BackGroundCancel.razor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { DisableBackgroundCancel = false };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}

void BackgroundCancelDisabled()
Expand All @@ -29,7 +29,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { DisableBackgroundCancel = true };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

4 changes: 2 additions & 2 deletions samples/ServerSideblazor/Pages/CustomStyle.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
parameters.Add("FormId", 11);

Modal.OnClose += ModalClosed;
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters);
Modal.Show<SignUpForm>("Sign Up Form", parameters);
}

void ShowModalCustomStyle()
Expand All @@ -37,7 +37,7 @@
var options = new ModalOptions() { Style = "blazored-prompt-modal" };

Modal.OnClose += ModalClosed;
Modal.Show("Delete record?", typeof(YesNoPrompt), options);
Modal.Show<YesNoPrompt>("Delete record?", options);
}


Expand Down
4 changes: 2 additions & 2 deletions samples/ServerSideblazor/Pages/HideCloseButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
parameters.Add("FormId", 11);

var options = new ModalOptions() { HideCloseButton = false };
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}

void CloseButtonHidden()
Expand All @@ -30,7 +30,7 @@
parameters.Add("FormId", 11);

var options = new ModalOptions() { HideCloseButton = true };
Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

4 changes: 2 additions & 2 deletions samples/ServerSideblazor/Pages/Position.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
var parameters = new ModalParameters();
parameters.Add("FormId", 11);

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters);
Modal.Show<SignUpForm>("Sign Up Form", parameters);
}

void PositionCustom(string position)
Expand All @@ -33,7 +33,7 @@
parameters.Add("FormId", 11);
var options = new ModalOptions() { Position = position };

Modal.Show("Sign Up Form", typeof(SignUpForm), parameters, options);
Modal.Show<SignUpForm>("Sign Up Form", parameters, options);
}
}

2 changes: 2 additions & 0 deletions samples/ServerSideblazor/Pages/SignUpForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ else
@code {

[CascadingParameter] ModalParameters Parameters { get; set; }
[CascadingParameter] BlazoredModal BlazoredModal { get; set; }

bool ShowForm { get; set; } = true;
string FirstName { get; set; }
Expand All @@ -38,6 +39,7 @@ else
protected override void OnInitialized()
{
FormId = Parameters.Get<int>("FormId");
BlazoredModal.SetTitle("Sheep");
}

void SubmitForm()
Expand Down
4 changes: 3 additions & 1 deletion samples/ServerSideblazor/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app>@(await Html.RenderComponentAsync<App>(RenderMode.Server))</app>
<app>
<component type="typeof(App)" render-mode="ServerPrerendered" />
</app>

<script src="_framework/blazor.server.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion samples/ServerSideblazor/ServerSideblazor.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

Expand Down
15 changes: 4 additions & 11 deletions src/Blazored.Modal/Blazored.Modal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,13 @@
<PackageTags>Blazored Blazor Razor Components Modal Dialogue</PackageTags>
<Description>A JavaScript free modal library for Blazor and Razor Components applications.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.3.0</Version>
<Version>3.0.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0" />
</ItemGroup>

<ItemGroup>
<!-- .js/.css files will be referenced via <script>/<link> tags; other content files will just be included in the app's 'dist' directory without any tags referencing them -->
<EmbeddedResource Include="wwwroot\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="wwwroot\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="wwwroot\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
</ItemGroup>

</Project>
32 changes: 18 additions & 14 deletions src/Blazored.Modal/BlazoredModal.razor
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
@inherits BlazoredModalBase
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web

<div class="blazored-modal-container @ComponentPosition @(IsVisible ? "blazored-modal-active" : string.Empty)">
<div @onkeyup="@((args) =>Console.WriteLine(args.Key))" tabindex="1" class="blazored-modal-container @ComponentPosition @(IsVisible ? "blazored-modal-active" : string.Empty)">

<div class="blazored-modal-overlay" @onclick="HandleBackgroundClick"></div>

<div class="blazored-modal-wrapper">
<div class="@ComponentStyle">
<div class="blazored-modal-header">
<h3 class="blazored-modal-title">@Title</h3>
@if (!ComponentHideCloseButton)
{
<button type="button" class="blazored-modal-close" @onclick="@(() => ModalService.Cancel())">
<span>&times;</span>
</button>
}
</div>
@if (!ComponentHideHeader)
{
<div class="blazored-modal-header">
<h3 class="blazored-modal-title">@Title</h3>
@if (!ComponentHideCloseButton)
{
<button type="button" class="blazored-modal-close" @onclick="@(() => ModalService.Cancel())">
<span>&times;</span>
</button>
}
</div>
}
<div class="blazored-modal-content">
<CascadingValue Value="@Parameters">
@Content
<CascadingValue Value="this">
<CascadingValue Value="@Parameters">
@Content
</CascadingValue>
</CascadingValue>
</div>
</div>
Expand Down
Loading

0 comments on commit caa3875

Please sign in to comment.