From 82b48a945d7d27dbfbf1653da7ba88cc6037d7d3 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Fri, 20 Jun 2025 17:52:50 +0900 Subject: [PATCH] =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=EB=B0=95=EC=8A=A4=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/table/index.tsx | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index c2b5219e8..a6c5cfdee 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -1,9 +1,11 @@ "use client" -import { Table, TableBody, TableCell, TableHeader, TableRow } from "@common/components"; +import { Checkbox, Table, TableBody, TableCell, TableHeader, TableRow } from "@common/components"; import { useEffect, useState } from "react"; import { HeadMakeColSpan } from "./HeadMakeColSpan"; import UiPageNations from "./uiPageNations"; +import { AlignVerticalDistributeCenterIcon, Check } from "lucide-react"; +import { boolean } from "zod"; type UiTableProps = { headName: React.ReactNode | undefined; @@ -29,6 +31,9 @@ type UiHeadProps = { export function UiTable({ tableData, headlist, pageSize, total, headName, children, cellClick, onPageChange, className = '', resetPageNo = false, boldArray = [] }: UiTableProps) { const [cur, setCur] = useState(1); const [idx, setIdx] = useState(-1); + const [isCheck, seIsCheck] = useState(false); + + useEffect(() => { if (resetPageNo) { setCur(1); @@ -47,6 +52,7 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr setIdx(index); } }; + return ( <> @@ -65,7 +71,9 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr .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('.') + {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, ",")} + ).join('.') + : + String(el[head.id] ?? '').replace(/\B(?=(\d{3})+(?!\d))/g, ",")} ) ))}