-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from valincius/v4.1.0
v4.1.0
- Loading branch information
Showing
22 changed files
with
305 additions
and
106 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Usage", "BL0005:Component parameter should not be set outside of its component.", Justification = "<Pending>", Scope = "member", Target = "~M:BlazorScheduler.Scheduler.OnMouseMove(System.String)")] |
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
33 changes: 29 additions & 4 deletions
33
BlazorScheduler/Internal/Components/SchedulerAllDayAppointment.razor.cs
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 |
---|---|---|
@@ -1,27 +1,52 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Web; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace BlazorScheduler.Internal.Components | ||
{ | ||
public partial class SchedulerAllDayAppointment | ||
{ | ||
[CascadingParameter] public Scheduler Scheduler { get; set; } | ||
[CascadingParameter] public Scheduler Scheduler { get; set; } = null!; | ||
|
||
[Parameter] public Appointment Appointment { get; set; } | ||
[Parameter] public Appointment Appointment { get; set; } = null!; | ||
[Parameter] public int Start { get; set; } | ||
[Parameter] public int End { get; set; } | ||
[Parameter] public int Order { get; set; } | ||
|
||
private IEnumerable<string> Classes | ||
private IEnumerable<string> Classes | ||
{ | ||
get | ||
{ | ||
if (ReferenceEquals(Appointment, Scheduler.NewAppointment)) | ||
if (ReferenceEquals(Appointment, Scheduler.DraggingAppointment)) | ||
{ | ||
yield return "new-appointment"; | ||
} | ||
} | ||
} | ||
|
||
private bool _drag; | ||
|
||
private void OnMouseDown(MouseEventArgs e) | ||
{ | ||
if (e.Button == 0) | ||
_drag = false; | ||
} | ||
|
||
private void OnMouseUp(MouseEventArgs e) | ||
{ | ||
if (_drag) | ||
return; | ||
|
||
Appointment.OnClick?.Invoke(); | ||
} | ||
|
||
private void OnMouseMove(MouseEventArgs e) | ||
{ | ||
_drag = true; | ||
|
||
if ((e.Buttons & 1) == 1) | ||
Scheduler.BeginDrag(Appointment); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
@namespace BlazorScheduler.Internal.Components | ||
|
||
<div class="appointment" style="--start: @Start; --order: @Order;" @onclick="Appointment.Click"> | ||
<div class="appointment appointment-timed @Classes.AsString()" style="--start: @Start; --order: @Order;" @onmousedown="OnMouseDown" @onmouseup="OnMouseUp" @onmousemove="OnMouseMove"> | ||
<span class="dot" style="background-color: @Appointment.Color;"></span> | ||
@Appointment.ChildContent - @Appointment.Start.ToString("htt") to @Appointment.End.ToString("htt") | ||
</div> |
Oops, something went wrong.