@shoplflow/templates 0.2.45 → 0.2.47
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.
- package/dist/index.cjs +2874 -972
- package/dist/index.d.cts +136 -65
- package/dist/index.d.ts +136 -65
- package/dist/index.js +2797 -895
- package/package.json +7 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TextProps, TooltipProps, IconButtonProps, IconButton, ChildrenProps, StackContainerOptionProps } from '@shoplflow/base';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ReactNode, ReactElement, RefObject, Dispatch, SetStateAction, CSSProperties
|
|
5
|
-
import { Table as Table$1,
|
|
4
|
+
import React__default, { ReactNode, ReactElement, ButtonHTMLAttributes, RefObject, Dispatch, SetStateAction, CSSProperties } from 'react';
|
|
5
|
+
import { ColumnDef, RowSelectionState, SortingState, Header, Table as Table$1, RowData } from '@tanstack/react-table';
|
|
6
6
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
7
7
|
import { IconSource } from '@shoplflow/shopl-assets';
|
|
8
8
|
|
|
@@ -71,21 +71,17 @@ declare const TitleGroup: {
|
|
|
71
71
|
Description: ({ description, ...rest }: DescriptionProps) => react_jsx_runtime.JSX.Element;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
type
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
hasFilterBar?: boolean;
|
|
84
|
-
hasPagination?: boolean;
|
|
85
|
-
columnResizing?: boolean;
|
|
86
|
-
filterValue: string;
|
|
87
|
-
setFilterValue: Dispatch<SetStateAction<string>>;
|
|
74
|
+
type TableButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
75
|
+
leftSource?: ReactNode;
|
|
76
|
+
children: string;
|
|
77
|
+
rightSource?: ReactNode;
|
|
78
|
+
};
|
|
79
|
+
declare const TableButton: ({ children, leftSource, rightSource, ...buttonProps }: TableButtonProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
type TableBadgeProps = {
|
|
82
|
+
children: ReactNode;
|
|
88
83
|
};
|
|
84
|
+
declare const TableBadge: ({ children }: TableBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
89
85
|
|
|
90
86
|
type TableProps<T extends object> = {
|
|
91
87
|
data: T[];
|
|
@@ -96,10 +92,43 @@ type TableProps<T extends object> = {
|
|
|
96
92
|
manualFiltering?: boolean;
|
|
97
93
|
manualSorting?: boolean;
|
|
98
94
|
selectedRows?: T[];
|
|
99
|
-
onSelectedRowsChange?: (rows: T[]) => void;
|
|
95
|
+
onSelectedRowsChange?: (rows: T[], rowState?: RowSelectionState) => void;
|
|
100
96
|
onClickRow?: (data?: T) => void;
|
|
97
|
+
/**
|
|
98
|
+
* 초기 페이지 사이즈
|
|
99
|
+
* 기본값은 100으로 설정되어 있음
|
|
100
|
+
*/
|
|
101
|
+
initPageSize?: number;
|
|
102
|
+
noBorder?: boolean;
|
|
103
|
+
isLoading?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 행의 고유 ID를 반환하는 함수
|
|
106
|
+
* 필터링/정렬 시 행 선택 상태를 유지하기 위해 사용
|
|
107
|
+
*/
|
|
108
|
+
getRowId?: (row: T) => string;
|
|
109
|
+
/**
|
|
110
|
+
* 외부에서 정렬 상태를 제어할 때 사용
|
|
111
|
+
*/
|
|
112
|
+
globalSorting?: SortingState;
|
|
113
|
+
/**
|
|
114
|
+
* 외부에서 필터를 조작하고 싶은 경우 사용
|
|
115
|
+
*/
|
|
116
|
+
outsideFilters?: OutsideFilter[];
|
|
117
|
+
/**
|
|
118
|
+
* data 등 페이지 영향 상태가 바뀔 때 pageIndex를 0으로 자동 리셋할지 여부
|
|
119
|
+
* 기본값은 true (TanStack Table 기본 동작)
|
|
120
|
+
* 행 삭제 후 현재 페이지를 유지해야 하는 경우 false로 설정
|
|
121
|
+
*/
|
|
122
|
+
autoResetPageIndex?: boolean;
|
|
101
123
|
};
|
|
124
|
+
type TableBodyRowStyle = React.CSSProperties | ((rowIndex: number, row: any) => React.CSSProperties);
|
|
102
125
|
type TableMainProps = {
|
|
126
|
+
enableDragDrop?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 드래그 핸들의 너비
|
|
129
|
+
* 기본값은 40px로 설정되어 있음
|
|
130
|
+
*/
|
|
131
|
+
dragColWidth?: 32 | 40;
|
|
103
132
|
fixedColumns?: FixedColumn[];
|
|
104
133
|
useVirtualization?: boolean;
|
|
105
134
|
useColumnVirtualization?: boolean;
|
|
@@ -109,6 +138,14 @@ type TableMainProps = {
|
|
|
109
138
|
children?: ReactNode;
|
|
110
139
|
maxHeight?: string;
|
|
111
140
|
emptyRowCount?: number;
|
|
141
|
+
virtualOverscan?: number;
|
|
142
|
+
onRowReorder?: (newOrder: any[]) => void;
|
|
143
|
+
footerRowProps?: {
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
};
|
|
146
|
+
headerRowStyle?: React.CSSProperties | ((rowIndex: number, row: any) => React.CSSProperties);
|
|
147
|
+
bodyRowStyle?: TableBodyRowStyle;
|
|
148
|
+
containerStyle?: React.CSSProperties;
|
|
112
149
|
};
|
|
113
150
|
type TableToolbarProps = {
|
|
114
151
|
filterAccessor?: string;
|
|
@@ -138,6 +175,7 @@ type FixedColumn = {
|
|
|
138
175
|
type TablePaginationProps = {
|
|
139
176
|
total: number;
|
|
140
177
|
defaultPageSize: number;
|
|
178
|
+
/** @deprecated 2026-04-16 leftSource를 사용하세요. */
|
|
141
179
|
children?: ReactNode;
|
|
142
180
|
pageSizeList?: Array<{
|
|
143
181
|
key: string;
|
|
@@ -150,7 +188,43 @@ type TablePaginationProps = {
|
|
|
150
188
|
notSizeOption?: boolean;
|
|
151
189
|
resetDependencies?: any[];
|
|
152
190
|
currentPage?: number;
|
|
191
|
+
/**
|
|
192
|
+
* 하단 스크롤만 사용할 경우 false로 설정
|
|
193
|
+
* 기본값은 true로 설정되어 있음
|
|
194
|
+
*/
|
|
195
|
+
showPagination?: boolean;
|
|
153
196
|
sizeVar?: 'S' | 'XS';
|
|
197
|
+
leftSource?: ReactNode;
|
|
198
|
+
hasPaddingInline?: boolean;
|
|
199
|
+
};
|
|
200
|
+
type OutsideFilter = {
|
|
201
|
+
id: string;
|
|
202
|
+
value?: string;
|
|
203
|
+
label?: string;
|
|
204
|
+
};
|
|
205
|
+
type TableFilterBarProps = {
|
|
206
|
+
onReset?: () => void;
|
|
207
|
+
onRemoveFilter?: (id: string, value?: string) => void;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type TableContextType<T extends object> = {
|
|
211
|
+
table: Table$1<T>;
|
|
212
|
+
headerRef: RefObject<HTMLDivElement>;
|
|
213
|
+
bodyRef: RefObject<HTMLDivElement>;
|
|
214
|
+
footerRef: RefObject<HTMLDivElement>;
|
|
215
|
+
tableScrollRef: RefObject<HTMLDivElement>;
|
|
216
|
+
selectedRows?: T[];
|
|
217
|
+
onClickRow?: (row?: T) => void;
|
|
218
|
+
hasToolbar?: boolean;
|
|
219
|
+
hasFilterBar?: boolean;
|
|
220
|
+
hasPagination?: boolean;
|
|
221
|
+
columnResizing?: boolean;
|
|
222
|
+
filterValue: string;
|
|
223
|
+
setFilterValue: Dispatch<SetStateAction<string>>;
|
|
224
|
+
outsideFilters?: OutsideFilter[];
|
|
225
|
+
hasFooter?: boolean;
|
|
226
|
+
isLoading?: boolean;
|
|
227
|
+
isVirtualTableLayout?: boolean;
|
|
154
228
|
};
|
|
155
229
|
|
|
156
230
|
type FilterChangeHandler = (value: string) => void;
|
|
@@ -166,7 +240,7 @@ type GlobalFilterChangeHandler = (value: string) => void;
|
|
|
166
240
|
* @property {(value: string) => void} [onFilterChange] - 필터 값 변경 핸들러
|
|
167
241
|
* @property {(order: 'asc' | 'desc' | undefined) => void} [onSortChange] - 정렬 순서 변경 핸들러
|
|
168
242
|
* @property {(value: string) => void} [onGlobalFilterChange] - 전역 필터 값 변경 핸들러
|
|
169
|
-
* @property {boolean} [activeHover] - 행 호버
|
|
243
|
+
* @property {boolean | ((row: TData) => boolean)} [activeHover] - 셀 `data-no-hover` (행 호버 스타일 분기). 함수면 행 데이터로 판별
|
|
170
244
|
*/
|
|
171
245
|
declare module '@tanstack/react-table' {
|
|
172
246
|
interface TableMeta<TData extends RowData> {
|
|
@@ -186,12 +260,18 @@ declare module '@tanstack/react-table' {
|
|
|
186
260
|
cellProps?: {
|
|
187
261
|
style?: CSSProperties;
|
|
188
262
|
};
|
|
263
|
+
footerProps?: {
|
|
264
|
+
style?: CSSProperties;
|
|
265
|
+
};
|
|
189
266
|
onFilterChange?: FilterChangeHandler;
|
|
190
267
|
onSortChange?: SortChangeHandler;
|
|
191
268
|
onGlobalFilterChange?: GlobalFilterChangeHandler;
|
|
192
|
-
activeHover?: boolean;
|
|
269
|
+
activeHover?: boolean | ((row: TData) => boolean);
|
|
193
270
|
hiddenColumn?: boolean;
|
|
194
271
|
isLastColumn?: boolean;
|
|
272
|
+
/** 필터 메뉴 너비: 'trigger'면 헤더 트리거 너비 고정(기본), 'auto'면 라벨이 길 때 100% 사용 */
|
|
273
|
+
filterMenuWidth?: 'trigger' | 'auto';
|
|
274
|
+
delegateSortToSingleLeaf?: boolean;
|
|
195
275
|
}
|
|
196
276
|
}
|
|
197
277
|
/**
|
|
@@ -209,7 +289,39 @@ declare module '@tanstack/react-table' {
|
|
|
209
289
|
* @param {Function} [props.onClickRow] - 행 클릭 시 호출되는 콜백 함수
|
|
210
290
|
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
211
291
|
*/
|
|
212
|
-
declare const Table: <T extends object>({ data, columns, columnResizing, children, manualPagination, manualFiltering, manualSorting, selectedRows, onSelectedRowsChange, onClickRow, }: TableProps<T>) =>
|
|
292
|
+
declare const Table: <T extends object>({ data, columns, columnResizing, children, manualPagination, manualFiltering, manualSorting, selectedRows, onSelectedRowsChange, onClickRow, initPageSize, noBorder, isLoading, getRowId, globalSorting, outsideFilters, autoResetPageIndex, }: TableProps<T>) => JSX.Element;
|
|
293
|
+
|
|
294
|
+
declare const TableColumnVisibility: () => react_jsx_runtime.JSX.Element;
|
|
295
|
+
|
|
296
|
+
type TableEmptyProps = {
|
|
297
|
+
children?: React__default.ReactNode;
|
|
298
|
+
minHeight?: string;
|
|
299
|
+
};
|
|
300
|
+
declare const TableEmpty: ({ children, minHeight }: TableEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
301
|
+
|
|
302
|
+
type TableFilterBarRef = {
|
|
303
|
+
resetFilters: () => void;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* 테이블 필터 바 컴포넌트
|
|
307
|
+
* @component
|
|
308
|
+
* @returns {JSX.Element} 필터 바 렌더링
|
|
309
|
+
*/
|
|
310
|
+
declare const TableFilterBar: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<TableFilterBarProps & React$1.RefAttributes<TableFilterBarRef>>>;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* 테이블의 메인 렌더링을 처리하는 컴포넌트
|
|
314
|
+
* @component
|
|
315
|
+
* @param {Object} props - 컴포넌트 props
|
|
316
|
+
* @param {Array<string>} [props.fixedColumns=[]] - 고정/핀 처리할 컬럼 ID 배열
|
|
317
|
+
* @param {boolean} [props.useVirtualization=true] - 대용량 데이터 처리를 위한 가상화 사용 여부
|
|
318
|
+
* @param {boolean} [props.isSticky=true] - 스크롤 시 헤더 고정 여부
|
|
319
|
+
* @param {number} [props.stickyHeaderTopPosition=120] - 고정 헤더의 상단 위치(픽셀)
|
|
320
|
+
* @param {ReactNode} props.children - 테이블 내부에 렌더링할 자식 컴포넌트
|
|
321
|
+
* @param {number} [props.emptyRowCount=8] - 빈 행 수
|
|
322
|
+
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
323
|
+
*/
|
|
324
|
+
declare const TableMain: (props: TableMainProps) => react_jsx_runtime.JSX.Element;
|
|
213
325
|
|
|
214
326
|
/**
|
|
215
327
|
* 테이블의 페이지네이션을 처리하는 컴포넌트
|
|
@@ -217,14 +329,15 @@ declare const Table: <T extends object>({ data, columns, columnResizing, childre
|
|
|
217
329
|
* @param {Object} props - 컴포넌트 props
|
|
218
330
|
* @param {number} props.total - 전체 데이터 수
|
|
219
331
|
* @param {number} props.defaultPageSize - 기본 페이지 크기
|
|
220
|
-
* @param {ReactNode} props.
|
|
332
|
+
* @param {ReactNode} [props.leftSource] - 페이지네이션 좌측 슬롯
|
|
333
|
+
* @param {ReactNode} [props.children] - (deprecated) 페이지네이션 내부 자식 슬롯
|
|
221
334
|
* @param {number[]} [props.pageSizeList] - 페이지 크기 선택 옵션 리스트
|
|
222
335
|
* @param {Function} [props.setCurrentPage] - 현재 페이지 변경 콜백 함수
|
|
223
336
|
* @param {boolean} [props.notSizeOption] - 페이지 크기 선택 옵션 표시 여부
|
|
224
337
|
* @param {number} [props.currentPage] - 현재 페이지 인덱스
|
|
225
338
|
* @returns {JSX.Element} 렌더링된 페이지네이션 컴포넌트
|
|
226
339
|
*/
|
|
227
|
-
declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList, setCurrentPage, notSizeOption, currentPage, sizeVar, }: TablePaginationProps) =>
|
|
340
|
+
declare const TablePagination: ({ total, defaultPageSize, leftSource, children, pageSizeList, setCurrentPage, notSizeOption, currentPage, showPagination, sizeVar, hasPaddingInline, }: TablePaginationProps) => JSX.Element;
|
|
228
341
|
|
|
229
342
|
/**
|
|
230
343
|
* 테이블의 툴바를 렌더링하는 컴포넌트
|
|
@@ -240,48 +353,6 @@ declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList
|
|
|
240
353
|
*/
|
|
241
354
|
declare const TableToolbar: ({ children, filterAccessor, height, padding, totalCount, }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
|
|
242
355
|
|
|
243
|
-
/**
|
|
244
|
-
* 테이블의 메인 렌더링을 처리하는 컴포넌트
|
|
245
|
-
* @component
|
|
246
|
-
* @param {Object} props - 컴포넌트 props
|
|
247
|
-
* @param {Array<string>} [props.fixedColumns=[]] - 고정/핀 처리할 컬럼 ID 배열
|
|
248
|
-
* @param {boolean} [props.useVirtualization=true] - 대용량 데이터 처리를 위한 가상화 사용 여부
|
|
249
|
-
* @param {boolean} [props.isSticky=true] - 스크롤 시 헤더 고정 여부
|
|
250
|
-
* @param {number} [props.stickyHeaderTopPosition=120] - 고정 헤더의 상단 위치(픽셀)
|
|
251
|
-
* @param {ReactNode} props.children - 테이블 내부에 렌더링할 자식 컴포넌트
|
|
252
|
-
* @param {number} [props.emptyRowCount=8] - 빈 행 수
|
|
253
|
-
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
254
|
-
*/
|
|
255
|
-
declare const TableMain: ({ fixedColumns, useVirtualization, isSticky, stickyHeaderTopPosition, children, maxHeight, emptyRowCount, }: TableMainProps) => react_jsx_runtime.JSX.Element;
|
|
256
|
-
|
|
257
|
-
type TableEmptyProps = {
|
|
258
|
-
children?: React__default.ReactNode;
|
|
259
|
-
};
|
|
260
|
-
declare const TableEmpty: ({ children }: TableEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
261
|
-
|
|
262
|
-
declare const TableColumnVisibility: () => react_jsx_runtime.JSX.Element;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* 테이블 필터 바 컴포넌트
|
|
266
|
-
* @component
|
|
267
|
-
* @returns {JSX.Element} 필터 바 렌더링
|
|
268
|
-
*/
|
|
269
|
-
declare const TableFilterBar: React$1.MemoExoticComponent<({ outsideFilters }: {
|
|
270
|
-
outsideFilters?: ColumnFilter[];
|
|
271
|
-
}) => react_jsx_runtime.JSX.Element>;
|
|
272
|
-
|
|
273
|
-
type TableButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
274
|
-
leftSource?: ReactNode;
|
|
275
|
-
children: string;
|
|
276
|
-
rightSource?: ReactNode;
|
|
277
|
-
};
|
|
278
|
-
declare const TableButton: ({ children, leftSource, rightSource, ...buttonProps }: TableButtonProps) => react_jsx_runtime.JSX.Element;
|
|
279
|
-
|
|
280
|
-
type TableBadgeProps = {
|
|
281
|
-
children: ReactNode;
|
|
282
|
-
};
|
|
283
|
-
declare const TableBadge: ({ children }: TableBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
284
|
-
|
|
285
356
|
type TableComponentType = typeof Table & {
|
|
286
357
|
Toolbar: typeof TableToolbar;
|
|
287
358
|
FilterBar: typeof TableFilterBar;
|
|
@@ -343,4 +414,4 @@ declare const AttachmentItem: React__default.FC<AttachmentItemProps> & {
|
|
|
343
414
|
Thumbnail: typeof AttachmentThumbnail;
|
|
344
415
|
};
|
|
345
416
|
|
|
346
|
-
export { ActionsProps, AttachmentItem, AttachmentItemData, AttachmentItemMulti, AttachmentItemMultiProps, AttachmentItemProps, AttachmentItemSingle, AttachmentItemSingleProps, AttachmentList, AttachmentListProps, AttachmentThumbnail, AttachmentThumbnailProps, DescriptionProps, FixedColumn, PinningPosition, TableComponent as Table, TableBadge, TableButton, TableContextType, TableHeadCellProps, TableMainProps, TablePaginationProps, TableProps, TableToolbarProps, TitleGroup, TitleGroupHeaderProps, TitleGroupHelpIconProps, TitleGroupProps };
|
|
417
|
+
export { ActionsProps, AttachmentItem, AttachmentItemData, AttachmentItemMulti, AttachmentItemMultiProps, AttachmentItemProps, AttachmentItemSingle, AttachmentItemSingleProps, AttachmentList, AttachmentListProps, AttachmentThumbnail, AttachmentThumbnailProps, DescriptionProps, FixedColumn, OutsideFilter, PinningPosition, TableComponent as Table, TableBadge, TableBodyRowStyle, TableButton, TableContextType, TableFilterBarProps, TableFilterBarRef, TableHeadCellProps, TableMainProps, TablePaginationProps, TableProps, TableToolbarProps, TitleGroup, TitleGroupHeaderProps, TitleGroupHelpIconProps, TitleGroupProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { TextProps, TooltipProps, IconButtonProps, IconButton, ChildrenProps, StackContainerOptionProps } from '@shoplflow/base';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ReactNode, ReactElement, RefObject, Dispatch, SetStateAction, CSSProperties
|
|
5
|
-
import { Table as Table$1,
|
|
4
|
+
import React__default, { ReactNode, ReactElement, ButtonHTMLAttributes, RefObject, Dispatch, SetStateAction, CSSProperties } from 'react';
|
|
5
|
+
import { ColumnDef, RowSelectionState, SortingState, Header, Table as Table$1, RowData } from '@tanstack/react-table';
|
|
6
6
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
7
7
|
import { IconSource } from '@shoplflow/shopl-assets';
|
|
8
8
|
|
|
@@ -71,21 +71,17 @@ declare const TitleGroup: {
|
|
|
71
71
|
Description: ({ description, ...rest }: DescriptionProps) => react_jsx_runtime.JSX.Element;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
type
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
hasFilterBar?: boolean;
|
|
84
|
-
hasPagination?: boolean;
|
|
85
|
-
columnResizing?: boolean;
|
|
86
|
-
filterValue: string;
|
|
87
|
-
setFilterValue: Dispatch<SetStateAction<string>>;
|
|
74
|
+
type TableButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
75
|
+
leftSource?: ReactNode;
|
|
76
|
+
children: string;
|
|
77
|
+
rightSource?: ReactNode;
|
|
78
|
+
};
|
|
79
|
+
declare const TableButton: ({ children, leftSource, rightSource, ...buttonProps }: TableButtonProps) => react_jsx_runtime.JSX.Element;
|
|
80
|
+
|
|
81
|
+
type TableBadgeProps = {
|
|
82
|
+
children: ReactNode;
|
|
88
83
|
};
|
|
84
|
+
declare const TableBadge: ({ children }: TableBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
89
85
|
|
|
90
86
|
type TableProps<T extends object> = {
|
|
91
87
|
data: T[];
|
|
@@ -96,10 +92,43 @@ type TableProps<T extends object> = {
|
|
|
96
92
|
manualFiltering?: boolean;
|
|
97
93
|
manualSorting?: boolean;
|
|
98
94
|
selectedRows?: T[];
|
|
99
|
-
onSelectedRowsChange?: (rows: T[]) => void;
|
|
95
|
+
onSelectedRowsChange?: (rows: T[], rowState?: RowSelectionState) => void;
|
|
100
96
|
onClickRow?: (data?: T) => void;
|
|
97
|
+
/**
|
|
98
|
+
* 초기 페이지 사이즈
|
|
99
|
+
* 기본값은 100으로 설정되어 있음
|
|
100
|
+
*/
|
|
101
|
+
initPageSize?: number;
|
|
102
|
+
noBorder?: boolean;
|
|
103
|
+
isLoading?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 행의 고유 ID를 반환하는 함수
|
|
106
|
+
* 필터링/정렬 시 행 선택 상태를 유지하기 위해 사용
|
|
107
|
+
*/
|
|
108
|
+
getRowId?: (row: T) => string;
|
|
109
|
+
/**
|
|
110
|
+
* 외부에서 정렬 상태를 제어할 때 사용
|
|
111
|
+
*/
|
|
112
|
+
globalSorting?: SortingState;
|
|
113
|
+
/**
|
|
114
|
+
* 외부에서 필터를 조작하고 싶은 경우 사용
|
|
115
|
+
*/
|
|
116
|
+
outsideFilters?: OutsideFilter[];
|
|
117
|
+
/**
|
|
118
|
+
* data 등 페이지 영향 상태가 바뀔 때 pageIndex를 0으로 자동 리셋할지 여부
|
|
119
|
+
* 기본값은 true (TanStack Table 기본 동작)
|
|
120
|
+
* 행 삭제 후 현재 페이지를 유지해야 하는 경우 false로 설정
|
|
121
|
+
*/
|
|
122
|
+
autoResetPageIndex?: boolean;
|
|
101
123
|
};
|
|
124
|
+
type TableBodyRowStyle = React.CSSProperties | ((rowIndex: number, row: any) => React.CSSProperties);
|
|
102
125
|
type TableMainProps = {
|
|
126
|
+
enableDragDrop?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 드래그 핸들의 너비
|
|
129
|
+
* 기본값은 40px로 설정되어 있음
|
|
130
|
+
*/
|
|
131
|
+
dragColWidth?: 32 | 40;
|
|
103
132
|
fixedColumns?: FixedColumn[];
|
|
104
133
|
useVirtualization?: boolean;
|
|
105
134
|
useColumnVirtualization?: boolean;
|
|
@@ -109,6 +138,14 @@ type TableMainProps = {
|
|
|
109
138
|
children?: ReactNode;
|
|
110
139
|
maxHeight?: string;
|
|
111
140
|
emptyRowCount?: number;
|
|
141
|
+
virtualOverscan?: number;
|
|
142
|
+
onRowReorder?: (newOrder: any[]) => void;
|
|
143
|
+
footerRowProps?: {
|
|
144
|
+
style?: React.CSSProperties;
|
|
145
|
+
};
|
|
146
|
+
headerRowStyle?: React.CSSProperties | ((rowIndex: number, row: any) => React.CSSProperties);
|
|
147
|
+
bodyRowStyle?: TableBodyRowStyle;
|
|
148
|
+
containerStyle?: React.CSSProperties;
|
|
112
149
|
};
|
|
113
150
|
type TableToolbarProps = {
|
|
114
151
|
filterAccessor?: string;
|
|
@@ -138,6 +175,7 @@ type FixedColumn = {
|
|
|
138
175
|
type TablePaginationProps = {
|
|
139
176
|
total: number;
|
|
140
177
|
defaultPageSize: number;
|
|
178
|
+
/** @deprecated 2026-04-16 leftSource를 사용하세요. */
|
|
141
179
|
children?: ReactNode;
|
|
142
180
|
pageSizeList?: Array<{
|
|
143
181
|
key: string;
|
|
@@ -150,7 +188,43 @@ type TablePaginationProps = {
|
|
|
150
188
|
notSizeOption?: boolean;
|
|
151
189
|
resetDependencies?: any[];
|
|
152
190
|
currentPage?: number;
|
|
191
|
+
/**
|
|
192
|
+
* 하단 스크롤만 사용할 경우 false로 설정
|
|
193
|
+
* 기본값은 true로 설정되어 있음
|
|
194
|
+
*/
|
|
195
|
+
showPagination?: boolean;
|
|
153
196
|
sizeVar?: 'S' | 'XS';
|
|
197
|
+
leftSource?: ReactNode;
|
|
198
|
+
hasPaddingInline?: boolean;
|
|
199
|
+
};
|
|
200
|
+
type OutsideFilter = {
|
|
201
|
+
id: string;
|
|
202
|
+
value?: string;
|
|
203
|
+
label?: string;
|
|
204
|
+
};
|
|
205
|
+
type TableFilterBarProps = {
|
|
206
|
+
onReset?: () => void;
|
|
207
|
+
onRemoveFilter?: (id: string, value?: string) => void;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type TableContextType<T extends object> = {
|
|
211
|
+
table: Table$1<T>;
|
|
212
|
+
headerRef: RefObject<HTMLDivElement>;
|
|
213
|
+
bodyRef: RefObject<HTMLDivElement>;
|
|
214
|
+
footerRef: RefObject<HTMLDivElement>;
|
|
215
|
+
tableScrollRef: RefObject<HTMLDivElement>;
|
|
216
|
+
selectedRows?: T[];
|
|
217
|
+
onClickRow?: (row?: T) => void;
|
|
218
|
+
hasToolbar?: boolean;
|
|
219
|
+
hasFilterBar?: boolean;
|
|
220
|
+
hasPagination?: boolean;
|
|
221
|
+
columnResizing?: boolean;
|
|
222
|
+
filterValue: string;
|
|
223
|
+
setFilterValue: Dispatch<SetStateAction<string>>;
|
|
224
|
+
outsideFilters?: OutsideFilter[];
|
|
225
|
+
hasFooter?: boolean;
|
|
226
|
+
isLoading?: boolean;
|
|
227
|
+
isVirtualTableLayout?: boolean;
|
|
154
228
|
};
|
|
155
229
|
|
|
156
230
|
type FilterChangeHandler = (value: string) => void;
|
|
@@ -166,7 +240,7 @@ type GlobalFilterChangeHandler = (value: string) => void;
|
|
|
166
240
|
* @property {(value: string) => void} [onFilterChange] - 필터 값 변경 핸들러
|
|
167
241
|
* @property {(order: 'asc' | 'desc' | undefined) => void} [onSortChange] - 정렬 순서 변경 핸들러
|
|
168
242
|
* @property {(value: string) => void} [onGlobalFilterChange] - 전역 필터 값 변경 핸들러
|
|
169
|
-
* @property {boolean} [activeHover] - 행 호버
|
|
243
|
+
* @property {boolean | ((row: TData) => boolean)} [activeHover] - 셀 `data-no-hover` (행 호버 스타일 분기). 함수면 행 데이터로 판별
|
|
170
244
|
*/
|
|
171
245
|
declare module '@tanstack/react-table' {
|
|
172
246
|
interface TableMeta<TData extends RowData> {
|
|
@@ -186,12 +260,18 @@ declare module '@tanstack/react-table' {
|
|
|
186
260
|
cellProps?: {
|
|
187
261
|
style?: CSSProperties;
|
|
188
262
|
};
|
|
263
|
+
footerProps?: {
|
|
264
|
+
style?: CSSProperties;
|
|
265
|
+
};
|
|
189
266
|
onFilterChange?: FilterChangeHandler;
|
|
190
267
|
onSortChange?: SortChangeHandler;
|
|
191
268
|
onGlobalFilterChange?: GlobalFilterChangeHandler;
|
|
192
|
-
activeHover?: boolean;
|
|
269
|
+
activeHover?: boolean | ((row: TData) => boolean);
|
|
193
270
|
hiddenColumn?: boolean;
|
|
194
271
|
isLastColumn?: boolean;
|
|
272
|
+
/** 필터 메뉴 너비: 'trigger'면 헤더 트리거 너비 고정(기본), 'auto'면 라벨이 길 때 100% 사용 */
|
|
273
|
+
filterMenuWidth?: 'trigger' | 'auto';
|
|
274
|
+
delegateSortToSingleLeaf?: boolean;
|
|
195
275
|
}
|
|
196
276
|
}
|
|
197
277
|
/**
|
|
@@ -209,7 +289,39 @@ declare module '@tanstack/react-table' {
|
|
|
209
289
|
* @param {Function} [props.onClickRow] - 행 클릭 시 호출되는 콜백 함수
|
|
210
290
|
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
211
291
|
*/
|
|
212
|
-
declare const Table: <T extends object>({ data, columns, columnResizing, children, manualPagination, manualFiltering, manualSorting, selectedRows, onSelectedRowsChange, onClickRow, }: TableProps<T>) =>
|
|
292
|
+
declare const Table: <T extends object>({ data, columns, columnResizing, children, manualPagination, manualFiltering, manualSorting, selectedRows, onSelectedRowsChange, onClickRow, initPageSize, noBorder, isLoading, getRowId, globalSorting, outsideFilters, autoResetPageIndex, }: TableProps<T>) => JSX.Element;
|
|
293
|
+
|
|
294
|
+
declare const TableColumnVisibility: () => react_jsx_runtime.JSX.Element;
|
|
295
|
+
|
|
296
|
+
type TableEmptyProps = {
|
|
297
|
+
children?: React__default.ReactNode;
|
|
298
|
+
minHeight?: string;
|
|
299
|
+
};
|
|
300
|
+
declare const TableEmpty: ({ children, minHeight }: TableEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
301
|
+
|
|
302
|
+
type TableFilterBarRef = {
|
|
303
|
+
resetFilters: () => void;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* 테이블 필터 바 컴포넌트
|
|
307
|
+
* @component
|
|
308
|
+
* @returns {JSX.Element} 필터 바 렌더링
|
|
309
|
+
*/
|
|
310
|
+
declare const TableFilterBar: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<TableFilterBarProps & React$1.RefAttributes<TableFilterBarRef>>>;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* 테이블의 메인 렌더링을 처리하는 컴포넌트
|
|
314
|
+
* @component
|
|
315
|
+
* @param {Object} props - 컴포넌트 props
|
|
316
|
+
* @param {Array<string>} [props.fixedColumns=[]] - 고정/핀 처리할 컬럼 ID 배열
|
|
317
|
+
* @param {boolean} [props.useVirtualization=true] - 대용량 데이터 처리를 위한 가상화 사용 여부
|
|
318
|
+
* @param {boolean} [props.isSticky=true] - 스크롤 시 헤더 고정 여부
|
|
319
|
+
* @param {number} [props.stickyHeaderTopPosition=120] - 고정 헤더의 상단 위치(픽셀)
|
|
320
|
+
* @param {ReactNode} props.children - 테이블 내부에 렌더링할 자식 컴포넌트
|
|
321
|
+
* @param {number} [props.emptyRowCount=8] - 빈 행 수
|
|
322
|
+
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
323
|
+
*/
|
|
324
|
+
declare const TableMain: (props: TableMainProps) => react_jsx_runtime.JSX.Element;
|
|
213
325
|
|
|
214
326
|
/**
|
|
215
327
|
* 테이블의 페이지네이션을 처리하는 컴포넌트
|
|
@@ -217,14 +329,15 @@ declare const Table: <T extends object>({ data, columns, columnResizing, childre
|
|
|
217
329
|
* @param {Object} props - 컴포넌트 props
|
|
218
330
|
* @param {number} props.total - 전체 데이터 수
|
|
219
331
|
* @param {number} props.defaultPageSize - 기본 페이지 크기
|
|
220
|
-
* @param {ReactNode} props.
|
|
332
|
+
* @param {ReactNode} [props.leftSource] - 페이지네이션 좌측 슬롯
|
|
333
|
+
* @param {ReactNode} [props.children] - (deprecated) 페이지네이션 내부 자식 슬롯
|
|
221
334
|
* @param {number[]} [props.pageSizeList] - 페이지 크기 선택 옵션 리스트
|
|
222
335
|
* @param {Function} [props.setCurrentPage] - 현재 페이지 변경 콜백 함수
|
|
223
336
|
* @param {boolean} [props.notSizeOption] - 페이지 크기 선택 옵션 표시 여부
|
|
224
337
|
* @param {number} [props.currentPage] - 현재 페이지 인덱스
|
|
225
338
|
* @returns {JSX.Element} 렌더링된 페이지네이션 컴포넌트
|
|
226
339
|
*/
|
|
227
|
-
declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList, setCurrentPage, notSizeOption, currentPage, sizeVar, }: TablePaginationProps) =>
|
|
340
|
+
declare const TablePagination: ({ total, defaultPageSize, leftSource, children, pageSizeList, setCurrentPage, notSizeOption, currentPage, showPagination, sizeVar, hasPaddingInline, }: TablePaginationProps) => JSX.Element;
|
|
228
341
|
|
|
229
342
|
/**
|
|
230
343
|
* 테이블의 툴바를 렌더링하는 컴포넌트
|
|
@@ -240,48 +353,6 @@ declare const TablePagination: ({ total, defaultPageSize, children, pageSizeList
|
|
|
240
353
|
*/
|
|
241
354
|
declare const TableToolbar: ({ children, filterAccessor, height, padding, totalCount, }: TableToolbarProps) => react_jsx_runtime.JSX.Element;
|
|
242
355
|
|
|
243
|
-
/**
|
|
244
|
-
* 테이블의 메인 렌더링을 처리하는 컴포넌트
|
|
245
|
-
* @component
|
|
246
|
-
* @param {Object} props - 컴포넌트 props
|
|
247
|
-
* @param {Array<string>} [props.fixedColumns=[]] - 고정/핀 처리할 컬럼 ID 배열
|
|
248
|
-
* @param {boolean} [props.useVirtualization=true] - 대용량 데이터 처리를 위한 가상화 사용 여부
|
|
249
|
-
* @param {boolean} [props.isSticky=true] - 스크롤 시 헤더 고정 여부
|
|
250
|
-
* @param {number} [props.stickyHeaderTopPosition=120] - 고정 헤더의 상단 위치(픽셀)
|
|
251
|
-
* @param {ReactNode} props.children - 테이블 내부에 렌더링할 자식 컴포넌트
|
|
252
|
-
* @param {number} [props.emptyRowCount=8] - 빈 행 수
|
|
253
|
-
* @returns {JSX.Element} 렌더링된 테이블 컴포넌트
|
|
254
|
-
*/
|
|
255
|
-
declare const TableMain: ({ fixedColumns, useVirtualization, isSticky, stickyHeaderTopPosition, children, maxHeight, emptyRowCount, }: TableMainProps) => react_jsx_runtime.JSX.Element;
|
|
256
|
-
|
|
257
|
-
type TableEmptyProps = {
|
|
258
|
-
children?: React__default.ReactNode;
|
|
259
|
-
};
|
|
260
|
-
declare const TableEmpty: ({ children }: TableEmptyProps) => react_jsx_runtime.JSX.Element;
|
|
261
|
-
|
|
262
|
-
declare const TableColumnVisibility: () => react_jsx_runtime.JSX.Element;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* 테이블 필터 바 컴포넌트
|
|
266
|
-
* @component
|
|
267
|
-
* @returns {JSX.Element} 필터 바 렌더링
|
|
268
|
-
*/
|
|
269
|
-
declare const TableFilterBar: React$1.MemoExoticComponent<({ outsideFilters }: {
|
|
270
|
-
outsideFilters?: ColumnFilter[];
|
|
271
|
-
}) => react_jsx_runtime.JSX.Element>;
|
|
272
|
-
|
|
273
|
-
type TableButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
274
|
-
leftSource?: ReactNode;
|
|
275
|
-
children: string;
|
|
276
|
-
rightSource?: ReactNode;
|
|
277
|
-
};
|
|
278
|
-
declare const TableButton: ({ children, leftSource, rightSource, ...buttonProps }: TableButtonProps) => react_jsx_runtime.JSX.Element;
|
|
279
|
-
|
|
280
|
-
type TableBadgeProps = {
|
|
281
|
-
children: ReactNode;
|
|
282
|
-
};
|
|
283
|
-
declare const TableBadge: ({ children }: TableBadgeProps) => react_jsx_runtime.JSX.Element;
|
|
284
|
-
|
|
285
356
|
type TableComponentType = typeof Table & {
|
|
286
357
|
Toolbar: typeof TableToolbar;
|
|
287
358
|
FilterBar: typeof TableFilterBar;
|
|
@@ -343,4 +414,4 @@ declare const AttachmentItem: React__default.FC<AttachmentItemProps> & {
|
|
|
343
414
|
Thumbnail: typeof AttachmentThumbnail;
|
|
344
415
|
};
|
|
345
416
|
|
|
346
|
-
export { ActionsProps, AttachmentItem, AttachmentItemData, AttachmentItemMulti, AttachmentItemMultiProps, AttachmentItemProps, AttachmentItemSingle, AttachmentItemSingleProps, AttachmentList, AttachmentListProps, AttachmentThumbnail, AttachmentThumbnailProps, DescriptionProps, FixedColumn, PinningPosition, TableComponent as Table, TableBadge, TableButton, TableContextType, TableHeadCellProps, TableMainProps, TablePaginationProps, TableProps, TableToolbarProps, TitleGroup, TitleGroupHeaderProps, TitleGroupHelpIconProps, TitleGroupProps };
|
|
417
|
+
export { ActionsProps, AttachmentItem, AttachmentItemData, AttachmentItemMulti, AttachmentItemMultiProps, AttachmentItemProps, AttachmentItemSingle, AttachmentItemSingleProps, AttachmentList, AttachmentListProps, AttachmentThumbnail, AttachmentThumbnailProps, DescriptionProps, FixedColumn, OutsideFilter, PinningPosition, TableComponent as Table, TableBadge, TableBodyRowStyle, TableButton, TableContextType, TableFilterBarProps, TableFilterBarRef, TableHeadCellProps, TableMainProps, TablePaginationProps, TableProps, TableToolbarProps, TitleGroup, TitleGroupHeaderProps, TitleGroupHelpIconProps, TitleGroupProps };
|