[feat] negodata: 소유권 게이팅 + 견적 낙찰 + 작성자명 표시 + 전화입력 + 카드 엑셀
- 소유권 게이팅(common/authz): 변경 액션 본인∪OWNER, 협력사 삭제 OWNER 전용 - 견적 수동 낙찰(award) + 작성자명(creatorName) 표시 + 전화번호 입력 컴포넌트 + 카드 엑셀 업로드 - supplier_type 은 이번 커밋 미변경(다음 커밋에서 코드부터 정리 예정) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c32ee300e6
commit
c62b66e35b
56 files changed
+1900
-188
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { forwardRef } from 'react';
|
||||
import { Input } from './input';
|
||||
import { formatPhoneKR, normalizePhone } from '@/lib/phone';
|
||||
|
||||
// 연락처 전용 입력. 표시는 하이픈 자동(010/02/031/1588 등), 밖으로 넘기는 값은 숫자만.
|
||||
// react-hook-form Controller 의 field(value/onChange/onBlur)를 그대로 물리면 된다.
|
||||
type PhoneInputProps = Omit<React.ComponentProps<typeof Input>, 'value' | 'onChange' | 'type'> & {
|
||||
value?: string; // 숫자만(정규화된 폼 값)
|
||||
onChange?: (value: string) => void; // 숫자만으로 방출
|
||||
};
|
||||
|
||||
export const PhoneInput = forwardRef<HTMLInputElement, PhoneInputProps>(function PhoneInput(
|
||||
{ value = '', onChange, ...props },
|
||||
ref,
|
||||
) {
|
||||
return (
|
||||
<Input
|
||||
ref={ref}
|
||||
type="tel"
|
||||
inputMode="numeric"
|
||||
value={formatPhoneKR(value)}
|
||||
onChange={(e) => onChange?.(normalizePhone(e.target.value))}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user