feat: add currency input field and enhance currency formatting utilities
- Introduced `FieldCurrencyInput` component for handling currency input in forms, supporting formatted display while maintaining numeric values. - Implemented `RenderCurrency` component for displaying currency values with proper formatting. - Enhanced `CurrencyUtils` to include parsing and formatting functions for Rupiah, ensuring accurate representation in UI. - Updated various components and forms to utilize the new currency input and rendering capabilities, improving user experience in financial data entry. - Added unit tests for currency input and formatting functionalities to ensure reliability and correctness. These changes enhance the application's handling of currency inputs and displays, providing a more user-friendly experience for financial transactions.
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
FieldPasswordInput,
|
||||
FieldTextarea,
|
||||
FieldNumberInput,
|
||||
FieldCurrencyInput,
|
||||
FieldJsonInput,
|
||||
FieldPinInput,
|
||||
FieldAutocomplete,
|
||||
@@ -82,6 +83,7 @@ export default function AllFieldsDemo() {
|
||||
password: '',
|
||||
description: '',
|
||||
age: undefined,
|
||||
price: 12500.12345,
|
||||
jsonConfig: '',
|
||||
pin: '',
|
||||
country: '',
|
||||
@@ -142,6 +144,9 @@ export default function AllFieldsDemo() {
|
||||
<FieldPasswordInput name="password" control={control} label={t.fields.password} />
|
||||
<FieldNumberInput name="age" control={control} label={t.fields.age} />
|
||||
</Group>
|
||||
<Group grow align="flex-start" mb="md">
|
||||
<FieldCurrencyInput name="price" control={control} label={t.fields.price} />
|
||||
</Group>
|
||||
<Group grow align="flex-start" mb="md">
|
||||
<FieldTextarea name="description" control={control} label={t.fields.description} minRows={3} />
|
||||
<FieldJsonInput name="jsonConfig" control={control} label={t.fields.jsonConfig} formatOnBlur />
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"password": "Password",
|
||||
"description": "Description",
|
||||
"age": "Age",
|
||||
"price": "Price",
|
||||
"jsonConfig": "JSON Config",
|
||||
"tags": "Tags",
|
||||
"terms": "I agree to the terms and conditions",
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
"password": "Kata Sandi",
|
||||
"description": "Deskripsi",
|
||||
"age": "Usia",
|
||||
"price": "Harga",
|
||||
"jsonConfig": "Konfigurasi JSON",
|
||||
"tags": "Label (Tags)",
|
||||
"terms": "Saya setuju dengan syarat dan ketentuan",
|
||||
|
||||
Reference in New Issue
Block a user