Skip to content

Commit

Permalink
Updated to work with Blazor 3.0.0-preview4 (BlazorExtensions#5)
Browse files Browse the repository at this point in the history
* (WIP) Update types and references for Blazor 3.0.0-preview4

* Rename remaining .cshtml to .razor

* Updated to work with Blazor 3.0.0-preview4

* Updated to follow blazorlib template:  Sdk to Microsoft.NET.Sdk.Razor, updated package references, changed layout to follow convention putting js/css in content folder.  Also removed global.json file.

* Removed myget.org package sources

* Restore global.json
  • Loading branch information
DanielCarmingham authored and galvesribeiro committed Apr 30, 2019
1 parent e0d1e11 commit 45fcd98
Show file tree
Hide file tree
Showing 59 changed files with 133 additions and 160 deletions.
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "2.1.300-preview2-008533"
}
"sdk": {
"version": "3.0.100-preview4-011223"
}
}
19 changes: 9 additions & 10 deletions src/BlazorMaterial.Base/BlazorMaterial.Base.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<LangVersion>latest</LangVersion>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>BlazorMaterial</RootNamespace>
</PropertyGroup>

<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="**\*.js" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="**\*.css" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<!--<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />-->
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
</ItemGroup>

</Project>
</Project>
8 changes: 6 additions & 2 deletions src/BlazorMaterial.Base/BlazorMaterialComponent.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;

namespace BlazorMaterial
{
public class BlazorMaterialComponent : BlazorComponent
public class BlazorMaterialComponent : ComponentBase
{
[Parameter]
protected string Class { get; set; }

[Inject]
protected IJSRuntime JSRuntime { get; set; }
}
}
File renamed without changes.
File renamed without changes.
19 changes: 9 additions & 10 deletions src/BlazorMaterial.Button/BlazorMaterial.Button.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<LangVersion>latest</LangVersion>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>BlazorMaterial</RootNamespace>
</PropertyGroup>

<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="**\*.js" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="**\*.css" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<!--<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />-->
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorMaterial.Ripple\BlazorMaterial.Ripple.csproj" />
</ItemGroup>

</Project>
</Project>
File renamed without changes.
17 changes: 8 additions & 9 deletions src/BlazorMaterial.Button/MDCButtonComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Blazor;
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
Expand All @@ -16,17 +15,17 @@ public class MDCButtonComponent : BlazorMaterialComponent
[Parameter]
protected MDCButtonStyle Style { get; set; }
[Parameter]
protected Action<UIMouseEventArgs> OnClick { get; set; }
protected EventCallback<UIMouseEventArgs> OnClick { get; set; }
[Parameter]
protected Action<UIMouseEventArgs> OnMouseUp { get; set; }
protected EventCallback<UIMouseEventArgs> OnMouseUp { get; set; }
[Parameter]
protected Action<UIMouseEventArgs> OnMouseDown { get; set; }
protected EventCallback<UIMouseEventArgs> OnMouseDown { get; set; }
[Parameter]
protected Action<UIKeyboardEventArgs> OnKeyPress { get; set; }
protected EventCallback<UIKeyboardEventArgs> OnKeyPress { get; set; }
[Parameter]
protected Action<UIKeyboardEventArgs> OnKeyDown { get; set; }
protected EventCallback<UIKeyboardEventArgs> OnKeyDown { get; set; }
[Parameter]
protected Action<UIKeyboardEventArgs> OnKeyUp { get; set; }
protected EventCallback<UIKeyboardEventArgs> OnKeyUp { get; set; }
[Parameter]
protected string Icon { get; set; }
[Parameter]
Expand Down Expand Up @@ -61,7 +60,7 @@ protected override async Task OnAfterRenderAsync()
if (this._isFirstRender)
{
this._isFirstRender = false;
await JSRuntime.Current.InvokeAsync<bool>(ADD_RIPPLE_FUNCTION, this._MDCButton);
await this.JSRuntime.InvokeAsync<bool>(ADD_RIPPLE_FUNCTION, this._MDCButton);
}
}
}
Expand Down
File renamed without changes.
19 changes: 9 additions & 10 deletions src/BlazorMaterial.Drawer/BlazorMaterial.Drawer.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<LangVersion>latest</LangVersion>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>BlazorMaterial</RootNamespace>
</PropertyGroup>

<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="**\*.js" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="**\*.css" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<!--<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />-->
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorMaterial.Base\BlazorMaterial.Base.csproj" />
</ItemGroup>

