Skip to content

Commit

Permalink
Merge pull request #74 from danheron/dev
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
danheron authored Nov 16, 2023
2 parents 91ba179 + cbdaaa5 commit f534e5a
Show file tree
Hide file tree
Showing 110 changed files with 1,665 additions and 753 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,6 @@ FodyWeavers.xsd

# Autogenerated files
**/Heron.MudCalendar.min.css
**/Heron.MudCalendar.min.js
**/Heron.MudCalendar.js
Heron.MudCalendar.Docs/NewFilesToBuild.txt
6 changes: 3 additions & 3 deletions Heron.MudCalendar.Docs/Heron.MudCalendar.Docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<PackageReference Include="Blazor-Analytics" Version="3.11.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
<PackageReference Include="Heron.MudTotalCalendar" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.1" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.1.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.11.0" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions Heron.MudCalendar.Docs/Pages/Calendar/CalendarPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@
</SectionContent>
</DocsPageSection>

<DocsPageSection>
<SectionHeader Title="Drag/Drop">
<Description>
Drag and Drop of items can be enabled by setting the <CodeInline>EnableDragItems</CodeInline> property to true.
Allow the user to resize items by setting the <CodeInline>EnableResizeItems</CodeInline> property to true.
Be notified when the start or end date of an item was changed by dragging or resizing with the <CodeInline>ItemChanged</CodeInline> event.
</Description>
</SectionHeader>
<SectionContent DarkenBackground="true" Code="DragDropCalendarExample" ShowCode="false" Block="true" FullWidth="true" Assembly="typeof(CalendarPage).Assembly" AllowRunCode="false">
<DragDropCalendarExample/>
</SectionContent>
</DocsPageSection>

<DocsPageSection>
<SectionHeader Title="Restrict Views">
<Description>
Expand All @@ -76,6 +89,7 @@
<SectionHeader Title="Events">
<Description>
The <CodeInline>CellClicked</CodeInline> event will be raised when a calendar cell is clicked. This can be used, for example, to add new events to the calendar.
The <CodeInline>ItemClicked</CodeInline> event will be raised when an item in the calendar is clicked.
</Description>
</SectionHeader>
<SectionContent DarkenBackground="true" Code="EventsCalendarExample" ShowCode="false" Block="true" FullWidth="true" Assembly="typeof(CalendarPage).Assembly" AllowRunCode="false">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@namespace Heron.MudCalendar.Docs.Examples

<MudCalendar Items="_events" EnableDragItems="true" EnableResizeItems="true" />

