Skip to content

Commit

Permalink
🚧 feat: working on Todo page
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Mar 4, 2024
1 parent bf522b8 commit 3392195
Show file tree
Hide file tree
Showing 63 changed files with 1,336 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Masa.Blazor.Pro.Components/Masa.Blazor.Pro.Components.csproj
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>
95 changes: 95 additions & 0 deletions Masa.Blazor.Pro.Components/Todo/TodoNav.razor
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);

}
2 changes: 2 additions & 0 deletions Masa.Blazor.Pro.Components/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@using Microsoft.AspNetCore.Components.Web
@using Masa.Blazor
86 changes: 86 additions & 0 deletions Masa.Blazor.Pro.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Blazor.Pro", "Masa.Bla
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Blazor.Pro.Client", "Masa.Blazor.Pro.Client\Masa.Blazor.Pro.Client.csproj", "{944BA7F3-6BDE-4008-81B2-13B9CB517DDB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Blazor", "..\MASA.Blazor\src\Masa.Blazor\Masa.Blazor.csproj", "{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorComponent", "..\MASA.Blazor\src\BlazorComponent\src\Component\BlazorComponent\BlazorComponent.csproj", "{F483BCBA-6164-445E-A595-B860C09ADC9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Blazor.ProApp.Rcl", "Masa.Blazor.ProApp\Masa.Blazor.ProApp.Rcl\Masa.Blazor.ProApp.Rcl.csproj", "{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Blazor.ProApp", "Masa.Blazor.ProApp\Masa.Blazor.ProApp\Masa.Blazor.ProApp.csproj", "{E704A188-E14D-484D-83A4-B989666FCC74}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Blazor.ProApp.Web", "Masa.Blazor.ProApp.Web\Masa.Blazor.ProApp.Web.csproj", "{A36B39BC-9D91-41B1-853E-D3927D8D844A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Blazor.Pro.Components", "Masa.Blazor.Pro.Components\Masa.Blazor.Pro.Components.csproj", "{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -40,11 +52,85 @@ Global
{E505F326-BACB-4FF3-93A2-8EC64CC0DCCE}.Release|x64.Build.0 = Release|Any CPU
{E505F326-BACB-4FF3-93A2-8EC64CC0DCCE}.Release|x86.ActiveCfg = Release|Any CPU
{E505F326-BACB-4FF3-93A2-8EC64CC0DCCE}.Release|x86.Build.0 = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|x64.ActiveCfg = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|x64.Build.0 = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|x86.ActiveCfg = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Debug|x86.Build.0 = Debug|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|Any CPU.Build.0 = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|x64.ActiveCfg = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|x64.Build.0 = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|x86.ActiveCfg = Release|Any CPU
{7BBF4E0D-C76F-4770-ADC8-D293D40C87B3}.Release|x86.Build.0 = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|x64.ActiveCfg = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|x64.Build.0 = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|x86.ActiveCfg = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Debug|x86.Build.0 = Debug|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|Any CPU.Build.0 = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|x64.ActiveCfg = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|x64.Build.0 = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|x86.ActiveCfg = Release|Any CPU
{F483BCBA-6164-445E-A595-B860C09ADC9F}.Release|x86.Build.0 = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|x64.ActiveCfg = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|x64.Build.0 = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|x86.ActiveCfg = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Debug|x86.Build.0 = Debug|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|Any CPU.Build.0 = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|x64.ActiveCfg = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|x64.Build.0 = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|x86.ActiveCfg = Release|Any CPU
{B21CE0B3-EF79-4FD9-A1C7-42FE215EDC6F}.Release|x86.Build.0 = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|x64.ActiveCfg = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|x64.Build.0 = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|x86.ActiveCfg = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Debug|x86.Build.0 = Debug|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|Any CPU.Build.0 = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|x64.ActiveCfg = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|x64.Build.0 = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|x86.ActiveCfg = Release|Any CPU
{E704A188-E14D-484D-83A4-B989666FCC74}.Release|x86.Build.0 = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|x64.ActiveCfg = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|x64.Build.0 = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|x86.ActiveCfg = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Debug|x86.Build.0 = Debug|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|Any CPU.Build.0 = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|x64.ActiveCfg = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|x64.Build.0 = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|x86.ActiveCfg = Release|Any CPU
{A36B39BC-9D91-41B1-853E-D3927D8D844A}.Release|x86.Build.0 = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|x64.ActiveCfg = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|x64.Build.0 = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|x86.ActiveCfg = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Debug|x86.Build.0 = Debug|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|Any CPU.Build.0 = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|x64.ActiveCfg = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|x64.Build.0 = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|x86.ActiveCfg = Release|Any CPU
{DC495E7A-3E28-48A0-A185-C30BAACFEEE3}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {41A0DEFD-768D-440B-B382-E4BA2E314018}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions Masa.Blazor.ProApp.Web/Masa.Blazor.ProApp.Web.csproj
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>
37 changes: 37 additions & 0 deletions Masa.Blazor.ProApp.Web/Pages/_Host.cshtml
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>
23 changes: 23 additions & 0 deletions Masa.Blazor.ProApp.Web/Program.cs
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();
35 changes: 35 additions & 0 deletions Masa.Blazor.ProApp.Web/Properties/launchSettings.json
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"
}
}
}
}
7 changes: 7 additions & 0 deletions Masa.Blazor.ProApp.Web/_Imports.razor
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
9 changes: 9 additions & 0 deletions Masa.Blazor.ProApp.Web/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions Masa.Blazor.ProApp.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Loading

0 comments on commit 3392195

Please sign in to comment.