fone-design-system_v2 1.0.40 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,15 +63,44 @@ export type FieldRow = {
63
63
  * - onTableChange: 폼 데이터 변경을 100ms 디바운스로 통지
64
64
  * --------------------------------------------- */
65
65
  export interface VerticalTableProps {
66
- data: {
67
- [key: string]: any;
68
- };
69
66
  items: FieldRow[];
70
67
  totalColumns: number;
68
+ data?: {
69
+ [key: string]: any;
70
+ };
71
71
  colGroup?: string[];
72
72
  title?: string;
73
73
  onSave?: (e: any) => void;
74
74
  onTableChange?: (data: any) => void;
75
75
  }
76
+ /** ---------------------------------------------
77
+ * 내부 전용 셀 타입
78
+ * - 렌더링 단계에서 th/td 역할을 구분하기 위해 kind("title" | "value")로 나눈다.
79
+ * - span은 해당 셀의 colspan, required 등 렌더링을 위한 메타 데이터 포함.
80
+ * --------------------------------------------- */
81
+ export type TitleCell = {
82
+ kind: "title";
83
+ accessorKey: string;
84
+ title: string;
85
+ span?: ColSpan["span"];
86
+ required?: FieldRow["required"];
87
+ };
88
+ export type ValueCell = {
89
+ kind: "value";
90
+ accessorKey: string;
91
+ type?: FieldRow["type"];
92
+ value: string;
93
+ span?: ColSpan["span"];
94
+ required?: FieldRow["required"];
95
+ textAlign?: FieldRow["textAlign"];
96
+ buttons?: FieldRow["buttons"];
97
+ menuItems?: FieldRow["menuItems"];
98
+ onClick?: FieldRow["onClick"];
99
+ startIcon?: FieldRow["startIcon"];
100
+ endIcon?: FieldRow["endIcon"];
101
+ disabled?: FieldRow["disabled"];
102
+ readOnly?: FieldRow["readOnly"];
103
+ maxLength?: FieldRow["maxLength"];
104
+ };
76
105
  declare const VerticalTable: React.ForwardRefExoticComponent<VerticalTableProps & React.RefAttributes<HTMLTableElement>>;
77
106
  export default VerticalTable;
@@ -1,7 +1,7 @@
1
- import { FieldRow } from '../../VerticalTable';
1
+ import { ValueCell } from '../../VerticalTable';
2
2
  interface SelectCellProps {
3
3
  formData: Record<string, any>;
4
- cellItem: FieldRow;
4
+ cellItem: ValueCell;
5
5
  setField: (key: string, value: any) => void;
6
6
  }
7
7
  declare const SelectCell: ({ formData, cellItem, setField }: SelectCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { FieldRow } from '../../VerticalTable';
1
+ import { ValueCell } from '../../VerticalTable';
2
2
  interface TdProps {
3
3
  value?: string;
4
4
  vSpan?: number;
@@ -7,7 +7,7 @@ interface TdProps {
7
7
  variant?: "contained" | "outlined";
8
8
  disabled?: boolean;
9
9
  }[];
10
- cellItem: FieldRow;
10
+ cellItem: ValueCell;
11
11
  formData: Record<string, any>;
12
12
  setField: (key: string, value: any) => void;
13
13
  }