@code {

private readonly List<CalendarItem> _events = new()
{
new CalendarItem
{
Start = DateTime.Today.AddHours(10),
End = DateTime.Today.AddHours(12),
Text = "Event today"
}
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@namespace Heron.MudCalendar.Docs.Examples

<MudCalendar CellClicked="CellClicked" DayTimeInterval="CalendarTimeInterval.Minutes15" />
<MudCalendar Items="_events" CellClicked="CellClicked" ItemClicked="ItemClicked" DayTimeInterval="CalendarTimeInterval.Minutes15" />

@code {

Expand All @@ -9,7 +9,27 @@

private Task CellClicked(DateTime dateTime)
{
return DialogService.ShowMessageBox("Click", dateTime.ToString(Thread.CurrentThread.CurrentCulture));
return DialogService.ShowMessageBox("Cell Clicked", dateTime.ToString(Thread.CurrentThread.CurrentCulture));
}

private Task ItemClicked(CalendarItem item)
{
return DialogService.ShowMessageBox("Item Clicked", item.Text);
}

private List<CalendarItem> _events = new()
{
new CalendarItem
{
Start = DateTime.Today.AddHours(10),
End = DateTime.Today.AddHours(11),
Text = "Event today"
},
new CalendarItem
{
Start = DateTime.Today.AddDays(1).AddHours(11),
End = DateTime.Today.AddDays(1).AddHours(12.5),
Text = "Event tomorrow"
}
};
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@namespace Heron.MudCalendar.Docs.Examples

<MudCalendar Outlined="_outlined" ShowPrevNextButtons="_prevNext" ShowDatePicker="_datePicker" Color="_color" ButtonVariant="_buttonVariant" Style="height: 400px;" />
<MudCalendar Outlined="_outlined" ShowPrevNextButtons="_prevNext" ShowDatePicker="_datePicker" ShowTodayButton="_todayButton" Color="_color" ButtonVariant="_buttonVariant" Style="height: 400px;" />

<MudToolBar Class="mt-4">
<MudSwitch @bind-checked="@_outlined" Color="Color.Primary" T="bool">Outlined</MudSwitch>
<MudSwitch @bind-checked="@_prevNext" Color="Color.Primary" T="bool">Prev/Next Buttons</MudSwitch>
<MudSwitch @bind-checked="@_datePicker" Color="Color.Primary" T="bool">Date Picker</MudSwitch>
<MudSwitch @bind-checked="@_todayButton" Color="Color.Primary" T="bool">Today Button</MudSwitch>
<MudSelect @bind-Value="_color" T="Color" Label="Color" Placeholder="Select Color" Class="ml-4">
<MudSelectItem Value="Color.Primary">Primary</MudSelectItem>
<MudSelectItem Value="Color.Secondary">Secondary</MudSelectItem>
Expand All @@ -22,6 +23,7 @@
private bool _outlined;
private bool _prevNext = true;
private bool _datePicker = true;
private bool _todayButton = false;
private Color _color = Color.Primary;
private Variant _buttonVariant = Variant.Filled;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
<MudToolBar Class="mt-4">
<MudSwitch @bind-Checked="_showCurrentTime" T="bool" Color="Color.Primary" Label="Show Current Time" />
<MudSelect @bind-Value="_interval" T="CalendarTimeInterval" Label="Time Interval" class="ml-4">
<MudSelectItem Value="CalendarTimeInterval.Minutes10">10 Minutes</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes15">15 Minutes</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes20">20 Minutes</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes30">30 Minutes</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes60">1 Hour</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes120">2 Hours</MudSelectItem>
<MudSelectItem Value="CalendarTimeInterval.Minutes180">3 Hours</MudSelectItem>
</MudSelect>
<MudNumericField @bind-Value="_cellHeight" T="int" Label="Cell Height" Class="ml-4"/>
</MudToolBar>
Expand Down
8 changes: 4 additions & 4 deletions Heron.MudCalendar.Docs/Theme/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static MudTheme DocsTheme()

#region Docs

private static readonly Palette DocsLightPalette = new()
private static readonly PaletteLight DocsLightPalette = new()
{
Black = "#110e2d",
AppbarText = "#424242",
Expand All @@ -52,7 +52,7 @@ public static MudTheme DocsTheme()
GrayLighter = "#f9f9f9"
};

private static readonly Palette DocsDarkPalette = new()
private static readonly PaletteDark DocsDarkPalette = new()
{
Primary = "#7e6fff",
Surface= "#1e1e2d",
Expand Down Expand Up @@ -144,7 +144,7 @@ public static MudTheme DocsTheme()
TextTransform = "none"
}
};
private static readonly Palette LandingPageLightPalette = new()
private static readonly PaletteLight LandingPageLightPalette = new()
{
AppbarText = "#424242",
AppbarBackground = "rgba(0,0,0,0)",
Expand All @@ -156,7 +156,7 @@ public static MudTheme DocsTheme()
GrayLight = "#9CA3AF",
GrayLighter = "#adbdccff"
};
private static readonly Palette LandingPageDarkPalette = new()
private static readonly PaletteDark LandingPageDarkPalette = new()
{
AppbarText = "#92929f",
AppbarBackground = "rgba(0,0,0,0)",
Expand Down
14 changes: 11 additions & 3 deletions Heron.MudCalendar.Docs/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
<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=6.1.0" rel="stylesheet" />
<link href="MudBlazorDocs.min.css?v=6.1.0" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css?v=6.11.0" rel="stylesheet" />
<link href="_content/Heron.MudCalendar/Heron.MudCalendar.min.css" rel="stylesheet" />
<link href="MudBlazorDocs.min.css?v=6.11.0" rel="stylesheet" />
</head>

<body>
<div id="app">Loading...</div>
<div id="app">
<div style="display: flex; align-items: center; justify-content: center; height: 100vh;">
<div style="height: 30%; text-align: center; font-family: 'Public Sans', 'Roboto', 'Arial', 'sans-serif'; color: rgb(66, 66, 66);">
<h1 style="font-size: 40px;">Heron.MudCalendar</h1>
<h3 style="margin-top: 20px;">Loading...</h3>
</div>
</div>
</div>

<div id="blazor-error-ui">
An unhandled error has occurred.
Expand Down
11 changes: 11 additions & 0 deletions Heron.MudCalendar.UnitTests.Viewer.Server/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Router AppAssembly="@typeof(Heron.MudCalendar.UnitTests.Viewer.Pages.Index).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Heron.MudCalendar.UnitTests.Viewer.Shared.MainLayout)"/>
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(Heron.MudCalendar.UnitTests.Viewer.Shared.MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Heron.MudCalendar.UnitTests.Viewer\Heron.MudCalendar.UnitTests.Viewer.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MudBlazor" Version="6.11.0" />
</ItemGroup>

</Project>
32 changes: 32 additions & 0 deletions Heron.MudCalendar.UnitTests.Viewer.Server/Pages/_Host.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@page "/"
@using Microsoft.AspNetCore.Components.Web
@namespace Heron.MudCalendar.UnitTests.Viewer.Server.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

<!DOCTYPE html>
<html lang="en">
<head>
<title>Heron.MudCalendar.UnitTests.Viewer.Server</title>
<meta charset="utf-8"/>
<base href="/"/>
<link href="_content/MudBlazor/MudBlazor.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="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions Heron.MudCalendar.UnitTests.Viewer.Server/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using MudBlazor.Services;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();

builder.Services.AddMudServices();

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();
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"iisSettings": {
"iisExpress": {
"applicationUrl": "http://localhost:42361",
"sslPort": 44328
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5018",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7269;http://localhost:5018",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
6 changes: 6 additions & 0 deletions Heron.MudCalendar.UnitTests.Viewer.Server/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.JSInterop
@using MudBlazor;
@using Heron.MudCalendar.UnitTests.Viewer
@using Heron.MudCalendar.UnitTests.Viewer.Server
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.1.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
<PackageReference Include="MudBlazor" Version="6.11.0" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions Heron.MudCalendar.UnitTests.Viewer/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
@inherits LayoutComponentBase

<HeadContent>
<meta name="description" content="@_description" />
</HeadContent>

<MudThemeProvider/>
<MudDialogProvider/>
<MudSnackbarProvider/>

@Body

@code {

private string _description = "Description set by code";

}
Loading

0 comments on commit f534e5a

Please sign in to comment.