Compare commits

..

2 Commits

1 changed files with 45 additions and 39 deletions

View File

@ -2150,11 +2150,14 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
{col.label} {col.label}
</th> </th>
))} ))}
{!isDesignMode && ( {/* 수정 또는 삭제 버튼이 하나라도 활성화되어 있을 때만 작업 컬럼 표시 */}
<th className="px-3 py-2 text-right text-xs font-medium text-gray-500 uppercase"> {!isDesignMode &&
((componentConfig.rightPanel?.editButton?.enabled ?? true) ||
</th> (componentConfig.rightPanel?.deleteButton?.enabled ?? true)) && (
)} <th className="px-3 py-2 text-right text-xs font-medium text-gray-500 uppercase">
</th>
)}
</tr> </tr>
</thead> </thead>
<tbody className="divide-y divide-gray-200 bg-white"> <tbody className="divide-y divide-gray-200 bg-white">
@ -2172,40 +2175,43 @@ export const SplitPanelLayoutComponent: React.FC<SplitPanelLayoutComponentProps>
{formatCellValue(col.name, item[col.name], rightCategoryMappings, col.format)} {formatCellValue(col.name, item[col.name], rightCategoryMappings, col.format)}
</td> </td>
))} ))}
{!isDesignMode && ( {/* 수정 또는 삭제 버튼이 하나라도 활성화되어 있을 때만 작업 셀 표시 */}
<td className="px-3 py-2 text-right text-sm whitespace-nowrap"> {!isDesignMode &&
<div className="flex justify-end gap-1"> ((componentConfig.rightPanel?.editButton?.enabled ?? true) ||
{(componentConfig.rightPanel?.editButton?.enabled ?? true) && ( (componentConfig.rightPanel?.deleteButton?.enabled ?? true)) && (
<Button <td className="px-3 py-2 text-right text-sm whitespace-nowrap">
variant={ <div className="flex justify-end gap-1">
componentConfig.rightPanel?.editButton?.buttonVariant || "outline" {(componentConfig.rightPanel?.editButton?.enabled ?? true) && (
} <Button
size="sm" variant={
onClick={(e) => { componentConfig.rightPanel?.editButton?.buttonVariant || "outline"
e.stopPropagation(); }
handleEditClick("right", item); size="sm"
}} onClick={(e) => {
className="h-7" e.stopPropagation();
> handleEditClick("right", item);
<Pencil className="mr-1 h-3 w-3" /> }}
{componentConfig.rightPanel?.editButton?.buttonLabel || "수정"} className="h-7"
</Button> >
)} <Pencil className="mr-1 h-3 w-3" />
{(componentConfig.rightPanel?.deleteButton?.enabled ?? true) && ( {componentConfig.rightPanel?.editButton?.buttonLabel || "수정"}
<button </Button>
onClick={(e) => { )}
e.stopPropagation(); {(componentConfig.rightPanel?.deleteButton?.enabled ?? true) && (
handleDeleteClick("right", item); <button
}} onClick={(e) => {
className="rounded p-1 transition-colors hover:bg-red-100" e.stopPropagation();
title={componentConfig.rightPanel?.deleteButton?.buttonLabel || "삭제"} handleDeleteClick("right", item);
> }}
<Trash2 className="h-4 w-4 text-red-600" /> className="rounded p-1 transition-colors hover:bg-red-100"
</button> title={componentConfig.rightPanel?.deleteButton?.buttonLabel || "삭제"}
)} >
</div> <Trash2 className="h-4 w-4 text-red-600" />
</td> </button>
)} )}
</div>
</td>
)}
</tr> </tr>
); );
})} })}