fone-design-system_v2 1.0.207 → 1.0.209

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.
Files changed (32) hide show
  1. package/dist/components/Table2/Table2.d.ts +2 -69
  2. package/dist/components/Table2/headers/Header.d.ts +1 -0
  3. package/dist/components/Table2/headers/HeaderItem.d.ts +2 -1
  4. package/dist/components/Table2/index.d.ts +2 -1
  5. package/dist/components/Table2/rows/Cell.d.ts +2 -2
  6. package/dist/components/Table2/rows/Row.d.ts +2 -0
  7. package/dist/components/Table2/rows/Rows.d.ts +2 -0
  8. package/dist/components/Table2/rows/shared/CellEditorLayout.d.ts +15 -0
  9. package/dist/components/Table2/types/index.d.ts +1 -0
  10. package/dist/components/Table2/types/render.types.d.ts +5 -0
  11. package/dist/components/Table2/types/resolver.types.d.ts +5 -0
  12. package/dist/components/Table2/types/table.types.d.ts +80 -0
  13. package/dist/fone-design-system.es.js +12604 -12605
  14. package/dist/fone-design-system.umd.js +193 -182
  15. package/package.json +1 -1
  16. /package/dist/components/Table2/rows/{CellButton.d.ts → cells/CellButton.d.ts} +0 -0
  17. /package/dist/components/Table2/rows/{CellCheckbox.d.ts → cells/CellCheckbox.d.ts} +0 -0
  18. /package/dist/components/Table2/rows/{CellCheckboxN.d.ts → cells/CellCheckboxN.d.ts} +0 -0
  19. /package/dist/components/Table2/rows/{CellCustom.d.ts → cells/CellCustom.d.ts} +0 -0
  20. /package/dist/components/Table2/rows/{CellDate.d.ts → cells/CellDate.d.ts} +0 -0
  21. /package/dist/components/Table2/rows/{CellDatePicker2.d.ts → cells/CellDatePicker2.d.ts} +0 -0
  22. /package/dist/components/Table2/rows/{CellEdit.d.ts → cells/CellEdit.d.ts} +0 -0
  23. /package/dist/components/Table2/rows/{CellFile.d.ts → cells/CellFile.d.ts} +0 -0
  24. /package/dist/components/Table2/rows/{CellFrontCheckbox.d.ts → cells/CellFrontCheckbox.d.ts} +0 -0
  25. /package/dist/components/Table2/rows/{CellInput.d.ts → cells/CellInput.d.ts} +0 -0
  26. /package/dist/components/Table2/rows/{CellModal.d.ts → cells/CellModal.d.ts} +0 -0
  27. /package/dist/components/Table2/rows/{CellNo.d.ts → cells/CellNo.d.ts} +0 -0
  28. /package/dist/components/Table2/rows/{CellReorder.d.ts → cells/CellReorder.d.ts} +0 -0
  29. /package/dist/components/Table2/rows/{CellSelect.d.ts → cells/CellSelect.d.ts} +0 -0
  30. /package/dist/components/Table2/rows/{CellText.d.ts → cells/CellText.d.ts} +0 -0
  31. /package/dist/components/Table2/rows/{CellTextarea.d.ts → cells/CellTextarea.d.ts} +0 -0
  32. /package/dist/components/Table2/rows/{rowCrud.d.ts → shared/rowCrud.d.ts} +0 -0
