tmp
This commit is contained in:
@@ -5,7 +5,7 @@ import {useForm} from "@mantine/form";
|
||||
import {Checkbox, Fieldset, Flex, NumberInput, rem, TextInput} from "@mantine/core";
|
||||
import {IconX} from "@tabler/icons-react";
|
||||
import BarcodeTemplateAttributeMultiselect
|
||||
from "../../component/BarcodeTemplateAttributeMultiselect/BarcodeTemplateAttributeMultiselect.tsx";
|
||||
from "../../components/BarcodeTemplateAttributeMultiselect/BarcodeTemplateAttributeMultiselect.tsx";
|
||||
|
||||
type Props = CreateEditFormProps<BarcodeTemplateSchema>
|
||||
const BarcodeTemplateFormModal = ({
|
||||
@@ -30,7 +30,7 @@ const BarcodeTemplateFormModal = ({
|
||||
name: (name: string | undefined) => name && name.trim() !== '' ? null : "Необходимо ввести название шаблона",
|
||||
}
|
||||
})
|
||||
console.log(form.values);
|
||||
|
||||
return (
|
||||
<BaseFormModal
|
||||
{...innerProps}
|
||||
@@ -44,40 +44,33 @@ const BarcodeTemplateFormModal = ({
|
||||
<Fieldset legend={"Шаблон штрихкода"}>
|
||||
<Flex direction={"column"} gap={rem(10)}>
|
||||
<TextInput
|
||||
label={"Название"}
|
||||
label={'Название'}
|
||||
placeholder={"Введите название шаблона"}
|
||||
{...form.getInputProps('name')}
|
||||
/>
|
||||
<Fieldset
|
||||
styles={{
|
||||
legend: {
|
||||
marginBottom: 0,
|
||||
fontWeight: 500
|
||||
}
|
||||
}}
|
||||
variant={"unstyled"}
|
||||
legend={"Размер"}>
|
||||
<Flex gap={10} align={"center"}>
|
||||
<NumberInput
|
||||
hideControls
|
||||
placeholder={"Ширина"}
|
||||
{...form.getInputProps('width')}
|
||||
/>
|
||||
<IconX/>
|
||||
<NumberInput
|
||||
hideControls
|
||||
placeholder={"Высота"}
|
||||
{...form.getInputProps('height')}
|
||||
/>
|
||||
</Flex>
|
||||
</Fieldset>
|
||||
<Flex gap={10} align={"center"}>
|
||||
<NumberInput
|
||||
hideControls
|
||||
label={'Ширина'}
|
||||
placeholder={"Ширина в мм"}
|
||||
{...form.getInputProps('width')}
|
||||
/>
|
||||
<IconX/>
|
||||
<NumberInput
|
||||
hideControls
|
||||
label={'Высота'}
|
||||
placeholder={"Высота в мм"}
|
||||
{...form.getInputProps('height')}
|
||||
/>
|
||||
</Flex>
|
||||
<BarcodeTemplateAttributeMultiselect
|
||||
label={"Атрибуты"}
|
||||
placeholder={"Выберите атрибуты"}
|
||||
placeholder={!form.values.attributes?.length ? "Выберите атрибуты" : undefined}
|
||||
{...form.getInputProps('attributes')}
|
||||
/>
|
||||
<Checkbox
|
||||
label={"Использовать как стандартный шаблон"}
|
||||
checked={form.getInputProps('isDefault').value as boolean}
|
||||
{...form.getInputProps('isDefault')}/>
|
||||
</Flex>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user