Skip to content

Commit

Permalink
Merge pull request #194 from danheron/feature/mudblazor-8
Browse files Browse the repository at this point in the history
Feature/mudblazor 8
  • Loading branch information
danheron authored Dec 5, 2024
2 parents c256623 + a571c94 commit 0c84140
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 143 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-mudcalendar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: [ '7.0.x', '8.0.x' ]
dotnet-version: [ '8.0.x', '9.0.x' ]

steps:
- name: Checkout MudCalendar repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v3
Expand Down
13 changes: 6 additions & 7 deletions Heron.MudCalendar.Docs/Heron.MudCalendar.Docs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand All @@ -10,10 +10,9 @@
<PackageReference Include="Blazor-Analytics" Version="3.12.0" />
<PackageReference Include="BytexDigital.Blazor.Components.CookieConsent" Version="1.2.1" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Heron.MudTotalCalendar" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="7.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="8.0.0-preview.5" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,10 +26,10 @@

<ItemGroup>
<Reference Include="MudBlazor.Docs">
<HintPath>..\..\MudBlazor\src\MudBlazor.Docs\bin\Release\net8.0\MudBlazor.Docs.dll</HintPath>
<HintPath>..\..\MudBlazor\src\MudBlazor.Docs\bin\Release\net9.0\MudBlazor.Docs.dll</HintPath>
</Reference>
<Reference Include="MudBlazor.Examples.Data">
<HintPath>..\..\MudBlazor\src\MudBlazor.Docs\bin\Release\net8.0\MudBlazor.Examples.Data.dll</HintPath>
<HintPath>..\..\MudBlazor\src\MudBlazor.Docs\bin\Release\net9.0\MudBlazor.Examples.Data.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
20 changes: 10 additions & 10 deletions Heron.MudCalendar.Docs/Pages/Extending/Extending.razor
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
</SectionContent>
</DocsPageSection>

<DocsPageSection>
<SectionHeader Title="Heron.MudTotalCalendar">
<Description><CodeInline>Heron.MudTotalCalendar</CodeInline> is a calendar component for displaying numeric values and totals.
It can be used as an example of extending <CodeInline>Heron.MudCalendar</CodeInline>.
The source code can be found on <MudLink Href="https://github.com/danheron/Heron.MudTotalCalendar">Github</MudLink>.</Description>
</SectionHeader>
<SectionContent>
<TotalCalendar />
</SectionContent>
</DocsPageSection>
@* <DocsPageSection> *@
@* <SectionHeader Title="Heron.MudTotalCalendar"> *@
@* <Description><CodeInline>Heron.MudTotalCalendar</CodeInline> is a calendar component for displaying numeric values and totals. *@
@* It can be used as an example of extending <CodeInline>Heron.MudCalendar</CodeInline>. *@
@* The source code can be found on <MudLink Href="https://github.com/danheron/Heron.MudTotalCalendar">Github</MudLink>.</Description> *@
@* </SectionHeader> *@
@* <SectionContent> *@
@* <TotalCalendar /> *@
@* </SectionContent> *@
@* </DocsPageSection> *@

</DocsPageContent>
</DocsPage>
126 changes: 63 additions & 63 deletions Heron.MudCalendar.Docs/Pages/Extending/TotalCalendar.razor
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
@using Heron.MudTotalCalendar

<MudTotalCalendar Values="BuildTestData()"/>

