- 화면 복제 기능을 개선하여 DB 구조 개편 후의 효율적인 화면 관리를 지원합니다. - 그룹 복제 시 버튼의 `targetScreenId`가 새 화면으로 매핑되지 않는 버그를 수정하였습니다. - 관련된 서비스 및 쿼리에서 `table_type_columns`를 사용하여 라벨 정보를 조회하도록 변경하였습니다. - 여러 컨트롤러 및 서비스에서 `column_labels` 대신 `table_type_columns`를 참조하도록 업데이트하였습니다.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
/**
|
|
* button-primary 컴포넌트 Zod 스키마 및 기본값
|
|
*/
|
|
import { z } from "zod";
|
|
|
|
// 버튼 액션 스키마
|
|
export const buttonActionSchema = z.object({
|
|
type: z.string().default("save"),
|
|
targetScreenId: z.number().optional(),
|
|
successMessage: z.string().optional(),
|
|
errorMessage: z.string().optional(),
|
|
modalSize: z.string().optional(),
|
|
modalTitle: z.string().optional(),
|
|
modalDescription: z.string().optional(),
|
|
modalTitleBlocks: z.array(z.any()).optional(),
|
|
});
|
|
|
|
// button-primary 설정 스키마
|
|
export const buttonPrimaryConfigSchema = z.object({
|
|
type: z.literal("button-primary").default("button-primary"),
|
|
text: z.string().default("저장"),
|
|
actionType: z.enum(["button", "submit", "reset"]).default("button"),
|
|
variant: z.enum(["primary", "secondary", "danger", "outline", "destructive"]).default("primary"),
|
|
webType: z.literal("button").default("button"),
|
|
action: buttonActionSchema.optional(),
|
|
// 추가 속성들
|
|
label: z.string().optional(),
|
|
langKey: z.string().optional(),
|
|
langKeyId: z.number().optional(),
|
|
size: z.string().optional(),
|
|
backgroundColor: z.string().optional(),
|
|
textColor: z.string().optional(),
|
|
borderRadius: z.string().optional(),
|
|
});
|
|
|
|
export type ButtonPrimaryConfig = z.infer<typeof buttonPrimaryConfigSchema>;
|
|
|
|
// 기본값 (스키마에서 자동 생성)
|
|
export const buttonPrimaryDefaults: ButtonPrimaryConfig = buttonPrimaryConfigSchema.parse({});
|