NumericTextBox Typescript API

Interface

NumericTextBox

input field for entering a number. Includes number formatting for Engineers and Scientists.

Selector

smart-numeric-text-box

Properties

animationAnimation

Sets or gets the animation mode. Animation is disabled when the property is set to 'none'

Default valueadvanced

decimalSeparatorstring

Sets or gets the char to use as the decimal separator in numeric values.

Default value".

disabledboolean

Enables or disables the smartNumericTextBox.

Default valuefalse

dropDownAppendToany

Sets the parent container of the radix dropdown.

dropDownEnabledboolean

Determines if a dropdown will be displayed when the radix display button is clicked. The dropdown shows options for changing to the binary, octal, decimal, and hexadecimal numeral systems.

Default valuefalse

enableMouseWheelActionboolean

Enables or disables incrementing/decrementing the value using the mouse wheel in smartNumericTextBox.

Default valuefalse

hintstring

Sets additional helper text below the element.

Default value"

inputFormatNumericTextBoxInputFormat

Sets or gets the input format of the widget. Setting this property dynamically can lead to precision loss.

Default valueinteger

labelstring

Sets a label above the element.

Default value"

leadingZerosboolean

If this property is enabled, leading zeros are added (if necessary) to the binary and hexadecimal representations of a number based on wordLength.

Default valuefalse

localestring

Sets or gets the language. Used in conjunction with the property messages.

Default value"en

localizeFormatFunctionany

Callback, related to localization module.

maxany

Sets or gets the maximum value of the widget.

messagesany

Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.

Default value


"en": {

"propertyUnknownType": "'{{name}}' property is with undefined 'type' member!",

"propertyInvalidValue": "Invalid '{{name}}' property value! Actual value: {{actualValue}}, Expected value: {{value}}!",

"propertyInvalidValueType": "Invalid '{{name}}' property value type! Actual type: {{actualType}}, Expected type: {{type}}!",

"elementNotInDOM": "Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",

"moduleUndefined": "Module is undefined.",

"missingReference": "{{elementType}}: Missing reference to {{files}}.",

"htmlTemplateNotSuported": "{{elementType}}: Browser doesn't support HTMLTemplate elements.",

"invalidTemplate": "{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM.",

"binary": "BIN",

"octal": "OCT",

"decimal": "DEC",

"hexadecimal": "HEX",

"integerOnly": "smartNumericTextBox: The property {{property}} can only be set when inputFormat is integer.",

"noInteger": "smartNumericTextBox: the property {{property}} cannot be set when inputFormat is integer.",

"significantPrecisionDigits": "smartNumericTextBox: the properties significantDigits and precisionDigits cannot be set at the same time."

}


minany

Sets or gets the minimum value of the widget.

namestring

The name of the control.

Default value"

nullableboolean

Enables or disables the setting of the value property to null or empty string.

Default valuefalse

openedboolean

Sets or gets whether the radix dropdown is opened. Applicable only when dropDownEnabled is true.

Default valuefalse

outputFormatStringstring

Sets or gets the pattern which the input value is displayed in when the element is not focused. All formats available to the NumberRenderer class can be applied as outputFormatString.

Default value"null

placeholderstring

Determines the widget's place holder displayed when the widget's input is empty.

Default value"""

precisionDigitsnumber

Determines the number of digits after the decimal point. Applicable when inputFormat is either 'floatingPoint' or 'complex'.

radixNumericTextBoxRadix

Sets or gets the radix of the smartNumericTextBox. The radix specifies the numeral system in which to display the widget's value. Applicable only when inputFormat is 'integer'.

Default value10

radixDisplayboolean

Enables or disables the radix display button of the smartNumericTextBox. Applicable only when inputFormat is 'integer'.

Default valuefalse

radixDisplayPositionNumericTextBoxDisplayPosition

Sets or gets the position of the radix display button of the smartNumericTextBox.

Default valueleft

readonlyboolean

Sets or gets the readonly state of the smartNumericTextBox.

Default valuefalse

scientificNotationboolean

Enables or disables outputting the value in scientific notation. Applicable only when inputFormat is 'integer'.

Default valuefalse

showDropDownValuesboolean

Determines whether to show the current value represented in all four numeral systems in the drop down.

Default valuefalse

showUnitboolean

Enables or disables the visibility of the units.

Default valuefalse

significantDigitsnumber

Determining how many significant digits are in a number. Applicable when inputFormat is either 'floatingPoint' or 'complex'.

Default value8

spinButtonsboolean

Enables or disables the visibility of the spin buttons.

Default valuefalse

spinButtonsDelaynumber

Sets the delay between repeats of spin buttons in miliseconds.

Default value75

spinButtonsInitialDelaynumber

Sets a delay before the first repeat iteration of spin buttons in miliseconds.

Default value0

spinButtonsPositionNumericTextBoxDisplayPosition

Sets or gets the position of the spin buttons of the smartNumericTextBox.

Default valueright

spinButtonsStepany

Sets or gets the increase/decrease step.

Default value1

themestring

Determines the theme. Theme defines the look of the element

Default value"

unfocusableboolean

If is set to true, the element cannot be focused.

Default valuefalse

unitstring

Sets or gets the name of unit used in smartNumericTextBox widget.

Default value"kg

validationValidation

Sets the value's validation by min/max. If 'strict' is applied, the value is always validated by min and max. If 'interaction' is applied, programmatic value changes are not coerced to min/max and if min/max are changed, resulting in the current value being out of range, the value is not coerced, and no change event is fired.

Default valuestrict

valueany

Sets or gets the value of the smartNumericTextBox widget.

Default value0

wordLengthWordLength

Sets or gets the word length. Applicable only when inputFormat is 'integer'. If min and/or max are not set by default, they will be set automatically based on the specified word length.

Default valueint32

onchange((this: Window, ev: Event) => any) | null

This event is triggered when the value is changed.

Arguments

evEvent

onchanging((this: Window, ev: Event) => any) | null

This event is triggered when the value in the input is being changed via keypress or paste.

Arguments

evEvent

onclose((this: Window, ev: Event) => any) | null

This event is triggered when the dropdown is closed.

Arguments

evEvent

onclosing((this: Window, ev: Event) => any) | null

This event is triggered when the dropdown is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.

Arguments

evEvent

onopen((this: Window, ev: Event) => any) | null

This event is triggered when the dropdown is opened.

Arguments

evEvent

onopening((this: Window, ev: Event) => any) | null

This event is triggered when the dropdown is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function.

Arguments

evEvent

onradixchange((this: Window, ev: Event) => any) | null

This event is triggered when the radix is changed.

Arguments

evEvent

Methods

focus(): void

Focuses the NumericTextBox.


val( value?: string | number, suppressValidation?: boolean): string

Get/set the value of the NumericTextBox.

Arguments

value?string | number

The value to be set. If no parameter is passed, returns the displayed value of the smartNumericTextBox.

suppressValidation?boolean

If true is passed, the passed value will be set to the smartNumericTextBox without validation.

Returnsstring


Enums

Animation

None Simple Advanced

NumericTextBoxDisplayPosition

Left Right

NumericTextBoxInputFormat

Integer FloatingPoint Complex

NumericTextBoxRadix

Two Base8 Base10 Base16 Binary Octal Decimal Hexadecimal

Validation

Strict Interaction

WordLength

Int8 Uint8 Int16 Uint16 Int32 Uint32 Int64 Uint64