- 품목 검색 모달에서 컬럼명 대신 라벨명 표시 * ItemSelectionModal에 columnLabels prop 추가 * ModalRepeaterTableComponent에서 columns 설정의 라벨 매핑 생성 * 테이블 헤더에 한글 라벨 표시 (품번, 품명, 규격, 재질 등) - 이미 추가된 품목은 검색 결과에서 완전 제외 * filteredResults로 중복 항목 필터링 * 회색 표시 대신 목록에서 아예 제거 * 사용자 친화적인 안내 메시지 추가 - 수주등록 버튼 크기 및 렌더링 수정 * 기본 크기를 200x40에서 120x40으로 변경 (다른 버튼과 통일) * h-full w-full 클래스 적용하여 컨테이너 크기에 맞게 렌더링 * style prop의 width/height 제거하여 Tailwind 클래스 우선순위 문제 해결 - 수주등록 모달에 판매 유형 및 무역 정보 추가 * 국내/해외 판매 선택 기능 * 해외 판매 시 무역 정보 섹션 표시 (인코텀즈, 결제조건, 통화 등) * 거래처 정보 확장 (담당자, 납품처, 납품장소) - 품목 반복 테이블 컬럼 조정 * 품목번호를 품번으로 변경 * 비고 컬럼 제거 * 규격, 재질 컬럼 추가 * 납품일을 납기일로 변경
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import React, { useState } from "react";
|
|
import { Button } from "@/components/ui/button";
|
|
import { Plus } from "lucide-react";
|
|
import { OrderRegistrationModal } from "@/components/order/OrderRegistrationModal";
|
|
import { ComponentRegistry } from "@/lib/registry/ComponentRegistry";
|
|
import OrderRegistrationModalDefinition from "./index";
|
|
import { OrderRegistrationModalConfigPanel } from "./OrderRegistrationModalConfigPanel";
|
|
|
|
interface OrderRegistrationModalRendererProps {
|
|
buttonText?: string;
|
|
buttonVariant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
buttonSize?: "default" | "sm" | "lg";
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
export function OrderRegistrationModalRenderer({
|
|
buttonText = "수주 등록",
|
|
buttonVariant = "default",
|
|
buttonSize = "default",
|
|
style,
|
|
}: OrderRegistrationModalRendererProps) {
|
|
const [isOpen, setIsOpen] = useState(false);
|
|
|
|
// style에서 width, height 제거 (h-full w-full로 제어)
|
|
const { width, height, ...restStyle } = style || {};
|
|
|
|
return (
|
|
<>
|
|
<Button
|
|
variant={buttonVariant}
|
|
size={buttonSize}
|
|
onClick={() => setIsOpen(true)}
|
|
className="h-full w-full"
|
|
style={restStyle}
|
|
>
|
|
<Plus className="mr-2 h-4 w-4" />
|
|
{buttonText}
|
|
</Button>
|
|
|
|
<OrderRegistrationModal open={isOpen} onOpenChange={setIsOpen} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
// 컴포넌트 자동 등록
|
|
if (typeof window !== "undefined") {
|
|
ComponentRegistry.registerComponent({
|
|
...OrderRegistrationModalDefinition,
|
|
component: OrderRegistrationModalRenderer,
|
|
renderer: OrderRegistrationModalRenderer,
|
|
configPanel: OrderRegistrationModalConfigPanel,
|
|
} as any);
|
|
}
|
|
|