@aivex/ui 1.2.0-dev.10 → 1.2.0-dev.11
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/components/DataGrid/DataGrid.d.ts +21 -73
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +77 -0
- package/dist/components/DataGrid/DataGridRows.d.ts +25 -0
- package/dist/components/DataGrid/index.d.ts +4 -2
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4561 -3733
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -1
|
@@ -1,74 +1,7 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
import { type ScrollAreaProps } from "@/components/ScrollArea";
|
|
1
|
+
import { type TableOptions } from "@tanstack/react-table";
|
|
2
|
+
import type { MouseEvent, ReactNode, Ref } from "react";
|
|
4
3
|
import { type DataGridColumnSettingsOptions } from "./DataGridColumnSettings";
|
|
5
|
-
|
|
6
|
-
type DataGridValue<TData, TValue> = TValue | ((row: TData, index: number) => TValue);
|
|
7
|
-
declare module "@tanstack/react-table" {
|
|
8
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
9
|
-
align?: DataGridAlign;
|
|
10
|
-
headerAlign?: DataGridAlign;
|
|
11
|
-
cellAlign?: DataGridAlign;
|
|
12
|
-
className?: string;
|
|
13
|
-
headerClassName?: string;
|
|
14
|
-
cellClassName?: DataGridValue<TData, string | undefined>;
|
|
15
|
-
headerSortTrigger?: boolean;
|
|
16
|
-
/** 컬럼 설정 목록에 표시할 라벨 (header 가 문자열이 아닌 컬럼용) */
|
|
17
|
-
settingsLabel?: string;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export interface DataGridRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
-
ref?: Ref<HTMLDivElement>;
|
|
22
|
-
}
|
|
23
|
-
declare function DataGridRoot({ className, children, ref, ...props }: DataGridRootProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export interface DataGridViewportProps extends ScrollAreaProps {
|
|
25
|
-
ref?: Ref<HTMLDivElement>;
|
|
26
|
-
}
|
|
27
|
-
declare function DataGridViewport({ className, children, ref, scrollbars, type, ...props }: DataGridViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export interface DataGridHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
-
sticky?: boolean;
|
|
30
|
-
ref?: Ref<HTMLDivElement>;
|
|
31
|
-
}
|
|
32
|
-
declare function DataGridHeader({ className, children, sticky, ref, ...props }: DataGridHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export interface DataGridBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
34
|
-
ref?: Ref<HTMLDivElement>;
|
|
35
|
-
}
|
|
36
|
-
declare function DataGridBody({ className, children, ref, ...props }: DataGridBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export interface DataGridRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
38
|
-
asChild?: boolean;
|
|
39
|
-
selected?: boolean;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
interactive?: boolean;
|
|
42
|
-
ref?: Ref<HTMLDivElement>;
|
|
43
|
-
}
|
|
44
|
-
declare function DataGridRow({ className, children, asChild, selected, disabled, interactive, ref, onClick, onDoubleClick, onKeyDown, tabIndex, "aria-disabled": ariaDisabled, ...props }: DataGridRowProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export interface DataGridCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
46
|
-
align?: DataGridAlign;
|
|
47
|
-
asChild?: boolean;
|
|
48
|
-
ref?: Ref<HTMLDivElement>;
|
|
49
|
-
}
|
|
50
|
-
declare function DataGridCell({ className, children, align, asChild, ref, ...props }: DataGridCellProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export interface DataGridHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
52
|
-
align?: DataGridAlign;
|
|
53
|
-
asChild?: boolean;
|
|
54
|
-
ref?: Ref<HTMLDivElement>;
|
|
55
|
-
}
|
|
56
|
-
declare function DataGridHeaderCell({ className, children, align, asChild, ref, ...props }: DataGridHeaderCellProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
export interface DataGridEmptyProps extends HTMLAttributes<HTMLDivElement> {
|
|
58
|
-
children?: ReactNode;
|
|
59
|
-
ref?: Ref<HTMLDivElement>;
|
|
60
|
-
}
|
|
61
|
-
declare function DataGridEmpty({ className, children, ref, ...props }: DataGridEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export interface DataGridLoadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
-
rowCount?: number;
|
|
64
|
-
ref?: Ref<HTMLDivElement>;
|
|
65
|
-
}
|
|
66
|
-
declare function DataGridLoading({ className, rowCount, ref, ...props }: DataGridLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
-
export interface DataGridInfiniteTriggerProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
|
-
loading?: boolean;
|
|
69
|
-
ref?: Ref<HTMLDivElement>;
|
|
70
|
-
}
|
|
71
|
-
declare function DataGridInfiniteTrigger({ className, children, loading, ref, ...props }: DataGridInfiniteTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
import { type DataGridValue } from "./DataGridPrimitives";
|
|
72
5
|
export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCoreRowModel"> {
|
|
73
6
|
getCoreRowModel?: TableOptions<TData>["getCoreRowModel"];
|
|
74
7
|
className?: string;
|
|
@@ -88,6 +21,12 @@ export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCore
|
|
|
88
21
|
onRowClick?: (row: TData, index: number, event: MouseEvent<HTMLDivElement>) => void;
|
|
89
22
|
loadingMore?: boolean;
|
|
90
23
|
loadingMoreContent?: ReactNode;
|
|
24
|
+
/** loadingMore 시 표시할 컬럼 기반 스켈레톤 행 수 (loadingMoreContent 미지정 시 사용) */
|
|
25
|
+
loadingMoreRowCount?: number;
|
|
26
|
+
/** 로딩 스켈레톤 행에 적용할 클래스 (행 높이 등 실제 행과 맞출 때 사용) */
|
|
27
|
+
skeletonRowClassName?: string;
|
|
28
|
+
/** 목록 끝에 도달했을 때 마지막 행 아래에 표시할 콘텐츠 (예: "마지막 데이터입니다") */
|
|
29
|
+
endContent?: ReactNode;
|
|
91
30
|
infiniteTriggerRef?: Ref<HTMLDivElement>;
|
|
92
31
|
infiniteTriggerClassName?: string;
|
|
93
32
|
/**
|
|
@@ -97,6 +36,15 @@ export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCore
|
|
|
97
36
|
* overflow 조상에도 잘리지 않는다 — 좌측 요소 위에 겹쳐 보일 수 있다.
|
|
98
37
|
*/
|
|
99
38
|
columnSettings?: boolean | DataGridColumnSettingsOptions;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
39
|
+
/**
|
|
40
|
+
* 행 가상화 활성화 — 보이는 창의 행만 마운트한다.
|
|
41
|
+
* SSR에서는 초기 행이 비어 있고 마운트 후 렌더된다.
|
|
42
|
+
*/
|
|
43
|
+
virtualized?: boolean;
|
|
44
|
+
/** 가상화 시 행 높이 추정값(px). 실제 높이는 렌더 후 실측로 보정된다. 기본 48 */
|
|
45
|
+
estimateRowHeight?: number;
|
|
46
|
+
/** 가상화 시 화면 밖에 미리 렌더할 행 수. 기본 6 */
|
|
47
|
+
overscan?: number;
|
|
48
|
+
}
|
|
49
|
+
declare function DataGrid<TData>({ className, loading, loadingRowCount, empty, headerSticky, viewportClassName, contentClassName, headerClassName, bodyClassName, rowClassName, rowInteractive, isRowSelected, isRowDisabled, onRowClick, loadingMore, loadingMoreContent, loadingMoreRowCount, skeletonRowClassName, endContent, infiniteTriggerRef, infiniteTriggerClassName, columnSettings, virtualized, estimateRowHeight, overscan, ref, getCoreRowModel, ...tableOptions }: DataGridProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export { DataGrid };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { HTMLAttributes, ReactNode, Ref } from "react";
|
|
3
|
+
import { type ScrollAreaProps } from "@/components/ScrollArea";
|
|
4
|
+
export type DataGridAlign = "start" | "center" | "end";
|
|
5
|
+
export type DataGridValue<TData, TValue> = TValue | ((row: TData, index: number) => TValue);
|
|
6
|
+
declare module "@tanstack/react-table" {
|
|
7
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
8
|
+
align?: DataGridAlign;
|
|
9
|
+
headerAlign?: DataGridAlign;
|
|
10
|
+
cellAlign?: DataGridAlign;
|
|
11
|
+
className?: string;
|
|
12
|
+
headerClassName?: string;
|
|
13
|
+
cellClassName?: DataGridValue<TData, string | undefined>;
|
|
14
|
+
headerSortTrigger?: boolean;
|
|
15
|
+
/** 컬럼 설정 목록에 표시할 라벨 (header 가 문자열이 아닌 컬럼용) */
|
|
16
|
+
settingsLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 로딩 스켈레톤 행에서 이 컬럼 셀에 렌더할 콘텐츠.
|
|
19
|
+
* 미지정 시 기본 스켈레톤 바, null이면 비워둠.
|
|
20
|
+
*/
|
|
21
|
+
skeleton?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export declare function resolveDataGridValue<TData, TValue>(value: DataGridValue<TData, TValue> | undefined, row: TData, index: number): TValue | undefined;
|
|
25
|
+
export interface DataGridRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
ref?: Ref<HTMLDivElement>;
|
|
27
|
+
}
|
|
28
|
+
declare function DataGridRoot({ className, children, ref, ...props }: DataGridRootProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export interface DataGridViewportProps extends ScrollAreaProps {
|
|
30
|
+
ref?: Ref<HTMLDivElement>;
|
|
31
|
+
}
|
|
32
|
+
declare function DataGridViewport({ className, children, ref, scrollbars, type, ...props }: DataGridViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export interface DataGridHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
sticky?: boolean;
|
|
35
|
+
ref?: Ref<HTMLDivElement>;
|
|
36
|
+
}
|
|
37
|
+
declare function DataGridHeader({ className, children, sticky, ref, ...props }: DataGridHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export interface DataGridBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
39
|
+
ref?: Ref<HTMLDivElement>;
|
|
40
|
+
}
|
|
41
|
+
declare function DataGridBody({ className, children, ref, ...props }: DataGridBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export interface DataGridRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
selected?: boolean;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
interactive?: boolean;
|
|
47
|
+
ref?: Ref<HTMLDivElement>;
|
|
48
|
+
}
|
|
49
|
+
declare function DataGridRow({ className, children, asChild, selected, disabled, interactive, ref, onClick, onDoubleClick, onKeyDown, tabIndex, "aria-disabled": ariaDisabled, ...props }: DataGridRowProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export interface DataGridCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
51
|
+
align?: DataGridAlign;
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
ref?: Ref<HTMLDivElement>;
|
|
54
|
+
}
|
|
55
|
+
declare function DataGridCell({ className, children, align, asChild, ref, ...props }: DataGridCellProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export interface DataGridHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
|
|
57
|
+
align?: DataGridAlign;
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
ref?: Ref<HTMLDivElement>;
|
|
60
|
+
}
|
|
61
|
+
declare function DataGridHeaderCell({ className, children, align, asChild, ref, ...props }: DataGridHeaderCellProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export interface DataGridEmptyProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
+
children?: ReactNode;
|
|
64
|
+
ref?: Ref<HTMLDivElement>;
|
|
65
|
+
}
|
|
66
|
+
declare function DataGridEmpty({ className, children, ref, ...props }: DataGridEmptyProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export interface DataGridLoadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
68
|
+
rowCount?: number;
|
|
69
|
+
ref?: Ref<HTMLDivElement>;
|
|
70
|
+
}
|
|
71
|
+
declare function DataGridLoading({ className, rowCount, ref, ...props }: DataGridLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export interface DataGridInfiniteTriggerProps extends HTMLAttributes<HTMLDivElement> {
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
ref?: Ref<HTMLDivElement>;
|
|
75
|
+
}
|
|
76
|
+
declare function DataGridInfiniteTrigger({ className, children, loading, ref, ...props }: DataGridInfiniteTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
export { DataGridBody, DataGridCell, DataGridEmpty, DataGridHeader, DataGridHeaderCell, DataGridInfiniteTrigger, DataGridLoading, DataGridRoot, DataGridRow, DataGridViewport, };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Row } from "@tanstack/react-table";
|
|
2
|
+
import { type VirtualItem } from "@tanstack/react-virtual";
|
|
3
|
+
import type { MouseEvent, ReactNode, Ref, RefObject } from "react";
|
|
4
|
+
export interface DataGridDataRowProps<TData> {
|
|
5
|
+
row: Row<TData>;
|
|
6
|
+
virtualIndex?: number;
|
|
7
|
+
virtualStart?: number;
|
|
8
|
+
measureRef?: Ref<HTMLDivElement>;
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
onRowClick?: (row: TData, index: number, event: MouseEvent<HTMLDivElement>) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function DataGridDataRowBase<TData>({ row, virtualIndex, virtualStart, measureRef, interactive, selected, disabled, className, onRowClick, }: DataGridDataRowProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const DataGridDataRow: typeof DataGridDataRowBase;
|
|
17
|
+
export interface DataGridVirtualizedRowsProps<TData> {
|
|
18
|
+
rows: Row<TData>[];
|
|
19
|
+
viewportRef: RefObject<HTMLDivElement | null>;
|
|
20
|
+
estimateRowHeight?: number;
|
|
21
|
+
overscan?: number;
|
|
22
|
+
renderRow: (row: Row<TData>, virtualItem: VirtualItem, measureRef: Ref<HTMLDivElement>) => ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function DataGridVirtualizedRows<TData>({ rows, viewportRef, estimateRowHeight, overscan, renderRow, }: DataGridVirtualizedRowsProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { CellContext, ColumnDef, ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, Row, RowSelectionState, SortingState, Table as ReactTableInstance, TableOptions, VisibilityState, } from "@tanstack/react-table";
|
|
2
2
|
export { getCoreRowModel, getExpandedRowModel, getFacetedMinMaxValues, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getGroupedRowModel, getPaginationRowModel, getSortedRowModel, } from "@tanstack/react-table";
|
|
3
|
-
export type {
|
|
4
|
-
export { DataGrid
|
|
3
|
+
export type { DataGridProps } from "./DataGrid";
|
|
4
|
+
export { DataGrid } from "./DataGrid";
|
|
5
5
|
export type { DataGridColumnSettingsOptions } from "./DataGridColumnSettings";
|
|
6
6
|
export { DataGridColumnSettings } from "./DataGridColumnSettings";
|
|
7
|
+
export type { DataGridAlign, DataGridBodyProps, DataGridCellProps, DataGridEmptyProps, DataGridHeaderCellProps, DataGridHeaderProps, DataGridInfiniteTriggerProps, DataGridLoadingProps, DataGridRootProps, DataGridRowProps, DataGridViewportProps, } from "./DataGridPrimitives";
|
|
8
|
+
export { DataGridBody, DataGridCell, DataGridEmpty, DataGridHeader, DataGridHeaderCell, DataGridInfiniteTrigger, DataGridLoading, DataGridRoot, DataGridRow, DataGridViewport, } from "./DataGridPrimitives";
|