@ehfuse/mui-virtual-data-table 1.8.0 → 1.9.0

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.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * rowReorder.tsx — 줄 끌어 옮기기(1.9.0)
3
+ *
4
+ * 첫 칸에 손잡이(⋮⋮)를 세우고, 손잡이를 끌면 놓을 자리에 선을 긋고 놓을 때 onReorder(from, to) 를 부른다. 표는 data 를 바꾸지 않는다 —
5
+ * 소비처가 바꿔 넘기면 그대로 다시 그린다. 가상화 표에서도 되도록 줄 DOM 을 손대지 않는다: 끄는 동안은 포인터 아래 줄(elementFromPoint)의
6
+ * 자리로 선 위치만 정하고, 끌던 줄은 data-vdt-dragging 속성으로 흐리게 보인다(React 재렌더 없음). 바깥 의존성(dnd-kit 등) 없이 포인터 이벤트로 한다.
7
+ * 키보드: 손잡이에 초점 → Space(들기) → ↑ ↓ 로 한 칸씩(바로 onReorder) → Space · Enter · Esc 로 놓기.
8
+ */
9
+ import React from "react";
10
+ import type { DataColumn, VDTRowReorderConfig } from "./types";
11
+ /** 손잡이 열의 id — 소비처 열과 겹치지 않게 */
12
+ export declare const REORDER_COLUMN_ID = "__vdt_reorder";
13
+ export interface UseRowReorderArgs<T> {
14
+ config: VDTRowReorderConfig<T> | undefined;
15
+ tableBoxRef: React.RefObject<HTMLElement | null>;
16
+ getScroller: () => HTMLElement | null;
17
+ dataLengthRef: React.RefObject<number>;
18
+ anyPinned: boolean;
19
+ }
20
+ /**
21
+ * 끌어 옮기기 — 손잡이 열 · 손잡이 렌더 · 표 상자에 넣을 선 요소를 돌려준다.
22
+ * 모든 포인터 처리는 ref 로 해 끄는 동안 React 가 다시 그리지 않는다.
23
+ */
24
+ export declare function useRowReorder<T>({ config, tableBoxRef, getScroller, dataLengthRef, anyPinned }: UseRowReorderArgs<T>): {
25
+ on: boolean;
26
+ handleColumn: DataColumn<T> | null;
27
+ renderHandle: (item: T, index: number) => React.ReactNode;
28
+ indicator: import("react/jsx-runtime").JSX.Element | null;
29
+ };
package/dist/types.d.ts CHANGED
@@ -282,4 +282,23 @@ export interface VirtualDataTableProps<T> {
282
282
  columnWidths?: VDTColumnWidths;
283
283
  /** 열 폭이 바뀌었을 때 — 끌기를 놓을 때 한 번(끄는 동안은 부르지 않는다), 두 번 눌러 되돌리면 그 열 키를 뺀 값으로(1.8.0). */
284
284
  onColumnWidthsChange?: (widths: VDTColumnWidths) => void;
285
+ /**
286
+ * 줄 끌어 옮기기(1.9.0) — 주면 첫 칸에 손잡이(⋮⋮)가 서고, 끌어 놓으면 onReorder(from, to) 를 부른다. 표는 data 를 바꾸지 않는다 —
287
+ * 소비처가 바꿔 넘기면 그대로 다시 그린다. 정렬 · 거르기가 걸려 보이는 순서가 저장 순서와 다를 때는 disabledReason 으로 막는다.
288
+ * 폰 목록(mobile)에서는 카드 왼쪽에 손잡이가 선다. 키보드: 손잡이에 초점 → Space → ↑ ↓ → Space.
289
+ */
290
+ rowReorder?: VDTRowReorderConfig<T>;
291
+ }
292
+ /** 줄 끌어 옮기기 설정(1.9.0) */
293
+ export interface VDTRowReorderConfig<T> {
294
+ /** 놓았을 때 — from · to 는 data 안 순번이고 to 는 옮긴 뒤 그 줄이 설 자리(arrayMove(data, from, to) 와 같다). 같은 자리면 부르지 않는다 */
295
+ onReorder: (from: number, to: number, item: T) => void;
296
+ /** 이 줄을 끌 수 있나(기본 모두). 끌 수 없는 줄은 손잡이를 그리지 않는다 */
297
+ canDrag?: (item: T, index: number) => boolean;
298
+ /** 끌기를 막는 이유(정렬 · 거르기 중 등) — 주면 손잡이를 흐리게 그리고 누를 수 없다. 손잡이 title 로 보인다 */
299
+ disabledReason?: string;
300
+ /** 손잡이 열 폭 px(기본 36) */
301
+ handleWidth?: number;
302
+ /** 손잡이 aria-label(기본 "순서 옮기기") */
303
+ handleLabel?: string;
285
304
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/mui-virtual-data-table",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "A high-performance virtual data table component for React with Material-UI integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",