@code {

private List<Value> BuildTestData()
{
var power = new ValueDefinition
{
Name = "Power",
Units = "kWh",
FormatString = "N2",
Style = "background-color: #AD1457; color: #ffffff;"
};
var offpeak = new ValueDefinition
{
Name = "Off-peak",
Units = "EUR",
PrefixUnits = true,
FormatString = "N2",
Style = "background-color: #1565C0; color: #ffffff;"
};
var peak = new ValueDefinition
{
Name = "Peak",
Units = "EUR",
PrefixUnits = true,
FormatString = "N2",
Style = "background-color: #2E7D32; color: #ffffff;"
};
var total = new ValueDefinition
{
Name = "Total",
Units = "EUR",
PrefixUnits = true,
FormatString = "N2",
Style = "background-color: #EF6C00; color: #ffffff;"
};

return new List<Value>
{
// Today
new() { Date = DateTime.Today, Definition = power, Amount = 3.34 },
new() { Date = DateTime.Today, Definition = peak, Amount = 4.34 },
new() { Date = DateTime.Today, Definition = offpeak, Amount = 2.34 },
new() { Date = DateTime.Today, Definition = total, Amount = 6.68 },

// Tomorrow
new() { Date = DateTime.Today.AddDays(-1), Definition = power, Amount = 4.89 },
new() { Date = DateTime.Today.AddDays(-1), Definition = peak, Amount = 5.23 },
new() { Date = DateTime.Today.AddDays(-1), Definition = offpeak, Amount = 3.32 },
new() { Date = DateTime.Today.AddDays(-1), Definition = total, Amount = 8.55 },

// The next day
new() { Date = DateTime.Today.AddDays(-2), Definition = power, Amount = 2.97 },
new() { Date = DateTime.Today.AddDays(-2), Definition = peak, Amount = 5.78 },
new() { Date = DateTime.Today.AddDays(-2), Definition = offpeak, Amount = 2.98 },
new() { Date = DateTime.Today.AddDays(-2), Definition = total, Amount = 8.76 }
};
}

}
@* @using Heron.MudTotalCalendar *@
@* *@
@* <MudTotalCalendar Values="BuildTestData()"/> *@
@* *@
@* @code { *@
@* *@
@* private List<Value> BuildTestData() *@
@* { *@
@* var power = new ValueDefinition *@
@* { *@
@* Name = "Power", *@
@* Units = "kWh", *@
@* FormatString = "N2", *@
@* Style = "background-color: #AD1457; color: #ffffff;" *@
@* }; *@
@* var offpeak = new ValueDefinition *@
@* { *@
@* Name = "Off-peak", *@
@* Units = "EUR", *@
@* PrefixUnits = true, *@
@* FormatString = "N2", *@
@* Style = "background-color: #1565C0; color: #ffffff;" *@
@* }; *@
@* var peak = new ValueDefinition *@
@* { *@
@* Name = "Peak", *@
@* Units = "EUR", *@
@* PrefixUnits = true, *@
@* FormatString = "N2", *@
@* Style = "background-color: #2E7D32; color: #ffffff;" *@
@* }; *@
@* var total = new ValueDefinition *@
@* { *@
@* Name = "Total", *@
@* Units = "EUR", *@
@* PrefixUnits = true, *@
@* FormatString = "N2", *@
@* Style = "background-color: #EF6C00; color: #ffffff;" *@
@* }; *@
@* *@
@* return new List<Value> *@
@* { *@
@* // Today *@
@* new() { Date = DateTime.Today, Definition = power, Amount = 3.34 }, *@
@* new() { Date = DateTime.Today, Definition = peak, Amount = 4.34 }, *@
@* new() { Date = DateTime.Today, Definition = offpeak, Amount = 2.34 }, *@
@* new() { Date = DateTime.Today, Definition = total, Amount = 6.68 }, *@
@* *@
@* // Tomorrow *@
@* new() { Date = DateTime.Today.AddDays(-1), Definition = power, Amount = 4.89 }, *@
@* new() { Date = DateTime.Today.AddDays(-1), Definition = peak, Amount = 5.23 }, *@
@* new() { Date = DateTime.Today.AddDays(-1), Definition = offpeak, Amount = 3.32 }, *@
@* new() { Date = DateTime.Today.AddDays(-1), Definition = total, Amount = 8.55 }, *@
@* *@
@* // The next day *@
@* new() { Date = DateTime.Today.AddDays(-2), Definition = power, Amount = 2.97 }, *@
@* new() { Date = DateTime.Today.AddDays(-2), Definition = peak, Amount = 5.78 }, *@
@* new() { Date = DateTime.Today.AddDays(-2), Definition = offpeak, Amount = 2.98 }, *@
@* new() { Date = DateTime.Today.AddDays(-2), Definition = total, Amount = 8.76 } *@
@* }; *@
@* } *@
@* *@
@* } *@
8 changes: 7 additions & 1 deletion Heron.MudCalendar.Docs/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Heron.MudCalendar.Docs;
using Heron.MudCalendar.Docs.Services;
using MudBlazor.Docs.Extensions;
using MudBlazor.Docs.Services;
using MudBlazor.Services;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
Expand All @@ -11,7 +12,12 @@

builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddMudServices();
builder.Services.TryAddDocsViewServices();
//builder.Services.TryAddDocsViewServices();

builder.Services.AddScoped<IDocsJsApiService, DocsJsApiService>();
builder.Services.AddSingleton<IMenuService, MenuService>();
builder.Services.AddScoped<IDocsNavigationService, DocsNavigationService>();
builder.Services.AddSingleton<IRenderQueueService, RenderQueueService>();

builder.Services.AddScoped<EventService>();

Expand Down
2 changes: 1 addition & 1 deletion Heron.MudCalendar.Docs/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<MudRTLProvider RightToLeft="_isRtl">
<MudThemeProvider Theme="_theme" @bind-IsDarkMode="_darkMode"/>
<MudPopoverProvider />
<MudDialogProvider/>
<MudDialogProvider FullWidth="true" MaxWidth="MaxWidth.ExtraSmall" />
<MudSnackbarProvider/>

<MudLayout Class="mudblazor-docs">
Expand Down
63 changes: 32 additions & 31 deletions Heron.MudCalendar.Docs/Theme/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static MudTheme DocsTheme()
return theme;
}



