From 4e6ac3bac1b7a1974af7e65d90c422460ac6db52 Mon Sep 17 00:00:00 2001 From: Lockwood Date: Sun, 2 Apr 2023 20:55:02 +0100 Subject: [PATCH] feat(interface/input): minLength & maxLength option --- web/src/features/dialog/components/fields/input.tsx | 4 ++++ web/src/typings/dialog.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/web/src/features/dialog/components/fields/input.tsx b/web/src/features/dialog/components/fields/input.tsx index bcf46782..7e772ad8 100644 --- a/web/src/features/dialog/components/fields/input.tsx +++ b/web/src/features/dialog/components/fields/input.tsx @@ -29,6 +29,8 @@ const InputField: React.FC = (props) => { description={props.row.description} icon={props.row.icon && } placeholder={props.row.placeholder} + minLength={props.row.min} + maxLength={props.row.max} disabled={props.row.disabled} withAsterisk={props.row.required} /> @@ -40,6 +42,8 @@ const InputField: React.FC = (props) => { description={props.row.description} icon={props.row.icon && } placeholder={props.row.placeholder} + minLength={props.row.min} + maxLength={props.row.max} disabled={props.row.disabled} withAsterisk={props.row.required} visibilityToggleIcon={({ reveal, size }) => ( diff --git a/web/src/typings/dialog.ts b/web/src/typings/dialog.ts index 79346220..8ab0cd70 100644 --- a/web/src/typings/dialog.ts +++ b/web/src/typings/dialog.ts @@ -21,6 +21,8 @@ type BaseField = { export interface IInput extends BaseField<'input', string> { password?: boolean; + min?: number; + max?: number; } export interface ICheckbox {