@@ -5,6 +5,7 @@ export type TextInputFieldProps = BaseFieldControlProps<string> & {
|
||||
placeholder?: string
|
||||
type?: React.HTMLInputTypeAttribute
|
||||
step?: React.InputHTMLAttributes<HTMLInputElement>["step"]
|
||||
formatter?: (value: string) => string
|
||||
}
|
||||
|
||||
export function TextInputField({
|
||||
@@ -17,11 +18,12 @@ export function TextInputField({
|
||||
placeholder,
|
||||
type = "text",
|
||||
step,
|
||||
formatter,
|
||||
}: TextInputFieldProps) {
|
||||
return (
|
||||
<Input
|
||||
value={value}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
onChange={(e) => onChange(formatter ? formatter(e.target.value) : e.target.value)}
|
||||
onBlur={onBlur}
|
||||
name={name}
|
||||
disabled={disabled}
|
||||
|
||||
@@ -38,7 +38,7 @@ export function TimePickerField({
|
||||
disabled,
|
||||
invalid,
|
||||
placeholder = "Pick a time",
|
||||
withSeconds = true,
|
||||
withSeconds = false,
|
||||
}: TimePickerFieldProps) {
|
||||
const { hours, minutes, seconds } = parseTime(value ?? "")
|
||||
const hasValue = !!value
|
||||
|
||||
Reference in New Issue
Block a user