@aivex/ui 1.2.0-dev.20 → 1.2.0-dev.22

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.
@@ -1,4 +1,4 @@
1
- import { type TableOptions } from "@tanstack/react-table";
1
+ import { type Row, type TableOptions } from "@tanstack/react-table";
2
2
  import type { MouseEvent, ReactNode, Ref } from "react";
3
3
  import { type DataGridColumnSettingsOptions } from "./DataGridColumnSettings";
4
4
  import { type DataGridValue } from "./DataGridPrimitives";
@@ -19,6 +19,15 @@ export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCore
19
19
  isRowSelected?: (row: TData, index: number) => boolean;
20
20
  isRowDisabled?: (row: TData, index: number) => boolean;
21
21
  onRowClick?: (row: TData, index: number, event: MouseEvent<HTMLDivElement>) => void;
22
+ /**
23
+ * 펼쳐진 행(row.getIsExpanded() === true) 아래에 렌더할 커스텀 상세 패널.
24
+ * 아코디언처럼 로우를 열고 닫을 때 사용한다 — 소비자가 getExpandedRowModel과
25
+ * state.expanded(또는 getRowCanExpand)를 함께 설정해야 펼침 상태가 동작한다.
26
+ * 무엇으로 펼칠지는 소비자가 정한다 — 행 전체 클릭(onRowClick)이든 특정 컬럼의
27
+ * 꺾쇠 버튼(row.toggleExpanded())이든 상관없고, 펼침 가능한 행에는 aria-expanded가
28
+ * 자동으로 붙는다. 가상화 모드에서도 패널 높이가 함께 실측된다.
29
+ */
30
+ renderExpandedRow?: (row: Row<TData>) => ReactNode;
22
31
  loadingMore?: boolean;
23
32
  loadingMoreContent?: ReactNode;
24
33
  /** loadingMore 시 표시할 컬럼 기반 스켈레톤 행 수 (loadingMoreContent 미지정 시 사용) */
@@ -46,5 +55,5 @@ export interface DataGridProps<TData> extends Omit<TableOptions<TData>, "getCore
46
55
  /** 가상화 시 화면 밖에 미리 렌더할 행 수. 기본 6 */
47
56
  overscan?: number;
48
57
  }
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;
58
+ declare function DataGrid<TData>({ className, loading, loadingRowCount, empty, headerSticky, viewportClassName, contentClassName, headerClassName, bodyClassName, rowClassName, rowInteractive, isRowSelected, isRowDisabled, onRowClick, renderExpandedRow, loadingMore, loadingMoreContent, loadingMoreRowCount, skeletonRowClassName, endContent, infiniteTriggerRef, infiniteTriggerClassName, columnSettings, virtualized, estimateRowHeight, overscan, ref, getCoreRowModel, ...tableOptions }: DataGridProps<TData>): import("react/jsx-runtime").JSX.Element;
50
59
  export { DataGrid };
@@ -27,9 +27,11 @@ export interface DataGridRootProps extends HTMLAttributes<HTMLDivElement> {
27
27
  }
28
28
  declare function DataGridRoot({ className, children, ref, ...props }: DataGridRootProps): import("react/jsx-runtime").JSX.Element;
29
29
  export interface DataGridViewportProps extends ScrollAreaProps {
30
+ /** 세로 스크롤바에 덧붙일 클래스 — 고정 헤더 아래에서 시작시킬 때 */
31
+ verticalScrollbarClassName?: string;
30
32
  ref?: Ref<HTMLDivElement>;
31
33
  }
