MoneyInput
Properties
- value
(number)
:
The current value of the input field. It can be a floating-point number if precision in decimal places is specified.
- onInput
(function(value: number, event?: InputEvent))
:
Handler for value changes. It is called every time the input value changes. Returns the new numeric value and the event.
- leftIcon
(IconProps['name'] | Node | jsx.JSX.ArrayElement)
:
An icon that will be displayed to the left of the input field. It can be a string (icon name), a React element, or an array of elements.
- waiting
(boolean)
:
If true, displays a loading indicator to the right of the input field.
- formId
(string)
:
The identifier of the form associated with the input field.
- store
([get: any, set: (field: string, value: number) => void])
:
An optional store for managing the component's state. Allows controlling the value through a data store.
- currency
(string)
:
The currency code that will be displayed next to the input field. For example, RUB
, USD
, EUR
.
- decimals
(number)
:
The number of decimal places to which the value should be rounded. For example, if decimals is 2, the input will be rounded to hundredths.
Important Points
- symbol
(createMemo)
:
Calculates the currency symbol based on the provided currency code currency
. Uses Intl.NumberFormat for formatting and extracting the currency symbol. The symbol is displayed to the right of the input field.
- onInputHandler:
A handler function that processes the change event in the field. The value is rounded to the specified number of decimal places and updated through the store (if provided) or calls onInput.