From 684d23cc38bcaf9d8fc7a024a9ce6bcbd98a0bfe Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Mon, 6 Apr 2026 15:35:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B6=88=EB=9F=89=20=EC=88=98=EB=9F=89?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5=EC=97=90=20=EC=88=AB=EC=9E=90=20=ED=82=A4?= =?UTF-8?q?=ED=8C=A8=EB=93=9C=20=EB=AA=A8=EB=8B=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hardcoded/production/DefectTypeModal.tsx | 102 ++++++++++++++---- 1 file changed, 82 insertions(+), 20 deletions(-) diff --git a/frontend/components/pop/hardcoded/production/DefectTypeModal.tsx b/frontend/components/pop/hardcoded/production/DefectTypeModal.tsx index aed322f7..b4c58699 100644 --- a/frontend/components/pop/hardcoded/production/DefectTypeModal.tsx +++ b/frontend/components/pop/hardcoded/production/DefectTypeModal.tsx @@ -45,27 +45,89 @@ function QtyInput({ onChange: (v: number) => void; max: number; }) { + const [padOpen, setPadOpen] = useState(false); + const [padValue, setPadValue] = useState(String(value)); + + const handlePadOpen = () => { + setPadValue(String(value)); + setPadOpen(true); + }; + + const handlePadKey = (key: string) => { + if (key === "backspace") { + setPadValue((prev) => prev.length > 1 ? prev.slice(0, -1) : "0"); + } else if (key === "clear") { + setPadValue("0"); + } else if (key === "max") { + setPadValue(String(max)); + } else { + setPadValue((prev) => prev === "0" ? key : prev + key); + } + }; + + const handlePadConfirm = () => { + const num = Math.min(Math.max(0, parseInt(padValue, 10) || 0), max); + onChange(num); + setPadOpen(false); + }; + return ( -
- - - {value} - - -
+ <> +
+ + + +
+ + {/* 숫자 키패드 모달 */} + {padOpen && ( +
+
setPadOpen(false)} /> +
+
+

불량 수량 (최대 {max})

+

{padValue}

+
+
+ {["1","2","3","4","5","6","7","8","9"].map((k) => ( + + ))} + + + +
+ +
+ + +
+
+
+ )} + ); }