Skip to content

Commit

Permalink
Support .NET Core 3.0
Browse files Browse the repository at this point in the history
- Added support for .NET Core 3.0.
- Updated documentation to reflect changes in .Net Core 3.0
  • Loading branch information
DerekChasse committed Oct 17, 2019
1 parent eb3307b commit 19fae6e
Show file tree
Hide file tree
Showing 40 changed files with 280 additions and 5,702 deletions.
6 changes: 5 additions & 1 deletion Documentation/Flexor.DocGen/articles/changelogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@


## Version 1.0.0
* Initial Release
* Initial Release

## Version 1.1.0
* Updated to official Razor Class Library.
* Updated to .NET Core 3.0.
27 changes: 22 additions & 5 deletions Documentation/Flexor.DocGen/articles/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,46 @@
## Prerequisites
* Visual Studio 2019
* [https://visualstudio.microsoft.com/](https://visualstudio.microsoft.com/)
* Dot Net Core SDK 3.0.0 preview4
* Dot Net Core SDK 3.0.0
* [https://dotnet.microsoft.com/download/dotnet-core/3.0](https://dotnet.microsoft.com/download/dotnet-core/3.0])

### Startup.cs
Update `Startup.cs` to include the following.

```csharp
...
public void ConfigureServices(IServiceCollection services)
{
services.AddFlexor();
}
...
```

### _Host.cshtml
Update the `_Host.cshtml` to include the following.

```html
<html lang="en">
<head>

<link rel="stylesheet" href="_content/Flexor/flexor.css" />

</head>

<body>

<script src="_content/Flexor/flexor.js"></script>

</body>
<html>
```


### _Imports.razor
Get intellisense for Flexor components and classes by adding the following to the root `_Imports.razor` file.

```csharp
...
@using Flexor
...
```


### All Done!
Start using Flexor in your own Blazor components. Take a look at the [Demo site](http://flexor.azurewebsites.net/) for examples.
60 changes: 30 additions & 30 deletions Flexor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ VisualStudioVersion = 16.0.28822.285
MinimumVisualStudioVersion = 15.0.26124.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{5624BEBD-A674-400D-94B5-40C504408E17}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flexor", "Source\Flexor\Flexor.csproj", "{6AEFC81D-44B4-4EFC-9178-464870F94869}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0A417349-FB32-47F3-977F-8BD687D275FB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flexor.Demo", "Tests\Flexor.Demo\Flexor.Demo.csproj", "{ED4ECC9A-A1B5-4910-8A07-2459028611C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flexor.Tests", "Tests\Flexor.Tests\Flexor.Tests.csproj", "{2D6C0085-0294-440F-B239-E61EBB867F99}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{87954895-C5A7-401C-B81D-A9BC581D177B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flexor.DocGen", "Documentation\Flexor.DocGen\Flexor.DocGen.csproj", "{976AC9F8-363B-424B-8000-CB4AF43615E3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flexor", "Source\Flexor\Flexor.csproj", "{5580AADC-8AED-4977-A48B-1A3B6AD2784C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Flexor.Demo", "Tests\Flexor.Demo\Flexor.Demo.csproj", "{ACC11174-03BB-4342-83FB-6A9D10B6475E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -27,30 +27,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|x64.ActiveCfg = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|x64.Build.0 = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|x86.ActiveCfg = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Debug|x86.Build.0 = Debug|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|Any CPU.Build.0 = Release|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|x64.ActiveCfg = Release|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|x64.Build.0 = Release|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|x86.ActiveCfg = Release|Any CPU
{6AEFC81D-44B4-4EFC-9178-464870F94869}.Release|x86.Build.0 = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|x64.ActiveCfg = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|x64.Build.0 = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|x86.ActiveCfg = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Debug|x86.Build.0 = Debug|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|Any CPU.Build.0 = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|x64.ActiveCfg = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|x64.Build.0 = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|x86.ActiveCfg = Release|Any CPU
{ED4ECC9A-A1B5-4910-8A07-2459028611C0}.Release|x86.Build.0 = Release|Any CPU
{2D6C0085-0294-440F-B239-E61EBB867F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D6C0085-0294-440F-B239-E61EBB867F99}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D6C0085-0294-440F-B239-E61EBB867F99}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -75,15 +51,39 @@ Global
{976AC9F8-363B-424B-8000-CB4AF43615E3}.Release|x64.Build.0 = Release|Any CPU
{976AC9F8-363B-424B-8000-CB4AF43615E3}.Release|x86.ActiveCfg = Release|Any CPU
{976AC9F8-363B-424B-8000-CB4AF43615E3}.Release|x86.Build.0 = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|x64.ActiveCfg = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|x64.Build.0 = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|x86.ActiveCfg = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Debug|x86.Build.0 = Debug|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|Any CPU.Build.0 = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|x64.ActiveCfg = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|x64.Build.0 = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|x86.ActiveCfg = Release|Any CPU
{5580AADC-8AED-4977-A48B-1A3B6AD2784C}.Release|x86.Build.0 = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|x64.ActiveCfg = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|x64.Build.0 = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|x86.ActiveCfg = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Debug|x86.Build.0 = Debug|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|Any CPU.Build.0 = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|x64.ActiveCfg = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|x64.Build.0 = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|x86.ActiveCfg = Release|Any CPU
{ACC11174-03BB-4342-83FB-6A9D10B6475E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{6AEFC81D-44B4-4EFC-9178-464870F94869} = {5624BEBD-A674-400D-94B5-40C504408E17}
{ED4ECC9A-A1B5-4910-8A07-2459028611C0} = {0A417349-FB32-47F3-977F-8BD687D275FB}
{2D6C0085-0294-440F-B239-E61EBB867F99} = {0A417349-FB32-47F3-977F-8BD687D275FB}
{976AC9F8-363B-424B-8000-CB4AF43615E3} = {87954895-C5A7-401C-B81D-A9BC581D177B}
{5580AADC-8AED-4977-A48B-1A3B6AD2784C} = {5624BEBD-A674-400D-94B5-40C504408E17}
{ACC11174-03BB-4342-83FB-6A9D10B6475E} = {0A417349-FB32-47F3-977F-8BD687D275FB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3494079C-11D7-441E-AB1F-D0C2F4BB3034}
Expand Down
8 changes: 4 additions & 4 deletions Source/Flexor/Base/BaseFlexComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class BaseFlexComponent : ComponentBase
/// Default is 'always'.
/// </summary>
[Parameter]
protected IVisible Visible
public IVisible Visible
{
get => this.visible;
set
Expand All @@ -38,7 +38,7 @@ protected IVisible Visible
/// Custom CSS class to apply to the component.
/// </summary>
[Parameter]
protected string Class
public string Class
{
get => this.cssClass;
set
Expand All @@ -55,7 +55,7 @@ protected string Class
/// Custom CSS style to apply to the component.
/// </summary>
[Parameter]
protected string Style
public string Style
{
get => this.cssStyle;
set
Expand All @@ -72,7 +72,7 @@ protected string Style
/// The inner content of the component.
/// </summary>
[Parameter]
protected RenderFragment ChildContent
public RenderFragment ChildContent
{
get;
set;
Expand Down
8 changes: 4 additions & 4 deletions Source/Flexor/Base/BaseFlexItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class BaseFlexItem : BaseFlexComponent
/// Default is 'default'.
/// </summary>
[Parameter]
protected IOrder Order
public IOrder Order
{
get => this.order;
set
Expand All @@ -42,7 +42,7 @@ protected IOrder Order
/// Default is 'auto'.
/// </summary>
[Parameter]
protected IAlignSelf AlignSelf
public IAlignSelf AlignSelf
{
get => this.alignSelf;
set
Expand All @@ -61,7 +61,7 @@ protected IAlignSelf AlignSelf
/// Default is 'unspecified'.
/// </summary>
[Parameter]
protected ISize Size
public ISize Size
{
get => this.size;
set
Expand All @@ -80,7 +80,7 @@ protected ISize Size
/// Default is 'auto'.
/// </summary>
[Parameter]
protected IResizable Resizable
public IResizable Resizable
{
get => this.resizable;
set
Expand Down
34 changes: 17 additions & 17 deletions Source/Flexor/Base/BaseFlexLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public abstract class BaseFlexLine : BaseFlexComponent
/// Default is 'row'.
/// </summary>
[Parameter]
protected IDirection Direction
public IDirection Direction
{
get => this.direction;
set
Expand All @@ -41,7 +41,7 @@ protected IDirection Direction
/// Default is 'false'.
/// </summary>
[Parameter]
protected IWrap Wrap
public IWrap Wrap
{
get => this.wrap;
set
Expand All @@ -60,7 +60,7 @@ protected IWrap Wrap
/// Default is 'start'.
/// </summary>
[Parameter]
protected IJustifyContent JustifyContent
public IJustifyContent JustifyContent
{
get => this.justifyContent;
set
Expand All @@ -73,26 +73,13 @@ protected IJustifyContent JustifyContent
}
}

/// <summary>
/// Gets the flex-line's computed class.
/// </summary>
protected string ComputedClass =>
string.Join(
" ",
this.Direction.Class,
this.AlignItems.Class,
this.JustifyContent.Class,
this.Visible.Class,
this.Wrap.Class,
this.Class);

/// <summary>
/// Defines the alignment of items across the flex-line's cross axis.
///
/// Default is 'stretch'.
/// </summary>
[Parameter]
protected IAlignItems AlignItems
public IAlignItems AlignItems
{
get => this.alignItems;
set
Expand All @@ -104,5 +91,18 @@ protected IAlignItems AlignItems
}
}
}

/// <summary>
/// Gets the flex-line's computed class.
/// </summary>
protected string ComputedClass =>
string.Join(
" ",
this.Direction.Class,
this.AlignItems.Class,
this.JustifyContent.Class,
this.Visible.Class,
this.Wrap.Class,
this.Class);
}
}
32 changes: 7 additions & 25 deletions Source/Flexor/Flexor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
<RestoreAdditionalProjectSources>
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
</RestoreAdditionalProjectSources>
<LangVersion>7.3</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>


<Authors>Derek Chasse</Authors>
<Company />
<Description>Highly configurable Blazor flexbox components.</Description>
Expand All @@ -21,34 +14,23 @@
<PackageTags>Blazor Flexbox CSS</PackageTags>
<Copyright>2019 Derek Chasse</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>

<WarningsAsErrors>NU1605</WarningsAsErrors>
<NoWarn>1701;1702;SA1649;SA1402;SA1623</NoWarn>
<DocumentationFile></DocumentationFile>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
</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="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>
<None Remove="stylecop.json" />
</ItemGroup>

<ItemGroup>
<Content Remove="stylecop.json" />
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>

<ItemGroup>
<None Include="LICENSE.txt" Pack="true" PackagePath="LICENSE.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Browser" Version="3.0.0-preview4-19216-03" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Source/Flexor/FlexorJSInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public FlexorJSInterop(IJSRuntime runtime)
/// <inheritdoc/>
public Task AddDynamicStyle(string className, string classCSS)
{
return this.runtime.InvokeAsync<object>("flexor.addDynamicStyle", className, classCSS);
return this.runtime.InvokeAsync<object>("flexor.addDynamicStyle", className, classCSS).AsTask();
}
}
}
1 change: 1 addition & 0 deletions Source/Flexor/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@using Microsoft.AspNetCore.Components.Web
File renamed without changes.
File renamed without changes.
11 changes: 10 additions & 1 deletion Tests/Flexor.Demo/App.razor
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
<Router AppAssembly="typeof(Program).Assembly" />
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Loading

0 comments on commit 19fae6e

Please sign in to comment.