fix: Improve number and slider input handling in V2Input and SplitPanelLayoutComponent

- Enhanced V2Input to convert string values from the database to numbers for number and slider inputs, ensuring correct display and functionality.
- Updated primary key retrieval logic in SplitPanelLayoutComponent to prioritize actual DB id values, improving data integrity.
- Simplified primary key handling by removing unnecessary checks and ensuring consistent usage of id fields.
- Improved user feedback in the SplitPanelLayoutComponent with clearer console logs for save operations and item selections.
This commit is contained in:
kjs
2026-02-12 16:07:36 +09:00
parent 505930b3ec
commit d0ebb82f90
2 changed files with 47 additions and 20 deletions

View File

@@ -771,9 +771,15 @@ export const V2Input = forwardRef<HTMLDivElement, V2InputProps>((props, ref) =>
);
case "number":
// DB에서 문자열("325")로 반환되는 경우도 숫자로 변환하여 표시
const numValue = typeof displayValue === "number"
? displayValue
: (displayValue !== undefined && displayValue !== null && displayValue !== "" && !isNaN(Number(displayValue)))
? Number(displayValue)
: undefined;
return (
<NumberInput
value={typeof displayValue === "number" ? displayValue : undefined}
value={numValue}
onChange={(v) => {
setAutoGeneratedValue(null);
onChange?.(v ?? 0);
@@ -802,9 +808,15 @@ export const V2Input = forwardRef<HTMLDivElement, V2InputProps>((props, ref) =>
);
case "slider":
// DB에서 문자열로 반환되는 경우도 숫자로 변환
const sliderValue = typeof displayValue === "number"
? displayValue
: (displayValue !== undefined && displayValue !== null && displayValue !== "" && !isNaN(Number(displayValue)))
? Number(displayValue)
: (config.min ?? 0);
return (
<SliderInput
value={typeof displayValue === "number" ? displayValue : (config.min ?? 0)}
value={sliderValue}
onChange={(v) => {
setAutoGeneratedValue(null);
onChange?.(v);