ERP-node/frontend/lib/registry/components/simple-repeater-table/index.ts

72 lines
2.5 KiB
TypeScript
Raw Normal View History

"use client";
import { createComponentDefinition } from "../../utils/createComponentDefinition";
import { ComponentCategory } from "@/types/component";
import { SimpleRepeaterTableComponent } from "./SimpleRepeaterTableComponent";
import { SimpleRepeaterTableConfigPanel } from "./SimpleRepeaterTableConfigPanel";
/**
* 🆕 SimpleRepeaterTable
* - /
*
* :
* - 로드: 어떤
* - 설정: ( / / )
* - 설정:
* - 계산: 수량 * =
* - 모드: 전체
*/
export const SimpleRepeaterTableDefinition = createComponentDefinition({
id: "simple-repeater-table",
name: "단순 반복 테이블",
nameEng: "Simple Repeater Table",
description: "어떤 테이블에서 조회하고 어떤 테이블에 저장할지 컬럼별로 설정 가능한 반복 테이블 (검색/추가 없음, 자동 계산 지원)",
category: ComponentCategory.DATA,
webType: "table",
component: SimpleRepeaterTableComponent,
defaultConfig: {
columns: [],
calculationRules: [],
initialDataConfig: undefined,
readOnly: false,
showRowNumber: true,
allowDelete: true,
allowAdd: false,
addButtonText: "행 추가",
addButtonPosition: "bottom",
minRows: 0,
maxRows: undefined,
summaryConfig: {
enabled: false,
fields: [],
},
maxHeight: "240px",
},
defaultSize: { width: 800, height: 400 },
configPanel: SimpleRepeaterTableConfigPanel,
icon: "Table",
tags: ["테이블", "반복", "편집", "데이터", "목록", "계산", "조회", "저장"],
version: "2.0.0",
author: "개발팀",
});
// 타입 내보내기
export type {
SimpleRepeaterTableProps,
SimpleRepeaterColumnConfig,
CalculationRule,
ColumnSourceConfig,
ColumnTargetConfig,
InitialDataConfig,
DataFilterCondition,
SourceJoinCondition,
SummaryConfig,
SummaryFieldConfig,
} from "./types";
// 컴포넌트 내보내기
export { SimpleRepeaterTableComponent } from "./SimpleRepeaterTableComponent";
export { SimpleRepeaterTableConfigPanel } from "./SimpleRepeaterTableConfigPanel";
export { useCalculation } from "./useCalculation";