"use client"; import React, { useMemo } from "react"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { ImprovedButtonControlConfigPanel } from "../ImprovedButtonControlConfigPanel"; import { FlowVisibilityConfigPanel } from "../FlowVisibilityConfigPanel"; import type { ButtonTabProps } from "./types"; /** * AdvancedTab - 행 선택 활성화, 제어 기능, 플로우 표시 제어 */ export const AdvancedTab: React.FC = ({ component, onUpdateProperty, allComponents, }) => { // 플로우 위젯이 화면에 있는지 확인 const hasFlowWidget = useMemo(() => { return allComponents.some((comp: { componentType?: string; widgetType?: string }) => { const compType = comp.componentType || comp.widgetType || ""; return compType === "flow-widget" || compType?.toLowerCase().includes("flow"); }); }, [allComponents]); const actionType = component.componentConfig?.action?.type; return (
{/* 행 선택 시에만 활성화 설정 */}

행 선택 활성화 조건

테이블 리스트나 분할 패널에서 데이터가 선택되었을 때만 버튼을 활성화합니다.

체크하면 테이블에서 행을 선택해야만 버튼이 활성화됩니다.

{ onUpdateProperty("componentConfig.action.requireRowSelection", checked); }} />
{component.componentConfig?.action?.requireRowSelection && (

자동 감지: 테이블, 분할 패널, 플로우 위젯 중 선택된 항목이 있으면 활성화

여러 행이 선택되어도 활성화 (기본: 1개 이상 선택 시 활성화)

{ onUpdateProperty("componentConfig.action.allowMultiRowSelection", checked); }} />
{!(component.componentConfig?.action?.allowMultiRowSelection ?? true) && (

정확히 1개의 행만 선택되어야 버튼이 활성화됩니다.

)}
)}
{/* 제어 기능 섹션 - 엑셀 업로드 계열이 아닐 때만 표시 */} {actionType !== "excel_upload" && actionType !== "multi_table_excel_upload" && (
)} {/* 플로우 단계별 표시 제어 (플로우 위젯이 있을 때만) */} {hasFlowWidget && (
)}
); };