fix: 컴포넌트 설정 패널 config 병합 및 props 전달 개선
- TableListConfigPanel: handleNestedChange에서 전체 config 병합 로직 추가 - TableListComponent: checkbox.enabled 및 position 기본값 처리 (undefined시 기본값 사용) - SelectedItemsDetailInputConfigPanel: handleChange에서 전체 config 병합 로직 추가 - SelectedItemsDetailInputConfigPanel: 원본 데이터 테이블 선택 disabled 조건 제거 - UnifiedPropertiesPanel: allTables 로드 및 ConfigPanel에 전달 추가 문제: 1. table-list 컴포넌트 체크박스 설정 변경 시 다른 설정 초기화 2. selected-items-detail-input 설정 변경 시 컴포넌트 이름 등 다른 속성 손실 3. 원본 데이터 테이블 선택이 비활성화되어 있음 해결: - 모든 설정 패널에서 부분 업데이트 시 기존 config와 병합하도록 수정 - checkbox 관련 기본값 처리로 기존 컴포넌트 호환성 보장 - allTables를 별도로 로드하여 전체 테이블 목록 제공
This commit is contained in:
@@ -269,7 +269,9 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
// });
|
||||
|
||||
const parentValue = config[parentKey] as any;
|
||||
// 전체 config와 병합하여 다른 속성 유지
|
||||
const newConfig = {
|
||||
...config,
|
||||
[parentKey]: {
|
||||
...parentValue,
|
||||
[childKey]: value,
|
||||
@@ -754,6 +756,52 @@ export const TableListConfigPanel: React.FC<TableListConfigPanelProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 체크박스 설정 */}
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold">체크박스 설정</h3>
|
||||
</div>
|
||||
<hr className="border-border" />
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id="checkboxEnabled"
|
||||
checked={config.checkbox?.enabled ?? true}
|
||||
onCheckedChange={(checked) => handleNestedChange("checkbox", "enabled", checked)}
|
||||
/>
|
||||
<Label htmlFor="checkboxEnabled">체크박스 표시</Label>
|
||||
</div>
|
||||
|
||||
{config.checkbox?.enabled && (
|
||||
<>
|
||||
<div className="flex items-center space-x-2">
|
||||
<Checkbox
|
||||
id="checkboxSelectAll"
|
||||
checked={config.checkbox?.selectAll ?? true}
|
||||
onCheckedChange={(checked) => handleNestedChange("checkbox", "selectAll", checked)}
|
||||
/>
|
||||
<Label htmlFor="checkboxSelectAll">전체 선택 체크박스 표시</Label>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
<Label htmlFor="checkboxPosition" className="text-xs">
|
||||
체크박스 위치
|
||||
</Label>
|
||||
<select
|
||||
id="checkboxPosition"
|
||||
value={config.checkbox?.position || "left"}
|
||||
onChange={(e) => handleNestedChange("checkbox", "position", e.target.value)}
|
||||
className="w-full h-8 text-xs border rounded-md px-2"
|
||||
>
|
||||
<option value="left">왼쪽</option>
|
||||
<option value="right">오른쪽</option>
|
||||
</select>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 가로 스크롤 및 컬럼 고정 */}
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user