docs: update full-screen analysis and V2 component usage guide
- Revised the full-screen analysis document to reflect the latest updates, including the purpose and core rules for screen development. - Expanded the V2 component usage guide to include a comprehensive catalog of components, their configurations, and usage guidelines for LLM and chatbot applications. - Added a summary of the system architecture and clarified the implementation methods for user business screens and admin menus. - Enhanced the documentation to serve as a reference for AI agents and screen designers, ensuring adherence to the established guidelines. These updates aim to improve clarity and usability for developers and designers working with the WACE ERP screen composition system. Made-with: Cursor
This commit is contained in:
@@ -11,6 +11,7 @@ import { ComponentRendererProps } from "@/types/component";
|
||||
import { useCalculation } from "./useCalculation";
|
||||
import { apiClient } from "@/lib/api/client";
|
||||
import { isColumnRequiredByMeta } from "@/lib/registry/DynamicComponentRenderer";
|
||||
import { formatNumber as centralFormatNumber } from "@/lib/formatting";
|
||||
|
||||
export interface SimpleRepeaterTableComponentProps extends ComponentRendererProps {
|
||||
config?: SimpleRepeaterTableProps;
|
||||
@@ -519,18 +520,17 @@ export function SimpleRepeaterTableComponent({
|
||||
return result;
|
||||
}, [value, summaryConfig]);
|
||||
|
||||
// 합계 값 포맷팅
|
||||
// 합계 값 포맷팅 (공통 formatNumber 사용)
|
||||
const formatSummaryValue = (field: SummaryFieldConfig, value: number): string => {
|
||||
const decimals = field.decimals ?? 0;
|
||||
const formatted = value.toFixed(decimals);
|
||||
|
||||
switch (field.format) {
|
||||
case "currency":
|
||||
return Number(formatted).toLocaleString() + "원";
|
||||
return centralFormatNumber(value, decimals) + "원";
|
||||
case "percent":
|
||||
return formatted + "%";
|
||||
return value.toFixed(decimals) + "%";
|
||||
default:
|
||||
return Number(formatted).toLocaleString();
|
||||
return centralFormatNumber(value, decimals);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -554,9 +554,9 @@ export function SimpleRepeaterTableComponent({
|
||||
return (
|
||||
<div className="px-2 py-1">
|
||||
{column.type === "number"
|
||||
? typeof cellValue === "number"
|
||||
? cellValue.toLocaleString()
|
||||
: cellValue || "0"
|
||||
? (cellValue !== null && cellValue !== undefined && cellValue !== ""
|
||||
? centralFormatNumber(cellValue)
|
||||
: "0")
|
||||
: cellValue || "-"}
|
||||
</div>
|
||||
);
|
||||
@@ -565,12 +565,28 @@ export function SimpleRepeaterTableComponent({
|
||||
// 편집 가능한 필드
|
||||
switch (column.type) {
|
||||
case "number":
|
||||
const numDisplay = (() => {
|
||||
if (cellValue === undefined || cellValue === null || cellValue === "") return "";
|
||||
const n = typeof cellValue === "number" ? cellValue : parseFloat(String(cellValue));
|
||||
return isNaN(n) ? "" : centralFormatNumber(n);
|
||||
})();
|
||||
return (
|
||||
<Input
|
||||
type="number"
|
||||
value={cellValue || ""}
|
||||
onChange={(e) => handleCellEdit(rowIndex, column.field, parseFloat(e.target.value) || 0)}
|
||||
className="h-7 text-xs"
|
||||
type="text"
|
||||
inputMode="decimal"
|
||||
value={numDisplay}
|
||||
onChange={(e) => {
|
||||
const stripped = e.target.value.replace(/,/g, "");
|
||||
if (stripped === "" || stripped === "-") {
|
||||
handleCellEdit(rowIndex, column.field, 0);
|
||||
return;
|
||||
}
|
||||
if (!/^-?\d*\.?\d*$/.test(stripped)) return;
|
||||
if (!stripped.endsWith(".")) {
|
||||
handleCellEdit(rowIndex, column.field, parseFloat(stripped) || 0);
|
||||
}
|
||||
}}
|
||||
className="h-7 text-right text-xs"
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user