-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 additions
and
0 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
11 changes: 11 additions & 0 deletions
11
src/DragonFly.Core/ContentItems/Models/Fields/Base/ColorField.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,11 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
namespace DragonFly; | ||
|
||
[FieldOptions(typeof(ColorFieldOptions))] | ||
public class ColorField : TextBaseField | ||
{ | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/DragonFly.Core/ContentItems/Models/Fields/Base/ColorFieldOptions.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,18 @@ | ||
// Copyright (c) usercode | ||
// https://github.com/usercode/DragonFly | ||
// MIT License | ||
|
||
namespace DragonFly; | ||
|
||
public class ColorFieldOptions : ContentFieldOptions | ||
{ | ||
public ColorFieldOptions() | ||
{ | ||
|
||
} | ||
|
||
public override IContentField CreateContentField() | ||
{ | ||
return new ColorField(); | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/DragonFly.Razor/Pages/ContentItems/Fields/ColorFieldView.razor
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,9 @@ | ||
@inherits FieldComponent<ColorField, ColorFieldOptions> | ||
|
||
<div class="color-field"> | ||
<div class="input-group"> | ||
<span class="input-group-text">@Field.Value</span> | ||
<BSInput InputType="InputType.Color" @bind-Value="Field.Value" /> | ||
<BSButton Color="BSColor.Light" title="Clear" OnClick="x => Field.Value = null"><i class="fas fa-times"></i></BSButton> | ||
</div> | ||
</div> |