From 6fb39d638495b9510302ffd819cbd8ecd7a16dab Mon Sep 17 00:00:00 2001 From: jyha00 Date: Sat, 26 Jul 2025 19:25:19 +0900 Subject: [PATCH 1/2] =?UTF-8?q?UiTable=20index=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/table/index.tsx | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index 4f369dc59..c3f5f8a60 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -81,6 +81,8 @@ export function UiTable({ const handlePageChange = (page: number) => { setCur(page); onPageChange(page); + if (index == 0) + setIdx(0) }; const handleCellClick = (index: number, headId: string) => { @@ -90,6 +92,7 @@ export function UiTable({ } }; + return ( <> {headName ? ( @@ -116,14 +119,13 @@ export function UiTable({ head.id.length > 1 && (boldArray.includes(index) ? ( handleCellClick(index, head.id)} key={`cell-${head.id}-${index}`} > @@ -131,39 +133,38 @@ export function UiTable({ ? String(el[head.id] ?? "") : String(el[head.id]).includes(".") ? String(el[head.id]) - .split(".") - .map((part, index) => - index === 0 - ? part.replace( - /\B(?=(\d{3})+(?!\d))/g, - ",", - ) - : part, - ) - .join(".") + .split(".") + .map((part, index) => + index === 0 + ? part.replace( + /\B(?=(\d{3})+(?!\d))/g, + ",", + ) + : part, + ) + .join(".") : String(el[head.id] ?? "").replace( - /\B(?=(\d{3})+(?!\d))/g, - ",", - )} + /\B(?=(\d{3})+(?!\d))/g, + ",", + )} ) : ( handleCellClick(index, head.id)} key={`cell-${head.id}-${index}`} > { //체크박스 유형애서 readOnly가 필요한 경우를 위해서 ChkClass 를 사용해서 readOnly 처리함. typeof el[head.id] === "object" && - el[head.id] !== null && - "chk" in (el[head.id] as object) && - "readonly" in (el[head.id] as object) ? ( + el[head.id] !== null && + "chk" in (el[head.id] as object) && + "readonly" in (el[head.id] as object) ? ( index === 0 ? part.replace( - /\B(?=(\d{3})+(?!\d))/g, - ",", - ) + /\B(?=(\d{3})+(?!\d))/g, + ",", + ) : part, ) .join(".") From e7a46ac3a23a8e716bebf4ad7e2292ce2b6ca92c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 27 Jul 2025 14:43:42 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=EB=85=84=EC=9B=94=20=EC=BA=98=EB=A6=B0?= =?UTF-8?q?=EB=8D=94=20=EB=85=84=20readonly=20=EC=98=B5=EC=85=98=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(not=20necessary)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/date_month_picker/index.tsx | 3 +++ .../src/ui/date_month_picker/mothPicker.tsx | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/common/business_components/src/ui/date_month_picker/index.tsx b/packages/common/business_components/src/ui/date_month_picker/index.tsx index 1b97d9ce1..a8da0ff0e 100644 --- a/packages/common/business_components/src/ui/date_month_picker/index.tsx +++ b/packages/common/business_components/src/ui/date_month_picker/index.tsx @@ -18,6 +18,7 @@ type MonthPickerProps = { selectClass?: string; readOnly?: boolean; startYear?: number; // 시작 연도 props 추가 + yearReadOnly?: boolean; }; // yyyyMM → Date 객체 @@ -39,6 +40,7 @@ export const DateMonthPicker = ({ selectClass, readOnly = false, startYear, + yearReadOnly = false, }: MonthPickerProps) => { const [open, setOpen] = useState(false); @@ -78,6 +80,7 @@ export const DateMonthPicker = ({ currentMonth={parsedDate} onMonthChange={handleSelect} startYear={startYear} + yearReadOnly={yearReadOnly} /> diff --git a/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx index 6afbde5e6..b5bc10ba5 100644 --- a/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx +++ b/packages/common/business_components/src/ui/date_month_picker/mothPicker.tsx @@ -29,9 +29,10 @@ export type MonthPickerProps = { shouldClosePopover?: boolean ) => void; startYear?: number; + yearReadOnly?: boolean; }; -export function MonthPicker({ currentMonth, onMonthChange, startYear }: MonthPickerProps) { +export function MonthPicker({ currentMonth, onMonthChange, startYear, yearReadOnly }: MonthPickerProps) { const today = startOfToday(); const currentYear = today.getFullYear(); @@ -73,6 +74,7 @@ const selectedYear = parseInt(yearFromProp);