-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to opt in to prerelease versions
- Loading branch information
Showing
18 changed files
with
261 additions
and
66 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="toggle"> | ||
<input type="radio" id="@Id false" name="@Id" value="false" checked="@(!Value)" @onchange="SetValue" /> | ||
<label for="@Id false">Disabled</label> | ||
|
||
<input type="radio" id="@Id true" name="@Id" value="true" checked="@(Value)" @onchange="SetValue" /> | ||
<label for="@Id true">Enabled</label> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
src/EventLogExpert/Shared/Components/BooleanSelect.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// // Copyright (c) Microsoft Corporation. | ||
// // Licensed under the MIT License. | ||
|
||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace EventLogExpert.Shared.Components; | ||
|
||
public partial class BooleanSelect | ||
{ | ||
[Parameter] public string Id { get; set; } = Guid.NewGuid().ToString(); | ||
|
||
[Parameter] public bool Value { get; set; } | ||
|
||
[Parameter] public EventCallback<bool> ValueChanged { get; set; } | ||
|
||
private async Task SetValue(ChangeEventArgs args) | ||
{ | ||
if (!bool.TryParse(args.Value?.ToString(), out bool value)) { return; } | ||
|
||
Value = value; | ||
await ValueChanged.InvokeAsync(Value); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/EventLogExpert/Shared/Components/BooleanSelect.razor.css
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,46 @@ | ||
.toggle { | ||
display: flex; | ||
overflow: hidden; | ||
margin-left: 5px; | ||
} | ||
|
||
.toggle input { | ||
position: absolute !important; | ||
clip: rect(0, 0, 0, 0); | ||
height: 1px; | ||
width: 1px; | ||
border: 0; | ||
overflow: hidden; | ||
} | ||
|
||
.toggle label { | ||
background-color: var(--background-darkgray); | ||
color: var(--clr-lightblue); | ||
line-height: 1; | ||
text-align: center; | ||
padding: 4px 8px; | ||
margin-right: -1px; | ||
border: 1px solid rgba(0, 0, 0, 0.2); | ||
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1); | ||
transition: all 0.1s ease-in-out; | ||
} | ||
|
||
.toggle label:hover { cursor: pointer; } | ||
|
||
.toggle input:checked + label:first-of-type { | ||
background-color: var(--clr-red); | ||
box-shadow: none; | ||
color: #fff; | ||
opacity: 0.75; | ||
} | ||
|
||
.toggle input:checked + label:last-of-type { | ||
background-color: var(--clr-green); | ||
box-shadow: none; | ||
color: var(--clr-black); | ||
opacity: 0.75; | ||
} | ||
|
||
.toggle label:first-of-type { border-radius: 4px 0 0 4px; } | ||
|
||
.toggle label:last-of-type { border-radius: 0 4px 4px 0; } |
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 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
Oops, something went wrong.