Skip to content

Commit

Permalink
Merge pull request #6 from valincius/dev
Browse files Browse the repository at this point in the history
Move IAppointment to Core project.
  • Loading branch information
valincius committed Jul 23, 2021
2 parents b33f347 + 1db074a commit 5a99a3d
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 12 deletions.
8 changes: 7 additions & 1 deletion BlazorScheduler.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ VisualStudioVersion = 17.0.31423.177
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorScheduler", "BlazorScheduler\BlazorScheduler.csproj", "{7B925AA6-DC1F-4E9F-8E1E-B57E344AA43D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoApp", "DemoApp\DemoApp.csproj", "{5FA9FE4D-C4C7-4A49-A10B-5B84E15D33E7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoApp", "DemoApp\DemoApp.csproj", "{5FA9FE4D-C4C7-4A49-A10B-5B84E15D33E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorScheduler.Core", "BlazorSchedulerCore\BlazorScheduler.Core.csproj", "{3F0AABE4-9274-4C6B-803A-748E80CEFAF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -21,6 +23,10 @@ Global
{5FA9FE4D-C4C7-4A49-A10B-5B84E15D33E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FA9FE4D-C4C7-4A49-A10B-5B84E15D33E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FA9FE4D-C4C7-4A49-A10B-5B84E15D33E7}.Release|Any CPU.Build.0 = Release|Any CPU
{3F0AABE4-9274-4C6B-803A-748E80CEFAF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F0AABE4-9274-4C6B-803A-748E80CEFAF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F0AABE4-9274-4C6B-803A-748E80CEFAF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F0AABE4-9274-4C6B-803A-748E80CEFAF1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 3 additions & 4 deletions BlazorScheduler/BlazorScheduler.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>John Valincius</Authors>
<Company>Valincius</Company>
<Description>Scheduler component library for Blazor.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl></PackageProjectUrl>
<RepositoryUrl>https://github.com/valincius/BlazorScheduler</RepositoryUrl>
<Version>1.0.2</Version>
<Version>2.0.0</Version>
</PropertyGroup>


<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BlazorScheduler.Core" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="5.0.*" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BlazorScheduler.Internal.Extensions;
using BlazorScheduler.Core;
using BlazorScheduler.Internal.Extensions;
using Microsoft.AspNetCore.Components;
using System.Collections.Generic;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BlazorScheduler.Internal.Extensions;
using BlazorScheduler.Core;
using BlazorScheduler.Internal.Extensions;
using Microsoft.AspNetCore.Components;

namespace BlazorScheduler.Internal.Components
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components;
using BlazorScheduler.Core;
using Microsoft.AspNetCore.Components;
using System.Collections.Generic;

namespace BlazorScheduler.Internal.Components
Expand Down
1 change: 1 addition & 0 deletions BlazorScheduler/Internal/Components/SchedulerDay.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using BlazorScheduler.Internal.Extensions;
using Microsoft.AspNetCore.Components.Web;
using BlazorScheduler.Core;

namespace BlazorScheduler.Internal.Components {
public partial class SchedulerDay<T> where T : IAppointment, new() {
Expand Down
3 changes: 2 additions & 1 deletion BlazorScheduler/Internal/Components/SchedulerWeek.razor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using BlazorScheduler.Internal.Extensions;
using BlazorScheduler.Core;
using BlazorScheduler.Internal.Extensions;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
Expand Down
1 change: 1 addition & 0 deletions BlazorScheduler/Scheduler.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using BlazorScheduler.Internal.Components;
using System.Drawing;
using Microsoft.AspNetCore.Components.Web;
using BlazorScheduler.Core;

namespace BlazorScheduler
{
Expand Down
19 changes: 19 additions & 0 deletions BlazorSchedulerCore/BlazorScheduler.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Authors>John Valincius</Authors>
<Company>Valincius</Company>
<Description>Core library for BlazorScheduler containing necessary classes and interfaces.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl></PackageProjectUrl>
<RepositoryUrl>https://github.com/valincius/BlazorScheduler</RepositoryUrl>
<Version>1.0.0</Version>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Drawing;

namespace BlazorScheduler
namespace BlazorScheduler.Core
{
public interface IAppointment
{
Expand Down
4 changes: 3 additions & 1 deletion DemoApp/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@page "/"
@using BlazorScheduler
@using System.Drawing

@using BlazorScheduler
@using BlazorScheduler.Core

@inject HttpClient HttpClient

<label>Start Day of Week</label>
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ The scheduler supports "all-day" appointments, appointments spanning multiple da
Also has support for dragging to create appointments.

## Usage
1. Add `BlazorScheduler` NuGet package
1. Run `Install-Package BlazorScheduler` in the package manager console to install the latest package in your frontend project.
- Optionally run `Install-Package BlazorScheduler.Core` in your shared project so you can have access to the interfaces there.
2. Add references to necessary js & css files in your `index.html`
- Add `<link href="_content/BlazorScheduler/css/styles.css" rel="stylesheet" />` to the head
- Add `<script src="_content/BlazorScheduler/js/scripts.js"></script>` to the body
3. Add `@using BlazorScheduler` to your page
- Add `using BlazorScheduler.Core` wherever you are creating an implementation of `BlazorScheduler.Core.IAppointment`
4. Create an implementation of `IAppointment`
```c#
public class Appointment : IAppointment
Expand All @@ -42,3 +44,16 @@ There are 3 callbacks that the scheduler provides.
- `Task OnOverflowAppointmentClick(IEnumerable<T> appointments, MouseEventArgs mouse)` - invoked when the user clicks on an "overflowing" appointment

See the demo [here](https://valincius.dev/BlazorScheduler/) for more information on usage

# Changlog
## 2.0.0
- Created `BlazorScheduler.Core` project
- This project will contain any classes/interfaces that may be required outside of the main UI project.
- Moved `IAppointment` from `BlazorScheduler` to `BlazorScheduler.Core`
- **You will need to add `using BlazorScheduler.Core` to where you are creating your implementation of `IAppointment`**
## 1.0.2
- Fix bug introduced in 1.0.1
## 1.0.1
- Add start day of week parameter to Scheduler
## 1.0.0
- Initial release

0 comments on commit 5a99a3d

Please sign in to comment.