mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 06:45:46 +00:00
feat(FE-114): add inputPrefix and inputSuffix props for enhanced input customization
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { ChangeEvent } from 'react';
|
||||
import { ChangeEvent, ReactNode } from 'react';
|
||||
import { NumericFormat, OnValueChange } from 'react-number-format';
|
||||
import TextInput, { TextInputProps } from '@/components/input/TextInput';
|
||||
|
||||
@@ -12,6 +12,8 @@ interface NumberInputProps extends Omit<TextInputProps, 'type'> {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
fixedDecimalScale?: boolean;
|
||||
inputPrefix?: ReactNode;
|
||||
inputSuffix?: ReactNode;
|
||||
}
|
||||
|
||||
const NumberInput = ({
|
||||
@@ -20,6 +22,8 @@ const NumberInput = ({
|
||||
decimalScale = 5,
|
||||
allowNegative = true,
|
||||
onChange,
|
||||
inputPrefix,
|
||||
inputSuffix,
|
||||
...restProps
|
||||
}: NumberInputProps) => {
|
||||
const valueChangeHandler: OnValueChange = (
|
||||
@@ -45,6 +49,8 @@ const NumberInput = ({
|
||||
onValueChange={valueChangeHandler}
|
||||
decimalScale={decimalScale}
|
||||
allowNegative={allowNegative}
|
||||
inputPrefix={inputPrefix}
|
||||
inputSuffix={inputSuffix}
|
||||
{...restProps}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user