Compare commits
2 Commits
84b9060e4e
...
59f5cf22f0
| Author | SHA1 | Date | |
|---|---|---|---|
| 59f5cf22f0 | |||
| c4631efbd2 |
@@ -219,6 +219,17 @@ function resolveTriple(
|
|||||||
return { kind: "attach", type: "file", format: "any" };
|
return { kind: "attach", type: "file", format: "any" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2.5 옛 레거시 컴포넌트 ID → triple default
|
||||||
|
// config.kind/type 가 없을 때만 도달. 명시된 config 가 있으면 step 0 에서 이미 return.
|
||||||
|
switch (componentType) {
|
||||||
|
case "text-input": return { kind: "input", type: "text", format: "free" };
|
||||||
|
case "number-input": return { kind: "input", type: "number", format: "int" };
|
||||||
|
case "date-input": return { kind: "input", type: "date", format: "date" };
|
||||||
|
case "select-basic": return { kind: "choice", type: "single", format: "list" };
|
||||||
|
case "checkbox-basic": return { kind: "choice", type: "single", format: "boolean" };
|
||||||
|
case "textarea-basic": return { kind: "input", type: "text", format: "free" };
|
||||||
|
}
|
||||||
|
|
||||||
// 3. 선택 (source / multiple)
|
// 3. 선택 (source / multiple)
|
||||||
const isMulti = !!config.multiple;
|
const isMulti = !!config.multiple;
|
||||||
const src = config.source || (config.fieldType === "select" ? "static" : config.fieldType);
|
const src = config.source || (config.fieldType === "select" ? "static" : config.fieldType);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { CheckboxBasicWrapper } from "./CheckboxBasicComponent";
|
import { CheckboxBasicWrapper } from "./CheckboxBasicComponent";
|
||||||
import { CheckboxBasicConfigPanel } from "./CheckboxBasicConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { CheckboxBasicConfig } from "./types";
|
import { CheckboxBasicConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,10 +21,13 @@ export const CheckboxBasicDefinition = createComponentDefinition({
|
|||||||
web_type: "checkbox",
|
web_type: "checkbox",
|
||||||
component: CheckboxBasicWrapper,
|
component: CheckboxBasicWrapper,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "choice",
|
||||||
|
type: "single",
|
||||||
|
format: "boolean",
|
||||||
placeholder: "입력하세요",
|
placeholder: "입력하세요",
|
||||||
},
|
},
|
||||||
default_size: { width: 150, height: 120 }, // 40 * 3 (3개 옵션)
|
default_size: { width: 150, height: 120 }, // 40 * 3 (3개 옵션)
|
||||||
config_panel: CheckboxBasicConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: [],
|
tags: [],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { DateInputComponent } from "./DateInputComponent";
|
import { DateInputComponent } from "./DateInputComponent";
|
||||||
import { DateInputConfigPanel } from "./DateInputConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { DateInputConfig } from "./types";
|
import { DateInputConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,10 +21,13 @@ export const DateInputDefinition = createComponentDefinition({
|
|||||||
web_type: "date",
|
web_type: "date",
|
||||||
component: DateInputComponent,
|
component: DateInputComponent,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "input",
|
||||||
|
type: "date",
|
||||||
|
format: "date",
|
||||||
placeholder: "입력하세요",
|
placeholder: "입력하세요",
|
||||||
},
|
},
|
||||||
default_size: { width: 220, height: 40 },
|
default_size: { width: 220, height: 40 },
|
||||||
config_panel: DateInputConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: [],
|
tags: [],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { createComponentDefinition } from "../../utils/createComponentDefinition";
|
import { createComponentDefinition } from "../../utils/createComponentDefinition";
|
||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import { InputWrapper } from "./InputComponent";
|
import { InputWrapper } from "./InputComponent";
|
||||||
import { InvInputConfigPanel } from "./InvInputConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import type { InputConfig } from "./types";
|
import type { InputConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,12 +25,14 @@ import type { InputConfig } from "./types";
|
|||||||
* notes/gbpark/2026-04-11-component-unification-plan.md §3.4
|
* notes/gbpark/2026-04-11-component-unification-plan.md §3.4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const DEFAULT_CONFIG: Partial<InputConfig> = {
|
const DEFAULT_CONFIG = {
|
||||||
|
kind: "input",
|
||||||
type: "text",
|
type: "text",
|
||||||
|
format: "free",
|
||||||
placeholder: "입력하세요",
|
placeholder: "입력하세요",
|
||||||
required: false,
|
required: false,
|
||||||
editable: true,
|
editable: true,
|
||||||
};
|
} as Record<string, any>;
|
||||||
|
|
||||||
export const InputDefinition = createComponentDefinition({
|
export const InputDefinition = createComponentDefinition({
|
||||||
id: "input",
|
id: "input",
|
||||||
@@ -40,9 +42,9 @@ export const InputDefinition = createComponentDefinition({
|
|||||||
category: ComponentCategory.INPUT,
|
category: ComponentCategory.INPUT,
|
||||||
web_type: "text",
|
web_type: "text",
|
||||||
component: InputWrapper,
|
component: InputWrapper,
|
||||||
default_config: DEFAULT_CONFIG as Record<string, any>,
|
default_config: DEFAULT_CONFIG,
|
||||||
default_size: { width: 240, height: 48 },
|
default_size: { width: 240, height: 48 },
|
||||||
config_panel: InvInputConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: ["입력", "input", "field", "text", "number", "date", "select"],
|
tags: ["입력", "input", "field", "text", "number", "date", "select"],
|
||||||
version: "2.0.0",
|
version: "2.0.0",
|
||||||
@@ -61,4 +63,3 @@ export const InputDefinition = createComponentDefinition({
|
|||||||
|
|
||||||
export type { InputConfig } from "./types";
|
export type { InputConfig } from "./types";
|
||||||
export { InputComponent, InputWrapper } from "./InputComponent";
|
export { InputComponent, InputWrapper } from "./InputComponent";
|
||||||
export { InvInputConfigPanel } from "./InvInputConfigPanel";
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { NumberInputWrapper } from "./NumberInputComponent";
|
import { NumberInputWrapper } from "./NumberInputComponent";
|
||||||
import { NumberInputConfigPanel } from "./NumberInputConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { NumberInputConfig } from "./types";
|
import { NumberInputConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,12 +21,15 @@ export const NumberInputDefinition = createComponentDefinition({
|
|||||||
web_type: "number",
|
web_type: "number",
|
||||||
component: NumberInputWrapper,
|
component: NumberInputWrapper,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "input",
|
||||||
|
type: "number",
|
||||||
|
format: "int",
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 999999,
|
max: 999999,
|
||||||
step: 1,
|
step: 1,
|
||||||
},
|
},
|
||||||
default_size: { width: 200, height: 40 },
|
default_size: { width: 200, height: 40 },
|
||||||
config_panel: NumberInputConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: [],
|
tags: [],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { SelectBasicWrapper } from "./SelectBasicComponent";
|
import { SelectBasicWrapper } from "./SelectBasicComponent";
|
||||||
import { SelectBasicConfigPanel } from "./SelectBasicConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { SelectBasicConfig } from "./types";
|
import { SelectBasicConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,11 +21,14 @@ export const SelectBasicDefinition = createComponentDefinition({
|
|||||||
web_type: "select",
|
web_type: "select",
|
||||||
component: SelectBasicWrapper,
|
component: SelectBasicWrapper,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "choice",
|
||||||
|
type: "single",
|
||||||
|
format: "list",
|
||||||
options: [],
|
options: [],
|
||||||
placeholder: "선택하세요",
|
placeholder: "선택하세요",
|
||||||
},
|
},
|
||||||
default_size: { width: 250, height: 40 },
|
default_size: { width: 250, height: 40 },
|
||||||
config_panel: SelectBasicConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: [],
|
tags: [],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { TextInputWrapper } from "./TextInputComponent";
|
import { TextInputWrapper } from "./TextInputComponent";
|
||||||
import { TextInputConfigPanel } from "./TextInputConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { TextInputConfig } from "./types";
|
import { TextInputConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,11 +21,14 @@ export const TextInputDefinition = createComponentDefinition({
|
|||||||
web_type: "text",
|
web_type: "text",
|
||||||
component: TextInputWrapper,
|
component: TextInputWrapper,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "input",
|
||||||
|
type: "text",
|
||||||
|
format: "free",
|
||||||
placeholder: "텍스트를 입력하세요",
|
placeholder: "텍스트를 입력하세요",
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
},
|
},
|
||||||
default_size: { width: 300, height: 40 },
|
default_size: { width: 300, height: 40 },
|
||||||
config_panel: TextInputConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: ["텍스트", "입력", "폼"],
|
tags: ["텍스트", "입력", "폼"],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { createComponentDefinition } from "../../utils/createComponentDefinition
|
|||||||
import { ComponentCategory } from "@/types/component";
|
import { ComponentCategory } from "@/types/component";
|
||||||
import type { WebType } from "@/types/screen";
|
import type { WebType } from "@/types/screen";
|
||||||
import { TextareaBasicWrapper } from "./TextareaBasicComponent";
|
import { TextareaBasicWrapper } from "./TextareaBasicComponent";
|
||||||
import { TextareaBasicConfigPanel } from "./TextareaBasicConfigPanel";
|
import { InvFieldConfigPanel } from "@/components/v2/config-panels/InvFieldConfigPanel";
|
||||||
import { TextareaBasicConfig } from "./types";
|
import { TextareaBasicConfig } from "./types";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,12 +21,15 @@ export const TextareaBasicDefinition = createComponentDefinition({
|
|||||||
web_type: "textarea",
|
web_type: "textarea",
|
||||||
component: TextareaBasicWrapper,
|
component: TextareaBasicWrapper,
|
||||||
default_config: {
|
default_config: {
|
||||||
|
kind: "input",
|
||||||
|
type: "text",
|
||||||
|
format: "free",
|
||||||
placeholder: "내용을 입력하세요",
|
placeholder: "내용을 입력하세요",
|
||||||
rows: 3,
|
rows: 3,
|
||||||
maxLength: 1000,
|
maxLength: 1000,
|
||||||
},
|
},
|
||||||
default_size: { width: 400, height: 100 },
|
default_size: { width: 400, height: 100 },
|
||||||
config_panel: TextareaBasicConfigPanel,
|
config_panel: InvFieldConfigPanel,
|
||||||
icon: "Edit",
|
icon: "Edit",
|
||||||
tags: [],
|
tags: [],
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const CONFIG_PANEL_MAP: Record<string, () => Promise<any>> = {
|
|||||||
"title": () => import("@/lib/registry/components/title/InvTitleConfigPanel"),
|
"title": () => import("@/lib/registry/components/title/InvTitleConfigPanel"),
|
||||||
"button": () => import("@/lib/registry/components/button/InvButtonConfigPanel"),
|
"button": () => import("@/lib/registry/components/button/InvButtonConfigPanel"),
|
||||||
"search": () => import("@/lib/registry/components/search/InvSearchConfigPanel"),
|
"search": () => import("@/lib/registry/components/search/InvSearchConfigPanel"),
|
||||||
"input": () => import("@/lib/registry/components/input/InvInputConfigPanel"),
|
"input": () => import("@/components/v2/config-panels/InvFieldConfigPanel"),
|
||||||
"stats": () => import("@/lib/registry/components/stats/InvStatsConfigPanel"),
|
"stats": () => import("@/lib/registry/components/stats/InvStatsConfigPanel"),
|
||||||
"table": () => import("@/lib/registry/components/table/InvTableConfigPanel"),
|
"table": () => import("@/lib/registry/components/table/InvTableConfigPanel"),
|
||||||
"container": () => import("@/lib/registry/components/container/InvContainerConfigPanel"),
|
"container": () => import("@/lib/registry/components/container/InvContainerConfigPanel"),
|
||||||
|
|||||||
Reference in New Issue
Block a user