상세입력 컴포넌트 테이블 선택 기능 추가

This commit is contained in:
kjs
2025-11-17 15:25:08 +09:00
parent a783317820
commit bc557c4074
14 changed files with 1095 additions and 230 deletions

View File

@@ -52,6 +52,9 @@ export interface ButtonPrimaryComponentProps extends ComponentRendererProps {
// 플로우 선택된 데이터 정보 (플로우 위젯 선택 액션용)
flowSelectedData?: any[];
flowSelectedStepId?: number | null;
// 🆕 같은 화면의 모든 컴포넌트 (TableList 자동 감지용)
allComponents?: any[];
}
/**
@@ -88,6 +91,7 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
selectedRowsData,
flowSelectedData,
flowSelectedStepId,
allComponents, // 🆕 같은 화면의 모든 컴포넌트
...props
}) => {
const { isPreviewMode } = useScreenPreview(); // 프리뷰 모드 확인
@@ -409,6 +413,8 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
sortOrder, // 🆕 정렬 방향
columnOrder, // 🆕 컬럼 순서
tableDisplayData, // 🆕 화면에 표시된 데이터
// 🆕 같은 화면의 모든 컴포넌트 (TableList 자동 감지용)
allComponents,
// 플로우 선택된 데이터 정보 추가
flowSelectedData,
flowSelectedStepId,

View File

@@ -1,77 +0,0 @@
"use client";
import React from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Checkbox } from "@/components/ui/checkbox";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { ButtonPrimaryConfig } from "./types";
export interface ButtonPrimaryConfigPanelProps {
config: ButtonPrimaryConfig;
onChange: (config: Partial<ButtonPrimaryConfig>) => void;
}
/**
* ButtonPrimary 설정 패널
* 컴포넌트의 설정값들을 편집할 수 있는 UI 제공
*/
export const ButtonPrimaryConfigPanel: React.FC<ButtonPrimaryConfigPanelProps> = ({ config, onChange }) => {
const handleChange = (key: keyof ButtonPrimaryConfig, value: any) => {
onChange({ [key]: value });
};
return (
<div className="space-y-4">
<div className="text-sm font-medium">button-primary </div>
{/* 버튼 관련 설정 */}
<div className="space-y-2">
<Label htmlFor="text"> </Label>
<Input id="text" value={config.text || ""} onChange={(e) => handleChange("text", e.target.value)} />
</div>
<div className="space-y-2">
<Label htmlFor="actionType"> </Label>
<Select value={config.actionType || "button"} onValueChange={(value) => handleChange("actionType", value)}>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="button">Button</SelectItem>
<SelectItem value="submit">Submit</SelectItem>
<SelectItem value="reset">Reset</SelectItem>
</SelectContent>
</Select>
</div>
{/* 공통 설정 */}
<div className="space-y-2">
<Label htmlFor="disabled"></Label>
<Checkbox
id="disabled"
checked={config.disabled || false}
onCheckedChange={(checked) => handleChange("disabled", checked)}
/>
</div>
<div className="space-y-2">
<Label htmlFor="required"> </Label>
<Checkbox
id="required"
checked={config.required || false}
onCheckedChange={(checked) => handleChange("required", checked)}
/>
</div>
<div className="space-y-2">
<Label htmlFor="readonly"> </Label>
<Checkbox
id="readonly"
checked={config.readonly || false}
onCheckedChange={(checked) => handleChange("readonly", checked)}
/>
</div>
</div>
);
};

View File

@@ -5,7 +5,6 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
import { ComponentCategory } from "@/types/component";
import type { WebType } from "@/types/screen";
import { ButtonPrimaryWrapper } from "./ButtonPrimaryComponent";
import { ButtonPrimaryConfigPanel } from "./ButtonPrimaryConfigPanel";
import { ButtonPrimaryConfig } from "./types";
/**
@@ -31,7 +30,7 @@ export const ButtonPrimaryDefinition = createComponentDefinition({
},
},
defaultSize: { width: 120, height: 40 },
configPanel: ButtonPrimaryConfigPanel,
configPanel: undefined, // 상세 설정 패널(ButtonConfigPanel)이 대신 사용됨
icon: "MousePointer",
tags: ["버튼", "액션", "클릭"],
version: "1.0.0",