-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to MudBlazor 7.0.0-rc.2 and Latest Blazor Project Templates (#…
…465) Co-authored-by: Artyom M <[email protected]>
- Loading branch information
1 parent
0b738ee
commit 5cd2b40
Showing
51 changed files
with
762 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.9.34902.65 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MudBlazor.Templates", "MudBlazor.Templates.csproj", "{7EAFF69B-A5AD-4A6C-A70D-DA61C3278F20}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7EAFF69B-A5AD-4A6C-A70D-DA61C3278F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7EAFF69B-A5AD-4A6C-A70D-DA61C3278F20}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7EAFF69B-A5AD-4A6C-A70D-DA61C3278F20}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7EAFF69B-A5AD-4A6C-A70D-DA61C3278F20}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {6F2CB990-E8D8-4534-9AFE-676348D0341F} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/mudblazor/MudBlazor.Template.Client/Pages/Weather.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
@page "/weather" | ||
@*#if (UseServer && !InteractiveAtRoot) | ||
@rendermode InteractiveAuto | ||
##elseif (!InteractiveAtRoot) | ||
@rendermode InteractiveWebAssembly | ||
##endif*@ | ||
|
||
@*#if (!InteractiveAtRoot) | ||
<MudPopoverProvider /> | ||
<MudDialogProvider /> | ||
<MudSnackbarProvider /> | ||
##endif*@ | ||
|
||
@*#if (!InteractiveAtRoot) --> | ||
@attribute [StreamRendering] | ||
##endif*@ | ||
|
||
<PageTitle>Weather</PageTitle> | ||
|
||
<MudText Typo="Typo.h3" GutterBottom="true">Weather forecast</MudText> | ||
<MudText Class="mb-8">This component demonstrates fetching data from the server.</MudText> | ||
|
||
@if (forecasts == null) | ||
{ | ||
<MudProgressCircular Color="Color.Default" Indeterminate="true" /> | ||
} | ||
else | ||
{ | ||
<MudTable Items="forecasts" Hover="true" SortLabel="Sort By" Elevation="0" AllowUnsorted="false"> | ||
<HeaderContent> | ||
<MudTh><MudTableSortLabel InitialDirection="SortDirection.Ascending" SortBy="new Func<WeatherForecast, object>(x=>x.Date)">Date</MudTableSortLabel></MudTh> | ||
<MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureC)">Temp. (C)</MudTableSortLabel></MudTh> | ||
<MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.TemperatureF)">Temp. (F)</MudTableSortLabel></MudTh> | ||
<MudTh><MudTableSortLabel SortBy="new Func<WeatherForecast, object>(x=>x.Summary!)">Summary</MudTableSortLabel></MudTh> | ||
</HeaderContent> | ||
<RowTemplate> | ||
<MudTd DataLabel="Date">@context.Date</MudTd> | ||
<MudTd DataLabel="Temp. (C)">@context.TemperatureC</MudTd> | ||
<MudTd DataLabel="Temp. (F)">@context.TemperatureF</MudTd> | ||
<MudTd DataLabel="Summary">@context.Summary</MudTd> | ||
</RowTemplate> | ||
<PagerContent> | ||
<MudTablePager PageSizeOptions="new int[]{50, 100}" /> | ||
</PagerContent> | ||
</MudTable> | ||
} | ||
|
||
@code { | ||
private WeatherForecast[]? forecasts; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
@*#if (InteractiveAtRoot) --> | ||
// Simulate asynchronous loading to demonstrate a loading indicator | ||
##else | ||
// Simulate asynchronous loading to demonstrate streaming rendering | ||
##endif*@ | ||
await Task.Delay(500); | ||
|
||
var startDate = DateOnly.FromDateTime(DateTime.Now); | ||
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; | ||
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = summaries[Random.Shared.Next(summaries.Length)] | ||
}).ToArray(); | ||
} | ||
|
||
private class WeatherForecast | ||
{ | ||
public DateOnly Date { get; set; } | ||
public int TemperatureC { get; set; } | ||
public string? Summary { get; set; } | ||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#if (IndividualLocalAuth) | ||
using MudBlazor.Template.Client; | ||
using Microsoft.AspNetCore.Components.Authorization; | ||
#endif | ||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||
using MudBlazor.Services; | ||
|
||
namespace MudBlazor.Template.Client; | ||
|
||
class Program | ||
{ | ||
static async Task Main(string[] args) | ||
{ | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
|
||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); | ||
builder.Services.AddMudServices(); | ||
|
||
#if (IndividualLocalAuth) | ||
builder.Services.AddAuthorizationCore(); | ||
builder.Services.AddCascadingAuthenticationState(); | ||
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>(); | ||
#endif | ||
|
||
await builder.Build().RunAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/mudblazor/MudBlazor.Template/Components/Account/Pages/AccessDenied.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "/Account/AccessDenied" | ||
|
||
<PageTitle>Access denied</PageTitle> | ||
|
||
<MudAlert Severity="Severity.Error">You do not have access to this resource.</MudAlert> |
Oops, something went wrong.