diff --git a/packages/common/business_components/src/ui/dialog_ui/index.tsx b/packages/common/business_components/src/ui/dialog_ui/index.tsx
index bbb27d327..df7fffd3a 100644
--- a/packages/common/business_components/src/ui/dialog_ui/index.tsx
+++ b/packages/common/business_components/src/ui/dialog_ui/index.tsx
@@ -1,7 +1,7 @@
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader } from "@common/components";
import { cn } from "../../lib/utils";
-type ModalType = {
+type ModalType = {
bodyClass: string;
body: React.ReactNode;
open?: boolean;
@@ -10,43 +10,45 @@ type ModalType = {
noFooterYn?: 'N' | 'Y';
headerTitle?: string;
footerContent?: React.ReactNode;
+ useDirectRender?: boolean;
}
-export function UiModal({
- bodyClass,
- body,
- open,
+export function UiModal({
+ bodyClass,
+ body,
+ open,
onOpenChange,
noHeaderYn = 'N',
noFooterYn = 'N',
headerTitle,
- footerContent
+ footerContent,
+ useDirectRender = false
}: ModalType) {
-
+
return (
<>
-
>
);
}
diff --git a/packages/common/business_components/src/ui/search_form_left/index.tsx b/packages/common/business_components/src/ui/search_form_left/index.tsx
index e7858df2a..4f36c078c 100644
--- a/packages/common/business_components/src/ui/search_form_left/index.tsx
+++ b/packages/common/business_components/src/ui/search_form_left/index.tsx
@@ -199,7 +199,7 @@ function SearchFormLeft({ isShowPart = false, children, selectSidoData = [], sel
setRtnSidoText(selectedSido?.text || '');
}
initializeSigunData(val);
- onSelectValue(selectSigunData[0]?.val || '0', 'sigun');
+ onSelectValue('0', 'sigun');
break;
case 'sigun':
if (setRtnSigunValue) {
diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx
index 6fa78ccf2..8843aa04e 100644
--- a/packages/common/business_components/src/ui/select/index.tsx
+++ b/packages/common/business_components/src/ui/select/index.tsx
@@ -1,3 +1,5 @@
+// selectBox
+
import { Label } from "@common/components";
import React from "react";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./lib/selectBox";
@@ -5,7 +7,8 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
/** 차트 기본 스타일 */
interface SelectBox1 {
text:string,
- val:string|number
+ val:string|number,
+ hidden?: boolean
}
const SelectBox = React.forwardRef<
@@ -20,17 +23,29 @@ const SelectBox = React.forwardRef<
readOnly?: boolean // readOnly 속성 추가
}
>(({ label, className, selectClass, selectArray, onSelectValue, value, readOnly = false }, ref)=>{
- const placeHolder = selectArray?.[0]?.text ?? "";
+ // hidden이 true인 첫 번째 항목을 placeholder로 사용
+ const hiddenItem = selectArray.find(item => item.hidden);
+ const placeHolder = hiddenItem?.text ?? "선택";
+
+ // hidden이 true인 항목만 드롭다운에서 제외
+ const visibleItems = selectArray.filter(item => !item.hidden);
+
+ // 현재 값이 hidden 항목이거나 빈 값인 경우 undefined로 설정하여 placeholder가 표시되도록 함
+ const currentValue = value !== undefined &&
+ hiddenItem &&
+ (String(value) === String(hiddenItem.val) || value === "" || value === "0" || value === 0)
+ ? undefined
+ : (value !== undefined ? String(value) : undefined);
return (
{label && }
-
{/* 페이지네이션 하단 고정 */}
- { (
+ {(
void )| undefined;
+ cellClick: ((index: number | undefined, headId: string) => void) | undefined;
onPageChange: (page: number) => void;
className?: string;
resetPageNo?: boolean;
children?: React.ReactNode | undefined;
boldArray?: number[];
resetSelection?: boolean;
- index?:number;
+ index?: number;
}
type UiHeadProps = {
id: string;
title: string;
align?: string;
- visible?:boolean;
+ visible?: boolean;
}
-export function UiTable({ tableData, headlist, pageSize, total, headName, children, cellClick, onPageChange, className = '', resetPageNo = false, boldArray = [], resetSelection = false, index=-1 }: UiTableProps) {
+export function UiTable({ tableData, headlist, pageSize, total, headName, children, cellClick, onPageChange, className = '', resetPageNo = false, boldArray = [], resetSelection = false, index = -1 }: UiTableProps) {
const [cur, setCur] = useState(1);
const [idx, setIdx] = useState(index);
const [isCheck, seIsCheck] = useState(false);
@@ -54,77 +54,75 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr
onPageChange(page);
}
- const handleCellClick = (index: number,headId:string )=> {
+ const handleCellClick = (index: number, headId: string) => {
if (cellClick) {
- cellClick(index,headId);
+ cellClick(index, headId);
setIdx(index);
}
};
-
+
return (
<>
{headName ?
{headName}
- : <>>}
+ : <>>}
{children ? children : }
- {tableData.length > 0 ? tableData?.map((el: { [key: string]: any}, index) => (
+ {tableData.length > 0 ? tableData?.map((el: { [key: string]: any }, index) => (
{headlist
- .filter((item) => item.visible != false)
- .map((head) => (
- head.id && head.id.length > 1 && (
- boldArray.includes(index)
- ?
- handleCellClick(index, head.id)}
- key={`cell-${head.id}-${index}`}
- >
- {typeof el[head.id] !== 'number'?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('.')
- : String(el[head.id] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
-
- :
- handleCellClick(index, head.id)}
- key={`cell-${head.id}-${index}`}
- >
- {typeof el[head.id] === 'boolean'
- ? {
- el[head.id]= checked;
- }}
- >
-
-
- :
- typeof el[head.id] !== 'number'?
- 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('.')
- :
- String(el[head.id] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
-
- )
- ))}
+ .filter((item) => item.visible != false)
+ .map((head) => (
+ head.id && head.id.length > 1 && (
+ boldArray.includes(index)
+ ?
+ handleCellClick(index, head.id)}
+ key={`cell-${head.id}-${index}`}
+ >
+ {typeof el[head.id] !== 'number' ? 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('.')
+ : String(el[head.id] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
+
+ :
+ handleCellClick(index, head.id)}
+ key={`cell-${head.id}-${index}`}
+ >
+ {typeof el[head.id] === 'boolean'
+ ? {
+ el[head.id] = checked;
+ }}
+ >
+
+
+ :
+ typeof el[head.id] !== 'number' ?
+ 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('.')
+ :
+ String(el[head.id] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")}
+
+ )
+ ))}
)) : <>>}
diff --git a/packages/common/business_components/src/ui/table/uiPageNations.tsx b/packages/common/business_components/src/ui/table/uiPageNations.tsx
index 891fc4c81..ca1f8e0c0 100644
--- a/packages/common/business_components/src/ui/table/uiPageNations.tsx
+++ b/packages/common/business_components/src/ui/table/uiPageNations.tsx
@@ -40,7 +40,8 @@ export default function UiPageNations(commonPageNationsProps: CommonPageNationsP
{
+ onClick={(e) => {
+ e.preventDefault();
if (startPage > 1) handlePageChange(startPage - 1);
}}
/>
@@ -53,7 +54,9 @@ export default function UiPageNations(commonPageNationsProps: CommonPageNationsP
handlePageChange(pageNum)}
+ onClick={(e) => {
+ e.preventDefault();
+ handlePageChange(pageNum)}}
>
{pageNum}
@@ -65,7 +68,8 @@ export default function UiPageNations(commonPageNationsProps: CommonPageNationsP
{
+ onClick={(e) => {
+ e.preventDefault();
if (endPage < totalPages) handlePageChange(endPage + 1);
}}
/>