</Project>
</Project>
File renamed without changes.
8 changes: 3 additions & 5 deletions src/BlazorMaterial.Drawer/MDCDrawerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Microsoft.AspNetCore.Blazor;
using Microsoft.JSInterop;
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;

namespace BlazorMaterial
Expand Down Expand Up @@ -44,11 +42,11 @@ protected override async Task OnAfterRenderAsync()
{
if (this.Type == MDCDrawerType.Persistent)
{
await JSRuntime.Current.InvokeAsync<bool>(ATTACH_PERSIST_DRAWER_FUNCTION, this._MDCDrawer);
await this.JSRuntime.InvokeAsync<bool>(ATTACH_PERSIST_DRAWER_FUNCTION, this._MDCDrawer);
}
else
{
await JSRuntime.Current.InvokeAsync<bool>(ATTACH_TEMPORARY_DRAWER_FUNCTION, this._MDCDrawer);
await this.JSRuntime.InvokeAsync<bool>(ATTACH_TEMPORARY_DRAWER_FUNCTION, this._MDCDrawer);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor
@using Microsoft.AspNetCore.Blazor.Components
@using Microsoft.AspNetCore.Components

@inherits BlazorMaterialComponent

Expand Down
2 changes: 1 addition & 1 deletion src/BlazorMaterial.Drawer/MDCDrawerItemComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;

namespace BlazorMaterial
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor
@using Microsoft.AspNetCore.Blazor.Components
@using Microsoft.AspNetCore.Components
@inherits BlazorMaterialComponent

<nav class=@( $"mdc-list {Class}" )>
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/BlazorMaterial.Drawer/mdc.drawer.js.map

This file was deleted.

19 changes: 9 additions & 10 deletions src/BlazorMaterial.Lists/BlazorMaterial.Lists.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<LangVersion>latest</LangVersion>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>BlazorMaterial</RootNamespace>
</PropertyGroup>

<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="**\*.js" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="**\*.css" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<!--<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />-->
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorMaterial.Base\BlazorMaterial.Base.csproj" />
</ItemGroup>

</Project>
</Project>
File renamed without changes.
3 changes: 1 addition & 2 deletions src/BlazorMaterial.Lists/MDCListComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Blazor;
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;

namespace BlazorMaterial
{
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorMaterial.Lists/MDCListDividerComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Blazor.Components;
using Microsoft.AspNetCore.Components;

namespace BlazorMaterial
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor;
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

<div class=@( $"mdc-list-group {Class}" )>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor;
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

<h3 class=@( $"mdc-list-group__subheader {Class}" )>@ChildContent</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor;
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

<li class=@( $"mdc-list-item {Class} {_dividerClass}" ) onclick="@OnClick">
Expand All @@ -8,7 +7,7 @@

@functions{
[Parameter]
private Action<UIMouseEventArgs> OnClick { get; set; }
private EventCallback<UIMouseEventArgs> OnClick { get; set; }
[Parameter]
private bool Divider { get; set; }
[Parameter]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

<span class=@( $"mdc-list-item__text {Class}" )>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

<span class=@( $"mdc-list-item__graphic {Class}" )>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@using Microsoft.AspNetCore.Blazor;
@using Microsoft.AspNetCore.Blazor.Components;
@using Microsoft.AspNetCore.Components;
@inherits BlazorMaterialComponent

@switch (Type)
Expand Down Expand Up @@ -36,7 +35,7 @@
[Parameter]
private string HRef { get; set; }
[Parameter]
private Action<UIMouseEventArgs> OnClick { get; set; }
private EventCallback<UIMouseEventArgs> OnClick { get; set; }
[Parameter]
private RenderFragment ChildContent { get; set; }
}
File renamed without changes.
19 changes: 9 additions & 10 deletions src/BlazorMaterial.Ripple/BlazorMaterial.Ripple.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>library</OutputType>
<IsPackable>true</IsPackable>
<BlazorLinkOnBuild>false</BlazorLinkOnBuild>
<LangVersion>latest</LangVersion>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RootNamespace>BlazorMaterial</RootNamespace>
</PropertyGroup>

<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="**\*.js" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="**\*.css" Exclude="bin\**\*.*;obj\**\*.*" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<!--<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />-->
<EmbeddedResource Include="content\**\*.js" LogicalName="blazor:js:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**\*.css" LogicalName="blazor:css:%(RecursiveDir)%(Filename)%(Extension)" />
<EmbeddedResource Include="content\**" Exclude="**\*.js;**\*.css" LogicalName="blazor:file:%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorMaterial.Base\BlazorMaterial.Base.csproj" />
</ItemGroup>

</Project>
</Project>
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 45fcd98

Please sign in to comment.