feat: add bulk update script for COMPANY_7 button styles
- Introduced a new script `btn-bulk-update-company7.ts` to facilitate bulk updates of button styles for COMPANY_7. - The script includes functionalities for testing, running updates, creating backups, and restoring from backups. - Implemented logic to dynamically apply button styles based on action types, ensuring consistent UI across the application. - Updated documentation to reflect changes in button icon mapping and dynamic loading of icons. This addition enhances the maintainability and consistency of button styles for COMPANY_7, streamlining the update process.
This commit is contained in:
@@ -502,15 +502,22 @@ export const ButtonPrimaryComponent: React.FC<ButtonPrimaryComponentProps> = ({
|
||||
if (component.style?.backgroundColor) {
|
||||
return component.style.backgroundColor;
|
||||
}
|
||||
// 4순위: style.labelColor (레거시)
|
||||
// 4순위: componentConfig.style.backgroundColor
|
||||
if (componentConfig.style?.backgroundColor) {
|
||||
return componentConfig.style.backgroundColor;
|
||||
}
|
||||
// 5순위: style.labelColor (레거시 호환)
|
||||
if (component.style?.labelColor) {
|
||||
return component.style.labelColor;
|
||||
}
|
||||
// 기본값: 삭제 버튼이면 빨강, 아니면 파랑
|
||||
if (isDeleteAction()) {
|
||||
return "#ef4444"; // 빨간색 (Tailwind red-500)
|
||||
}
|
||||
return "#3b82f6"; // 파란색 (Tailwind blue-500)
|
||||
// 6순위: 액션별 기본 배경색
|
||||
const excelActions = ["excel_download", "excel_upload", "multi_table_excel_upload"];
|
||||
const actionType = typeof componentConfig.action === "string"
|
||||
? componentConfig.action
|
||||
: componentConfig.action?.type || "";
|
||||
if (actionType === "delete") return "#F04544";
|
||||
if (excelActions.includes(actionType)) return "#212121";
|
||||
return "#3B83F6";
|
||||
};
|
||||
|
||||
const getButtonTextColor = () => {
|
||||
|
||||
@@ -6,16 +6,29 @@ import { ButtonPrimaryConfig } from "./types";
|
||||
* ButtonPrimary 컴포넌트 기본 설정
|
||||
*/
|
||||
export const ButtonPrimaryDefaultConfig: ButtonPrimaryConfig = {
|
||||
text: "버튼",
|
||||
text: "저장",
|
||||
actionType: "button",
|
||||
variant: "primary",
|
||||
|
||||
// 공통 기본값
|
||||
variant: "default",
|
||||
size: "md",
|
||||
disabled: false,
|
||||
required: false,
|
||||
readonly: false,
|
||||
variant: "default",
|
||||
size: "md",
|
||||
displayMode: "icon-text",
|
||||
icon: {
|
||||
name: "Check",
|
||||
type: "lucide",
|
||||
size: "보통",
|
||||
},
|
||||
iconTextPosition: "right",
|
||||
iconGap: 6,
|
||||
style: {
|
||||
borderRadius: "8px",
|
||||
labelColor: "#FFFFFF",
|
||||
fontSize: "12px",
|
||||
fontWeight: "normal",
|
||||
labelTextAlign: "left",
|
||||
backgroundColor: "#3B83F6",
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,8 +28,24 @@ export const V2ButtonPrimaryDefinition = createComponentDefinition({
|
||||
successMessage: "저장되었습니다.",
|
||||
errorMessage: "저장 중 오류가 발생했습니다.",
|
||||
},
|
||||
displayMode: "icon-text",
|
||||
icon: {
|
||||
name: "Check",
|
||||
type: "lucide",
|
||||
size: "보통",
|
||||
},
|
||||
iconTextPosition: "right",
|
||||
iconGap: 6,
|
||||
style: {
|
||||
borderRadius: "8px",
|
||||
labelColor: "#FFFFFF",
|
||||
fontSize: "12px",
|
||||
fontWeight: "normal",
|
||||
labelTextAlign: "left",
|
||||
backgroundColor: "#3B83F6",
|
||||
},
|
||||
},
|
||||
defaultSize: { width: 120, height: 40 },
|
||||
defaultSize: { width: 140, height: 40 },
|
||||
configPanel: undefined, // 상세 설정 패널(ButtonConfigPanel)이 대신 사용됨
|
||||
icon: "MousePointer",
|
||||
tags: ["버튼", "액션", "클릭"],
|
||||
|
||||
Reference in New Issue
Block a user