-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
1,336 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Masa.Blazor.Pro.Components/Masa.Blazor.Pro.Components.csproj
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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<SupportedPlatform Include="browser"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.2"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Folder Include="wwwroot\" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\MASA.Blazor\src\Masa.Blazor\Masa.Blazor.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,95 @@ | ||
@namespace Masa.Blazor.Pro.Components | ||
|
||
<MNavigationDrawer Value="@Value" | ||
ValueChanged="@ValueChanged" | ||
Permanent="@Permanent" | ||
Width="300" | ||
Fixed> | ||
@if (ShowAddTask) | ||
{ | ||
<MButton Block Rounded Color="primary" Class="ma-6">Add Task</MButton> | ||
} | ||
|
||
<MList Routable Dense> | ||
@foreach (var item in _categories) | ||
{ | ||
<MListItem ActiveClass="primary" Href="@item.Href" Exact> | ||
<ItemContent> | ||
<MListItemIcon Class="mr-4"> | ||
<MIcon>@item.IconOrColor</MIcon> | ||
</MListItemIcon> | ||
<MListItemContent> | ||
<MListItemTitle>@item.Title</MListItemTitle> | ||
</MListItemContent> | ||
</ItemContent> | ||
</MListItem> | ||
} | ||
|
||
<MSubheader>Tags</MSubheader> | ||
|
||
@foreach (var item in _tags) | ||
{ | ||
<MListItem ActiveClass="primary" Href="@item.Href" Exact> | ||
<ItemContent> | ||
<MListItemIcon Class="mr-4"> | ||
<MIcon Color="@item.IconOrColor">mdi-circle</MIcon> | ||
</MListItemIcon> | ||
<MListItemContent> | ||
<MListItemTitle>@item.Title</MListItemTitle> | ||
</MListItemContent> | ||
</ItemContent> | ||
</MListItem> | ||
} | ||
|
||
<MSubheader>Priority</MSubheader> | ||
|
||
@foreach (var item in _priority) | ||
{ | ||
<MListItem ActiveClass="primary" Href="@item.Href" Exact> | ||
<ItemContent> | ||
<MListItemIcon Class="mr-4"> | ||
<MIcon Color="@item.IconOrColor">mdi-flag-variant</MIcon> | ||
</MListItemIcon> | ||
<MListItemContent> | ||
<MListItemTitle>@item.Title</MListItemTitle> | ||
</MListItemContent> | ||
</ItemContent> | ||
</MListItem> | ||
} | ||
</MList> | ||
</MNavigationDrawer> | ||
|
||
@code { | ||
|
||
[Parameter] public bool? Value { get; set; } | ||
|
||
[Parameter] public EventCallback<bool?> ValueChanged { get; set; } | ||
|
||
[Parameter] public bool Permanent { get; set; } | ||
|
||
[Parameter] public bool ShowAddTask { get; set; } | ||
|
||
private static TodoNavItem[] _categories = | ||
[ | ||
new TodoNavItem("Inbox", "mdi-inbox-outline", "/todo"), | ||
new TodoNavItem("Important", "mdi-star-box-outline", "/todo/important"), | ||
new TodoNavItem("Completed", "mdi-checkbox-marked-outline", "/todo/completed"), | ||
new TodoNavItem("Trash", "mdi-trash-can-outline", "/todo/deleted") | ||
]; | ||
|
||
private static TodoNavItem[] _tags = | ||
[ | ||
new TodoNavItem("Team", "purple", "/todo/team"), | ||
new TodoNavItem("Family", "blue", "/todo/family"), | ||
]; | ||
|
||
private static TodoNavItem[] _priority = | ||
[ | ||
new TodoNavItem("Low", "green", "/todo/low"), | ||
new TodoNavItem("Medium", "yellow", "/todo/medium"), | ||
new TodoNavItem("High", "red", "/todo/high"), | ||
]; | ||
|
||
record TodoNavItem(string Title, string IconOrColor, string Href); | ||
|
||
} |
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,2 @@ | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using Masa.Blazor |
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,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Masa.Blazor.ProApp\Masa.Blazor.ProApp.Rcl\Masa.Blazor.ProApp.Rcl.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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,37 @@ | ||
@page "/" | ||
@using Masa.Blazor.ProApp.Rcl | ||
@using Microsoft.AspNetCore.Components.Web | ||
@namespace Masa.Blazor.ProApp.Web.Pages | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<base href="~/"/> | ||
<link href="_content/Masa.Blazor/css/masa-blazor.min.css" rel="stylesheet"/> | ||
<link href="css/site.css" rel="stylesheet"/> | ||
<link href="Masa.Blazor.ProApp.Web.styles.css" rel="stylesheet"/> | ||
<link href="https://cdn.masastack.com/npm/@("@mdi")/[email protected]/css/materialdesignicons.min.css" rel="stylesheet"> | ||
|
||
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered"/> | ||
</head> | ||
<body> | ||
<component type="typeof(App)" render-mode="ServerPrerendered"/> | ||
|
||
<div id="blazor-error-ui"> | ||
<environment include="Staging,Production"> | ||
An error has occurred. This application may no longer respond until reloaded. | ||
</environment> | ||
<environment include="Development"> | ||
An unhandled exception has occurred. See browser dev tools for details. | ||
</environment> | ||
<a href="" class="reload">Reload</a> | ||
<a class="dismiss">🗙</a> | ||
</div> | ||
|
||
<script src="_framework/blazor.server.js"></script> | ||
<script src="_content/BlazorComponent/js/blazor-component.js"></script> | ||
</body> | ||
</html> |
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,23 @@ | ||
var builder = WebApplication.CreateBuilder(args); | ||
builder.Services.AddRazorPages(); | ||
builder.Services.AddServerSideBlazor(); | ||
builder.Services.AddMasaBlazor(); | ||
|
||
var app = builder.Build(); | ||
|
||
if (!app.Environment.IsDevelopment()) | ||
{ | ||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. | ||
app.UseHsts(); | ||
} | ||
|
||
app.UseHttpsRedirection(); | ||
|
||
app.UseStaticFiles(); | ||
|
||
app.UseRouting(); | ||
|
||
app.MapBlazorHub(); | ||
app.MapFallbackToPage("/_Host"); | ||
|
||
app.Run(); |
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,35 @@ | ||
{ | ||
"iisSettings": { | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:63334", | ||
"sslPort": 44347 | ||
} | ||
}, | ||
"profiles": { | ||
"http": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"applicationUrl": "http://localhost:5284", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"https": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"applicationUrl": "https://localhost:7058;http://localhost:5284", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
@using BlazorComponent | ||
@using Masa.Blazor.ProApp.Web | ||
@using Masa.Blazor.Presets | ||
@using Masa.Blazor | ||
@using Microsoft.AspNetCore.Components.Routing | ||
@using Microsoft.AspNetCore.Components.Web | ||
@using Microsoft.JSInterop |
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,9 @@ | ||
{ | ||
"DetailedErrors": true, | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
Oops, something went wrong.