Blazor.CleaveJs 1.0.4

dotnet add package Blazor.CleaveJs --version 1.0.4
NuGet\Install-Package Blazor.CleaveJs -Version 1.0.4
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="Blazor.CleaveJs" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.CleaveJs --version 1.0.4
#r "nuget: Blazor.CleaveJs, 1.0.4"
#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 Blazor.CleaveJs as a Cake Addin
#addin nuget:?package=Blazor.CleaveJs&version=1.0.4

// Install Blazor.CleaveJs as a Cake Tool
#tool nuget:?package=Blazor.CleaveJs&version=1.0.4

Blazor Cleave.js

Cleave.js has a simple purpose: to help you format input text content automatically.

CleaveJs demo site

Features

  • Credit card number formatting
  • Phone number formatting (i18n js lib separated for each country to reduce size)
  • Date formatting
  • Numeral formatting
  • Custom delimiter, prefix and blocks pattern

Why

The idea is to provide an easy way to increase input field readability by formatting your typed data. By using this library, you won't need to write any mind-blowing regular expressions or mask patterns to format input text.

However, this isn't meant to replace any validation or mask library, you should still sanitize and validate your data in backend.

Installation

dotnet add package Blazor.CleaveJs

<script src="_content/Blazor.CleaveJs/cleave.js"></script>

builder.Services.AddScoped<CleaveJsProvider>();

*Optional

<script src="_content/Blazor.CleaveJs/addons/cleave-phone.ac.js"></script>

Examples

<CleaveWrapper CreditCard="true" OnCreditCardTypeChanged="(type) => _type = type">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Phone="true" PhoneRegionCode="AC">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Date="true" Delimiter="-" DatePattern="@(["Y", "m", "d"])">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Date="true" DatePattern="@(["m", "y"])">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Time="true" TimePattern="@(["h", "m", "s"])">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Time="true" TimePattern="@(["h", "m"])">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Numeral="true" NumeralThousandsGroupStyle="NumeralThousandsGroupStyleType.Thousand">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Numeral="true" NumeralThousandsGroupStyle="NumeralThousandsGroupStyleType.Lakh">
    <input id="@context" />
</CleaveWrapper>
    
<CleaveWrapper Numeral="true" NumeralThousandsGroupStyle="NumeralThousandsGroupStyleType.Wan">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Blocks="[4,4,4,4]" Uppercase="true">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Blocks="[4,4,4]" Uppercase="true" Delimiter="!">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Blocks="[4,4,4]" Uppercase="true" Delimiters="@([".", "-", "."])">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper Prefix="$" Numeral="true">
    <input id="@context" />
</CleaveWrapper>

<CleaveWrapper NumeralDecimalMark="^" Numeral="true">
    <input id="@context" />
</CleaveWrapper>
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 is compatible.  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.0.4 50 5/1/2024
1.0.3 81 4/28/2024
1.0.2 85 4/27/2024
1.0.1 81 4/27/2024
1.0.0 86 4/27/2024