260330_01_ENH: 26일자 수정사항 반영(라이프스테이지 중분류 제외)

This commit is contained in:
2026-03-30 13:18:08 +09:00
parent ee8bb13209
commit 7f9465e96f
19 changed files with 203 additions and 94 deletions

View File

@@ -5,7 +5,7 @@ import { cn, parseNumber } from "@/lib/utils";
import type { ChartData, SignStyle, TopChartTableRow } from "../types";
import { CHART_HEIGHTS, TABLE_DIMENSIONS } from "@/components/lge-dashboard/chart/chart.config";
import { UNIT_TEXT } from "@/const/lg-common.const";
import { isCagrRow } from "@/lib/lg-dashboard";
import {isCagrRow, isSampleRow} from "@/lib/lg-dashboard";
import BaseTableHeader from "../table/core/BaseTableHeader";
import { formatSignedValue, getSignTextClass, resolveSignStyle, toRoundedNumber } from "../table/core/table-core.helpers";
@@ -41,7 +41,7 @@ export default function TopChartTable({
signStyle,
fillCAGR = false,
unitText = UNIT_TEXT,
}: TopChartTableProps) {
}: Readonly<TopChartTableProps>) {
const resolvedSignStyle = resolveSignStyle(signStyle, {
positiveTextClassName: "lg-num-pos",
negativeTextClassName: "lg-num-neg",
@@ -93,6 +93,7 @@ export default function TopChartTable({
<tbody>
{rows.map((row, rowIndex) => {
const signRow = !!signStyle?.rowSelector?.(row, rowIndex);
const sampleRow = isSampleRow(row.label ?? "");
const cagrRow = isCagrRow(row.label ?? "");
const rowTotal = parseNumber(row.total);
@@ -104,7 +105,12 @@ export default function TopChartTable({
{categories.map((_, categoryIndex) => {
const rawValue = row.values?.[categoryIndex];
const roundedValue = toRoundedNumber(rawValue);
if(sampleRow){
return <td key={categoryIndex}>{rawValue}</td>;
}
const roundedValue = toRoundedNumber(rawValue, cagrRow? 1 : 0);
if (!signRow) {
if (roundedValue === null) {