Skip to content

Commit

Permalink
Merge branch 'main' into PureInput-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ModernMAK authored Oct 15, 2024
2 parents de91340 + 7974549 commit 01b70ac
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 40 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project>
<PropertyGroup>
<DefaultNetCoreTargetFramework>net9.0</DefaultNetCoreTargetFramework>
<AccelerateBuildsInVisualStudio>false</AccelerateBuildsInVisualStudio>
</PropertyGroup>
</Project>
62 changes: 35 additions & 27 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,23 @@
<PackageVersion Include="IdentityModel" Version="7.0.0" />
<PackageVersion Include="JsonSubTypes" Version="2.0.1" />
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="8.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.QuickGrid" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.QuickGrid.EntityFrameworkAdapter" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.Build" Version="17.9.5" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
Expand All @@ -54,24 +60,26 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.Extensions.Compliance.Redaction" Version="8.4.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Compliance.Redaction" Version="9.0.0-preview.9.24507.7" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Localization" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="8.4.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Localization" Version="9.0.0-rc.2.24474.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="9.0.0-preview.9.24507.7" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.17.5" />
<PackageVersion Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.3.8" />
<PackageVersion Include="Microsoft.Kiota.Serialization.Json" Version="1.2.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Pure.Blazor.Components.Dialogs;
using Pure.Blazor.Components.Feedback;
using Pure.Blazor.Components.Primitives;
using Theme = Pure.Blazor.Components.Primitives.Theme;

namespace Pure.Blazor.Components.AspNetCore;

Expand All @@ -28,6 +29,8 @@ public static IHostApplicationBuilder AddPureBlazorComponents(this IHostApplicat
return source;
});

builder.Services.TryAddCascadingValue(_ => Theme.Auto);

return builder;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>PureBlazor.Components.AspNetCore</Title>
<Version>0.32</Version>
<Version>0.40-rc1</Version>
<PackageId>PureBlazor.Components.AspNetCore</PackageId>
<Description>ASP.NET Core integration package for PureBlazor UI components.</Description>
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>PureBlazor Icons</Title>
<Version>0.32.8</Version>
<Version>0.40-rc1</Version>
<PackageId>PureBlazor.Components.Icons</PackageId>
<Description>Blazor Icons</Description>
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>PureBlazor Primitives</Title>
<Version>0.32</Version>
<Version>0.40-rc1</Version>
<PackageId>PureBlazor.Components.Primitives</PackageId>
<Description>PureBlazor.Components.Primitives</Description>
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl>
Expand Down
10 changes: 9 additions & 1 deletion src/Pure.Blazor.Components.Primitives/PureComponent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Logging;

namespace Pure.Blazor.Components.Primitives;

Expand All @@ -10,6 +11,8 @@ protected override void OnParametersSet()
BuildCss();
}

[Inject] public required ILogger<PureComponent> Logger { get; set; }

/// <summary>
/// Add additional css classes to this component
/// </summary>
Expand All @@ -20,7 +23,7 @@ protected override void OnParametersSet()
/// Disables or enables the theme. Default is Auto, which means the theme is inherited from the parent component.
/// </summary>
[CascadingParameter]
public Theme Theme { get; set; } = Theme.Auto;
public Theme Theme { get; set; }

/// <summary>
/// The current theme styles
Expand Down Expand Up @@ -60,6 +63,11 @@ protected virtual void BuildCss()
/// <returns></returns>
protected virtual string ApplyStyle(string? style)
{
if (Theme == Theme.Off)
{
return "";
}

if (style == null)
{
return Styles ?? "";
Expand Down
1 change: 0 additions & 1 deletion src/Pure.Blazor.Components/Common/InteropComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
}
}

[Inject] public required ILogger<InteropComponent> Logger { get; set; }
[Inject] public required IJSRuntime Js { get; set; }

async ValueTask IAsyncDisposable.DisposeAsync()
Expand Down
1 change: 0 additions & 1 deletion src/Pure.Blazor.Components/Display/PureCode.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@using Pure.Blazor.Components.Display
@* @implements IAsyncDisposable *@
@* @implements IHandleEvent *@
@inject ILogger<PureCode> Logger
@inject IJSRuntime JS

<figure class="@Styles relative">
Expand Down
1 change: 0 additions & 1 deletion src/Pure.Blazor.Components/Layout/PureTabButton.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
@code {
private ElementReference _elementReference;
private bool prevStateActive = false;
[Inject] public required ILogger<PureTabButton> Logger { get; set; }
[Parameter] public string Title { get; set; } = string.Empty;

[Parameter] public bool IsActive { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions src/Pure.Blazor.Components/Pure.Blazor.Components.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>preview</LangVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<Title>PureBlazor Components</Title>
<Version>0.32.8</Version>
<Version>0.40-rc1</Version>
<PackageId>PureBlazor.Components</PackageId>
<Description>Blazor UI components for .NET Blazor with an optional headless mode.</Description>
<PackageProjectUrl>https://pureblazor.com</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Pure.Blazor.Components.Dialogs;
using Pure.Blazor.Components.Feedback;
using Pure.Blazor.Components.Primitives;
using Theme = Pure.Blazor.Components.Primitives.Theme;

namespace Pure.Blazor.Components;

Expand All @@ -19,12 +20,14 @@ public static WebAssemblyHostBuilder AddPureBlazorComponents(this WebAssemblyHos
// services
builder.Services.AddScoped<AlertService>();
builder.Services.AddScoped<DialogService>();
builder.Services.AddCascadingValue(sp =>
builder.Services.AddCascadingValue(_ =>
{
theme ??= new DefaultTheme();
var source = new CascadingValueSource<PureTheme>(theme, isFixed: true);
return source;
});

builder.Services.TryAddCascadingValue(_ => Theme.Auto);
return builder;
}
}

0 comments on commit 01b70ac

Please sign in to comment.