#region Docs

Expand All @@ -49,13 +49,13 @@ public static MudTheme DocsTheme()
AppbarBackground = "rgba(255,255,255,0.8)",
DrawerBackground = "#ffffff",
GrayLight = "#e8e8e8",
GrayLighter = "#f9f9f9"
GrayLighter = "#f9f9f9",
};

private static readonly PaletteDark DocsDarkPalette = new()
private static readonly PaletteDark DocsDarkPalette = new()
{
Primary = "#7e6fff",
Surface= "#1e1e2d",
Surface = "#1e1e2d",
Background = "#1a1a27",
BackgroundGray = "#151521",
AppbarText = "#92929f",
Expand All @@ -78,8 +78,7 @@ public static MudTheme DocsTheme()
LinesDefault = "#33323e",
TableLines = "#33323e",
Divider = "#292838",
OverlayLight = "#1e1e2d80"

OverlayLight = "#1e1e2d80",
};
#endregion
#region LandingPage
Expand All @@ -88,62 +87,64 @@ public static MudTheme DocsTheme()
{
DefaultBorderRadius = "6px"
};

private static readonly Typography LandingPageTypography = new()
{
Default = new Default()
Default = new DefaultTypography()
{
FontFamily = new[] { "Public Sans", "Roboto", "Arial", "sans-serif" },
LetterSpacing = "normal"
},
H1 = new H1()
H1 = new H1Typography()
{
FontSize = "4rem",
FontWeight = 700,
FontWeight = "700",
},
H3 = new H3()
H3 = new H3Typography()
{
FontSize = "3rem",
FontWeight = 600,
LineHeight = 1.8,
FontWeight = "600",
LineHeight = "1.8",
},
H4 = new H4()
H4 = new H4Typography()
{
FontSize = "1.8rem",
FontWeight = 700,
FontWeight = "700",
},
H5 = new H5()
H5 = new H5Typography()
{
FontSize = "1.8rem",
FontWeight = 700,
LineHeight = 2,
FontWeight = "700",
LineHeight = "2",
},
H6 = new H6()
H6 = new H6Typography()
{
FontSize = "1.125rem",
FontWeight = 700,
LineHeight = 2,
FontWeight = "700",
LineHeight = "2",
},
Subtitle1 = new Subtitle1()
Subtitle1 = new Subtitle1Typography()
{
FontSize = "1.1rem",
FontWeight = 500
FontWeight = "500"
},
Subtitle2 = new Subtitle2()
Subtitle2 = new Subtitle2Typography()
{
FontSize = "1rem",
FontWeight = 600,
LineHeight = 1.8,
FontWeight = "600",
LineHeight = "1.8",
},
Body1 = new Body1()
Body1 = new Body1Typography()
{
FontSize = "1rem",
FontWeight = 400
FontWeight = "400"
},
Button = new Button()
Button = new ButtonTypography()
{
TextTransform = "none"
}
};

private static readonly PaletteLight LandingPageLightPalette = new()
{
AppbarText = "#424242",
Expand All @@ -154,14 +155,14 @@ public static MudTheme DocsTheme()
DarkLighten = "#1A1643",
GrayDefault = "#4B5563",
GrayLight = "#9CA3AF",
GrayLighter = "#adbdccff"
GrayLighter = "#adbdccff",
};
private static readonly PaletteDark LandingPageDarkPalette = new()
{
AppbarText = "#92929f",
AppbarBackground = "rgba(0,0,0,0)",
BackgroundGray = "#1a1a27",
Surface= "#1e1e2d",
Surface = "#1e1e2d",
Background = "#151521",
Dark = "#111019",
DarkLighten = "#1A1643",
Expand All @@ -173,7 +174,7 @@ public static MudTheme DocsTheme()
DrawerText = "#92929f",
DrawerBackground = "#151521",
OverlayLight = "#1e1e2d80",
Divider = "#5c5c6a"
Divider = "#5c5c6a",
};

private static readonly Shadow LandingPageShadows = new()
Expand Down
4 changes: 2 additions & 2 deletions Heron.MudCalendar.Docs/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<title>Heron.MudCalendar.Docs</title>
<base href="/"/>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet"/>
<link href="_content/MudBlazor/MudBlazor.min.css?v=7.0.0" rel="stylesheet"/>
<link href="_content/MudBlazor/MudBlazor.min.css?v=8.0.0" rel="stylesheet"/>
<link href="_content/Heron.MudCalendar/Heron.MudCalendar.min.css" rel="stylesheet"/>
<link href="MudBlazorDocs.min.css?v=7.0.0" rel="stylesheet"/>
<link href="MudBlazorDocs.min.css?v=8.0.0" rel="stylesheet"/>
</head>

<body>
Expand Down
Loading

0 comments on commit 0c84140

Please sign in to comment.