Compare commits
No commits in common. "1dabf54e3933c897f8fdc27d4b450475227491d7" and "1a424571ad07d169e04bb128dfd6ff5e7b0da114" have entirely different histories.
1dabf54e39
...
1a424571ad
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
@inherits UIComponent
|
@inherits UIComponent
|
||||||
|
|
||||||
|
|
||||||
<div role="alert" class="@CompiledClassList" @attributes="CustomAttributes" @onclick="Clicked">
|
<div role="alert" class="@CompiledClassList" @attributes="CustomAttributes" @onclick="Clicked">
|
||||||
<div name="alert-content" class="alert-content">
|
<div name="alert-content" class="alert-content">
|
||||||
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
@namespace Connected.Components
|
|
||||||
@inherits UIComponent
|
|
||||||
|
|
||||||
<a @attributes="Attributes" @onclick="OnClickHandler" class="@Classname">
|
|
||||||
@ChildContent
|
|
||||||
</a>
|
|
@ -1,99 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Extensions;
|
|
||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
|
||||||
|
|
||||||
namespace Connected.Components;
|
|
||||||
|
|
||||||
public partial class Link_old : UIComponent
|
|
||||||
{
|
|
||||||
|
|
||||||
#region Events
|
|
||||||
/// <summary>
|
|
||||||
/// Link click event.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter] public EventCallback<MouseEventArgs> OnClick { get; set; }
|
|
||||||
|
|
||||||
protected async Task OnClickHandler(MouseEventArgs ev)
|
|
||||||
{
|
|
||||||
if (Disabled) return;
|
|
||||||
await OnClick.InvokeAsync(ev);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Content
|
|
||||||
private Dictionary<string, object> Attributes
|
|
||||||
{
|
|
||||||
get => Disabled ? CustomAttributes : new Dictionary<string, object>(CustomAttributes)
|
|
||||||
{
|
|
||||||
{ "href", Href },
|
|
||||||
{ "target", Target }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// The URL, which is the actual link.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Behavior)]
|
|
||||||
public string Href { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The target attribute specifies where to open the link, if Link is specified. Possible values: _blank | _self | _parent | _top | <i>framename</i>
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Behavior)]
|
|
||||||
public string Target { get; set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Styling
|
|
||||||
protected string Classname =>
|
|
||||||
new CssBuilder("typography mud-link")
|
|
||||||
.AddClass($"{Color.ToDescription()}-text")
|
|
||||||
.AddClass($"link-underline-{Underline.ToDescription()}")
|
|
||||||
.AddClass($"typography-{Typo.ToDescription()}")
|
|
||||||
// When Href is empty, link's hover cursor is text "I beam" even when Clicked has a delegate.
|
|
||||||
// To change this for more expected look change hover cursor to a pointer:
|
|
||||||
.AddClass("cursor-pointer", Href == default && OnClick.HasDelegate && !Disabled)
|
|
||||||
.AddClass($"link-disabled", Disabled)
|
|
||||||
.AddClass(AdditionalClassList)
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Child content of component.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Behavior)]
|
|
||||||
public RenderFragment ChildContent { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The color of the component. It supports the theme colors.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Appearance)]
|
|
||||||
public ThemeColor Color { get; set; } = ThemeColor.Primary;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Typography variant to use.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Appearance)]
|
|
||||||
public Typo Typo { get; set; } = Typo.body1;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Controls when the link should have an underline.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Appearance)]
|
|
||||||
public Underline Underline { get; set; } = Underline.Hover;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If true, the navlink will be disabled.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
[Category(CategoryTypes.Link.Behavior)]
|
|
||||||
public bool Disabled { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
@if (Closed == false)
|
|
||||||
{
|
|
||||||
<div role="alert" class="@CompiledClassList">
|
|
||||||
<div name="alert-content" class="alert-content">
|
|
||||||
|
|
||||||
@if (ShowGlyph)
|
|
||||||
{
|
|
||||||
<div class="alert-icon alert-icon-left">
|
|
||||||
<Glyph SVG="@Glyph" />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="alert-message">
|
|
||||||
@ChildContent
|
|
||||||
@Text
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@if (ShowCloseButton)
|
|
||||||
{
|
|
||||||
<div class="alert-close">
|
|
||||||
<Glyph SVG="@CloseButton" Click="OnCloseClick" />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
@ -1,90 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class Alert
|
|
||||||
{
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowGlyph { get; set; } = true;
|
|
||||||
private string Glyph { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowCloseButton { get; set; } = false;
|
|
||||||
|
|
||||||
private string CloseButton { get; set; } = Icons.Material.Outlined.Close;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public bool Closed { get; set; } = false;
|
|
||||||
|
|
||||||
[Parameter, EditorRequired]
|
|
||||||
public string Text { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public Severity Severity { get; set;} = Severity.Normal;
|
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
|
||||||
{
|
|
||||||
switch (Severity)
|
|
||||||
{
|
|
||||||
case Severity.Normal:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Material.Outlined.EventNote;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Severity.Info:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Material.Outlined.Info;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Severity.Success:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Custom.Uncategorized.AlertSuccess;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Severity.Warning:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Material.Outlined.ReportProblem;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case Severity.Error:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Material.Filled.ErrorOutline;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
Glyph = Icons.Material.Outlined.EventNote;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await base.OnParametersSetAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Child content of the component.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public RenderFragment? ChildContent { get; set; }
|
|
||||||
|
|
||||||
private void OnCloseClick()
|
|
||||||
{
|
|
||||||
Closed = true;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ClassList { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// Contains the default container classlist and the user defined classes.
|
|
||||||
/// </summary>
|
|
||||||
private string CompiledClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder("alert")
|
|
||||||
.AddClass($"alert-text-{Severity}")
|
|
||||||
.AddClass(ClassList)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<button
|
|
||||||
onclick="@OnClick"
|
|
||||||
class="@ButtonClassList"
|
|
||||||
style="@ButtonStyleList"
|
|
||||||
onmouseover="@HoverOn"
|
|
||||||
onmouseout="@HoverOff">
|
|
||||||
@Text
|
|
||||||
</button>
|
|
@ -1,92 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class Button
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Text shown inside the button
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Text { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
/// <summary>
|
|
||||||
/// Button click event.
|
|
||||||
/// </summary>
|
|
||||||
public EventCallback<MouseEventArgs> Click { get; set; }
|
|
||||||
protected async Task OnClick(MouseEventArgs e)
|
|
||||||
{
|
|
||||||
await Click.InvokeAsync(e);
|
|
||||||
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Disabled or enabled property of the button. Default: false
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Disabled { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Glyph for the button.
|
|
||||||
/// Default: string.Empty
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Glyph { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Position of the glyph relative to button Text parameter. Default: GlyphPosition.LEFT (Possible options: GlyphPosition.LEFT, GlyphPosition.TOP, GlyphPosition.RIGHT, GlyphPosition.BOTTOM)
|
|
||||||
/// If Glyph parameter is empty this parameter is ignored
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public Position GlyphPosition { get; set; } = Position.Left;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// HEX value of the color for the glyph custom color. Default: black (#000000)
|
|
||||||
/// If Glyph parameter is empty this parameter is ignored
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string GlyphColor { get; set; } = "#000000";
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string ButtonClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Style { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string ButtonStyleList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new StyleBuilder()
|
|
||||||
.AddStyle(Style)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// When mouse is over the component
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task HoverOn()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// When mouse is away from component
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task HoverOff()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
<svg height="@Height" width="@Width" style="fill:@Color;" class="@GlyphClassList" @onclick="@OnClick">
|
|
||||||
@((MarkupString)SVG)
|
|
||||||
</svg>
|
|
@ -1,44 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN
|
|
||||||
{
|
|
||||||
public partial class Glyph
|
|
||||||
{
|
|
||||||
[Parameter]
|
|
||||||
public string SVG { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Color { get; set; } = "#000000";
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public int Width { get; set; } = 30;
|
|
||||||
[Parameter]
|
|
||||||
public int Height { get; set; } = 30;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string GlyphClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
/// <summary>
|
|
||||||
/// Button click event.
|
|
||||||
/// </summary>
|
|
||||||
public EventCallback<MouseEventArgs> Click { get; set; }
|
|
||||||
protected async Task OnClick(MouseEventArgs e)
|
|
||||||
{
|
|
||||||
await Click.InvokeAsync(e);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
internal interface ISelect
|
|
||||||
{
|
|
||||||
public object FilterItems();
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<div>
|
|
||||||
<input
|
|
||||||
@bind="@Value"
|
|
||||||
@oninput="ChangeValueAsync"
|
|
||||||
type="datetime-local"
|
|
||||||
data-date-format="@Format">
|
|
||||||
</div>
|
|
@ -1,63 +0,0 @@
|
|||||||
|
|
||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class InputDate
|
|
||||||
{
|
|
||||||
#region parameters
|
|
||||||
/// <summary>
|
|
||||||
/// Class
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; }
|
|
||||||
|
|
||||||
private string FixedInputClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private InputType InputType { get; set; } = InputType.Date;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show clear button.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowClearButton { get; set; } = false;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ErrorText { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Label { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Format { get; set; } = "DD.MM.YYYY";
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Variables
|
|
||||||
private string _clearIcon = Icons.Material.Filled.Clear;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public DateTime Value { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public EventCallback<DateTime> ValueChanged { get; set; }
|
|
||||||
|
|
||||||
private async Task ChangeValueAsync(ChangeEventArgs args)
|
|
||||||
{
|
|
||||||
DateTime value = DateTime.Parse(args.Value.ToString());
|
|
||||||
await ValueChanged.InvokeAsync(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Lifecycle
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
@typeparam Type
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<input
|
|
||||||
@bind="@Value"
|
|
||||||
@oninput="ChangeValueAsync"
|
|
||||||
type="number"
|
|
||||||
step="@Step"
|
|
||||||
/>
|
|
||||||
</div>
|
|
@ -1,77 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class InputNumber<Type>
|
|
||||||
{
|
|
||||||
#region parameters
|
|
||||||
/// <summary>
|
|
||||||
/// Class
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; }
|
|
||||||
|
|
||||||
private string InputFieldClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Type of the input element. It should be a valid HTML5 input type.
|
|
||||||
/// </summary>
|
|
||||||
private InputType InputType { get; set; } = InputType.Number;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show clear button.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowClearButton { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The show input character counter
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowCharacterCounter { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ErrorText { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Label { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Step of Numeric field up/down. Only used when InputType.Number is used
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public double Step { get; set; } = 1;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Variables
|
|
||||||
private string _clearIcon = Icons.Material.Filled.Clear;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public Type Value { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public EventCallback<Type> ValueChanged { get; set; }
|
|
||||||
|
|
||||||
private async Task ChangeValueAsync(ChangeEventArgs args)
|
|
||||||
{
|
|
||||||
Type param = (Type)Convert.ChangeType(args.Value, typeof(Type));
|
|
||||||
|
|
||||||
|
|
||||||
await ValueChanged.InvokeAsync(param);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Lifecycle
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
<div>
|
|
||||||
@if (NumOfLines > 1)
|
|
||||||
{
|
|
||||||
<textarea
|
|
||||||
@bind="@Value"
|
|
||||||
@oninput="ChangeValueAsync"
|
|
||||||
rows="@NumOfLines"
|
|
||||||
required="@Required"
|
|
||||||
disabled="@Disabled"
|
|
||||||
readonly="@Readonly"
|
|
||||||
class="@InputFieldClassList"
|
|
||||||
placeholder="@Placeholder">
|
|
||||||
@Value
|
|
||||||
</textarea>
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
<input
|
|
||||||
@bind="@Value"
|
|
||||||
@oninput="ChangeValueAsync"
|
|
||||||
type="@InputType"
|
|
||||||
placeholder="@Placeholder"
|
|
||||||
required="@Required"
|
|
||||||
disabled="@Disabled"
|
|
||||||
readonly="@Readonly"
|
|
||||||
class="@InputFieldClassList" />
|
|
||||||
}
|
|
||||||
</div>
|
|
@ -1,124 +0,0 @@
|
|||||||
|
|
||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class InputText
|
|
||||||
{
|
|
||||||
#region parameters
|
|
||||||
/// <summary>
|
|
||||||
/// Class
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; }
|
|
||||||
|
|
||||||
private string InputFieldClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private InputType InputType { get; set; } = InputType.Text;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public bool IsPasswordField { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show clear button.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Clearable { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required property
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Required { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show clear button.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Disabled { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Show clear button.
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Readonly { get; set; } = false;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The show input character counter
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool ShowCharCounter { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ErrorText { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Label { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Placeholder { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If more than 1, we have a textarea with defined number of lines
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public int NumOfLines
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _numberOfLines;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value < 1)
|
|
||||||
{
|
|
||||||
_numberOfLines = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_numberOfLines = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private int _numberOfLines = 1;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Variables
|
|
||||||
private string _clearIcon = Icons.Material.Filled.Clear;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Value { get; set; }
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public EventCallback<string> ValueChanged { get; set; }
|
|
||||||
|
|
||||||
private async Task ChangeValueAsync(ChangeEventArgs args)
|
|
||||||
{
|
|
||||||
|
|
||||||
await ValueChanged.InvokeAsync(args.Value.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Lifecycle
|
|
||||||
|
|
||||||
protected async Task OnParametersSetAsync()
|
|
||||||
{
|
|
||||||
if (IsPasswordField) InputType = InputType.Password;
|
|
||||||
|
|
||||||
|
|
||||||
await base.OnParametersSetAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<a
|
|
||||||
class="@LinkClassList"
|
|
||||||
style="@LinkStyleList"
|
|
||||||
href="@Url"
|
|
||||||
target="@Target" >
|
|
||||||
@Text
|
|
||||||
</a>
|
|
@ -1,49 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class Link
|
|
||||||
{
|
|
||||||
[Parameter, EditorRequired]
|
|
||||||
public string Url { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter, EditorRequired]
|
|
||||||
public string Text { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
[Parameter, EditorRequired]
|
|
||||||
public string Target { get; set; } = "_self";
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string LinkClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Style { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string LinkStyleList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new StyleBuilder()
|
|
||||||
.AddStyle(Style)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(Text)) Text = Url;
|
|
||||||
await base.OnParametersSetAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
@typeparam ValueType
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.selectbox {
|
|
||||||
width: 150px;
|
|
||||||
height: 100px;
|
|
||||||
background: red;
|
|
||||||
transition: height 0.05s;
|
|
||||||
overflow:hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.selectbox:hover {
|
|
||||||
height: 400px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<div class="selectbox @CompiledClassList">
|
|
||||||
@if (SearchFieldEnabled)
|
|
||||||
{
|
|
||||||
//search field
|
|
||||||
}
|
|
||||||
|
|
||||||
@foreach (SelectItem<ValueType> item in Items)
|
|
||||||
{
|
|
||||||
<Connected.ComponentsN.SelectItem ValueType="ValueType" Text="@item.Text" Value="item.Value" />
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@if (_pagination()>1)
|
|
||||||
{
|
|
||||||
//pagination
|
|
||||||
}
|
|
||||||
</div>
|
|
@ -1,63 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class Select<ValueType>
|
|
||||||
{
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public bool SearchFieldEnabled { get; set; } = false;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public int MaxVisibleItems { get; set; } = 7;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public List<SelectItem<ValueType>> Items
|
|
||||||
{
|
|
||||||
get{
|
|
||||||
if (FilterText.Length > 0)
|
|
||||||
{
|
|
||||||
return _items.Where(i => i.Value.ToString().Contains(FilterText) || i.Text.ToString().Contains(FilterText)).ToList();
|
|
||||||
}
|
|
||||||
return _items;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
_items= value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<SelectItem<ValueType>> _items = new List<SelectItem<ValueType>>();
|
|
||||||
|
|
||||||
private int ItemsCount => Items.Count();
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public int SelectedIndex { get; set; } = 0;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string FilterText { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private int _pagination()
|
|
||||||
{
|
|
||||||
int result = 0;
|
|
||||||
if (MaxVisibleItems<ItemsCount)
|
|
||||||
{
|
|
||||||
result = (int)(ItemsCount / MaxVisibleItems) + (ItemsCount % MaxVisibleItems);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string ClassList { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// Contains the default container classlist and the user defined classes.
|
|
||||||
/// </summary>
|
|
||||||
private string CompiledClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(ClassList)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
@typeparam ValueType
|
|
||||||
|
|
||||||
<div>
|
|
||||||
@Text
|
|
||||||
</div>
|
|
@ -1,20 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class SelectItem<ValueType>
|
|
||||||
{
|
|
||||||
[Parameter, EditorRequired]
|
|
||||||
public ValueType Value { get; set; }
|
|
||||||
[Parameter]
|
|
||||||
public string Text { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(Text)) {
|
|
||||||
|
|
||||||
if (Value is not null)
|
|
||||||
Text = Value.ToString();
|
|
||||||
}
|
|
||||||
await base.OnParametersSetAsync();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
@using Connected.ComponentsN
|
|
||||||
|
|
||||||
<button onclick="@OnClick" style="@ButtonStyleList" onmouseover="@HoverOn" onmouseout="@HoverOff">
|
|
||||||
@Text
|
|
||||||
</button>
|
|
@ -1,148 +0,0 @@
|
|||||||
using Connected.Utilities;
|
|
||||||
using Microsoft.AspNetCore.Components;
|
|
||||||
using Microsoft.AspNetCore.Components.Web;
|
|
||||||
|
|
||||||
namespace Connected.ComponentsN;
|
|
||||||
public partial class ToggleButton
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Define state of ToggleButton: Default: false
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Toggled { get; set; } = false;
|
|
||||||
|
|
||||||
private void Toggle()
|
|
||||||
{
|
|
||||||
Toggled=!Toggled;
|
|
||||||
StateHasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Text content
|
|
||||||
/// <summary>
|
|
||||||
/// default Text shown inside the button
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Text { get; set; } = string.Empty;
|
|
||||||
/// <summary>
|
|
||||||
/// Text of toggled button shown inside the button
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string ToggleText { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string TextToShow()
|
|
||||||
{
|
|
||||||
if (Toggled) return ToggleText;
|
|
||||||
return Text;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Glyph
|
|
||||||
/// <summary>
|
|
||||||
/// Glyph for the button.
|
|
||||||
/// Default: string.Empty
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string Glyph { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Glyph for the button.
|
|
||||||
/// Default: string.Empty
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string ToggleGlyph { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string GlyphToShow()
|
|
||||||
{
|
|
||||||
if (Toggled) return ToggleGlyph;
|
|
||||||
return Glyph;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Position of the glyph relative to button Text parameter. Default: Position.Left (Possible options: Top,Bottom,Center,Left,Right,Start,End)
|
|
||||||
/// If Glyph parameter is empty this parameter is ignored
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public Position GlyphPosition { get; set; } = Position.Left;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// HEX value of the color for the glyph custom color. Default: black (#000000)
|
|
||||||
/// If Glyph parameter is empty this parameter is ignored
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string GlyphColor { get; set; } = "#000000";
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// HEX value of the color for the glyph custom color. Default: black (#000000)
|
|
||||||
/// If Glyph parameter is empty this parameter is ignored
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public string ToggleGlyphColor { get; set; } = "#000000";
|
|
||||||
|
|
||||||
private string GlyphColorToUse()
|
|
||||||
{
|
|
||||||
if (Toggled) return ToggleGlyphColor;
|
|
||||||
return GlyphColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
/// <summary>
|
|
||||||
/// Button click event.
|
|
||||||
/// </summary>
|
|
||||||
public EventCallback<MouseEventArgs> Click { get; set; }
|
|
||||||
protected async Task OnClick(MouseEventArgs e)
|
|
||||||
{
|
|
||||||
await Click.InvokeAsync(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Disabled or enabled property of the button. Default: false
|
|
||||||
/// </summary>
|
|
||||||
[Parameter]
|
|
||||||
public bool Disabled { get; set; } = false;
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Class { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string ButtonClassList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new CssBuilder()
|
|
||||||
.AddClass(Class)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Parameter]
|
|
||||||
public string Style { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
private string ButtonStyleList
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new StyleBuilder()
|
|
||||||
.AddStyle(Style)
|
|
||||||
.Build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// When mouse is over the component
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task HoverOn()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// When mouse is away from component
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task HoverOff()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -17,13 +17,6 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="compilerconfig.json" />
|
<None Include="compilerconfig.json" />
|
||||||
<None Include="ComponentsN\ToggleButton.razor" />
|
|
||||||
<None Include="ComponentsN\Button.razor" />
|
|
||||||
<None Include="ComponentsN\Glyph.razor" />
|
|
||||||
<None Include="ComponentsN\Link.razor" />
|
|
||||||
<None Include="ComponentsN\InputDate.razor" />
|
|
||||||
<None Include="ComponentsN\InputNumber.razor" />
|
|
||||||
<None Include="ComponentsN\InputText.razor" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
namespace Connected.Enums;
|
|
||||||
|
|
||||||
public enum LinkTarget
|
|
||||||
{
|
|
||||||
_blank, //Opens the linked document in a new window or tab
|
|
||||||
_self, // Opens the linked document in the same frame as it was clicked(this is default)
|
|
||||||
_parent, // Opens the linked document in the parent frame
|
|
||||||
_top // Opens the linked document in the full body of the window
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user