32
- declare function DataGridViewport({ className, children, ref, scrollbars, type, ...props }: DataGridViewportProps): import("react/jsx-runtime").JSX.Element;
34
+ declare function DataGridViewport({ className, children, ref, scrollbars, type, verticalScrollbarClassName, ...props }: DataGridViewportProps): import("react/jsx-runtime").JSX.Element;
33
35
  export interface DataGridHeaderProps extends HTMLAttributes<HTMLDivElement> {
34
36
  sticky?: boolean;
35
37
  ref?: Ref<HTMLDivElement>;
@@ -46,19 +48,19 @@ export interface DataGridRowProps extends HTMLAttributes<HTMLDivElement> {
46
48
  interactive?: boolean;
47
49
  ref?: Ref<HTMLDivElement>;
48
50
  }
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;
51
+ declare function DataGridRow({ className, children, asChild, selected, disabled, interactive, ref, onClick, onDoubleClick, onKeyDown, tabIndex, role, "aria-disabled": ariaDisabled, ...props }: DataGridRowProps): import("react/jsx-runtime").JSX.Element;
50
52
  export interface DataGridCellProps extends HTMLAttributes<HTMLDivElement> {
51
53
  align?: DataGridAlign;
52
54
  asChild?: boolean;
53
55
  ref?: Ref<HTMLDivElement>;
54
56
  }
55
- declare function DataGridCell({ className, children, align, asChild, ref, ...props }: DataGridCellProps): import("react/jsx-runtime").JSX.Element;
57
+ declare function DataGridCell({ className, children, align, asChild, ref, role, ...props }: DataGridCellProps): import("react/jsx-runtime").JSX.Element;
56
58
  export interface DataGridHeaderCellProps extends HTMLAttributes<HTMLDivElement> {
57
59
  align?: DataGridAlign;
58
60
  asChild?: boolean;
59
61
  ref?: Ref<HTMLDivElement>;
60
62
  }
61
- declare function DataGridHeaderCell({ className, children, align, asChild, ref, ...props }: DataGridHeaderCellProps): import("react/jsx-runtime").JSX.Element;
63
+ declare function DataGridHeaderCell({ className, children, align, asChild, ref, role, ...props }: DataGridHeaderCellProps): import("react/jsx-runtime").JSX.Element;
62
64
  export interface DataGridEmptyProps extends HTMLAttributes<HTMLDivElement> {
63
65
  children?: ReactNode;
64
66
  ref?: Ref<HTMLDivElement>;
@@ -11,15 +11,43 @@ export interface DataGridDataRowProps<TData> {
11
11
  disabled?: boolean;
12
12
  className?: string;
13
13
  onRowClick?: (row: TData, index: number, event: MouseEvent<HTMLDivElement>) => void;
14
+ /** row.getIsExpanded() 시 행 아래에 렌더할 커스텀 상세 패널 */
15
+ expandedContent?: ReactNode;
16
+ /** 펼칠 수 있는 행인지 — aria-expanded 노출 여부를 정한다 */
17
+ expandable?: boolean;
18
+ /** 비활성/펼침 가능 여부를 반영해 부모에서 계산한 포커스 가능 상태 */
19
+ focusable?: boolean;
20
+ /**
21
+ * 이 행의 React Table 상태(선택/펼침). 셀은 row.getIsSelected() 같은 메서드로
22
+ * 상태를 직접 읽는데, 그 값이 바뀌어도 row 객체 자체는 그대로라 memo가 렌더를
23
+ * 건너뛴다 — 상태를 프롭으로 올려야 체크박스 같은 셀이 다시 그려진다.
24
+ */
25
+ rowSelected?: boolean;
26
+ rowExpanded?: boolean;
27
+ /** 셀의 ARIA 롤 — 펼침을 쓰는 그리드(treegrid)에서는 gridcell이어야 한다 */
28
+ cellRole?: "cell" | "gridcell";
29
+ /** 로빙 tabindex의 탭 스톱 여부 — 그리드 전체에서 한 행만 true (미지정 시 탭 스톱) */
30
+ tabStop?: boolean;
31
+ /** 위/아래 화살표로 행 사이 포커스를 옮길 때 호출 */
32
+ onNavigate?: (rowId: string, delta: -1 | 1) => void;
33
+ /** 행(또는 그 안의 요소)이 포커스를 받아 탭 스톱을 옮겨야 할 때 호출 */
34
+ onFocusRow?: (rowId: string) => void;
14
35
  }
15
- declare function DataGridDataRowBase<TData>({ row, virtualIndex, virtualStart, measureRef, interactive, selected, disabled, className, onRowClick, }: DataGridDataRowProps<TData>): import("react/jsx-runtime").JSX.Element;
36
+ declare function DataGridDataRowBase<TData>({ row, virtualIndex, virtualStart, measureRef, interactive, selected, disabled, className, onRowClick, expandedContent, expandable, focusable, rowSelected, rowExpanded, cellRole, tabStop, onNavigate, onFocusRow, }: DataGridDataRowProps<TData>): import("react/jsx-runtime").JSX.Element;
16
37
  export declare const DataGridDataRow: typeof DataGridDataRowBase;
17
38
  export interface DataGridVirtualizedRowsProps<TData> {
18
39
  rows: Row<TData>[];
19
40
  viewportRef: RefObject<HTMLDivElement | null>;
20
41
  estimateRowHeight?: number;
21
42
  overscan?: number;
22
- renderRow: (row: Row<TData>, virtualItem: VirtualItem, measureRef: Ref<HTMLDivElement>) => ReactNode;
43
+ /** 로빙 tabindex의 현재 포커스 행 id */
44
+ activeRowId?: string | null;
45
+ focusableRowIds: Set<string>;
46
+ pendingFocusRowId?: string | null;
47
+ focusRowElement: (rowId: string) => boolean;
48
+ onFocusSettled: () => void;
49
+ scrollToRowRef: RefObject<((index: number) => void) | null>;
50
+ renderRow: (row: Row<TData>, virtualItem: VirtualItem, measureRef: Ref<HTMLDivElement>, tabStop: boolean) => ReactNode;
23
51
  }
24
- export declare function DataGridVirtualizedRows<TData>({ rows, viewportRef, estimateRowHeight, overscan, renderRow, }: DataGridVirtualizedRowsProps<TData>): import("react/jsx-runtime").JSX.Element;
52
+ export declare function DataGridVirtualizedRows<TData>({ rows, viewportRef, estimateRowHeight, overscan, activeRowId, focusableRowIds, pendingFocusRowId, focusRowElement, onFocusSettled, scrollToRowRef, renderRow, }: DataGridVirtualizedRowsProps<TData>): import("react/jsx-runtime").JSX.Element;
25
53
  export {};
@@ -4,11 +4,13 @@ type ScrollAreaScrollbars = "both" | "horizontal" | "vertical";
4
4
  type ScrollAreaProps = ComponentProps<typeof ScrollAreaPrimitive.Root> & {
5
5
  onViewportScroll?: UIEventHandler<HTMLDivElement>;
6
6
  scrollbars?: ScrollAreaScrollbars;
7
+ /** 세로 스크롤바에 덧붙일 클래스 — 고정 헤더 아래에서 시작시킬 때 쓴다 */
8
+ verticalScrollbarClassName?: string;
7
9
  viewportClassName?: string;
8
10
  viewportRef?: Ref<HTMLDivElement>;
9
11
  };
10
12
  type ScrollBarProps = ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>;
11
- declare function ScrollArea({ className, children, onViewportScroll, ref, scrollbars, type, viewportClassName, viewportRef, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
13
+ declare function ScrollArea({ className, children, onViewportScroll, ref, scrollbars, type, verticalScrollbarClassName, viewportClassName, viewportRef, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
12
14
  declare function ScrollBar({ className, orientation, ref, ...props }: ScrollBarProps): import("react/jsx-runtime").JSX.Element;
13
15
  export type { ScrollAreaProps, ScrollAreaScrollbars, ScrollBarProps };
14
16
  export { ScrollArea, ScrollBar };
@@ -44,12 +44,14 @@ export type ContextMenuItem = {
44
44
  separator: true;
45
45
  };
46
46
  export interface EditorPointerEvent {
47
+ pointerId?: number;
47
48
  button?: number;
48
49
  shiftKey?: boolean;
49
50
  altKey?: boolean;
50
51
  ctrlKey?: boolean;
51
52
  metaKey?: boolean;
52
53
  global?: Point;
54
+ insideCanvas?: boolean;
53
55
  }
54
56
  export interface EditorCanvasViewport {
55
57
  scale: number;
@@ -12,20 +12,26 @@ export interface Viewport {
12
12
  x: number;
13
13
  y: number;
14
14
  }
15
+ interface EditorRendererPointerEventBase {
16
+ pointerId: number;
17
+ global: Point;
18
+ }
19
+ export interface EditorRendererPointerDownEvent extends EditorRendererPointerEventBase {
20
+ button: number;
21
+ shiftKey: boolean;
22
+ altKey: boolean;
23
+ ctrlKey: boolean;
24
+ metaKey: boolean;
25
+ }
26
+ export interface EditorRendererPointerUpEvent extends EditorRendererPointerEventBase {
27
+ /** 포인터를 캔버스 안에서 놓았는지 여부(pointerupoutside/window mouseup 구분). */
28
+ insideCanvas: boolean;
29
+ }
15
30
  export interface EditorRendererCallbacks {
16
31
  /** 빈 공간 또는 도형 위 포인터다운. targetId=도형 id 또는 null. */
17
- onPointerDown: (p: Point, targetId: string | null, e: {
18
- button: number;
19
- shiftKey: boolean;
20
- altKey: boolean;
21
- ctrlKey: boolean;
22
- metaKey: boolean;
23
- global: Point;
24
- }) => void;
25
- onPointerMove: (p: Point, e: {
26
- global: Point;
27
- }) => void;
28
- onPointerUp: (p: Point) => void;
32
+ onPointerDown: (p: Point, targetId: string | null, e: EditorRendererPointerDownEvent) => void;
33
+ onPointerMove: (p: Point, e: EditorRendererPointerEventBase) => void;
34
+ onPointerUp: (p: Point, e: EditorRendererPointerUpEvent) => void;
29
35
  onViewportChange?: () => void;
30
36
  /** 렌더러 내부 히트 영역(도형/핸들/드래그)이 제안하는 커서. 최종 결정은 Editor가 한다. */
31
37
  onCursorHint?: (cursor: string | null) => void;
@@ -118,3 +124,4 @@ export interface EditorRenderer<TMeta = unknown> {
118
124
  shapesIntersecting(box: BBox): string[];
119
125
  }
120
126
  export type EditorRendererFactory = (host: HTMLElement, cb: EditorRendererCallbacks) => EditorRenderer;
127
+ export {};
@@ -23,5 +23,5 @@ export interface ToastProps extends HTMLAttributes<HTMLDivElement>, VariantProps
23
23
  export type ToastToasterProps = ToasterProps;
24
24
  export type ToastOptions = ExternalToast;
25
25
  declare function Toast({ className, type, open, message, action, onClose, closeAriaLabel, ref, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
26
- declare function ToastToaster({ position, duration, visibleToasts, gap, toastOptions, ...props }: ToastToasterProps): import("react/jsx-runtime").JSX.Element;
26
+ declare function ToastToaster({ position, duration, visibleToasts, gap, style, toastOptions, ...props }: ToastToasterProps): import("react/jsx-runtime").JSX.Element;
27
27
  export { Toast, ToastToaster, toast, toastVariants };