feat(TEAMMSBMOB-19904): инпут ввода номера счета

This commit is contained in:
Лисицын Даниил
2025-11-28 13:49:34 +03:00
parent 1fea0ddf48
commit 530a6d9a49
6 changed files with 19 additions and 0 deletions
Regular → Executable
View File
Regular → Executable
View File
@@ -4,6 +4,7 @@ enum EXTERNAL_ACCOUNTS_FORM_FIELDS {
CURRENCY = 'currency',
CLIENT_SWIFT_CODE = 'clientSwiftCode',
BANK_SWIFT_CODE = 'bankSwiftCode',
ACCOUNT = 'account',
}
enum EXTERNAL_ACCOUNT_FORM_CURRENCY_TYPES {
@@ -15,6 +15,7 @@ const LOCALIZATION = {
DEFAULT_USAGE_COLUMN_TITLE: 'По умолчанию',
ACCOUNT_USAGE_ERROR: 'Выберите хотя бы один вариант',
EMPTY_FIELD_ERROR: 'Поле не заполнено',
ACCOUNT_LABEL: 'Номер счёта',
} as const;
export { LOCALIZATION };
@@ -0,0 +1,15 @@
import { Fields } from '@fractal-ui/form';
import { useField } from 'react-final-form';
import { EXTERNAL_ACCOUNTS_FORM_FIELDS, LOCALIZATION } from '../constants';
const AccountInput = () => {
const { input: clientIdFieldInput } = useField(EXTERNAL_ACCOUNTS_FORM_FIELDS.CLIENT_ID, { subscription: { value: true } });
if (!clientIdFieldInput.value) {
return null;
}
return <Fields.InputAccount label={LOCALIZATION.ACCOUNT_LABEL} labelPosition="top" name={EXTERNAL_ACCOUNTS_FORM_FIELDS.ACCOUNT} />;
};
export { AccountInput };
@@ -1,6 +1,7 @@
import { Flex } from '@msb/shared';
import { Form } from 'react-final-form';
import { useHandleSubmit, useInitialValues, validate } from '../model';
import { AccountInput } from './AccountInput';
import { CommonFormFields } from './CommonFormFields';
import { CurrencyExternalFields } from './CurrencyExternalFields';
import { ExternalAccountsCreateFormProvider } from './ExternalAccountsCreateFormProvider';
@@ -27,6 +28,7 @@ const ExternalAccountsCreateForm = () => {
<CommonFormFields organizationsSelectOptions={organizationsSelectOptions} />
<RubExternalFields />
<CurrencyExternalFields />
<AccountInput />
<AccountsCreateFormSubmitButton />
</Flex>
</ExternalAccountsCreateFormProvider>