Omu.BlazorAwesome 1.3.1

dotnet add package Omu.BlazorAwesome --version 1.3.1                
NuGet\Install-Package Omu.BlazorAwesome -Version 1.3.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Omu.BlazorAwesome" Version="1.3.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Omu.BlazorAwesome --version 1.3.1                
#r "nuget: Omu.BlazorAwesome, 1.3.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Omu.BlazorAwesome as a Cake Addin
#addin nuget:?package=Omu.BlazorAwesome&version=1.3.1

// Install Omu.BlazorAwesome as a Cake Tool
#tool nuget:?package=Omu.BlazorAwesome&version=1.3.1                

Blazor Awesome Components

buildtest NuGet

Live demo: blazor.aspnetawesome.com

Installation: aspnetawesome.com/learn/blazor/Installation

Demos downloads: Blazor Server Blazor Wasm

Getting started

(Installation and DropdownList tutorial)

  1. Install the library into your blazor project as shown here
  2. In your blazor page (Home.razor for example) add this code:
<OButton>hi</OButton>

<ODropdownList @bind-Value="input.Dropdown1" Opt="opt" />

<ODropdownList TKey="int" Opt="opt" />

@code {
    private InputModel input = new();

    private DropdownOpt opt = new DropdownOpt
        {
            Data = new KeyContent[]
            {
                new KeyContent(1, "apple"),
                new KeyContent(2, "banana"),
                new KeyContent(3, "cherry"),
            }
        };

    class InputModel
    {
        public int? Dropdown1 { get; set; }
    }
}
  1. Hit Ctrl+F5 in Visual Studio and try the Button and the 2 DropdownLists.

Open a popup

  1. In your @code section add this:
private OPopup popup1;
  1. In the markup add this:
<br />
<OPopup @ref="popup1" Opt="@(new(){ Modal = true, Title = "My Modal Popup", OutClickClose = true })">
    <div style="min-width: 30vw; padding: 1em;">
        Modal popup content
    </div>
</OPopup>
<OButton OnClick="() => popup1.Open()">Open popup</OButton>
  1. Hit Ctrl+F5 and try clicking the Open popup button.

Grid with column filter

  1. Add this to your markup:
<br />
<br />
<OGrid Opt="gopt" />
  1. Add this to you @code section
private GridOpt<Lunch> gopt = new();

protected override void OnInitialized()
{
    initGrid();
}

private void initGrid()
{
    gopt.ContentHeight = 250;

    gopt.KeyProp = m => m.Id;
    
    gopt.GetQuery = () => new Lunch[]
    {
        new Lunch { Id = 1, Name = "apple"},
        new Lunch { Id = 2, Name = "banana"},
        new Lunch { Id = 3, Name = "cherry"},
    }.AsQueryable();

    gopt.FilterRow = true;

    gopt.Column(new()
        {
            For = m => m.Id,
            Width = 100
        });

    gopt.Column(new()
        {
            For = m => m.Name
        })
    .StringFilter(gopt, this);
}

class Lunch
{
    public int Id { get; set; }

    public string Name { get; set; }
}
  1. Hit Ctrl + F5, and try the grid, you can sort, group, filter by the Name Column, and pick your columns from the bottom corner menu.

Multiselect, Multicheck and Combobox

We can reuse the opt options object from the 1st tutorial "Getting started", to demonstrate other editors. After the DropdownList paste this code:

<br />
<br />
<OMultiselect TKey="int" Opt="opt" />
<OMulticheck TKey="int" Opt="opt" />
<OCombobox Opt="opt" />

You can use @bind-Value="Prop1" instead of specifying the TKey, as shown for the DropdownList, in that case Prop1 could be of type IEnumerable<int>. The combobox bind-Value property type should be object because its value can be either string or the key type.


Video Tutorial

https://youtu.be/GoFudnfTUys

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.1 117 8/7/2024
1.3.0 82 7/18/2024
1.2.10 107 6/3/2024
1.1.19 106 5/31/2024