Table of Contents

Class NumberField<T>

Namespace
AbanoubNassem.Trinity.Fields
Assembly
AbanoubNassem.Trinity.dll

Represents a number field in Trinity framework.

public class NumberField<T> : TrinityField<NumberField<T>, T>, ITrinityComponent, ITrinityField, IFormComponent

Type Parameters

T
Inheritance
NumberField<T>
Implements
Inherited Members

Constructors

NumberField(string)

public NumberField(string columnName)

Parameters

columnName string

Properties

ButtonLayout

Gets or sets the layout of the increment and decrement buttons.

public string? ButtonLayout { get; protected set; }

Property Value

string

ComponentName

The component name in the front-end side.

public override string ComponentName { get; }

Property Value

string

Currency

Gets or sets the currency symbol of the number field component.

public string? Currency { get; protected set; }

Property Value

string

CurrencyDisplay

Gets or sets the display format of the currency symbol of the number field component.

public string? CurrencyDisplay { get; protected set; }

Property Value

string

DecrementButtonClassName

Gets or sets the CSS class name for the decrement button.

public string? DecrementButtonClassName { get; protected set; }

Property Value

string

DecrementButtonIcon

Gets or sets the icon class name for the decrement button.

public string? DecrementButtonIcon { get; protected set; }

Property Value

string

FormatMode

Gets or sets the format mode of the field.

public string FormatMode { get; protected set; }

Property Value

string

IncrementButtonClassName

Gets or sets the CSS class name for the increment button.

public string? IncrementButtonClassName { get; protected set; }

Property Value

string

IncrementButtonIcon

Gets or sets the icon class name for the increment button.

public string? IncrementButtonIcon { get; protected set; }

Property Value

string

InputPrefix

Gets or sets the input prefix of the number field component.

public string? InputPrefix { get; protected set; }

Property Value

string

InputSuffix

Gets or sets the input suffix of the number field component.

public string? InputSuffix { get; protected set; }

Property Value

string

Max

Gets or sets the maximum value of the number field component.

public int? Max { get; protected set; }

Property Value

int?

MaxFractionDigits

Gets or sets the maximum fraction digits of the field.

public int? MaxFractionDigits { get; protected set; }

Property Value

int?

Min

Gets or sets the minimum value of the number field component.

public int? Min { get; protected set; }

Property Value

int?

MinFractionDigits

Gets or sets the minimum fraction digits of the field.

public int? MinFractionDigits { get; protected set; }

Property Value

int?

ShowButtons

Gets or sets a value indicating whether to display increment and decrement buttons.

public bool ShowButtons { get; protected set; }

Property Value

bool

ShowIcon

Gets or sets a value indicating whether to show icon in the field.

public bool ShowIcon { get; protected set; }

Property Value

bool

Step

Gets or sets the step value used for incrementing or decrementing the value of the field.

public float? Step { get; protected set; }

Property Value

float?

Methods

SetCurrency(string, CurrencyDisplayTypes)

Sets the currency symbol and display format of the number field component.

public NumberField<T> SetCurrency(string currency, CurrencyDisplayTypes display = CurrencyDisplayTypes.Symbol)

Parameters

currency string

The currency symbol to be set.

display CurrencyDisplayTypes

The display format of the currency symbol to be set.

Returns

NumberField<T>

The current NumberField<T> instance.

SetDecrementButton(string, string)

Sets the class name and icon for the decrement button of the number field.

public NumberField<T> SetDecrementButton(string decrementButtonClassName = "p-button-danger", string decrementButtonIcon = "pi pi-minus")

Parameters

decrementButtonClassName string

The class name for the decrement button. Default is "p-button-danger".

decrementButtonIcon string

The icon for the decrement button. Default is "pi pi-minus".

Returns

NumberField<T>

The current instance of the NumberField<T> class.

SetFormatMode(FormatModeTypes)

Sets the format mode of the field.

public NumberField<T> SetFormatMode(FormatModeTypes mode = FormatModeTypes.Decimal)

Parameters

mode FormatModeTypes

The format mode type.

Returns

NumberField<T>

The current NumberField<T> instance.

SetIncrementButton(string, string)

Sets the CSS class name and icon class name for the increment button.

public NumberField<T> SetIncrementButton(string incrementButtonClassName = "p-button-success", string incrementButtonIcon = "pi pi-plus")

Parameters

incrementButtonClassName string

The CSS class name for the increment button. Default value is "p-button-success".

incrementButtonIcon string

The icon class name for the increment button. Default value is "pi pi-plus".

Returns

NumberField<T>

The current instance of the NumberField<T> class.

SetInputPrefix(string)

Sets the input prefix of the number field component.

public NumberField<T> SetInputPrefix(string prefix)

Parameters

prefix string

The input prefix to be set.

Returns

NumberField<T>

The current NumberField<T> instance.

SetInputSuffix(string)

Sets the input suffix of the number field component.

public NumberField<T> SetInputSuffix(string suffix)

Parameters

suffix string

The input suffix to be set.

Returns

NumberField<T>

The current NumberField<T> instance.

SetMax(int)

Sets the maximum value of the number field component.

public NumberField<T> SetMax(int max)

Parameters

max int

The maximum value to be set.

Returns

NumberField<T>

The current NumberField<T> instance.

SetMaxFractionDigits(int)

Sets the maximum and minimum fraction digits of the field.

public NumberField<T> SetMaxFractionDigits(int maxFractionDigits)

Parameters

maxFractionDigits int

The maximum number of fraction digits.

Returns

NumberField<T>

The current NumberField<T> instance.

SetMin(int)

Sets the minimum value of the number field component.

public NumberField<T> SetMin(int min)

Parameters

min int

The minimum value to be set.

Returns

NumberField<T>

The current NumberField<T> instance.

SetMinFractionDigits(int)

Sets the minimum and maximum fraction digits of the field.

public NumberField<T> SetMinFractionDigits(int minFractionDigits)

Parameters

minFractionDigits int

The minimum number of fraction digits.

Returns

NumberField<T>

The current NumberField<T> instance.

SetShowButtons(bool, ButtonLayoutTypes)

Sets whether to display increment and decrement buttons and the layout of the buttons.

public NumberField<T> SetShowButtons(bool showButtons = true, ButtonLayoutTypes buttonLayout = ButtonLayoutTypes.Stacked)

Parameters

showButtons bool

Whether to display increment and decrement buttons.

buttonLayout ButtonLayoutTypes

The layout of the buttons. Default value is Stacked.

Returns

NumberField<T>

The current instance of the NumberField<T> class.

SetStep(float)

Sets the step value used for incrementing or decrementing the value of the field.

public NumberField<T> SetStep(float step)

Parameters

step float

The step value to set.

Returns

NumberField<T>

The current instance of the NumberField<T> class.