@@ -1,70 +1,3 @@
1
- import { default as React, CSSProperties } from 'react';
2
- import { ColumnDef as TanstackColumnDef } from '@tanstack/react-table';
3
- export type ColumnDef<T extends object> = TanstackColumnDef<T> & {
4
- accessorKey?: string;
5
- width?: string;
6
- align?: "start" | "center" | "right";
7
- editable?: boolean;
8
- type?: "input" | "textarea" | "inputNum" | "inputEng" | "select" | "checkbox" | "checkboxN" | "datePicker" | "modal" | "file" | "button" | "custom" | "text" | "date" | ((row: T) => "input" | "textarea" | "inputNum" | "inputEng" | "select" | "checkbox" | "checkboxN" | "datePicker" | "modal" | "file" | "button" | "custom" | "text" | "date") | string;
9
- selectItems?: {
10
- value: string | number;
11
- label: string;
12
- }[];
13
- required?: boolean;
14
- setSort?: React.Dispatch<React.SetStateAction<string[]>>;
15
- button?: React.ReactNode | ((row: T) => React.ReactNode);
16
- ellipsis?: boolean;
17
- role?: "group";
18
- tags?: (row: T) => React.ReactNode[];
19
- disabled?: (row: T) => boolean | boolean;
20
- isOnly?: boolean;
21
- maxLength?: number;
22
- numRange?: number[];
23
- component?: (row: T) => React.ReactNode;
24
- modalFn?: (row: T) => void;
25
- accept?: string;
26
- icon?: React.ReactNode;
27
- onChange?: (...args: any[]) => any;
28
- readOnly?: boolean;
29
- visible?: boolean;
30
- simpleSelect?: boolean;
31
- showEditIcon?: boolean;
32
- };
33
- export interface Table2Props {
34
- /** Cell 클릭 시 해당 Cell Border 스타일 변경 여부를 설정합니다. */
35
- selectedCell?: boolean;
36
- /** 테이블에 표시할 데이터 배열을 설정합니다. */
37
- data?: any[];
38
- /** 테이블의 열 정의 배열을 설정합니다. */
39
- columns?: ColumnDef<any>[];
40
- /** 테이블 데이터 변경 시 호출되는 콜백 함수를 설정합니다. */
41
- onChange?: (data: any[]) => void;
42
- /** 체크박스 표시 여부를 설정합니다. */
43
- checkbox?: boolean;
44
- /** 행 번호 컬럼 표시 여부를 설정합니다. */
45
- no?: boolean;
46
- /** 체크박스를 라디오 버튼 형태로 표시 여부를 설정합니다. */
47
- radio?: boolean;
48
- /** Cell 클릭 시 해당 위치의 row, col 정보를 반환합니다. */
49
- onCellClick?: (row: any, rowIndex: number, col: any, colIndex: number) => void;
50
- /** 행 클릭 시 동작할 콜백 함수를 설정합니다. */
51
- onRowClick?: (row: any, rowIndex: number) => void;
52
- /** 행 더블 클릭 시 동작할 콜백 함수를 설정합니다. */
53
- onRowDoubleClick?: (row: any, rowIndex: number) => void;
54
- /** 로딩 상태 표시 여부를 설정합니다. */
55
- isLoading?: boolean;
56
- /** 특정 행으로 스크롤할 인덱스를 설정합니다. */
57
- scrollTo?: number;
58
- /** 편집, 추가 구분 확인 Column 여부를 설정합니다. */
59
- isEditMode?: boolean;
60
- /** 행 클릭 트리거 인덱스를 설정합니다. */
61
- rowClickTriggerIdx?: number;
62
- /** 행 드래그앤드롭 재정렬 모드를 활성화합니다. */
63
- reorderMode?: boolean;
64
- /** 행 순서가 변경될 때 재정렬된 데이터를 반환합니다. */
65
- onReorder?: (data: any[]) => void;
66
- /** 내부 table 요소 스타일을 오버라이드합니다. */
67
- sx?: CSSProperties;
68
- }
69
- declare const Table2: <T extends object>({ data, columns, onChange, checkbox, no, radio, selectedCell, onRowClick, onRowDoubleClick, isLoading, scrollTo, isEditMode, rowClickTriggerIdx, reorderMode, onReorder, onCellClick, sx, }: Table2Props) => import("react/jsx-runtime").JSX.Element;
1
+ import { Table2Props } from './types';
2
+ declare const Table2: <T extends object>({ data, columns, onChange, checkbox, no, radio, selectedCell, onRowClick, onRowDoubleClick, isLoading, scrollTo, isEditMode, rowClickTriggerIdx, reorderMode, onReorder, onCellClick, rowHeight, headerRowHeight, sx, }: Table2Props) => import("react/jsx-runtime").JSX.Element;
70
3
  export default Table2;
@@ -3,6 +3,7 @@ import { Table as ReactTable } from '@tanstack/react-table';
3
3
  interface Props<T extends object = any> {
4
4
  table: ReactTable<T>;
5
5
  clickedRowIndex: number;
6
+ headerRowHeight?: number;
6
7
  }
7
8
  declare const Header: React.ForwardRefExoticComponent<Props<any> & React.RefAttributes<HTMLTableSectionElement>>;
8
9
  export default Header;
@@ -5,6 +5,7 @@ interface Props<T extends object = any> {
5
5
  groupIndex: number;
6
6
  headerGroupsLength: number;
7
7
  clickedRowIndex: number;
8
+ headerRowHeight?: number;
8
9
  }
