2026-02-12 11:07:58 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* pop-card-list 컴포넌트 레지스트리 등록 진입점 (V2)
|
|
|
|
|
*
|
|
|
|
|
* 이 파일을 import하면 side-effect로 PopComponentRegistry에 자동 등록됨
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { PopComponentRegistry } from "../../PopComponentRegistry";
|
|
|
|
|
import { PopCardListComponent } from "./PopCardListComponent";
|
|
|
|
|
import { PopCardListConfigPanel } from "./PopCardListConfig";
|
|
|
|
|
import { PopCardListPreviewComponent } from "./PopCardListPreview";
|
|
|
|
|
import type { PopCardListConfig } from "../types";
|
|
|
|
|
import { DEFAULT_CARD_IMAGE } from "../types";
|
|
|
|
|
|
|
|
|
|
const defaultConfig: PopCardListConfig = {
|
|
|
|
|
// 데이터 소스 (테이블 단위)
|
|
|
|
|
dataSource: {
|
|
|
|
|
tableName: "",
|
|
|
|
|
},
|
|
|
|
|
// 카드 템플릿
|
|
|
|
|
cardTemplate: {
|
|
|
|
|
header: {
|
|
|
|
|
codeField: undefined,
|
|
|
|
|
titleField: undefined,
|
|
|
|
|
},
|
|
|
|
|
image: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
imageColumn: undefined,
|
|
|
|
|
defaultImage: DEFAULT_CARD_IMAGE,
|
|
|
|
|
},
|
|
|
|
|
body: {
|
|
|
|
|
fields: [],
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-02-24 15:54:57 +09:00
|
|
|
// 스크롤 방향
|
|
|
|
|
scrollDirection: "vertical",
|
2026-02-12 11:07:58 +09:00
|
|
|
cardSize: "medium",
|
2026-02-24 15:54:57 +09:00
|
|
|
// 그리드 배치 (가로 x 세로)
|
|
|
|
|
gridColumns: 3,
|
|
|
|
|
gridRows: 2,
|
|
|
|
|
// 담기 버튼 기본 설정
|
|
|
|
|
cartAction: {
|
|
|
|
|
navigateMode: "none",
|
|
|
|
|
iconType: "lucide",
|
|
|
|
|
iconValue: "ShoppingCart",
|
|
|
|
|
label: "담기",
|
|
|
|
|
cancelLabel: "취소",
|
|
|
|
|
},
|
2026-02-12 11:07:58 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 레지스트리 등록
|
|
|
|
|
PopComponentRegistry.registerComponent({
|
|
|
|
|
id: "pop-card-list",
|
|
|
|
|
name: "카드 목록",
|
|
|
|
|
description: "테이블 데이터를 카드 형태로 표시 (헤더 + 이미지 + 필드 목록)",
|
|
|
|
|
category: "display",
|
|
|
|
|
icon: "LayoutGrid",
|
|
|
|
|
component: PopCardListComponent,
|
|
|
|
|
configPanel: PopCardListConfigPanel,
|
|
|
|
|
preview: PopCardListPreviewComponent,
|
|
|
|
|
defaultProps: defaultConfig,
|
2026-02-25 17:03:47 +09:00
|
|
|
connectionMeta: {
|
|
|
|
|
sendable: [
|
|
|
|
|
{ key: "selected_row", label: "선택된 행", type: "selected_row", description: "사용자가 선택한 카드의 행 데이터를 전달" },
|
|
|
|
|
{ key: "cart_item_added", label: "담기 완료", type: "event", description: "카드 담기 시 해당 행 + 수량 데이터 전달" },
|
|
|
|
|
],
|
|
|
|
|
receivable: [
|
|
|
|
|
{ key: "filter_condition", label: "필터 조건", type: "filter_value", description: "외부 컴포넌트에서 받은 필터 조건으로 카드 목록 필터링" },
|
|
|
|
|
],
|
|
|
|
|
},
|
2026-02-12 11:07:58 +09:00
|
|
|
touchOptimized: true,
|
|
|
|
|
supportedDevices: ["mobile", "tablet"],
|
|
|
|
|
});
|