diff --git a/client/src/components/CompanyFieldInput.tsx b/client/src/components/CompanyFieldInput.tsx index aa4fd36..b42bcf9 100644 --- a/client/src/components/CompanyFieldInput.tsx +++ b/client/src/components/CompanyFieldInput.tsx @@ -2,6 +2,7 @@ import { useState, useRef, useEffect, useCallback } from "react"; import { Input } from "@/components/ui/input"; import { Popover, PopoverAnchor, PopoverContent } from "@/components/ui/popover"; import { apiRequest } from "@/lib/queryClient"; +import { fieldControlClass, type FieldControlSize } from "@/components/fields/field-styles"; import { Loader2 } from "lucide-react"; export interface DadataCompany { @@ -34,6 +35,7 @@ interface CompanyFieldInputProps { onClear?: () => void; placeholder?: string; disabled?: boolean; + size?: FieldControlSize; } export default function CompanyFieldInput({ @@ -43,6 +45,7 @@ export default function CompanyFieldInput({ onClear, placeholder = "Начните вводить название компании", disabled = false, + size = 'form', }: CompanyFieldInputProps) { const [inputValue, setInputValue] = useState(value); const [suggestions, setSuggestions] = useState([]); @@ -118,6 +121,7 @@ export default function CompanyFieldInput({ onChange={handleInputChange} placeholder={placeholder} disabled={disabled} + className={fieldControlClass(size)} data-testid="input-company-search" /> {isLoading && ( diff --git a/client/src/components/ContactField.tsx b/client/src/components/ContactField.tsx index faebf80..1b609e5 100644 --- a/client/src/components/ContactField.tsx +++ b/client/src/components/ContactField.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from "react"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; +import { fieldControlClass, type FieldControlSize } from "@/components/fields/field-styles"; import { Plus, X } from "lucide-react"; export interface ContactValue { @@ -14,6 +15,7 @@ interface ContactFieldProps { value: ContactValue | string | null; onChange: (value: ContactValue) => void; disabled?: boolean; + size?: FieldControlSize; } function safeParseContact(value: ContactValue | string | null): ContactValue { @@ -28,7 +30,7 @@ function safeParseContact(value: ContactValue | string | null): ContactValue { return value as ContactValue; } -export default function ContactField({ value, onChange, disabled = false }: ContactFieldProps) { +export default function ContactField({ value, onChange, disabled = false, size = 'form' }: ContactFieldProps) { const parsed = safeParseContact(value); const [name, setName] = useState(parsed.name || ""); const [position, setPosition] = useState(parsed.position || ""); @@ -101,7 +103,7 @@ export default function ContactField({ value, onChange, disabled = false }: Cont onChange={(e) => handleNameChange(e.target.value)} disabled={disabled} placeholder="ФИО (Иванов И.И.)" - className="h-8 flex-1 min-w-[140px]" + className={fieldControlClass(size, 'flex-1 min-w-[140px]')} /> {/* Должность */} handlePositionChange(e.target.value)} disabled={disabled} placeholder="Должность (Директор)" - className="h-8 flex-1 min-w-[140px]" + className={fieldControlClass(size, 'flex-1 min-w-[140px]')} /> {/* Телефон — первый + кнопка добавить */}
@@ -118,7 +120,7 @@ export default function ContactField({ value, onChange, disabled = false }: Cont onChange={(e) => changePhone(0, e.target.value)} disabled={disabled} placeholder="Телефон +7 (999) 123-45-67" - className="h-8 flex-1 min-w-0" + className={fieldControlClass(size, 'flex-1 min-w-0')} />