9
- declare const HeaderItem: <T extends object>({ header, idx, groupIndex, headerGroupsLength, clickedRowIndex, }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
+ declare const HeaderItem: <T extends object>({ header, idx, groupIndex, headerGroupsLength, clickedRowIndex, headerRowHeight, }: Props) => import("react/jsx-runtime").JSX.Element | null;
10
11
  export default HeaderItem;
@@ -1,4 +1,5 @@
1
- import { default as Table2, ColumnDef as BaseColumnDef, Table2Props as BaseTableProps } from './Table2';
1
+ import { default as Table2 } from './Table2';
2
+ import { ColumnDef as BaseColumnDef, Table2Props as BaseTableProps } from './types/table.types';
2
3
  export { Table2 };
3
4
  export type Table2Props = BaseTableProps;
4
5
  export type ColumnDef<T extends object> = BaseColumnDef<T>;
@@ -16,8 +16,8 @@ interface Props<T extends object = any> {
16
16
  setRowSelection: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
17
17
  rowSelection: Record<string, boolean>;
18
18
  radio?: boolean;
19
- reorderMode?: boolean;
20
19
  dragHandleProps?: DraggableProvidedDragHandleProps | null;
20
+ rowHeight?: number;
21
21
  }
22
- declare const Cell: <T extends object>({ onCellClick, cell, idx, isHover, isRowClicked, selectedCellInfo, showSelectedCellBorder, onChange, setTableData, setRowSelection, rowSelection, radio, reorderMode, dragHandleProps, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
22
+ declare const Cell: <T extends object>({ onCellClick, cell, idx, isHover, isRowClicked, selectedCellInfo, showSelectedCellBorder, onChange, setTableData, setRowSelection, rowSelection, radio, dragHandleProps, rowHeight, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
23
23
  export default Cell;
@@ -24,6 +24,8 @@ interface Props<T extends object = any> {
24
24
  isDragging?: boolean;
25
25
  rowProps?: HTMLAttributes<HTMLTableRowElement>;
26
26
  rowStyle?: CSSProperties;
27
+ rowHeight?: number;
28
+ headerRowHeight?: number;
27
29
  }
28
30
  declare const Row: import('react').ForwardRefExoticComponent<Props<any> & import('react').RefAttributes<HTMLTableRowElement>>;
29
31
  export default Row;
@@ -22,6 +22,8 @@ interface Props<T extends object = any> {
22
22
  radio?: boolean;
23
23
  reorderMode?: boolean;
24
24
  tableSx?: CSSProperties;
25
+ rowHeight: number;
26
+ headerRowHeight: number;
25
27
  }
26
28
  declare const Rows: import('react').ForwardRefExoticComponent<Props<any> & import('react').RefAttributes<HTMLDivElement>>;
27
29
  export default Rows;
@@ -0,0 +1,15 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ interface CellEditorFrameProps {
3
+ children: ReactNode;
4
+ justifyContent?: CSSProperties["justifyContent"];
5
+ padding?: string;
6
+ style?: CSSProperties;
7
+ }
8
+ export declare const CELL_EDITOR_ACTIVE_INSET = "var(--ds-table-active-inset)";
9
+ export declare const CELL_EDITOR_COMPACT_HEIGHT = "calc(var(--ds-input-height-base) - var(--ds-table-active-inset))";
10
+ export declare const getCellEditorFieldLayout: (isActive: boolean) => {
11
+ width: string;
12
+ margin: string | undefined;
13
+ };
14
+ export declare const CellEditorFrame: ({ children, justifyContent, padding, style, }: CellEditorFrameProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1 @@
1
+ export type { ColumnDef, Table2Props } from './table.types';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Table2의 render context 타입을 모아두는 파일입니다.
3
+ * renderCell, renderHeaderCell, getRowProps 같은 함수에 전달되는
4
+ * row, cell, rowIndex, value 등의 컨텍스트 타입을 둡니다.
5
+ */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Table2의 wrapper props 반환 타입을 모아두는 파일입니다.
3
+ * getCellProps, getRowProps, getHeaderCellProps 같은 resolver가
4
+ * 최종적으로 반환하는 style, className, rowSpan, colSpan 등의 타입을 둡니다.
5
+ */
@@ -0,0 +1,80 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ import { ColumnDef as TanstackColumnDef } from '@tanstack/react-table';
3
+ export type ColumnDef<T extends object> = TanstackColumnDef<T> & {
4
+ accessorKey?: string;
5
+ width?: string;
6
+ align?: "start" | "center" | "right";
7
+ editable?: boolean;
8
+ type?: "input" | "textarea" | "inputNum" | "inputEng" | "select" | "checkbox" | "checkboxN" | "datePicker" | "modal" | "file" | "button" | "custom" | "text" | "date" | ((row: T) => "input" | "textarea" | "inputNum" | "inputEng" | "select" | "checkbox" | "checkboxN" | "datePicker" | "modal" | "file" | "button" | "custom" | "text" | "date") | string;
9
+ selectItems?: {
10
+ value: string | number;
11
+ label: string;
12
+ }[];
13
+ required?: boolean;
14
+ setSort?: React.Dispatch<React.SetStateAction<string[]>>;
15
+ button?: React.ReactNode | ((row: T) => React.ReactNode);
16
+ ellipsis?: boolean;
17
+ role?: "group";
18
+ tags?: (row: T) => React.ReactNode[];
19
+ disabled?: (row: T) => boolean | boolean;
20
+ isOnly?: boolean;
21
+ maxLength?: number;
22
+ numRange?: number[];
23
+ component?: (row: T) => React.ReactNode;
24
+ modalFn?: (row: T) => void;
25
+ accept?: string;
26
+ icon?: React.ReactNode;
27
+ onChange?: (...args: any[]) => any;
28
+ readOnly?: boolean;
29
+ visible?: boolean;
30
+ simpleSelect?: boolean;
31
+ showEditIcon?: boolean;
32
+ };
33
+ export interface Table2Props {
34
+ /** Cell 클릭 시 해당 Cell Border 스타일 변경 여부를 설정합니다. */
35
+ selectedCell?: boolean;
36
+ /** 테이블에 표시할 데이터 배열을 설정합니다. */
37
+ data?: any[];
38
+ /** 테이블의 열 정의 배열을 설정합니다. */
39
+ columns?: ColumnDef<any>[];
40
+ /** 테이블 데이터 변경 시 호출되는 콜백 함수를 설정합니다. */
41
+ onChange?: (data: any[]) => void;
42
+ /** 체크박스 표시 여부를 설정합니다. */
43
+ checkbox?: boolean;
44
+ /** 행 번호 컬럼 표시 여부를 설정합니다. */
45
+ no?: boolean;
46
+ /** 체크박스를 라디오 버튼 형태로 표시 여부를 설정합니다. */
47
+ radio?: boolean;
48
+ /** Cell 클릭 시 해당 위치의 row, col 정보를 반환합니다. */
49
+ onCellClick?: (row: any, rowIndex: number, col: any, colIndex: number) => void;
50
+ /** 행 클릭 시 동작할 콜백 함수를 설정합니다. */
51
+ onRowClick?: (row: any, rowIndex: number) => void;
52
+ /** 행 더블 클릭 시 동작할 콜백 함수를 설정합니다. */
53
+ onRowDoubleClick?: (row: any, rowIndex: number) => void;
54
+ /** 로딩 상태 표시 여부를 설정합니다. */
55
+ isLoading?: boolean;
56
+ /** 특정 행으로 스크롤할 인덱스를 설정합니다. */
57
+ scrollTo?: number;
58
+ /** 편집, 추가 구분 확인 Column 여부를 설정합니다. */
59
+ isEditMode?: boolean;
60
+ /** 행 클릭 트리거 인덱스를 설정합니다. */
61
+ rowClickTriggerIdx?: number;
62
+ /** 행 드래그앤드롭 재정렬 모드를 활성화합니다. */
63
+ reorderMode?: boolean;
64
+ /** 행 순서가 변경될 때 재정렬된 데이터를 반환합니다. */
65
+ onReorder?: (data: any[]) => void;
66
+ /** 내부 table 요소 스타일을 오버라이드합니다. */
67
+ sx?: CSSProperties;
68
+ /** tbody 행 높이를 설정합니다. */
69
+ rowHeight?: number;
70
+ /** thead 행 높이를 설정합니다. */
71
+ headerRowHeight?: number;
72
+ /** 각 행에 대한 추가 속성을 설정할 수 있는 콜백 함수를 제공합니다. */
73
+ getRowProps?: (params: {
74
+ row: any;
75
+ rowIndex: number;
76
+ isSelected: boolean;
77
+ isActive: boolean;
78
+ isHovered: boolean;
79
+ }) => React.HTMLAttributes<HTMLTableRowElement>;
80
+ }