rockin 0.0.16 → 0.0.18

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,389 @@
1
+ // src/ui/data-table/core/data-table-root.tsx
2
+ import * as React from "react";
3
+ import { cn } from "cn";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var DataTableContext = React.createContext(
6
+ null
7
+ );
8
+ function useDataTable() {
9
+ const context = React.useContext(DataTableContext);
10
+ if (!context) {
11
+ throw new Error(
12
+ "DataTable components must be rendered inside DataTableRoot"
13
+ );
14
+ }
15
+ return context;
16
+ }
17
+ function DataTableRoot({
18
+ data,
19
+ columns,
20
+ children,
21
+ isLoading = false,
22
+ pageSize = 10,
23
+ getRowId = (_, index) => String(index),
24
+ className
25
+ }) {
26
+ const [globalFilter, setGlobalFilterState] = React.useState("");
27
+ const [pageIndex, setPageIndexState] = React.useState(0);
28
+ const filteredData = React.useMemo(() => {
29
+ const query = globalFilter.trim().toLowerCase();
30
+ if (!query) return data;
31
+ return data.filter(
32
+ (row) => columns.some((column) => {
33
+ if (column.enableSearch === false) return false;
34
+ const value = column.accessorFn ? column.accessorFn(row) : column.accessorKey ? row[column.accessorKey] : void 0;
35
+ return String(value ?? "").toLowerCase().includes(query);
36
+ })
37
+ );
38
+ }, [columns, data, globalFilter]);
39
+ const safePageSize = Math.max(1, pageSize);
40
+ const pageCount = Math.max(1, Math.ceil(filteredData.length / safePageSize));
41
+ const safePageIndex = Math.min(pageIndex, pageCount - 1);
42
+ const pageData = filteredData.slice(
43
+ safePageIndex * safePageSize,
44
+ (safePageIndex + 1) * safePageSize
45
+ );
46
+ React.useEffect(() => {
47
+ setPageIndexState((current) => Math.min(current, pageCount - 1));
48
+ }, [pageCount]);
49
+ const contextValue = React.useMemo(
50
+ () => ({
51
+ data,
52
+ columns,
53
+ filteredData,
54
+ pageData,
55
+ pageIndex: safePageIndex,
56
+ pageSize: safePageSize,
57
+ pageCount,
58
+ globalFilter,
59
+ isLoading,
60
+ getRowId,
61
+ setGlobalFilter: (value) => {
62
+ setGlobalFilterState(value);
63
+ setPageIndexState(0);
64
+ },
65
+ setPageIndex: (value) => setPageIndexState(Math.max(0, Math.min(value, pageCount - 1)))
66
+ }),
67
+ [
68
+ columns,
69
+ filteredData,
70
+ pageCount,
71
+ pageData,
72
+ safePageIndex,
73
+ safePageSize,
74
+ globalFilter,
75
+ isLoading,
76
+ getRowId
77
+ ]
78
+ );
79
+ return /* @__PURE__ */ jsx(DataTableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx("div", { className: cn("w-full space-y-3", className), children }) });
80
+ }
81
+
82
+ // src/ui/data-table/hooks/use-data-table-pagination.ts
83
+ function useDataTablePagination() {
84
+ const { pageIndex, pageSize, pageCount, setPageIndex } = useDataTable();
85
+ return {
86
+ pageIndex,
87
+ pageSize,
88
+ pageCount,
89
+ canPreviousPage: pageIndex > 0,
90
+ canNextPage: pageIndex < pageCount - 1,
91
+ goToPage: setPageIndex,
92
+ previousPage: () => setPageIndex(pageIndex - 1),
93
+ nextPage: () => setPageIndex(pageIndex + 1),
94
+ firstPage: () => setPageIndex(0),
95
+ lastPage: () => setPageIndex(pageCount - 1)
96
+ };
97
+ }
98
+
99
+ // src/ui/data-table/hooks/use-data-table-rows.ts
100
+ function useDataTableRows() {
101
+ const { data, filteredData, pageData, isLoading } = useDataTable();
102
+ return {
103
+ data,
104
+ rows: pageData,
105
+ pageRows: pageData,
106
+ filteredRows: filteredData,
107
+ totalRows: filteredData.length,
108
+ isLoading
109
+ };
110
+ }
111
+
112
+ // src/ui/data-table/hooks/use-data-table-search.ts
113
+ function useDataTableSearch() {
114
+ const { globalFilter, setGlobalFilter } = useDataTable();
115
+ return {
116
+ search: globalFilter,
117
+ setSearch: setGlobalFilter,
118
+ clearSearch: () => setGlobalFilter("")
119
+ };
120
+ }
121
+
122
+ // src/ui/data-table/data-grid.tsx
123
+ import * as React2 from "react";
124
+ import { cn as cn2 } from "cn";
125
+ import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
126
+ function useDataGrid({
127
+ columnIds = [],
128
+ columns,
129
+ initialRows = [],
130
+ getRowId = (row, index) => String(row.id ?? index)
131
+ } = {}) {
132
+ const [rows, setRows] = React2.useState(initialRows);
133
+ const resolvedColumns = React2.useMemo(
134
+ () => columns ?? columnIds.map((id) => ({
135
+ id,
136
+ accessorKey: id,
137
+ header: id
138
+ })),
139
+ [columnIds, columns]
140
+ );
141
+ const getRow = React2.useCallback(
142
+ (rowId) => rows.find((row, index) => getRowId(row, index) === rowId),
143
+ [getRowId, rows]
144
+ );
145
+ const getCellValue = React2.useCallback(
146
+ (rowId, columnId) => {
147
+ const row = getRow(rowId);
148
+ return row?.[columnId];
149
+ },
150
+ [getRow]
151
+ );
152
+ const updateCell = React2.useCallback(
153
+ (rowId, columnId, value) => {
154
+ setRows(
155
+ (current) => current.map(
156
+ (row, index) => getRowId(row, index) === rowId ? { ...row, [columnId]: value } : row
157
+ )
158
+ );
159
+ },
160
+ [getRowId]
161
+ );
162
+ const updateRows = React2.useCallback(
163
+ (updater) => setRows(updater),
164
+ []
165
+ );
166
+ return React2.useMemo(
167
+ () => ({
168
+ rows,
169
+ columns: resolvedColumns,
170
+ getRowId,
171
+ getRow,
172
+ getCellValue,
173
+ updateCell,
174
+ updateRows
175
+ }),
176
+ [
177
+ getCellValue,
178
+ getRow,
179
+ getRowId,
180
+ resolvedColumns,
181
+ rows,
182
+ updateCell,
183
+ updateRows
184
+ ]
185
+ );
186
+ }
187
+ var DataGridContext = React2.createContext(null);
188
+ function useDataGridContext() {
189
+ const context = React2.useContext(DataGridContext);
190
+ if (!context) throw new Error("DataGrid components must be inside DataGrid");
191
+ return context;
192
+ }
193
+ var DataGridCellContext = React2.createContext(null);
194
+ function DataGrid({
195
+ grid,
196
+ children,
197
+ className
198
+ }) {
199
+ return /* @__PURE__ */ jsx2(DataGridContext.Provider, { value: grid, children: /* @__PURE__ */ jsx2("div", { className: cn2("w-full space-y-2 outline-none", className), children }) });
200
+ }
201
+ function DataGridRow({
202
+ row,
203
+ rowId,
204
+ children,
205
+ className
206
+ }) {
207
+ const grid = useDataGridContext();
208
+ const resolvedRowId = rowId ?? (row ? grid.getRowId(row, 0) : "");
209
+ const resolvedRow = row ?? grid.getRow(resolvedRowId);
210
+ return /* @__PURE__ */ jsx2(
211
+ "div",
212
+ {
213
+ className: cn2(
214
+ "grid grid-cols-[repeat(var(--data-grid-columns),minmax(9rem,1fr))]",
215
+ className
216
+ ),
217
+ children: resolvedRow && children
218
+ }
219
+ );
220
+ }
221
+ function DataGridColumn({
222
+ column,
223
+ children,
224
+ className
225
+ }) {
226
+ return /* @__PURE__ */ jsx2("div", { className: cn2("min-w-0", className), children: children ?? column.header });
227
+ }
228
+ function DataGridCell({
229
+ row,
230
+ rowId,
231
+ columnId,
232
+ children,
233
+ state = "valid",
234
+ className
235
+ }) {
236
+ const grid = useDataGridContext();
237
+ const resolvedRowId = rowId ?? (row ? grid.getRowId(row, 0) : "");
238
+ const value = grid.getCellValue(resolvedRowId, columnId);
239
+ return /* @__PURE__ */ jsx2(
240
+ DataGridCellContext.Provider,
241
+ {
242
+ value: { rowId: resolvedRowId, columnId, value },
243
+ children: /* @__PURE__ */ jsx2(
244
+ "div",
245
+ {
246
+ "aria-invalid": state === "invalid" || void 0,
247
+ className: cn2(
248
+ "min-h-9 border-r border-b px-2 py-1.5",
249
+ state === "invalid" && "border-destructive/60 bg-destructive/10",
250
+ state === "pending" && "opacity-70",
251
+ className
252
+ ),
253
+ children
254
+ }
255
+ )
256
+ }
257
+ );
258
+ }
259
+ function useGridCell() {
260
+ const cell = React2.useContext(DataGridCellContext);
261
+ const grid = useDataGridContext();
262
+ if (!cell) throw new Error("Grid cell components must be inside DataGridCell");
263
+ return { ...cell, grid };
264
+ }
265
+ function GridTextCell({
266
+ value,
267
+ onChange,
268
+ placeholder
269
+ }) {
270
+ const cell = useGridCell();
271
+ const currentValue = value ?? String(cell.value ?? "");
272
+ return /* @__PURE__ */ jsx2(
273
+ "input",
274
+ {
275
+ className: "h-7 w-full min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground",
276
+ onChange: (event) => {
277
+ const nextValue = event.target.value;
278
+ onChange?.(nextValue);
279
+ cell.grid.updateCell(cell.rowId, cell.columnId, nextValue);
280
+ },
281
+ placeholder,
282
+ value: currentValue
283
+ }
284
+ );
285
+ }
286
+ function GridNumberCell({
287
+ value,
288
+ onChange
289
+ }) {
290
+ const cell = useGridCell();
291
+ const currentValue = value ?? (typeof cell.value === "number" ? cell.value : "");
292
+ return /* @__PURE__ */ jsx2(
293
+ "input",
294
+ {
295
+ className: "h-7 w-full min-w-0 bg-transparent text-sm outline-none",
296
+ onChange: (event) => {
297
+ const nextValue = event.target.valueAsNumber;
298
+ if (Number.isNaN(nextValue)) return;
299
+ onChange?.(nextValue);
300
+ cell.grid.updateCell(cell.rowId, cell.columnId, nextValue);
301
+ },
302
+ type: "number",
303
+ value: currentValue
304
+ }
305
+ );
306
+ }
307
+ function GridComboboxCell({
308
+ options,
309
+ value,
310
+ onChange
311
+ }) {
312
+ const cell = useGridCell();
313
+ const currentValue = value ?? String(cell.value ?? "");
314
+ return /* @__PURE__ */ jsx2(
315
+ "select",
316
+ {
317
+ className: "h-7 w-full min-w-0 bg-transparent text-sm outline-none",
318
+ onChange: (event) => {
319
+ const nextValue = event.target.value;
320
+ onChange?.(nextValue);
321
+ cell.grid.updateCell(cell.rowId, cell.columnId, nextValue);
322
+ },
323
+ value: currentValue,
324
+ children: options.map((option) => /* @__PURE__ */ jsx2("option", { value: option.value, children: option.label }, option.value))
325
+ }
326
+ );
327
+ }
328
+ function DataTableColumnResize() {
329
+ return /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: "absolute inset-y-0 right-0 w-px" });
330
+ }
331
+ function DataGridClipboard({
332
+ children
333
+ }) {
334
+ return /* @__PURE__ */ jsx2(Fragment, { children });
335
+ }
336
+ function DataGridFillHandle({
337
+ children
338
+ }) {
339
+ return /* @__PURE__ */ jsx2(Fragment, { children });
340
+ }
341
+ function DataGridMove({ children }) {
342
+ return /* @__PURE__ */ jsx2(Fragment, { children });
343
+ }
344
+
345
+ // src/hooks/useMediaQuery.ts
346
+ import { useEffect as useEffect2, useState as useState3 } from "react";
347
+ function useMediaQuery(query) {
348
+ const [matches, setMatches] = useState3(false);
349
+ useEffect2(() => {
350
+ const mediaQuery = window.matchMedia(query);
351
+ const handleChange = () => setMatches(mediaQuery.matches);
352
+ handleChange();
353
+ mediaQuery.addEventListener("change", handleChange);
354
+ return () => mediaQuery.removeEventListener("change", handleChange);
355
+ }, [query]);
356
+ return matches;
357
+ }
358
+
359
+ // src/hooks/useMounted.ts
360
+ import { useEffect as useEffect3, useState as useState4 } from "react";
361
+ function useMounted() {
362
+ const [mounted, setMounted] = useState4(false);
363
+ useEffect3(() => {
364
+ setMounted(true);
365
+ }, []);
366
+ return { mounted };
367
+ }
368
+
369
+ export {
370
+ useDataTable,
371
+ DataTableRoot,
372
+ useDataTablePagination,
373
+ useDataTableRows,
374
+ useDataTableSearch,
375
+ useDataGrid,
376
+ DataGrid,
377
+ DataGridRow,
378
+ DataGridColumn,
379
+ DataGridCell,
380
+ GridTextCell,
381
+ GridNumberCell,
382
+ GridComboboxCell,
383
+ DataTableColumnResize,
384
+ DataGridClipboard,
385
+ DataGridFillHandle,
386
+ DataGridMove,
387
+ useMediaQuery,
388
+ useMounted
389
+ };
@@ -0,0 +1,117 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+
4
+ type DataTableColumn<TData> = {
5
+ id?: string;
6
+ accessorKey?: keyof TData & string;
7
+ accessorFn?: (row: TData) => unknown;
8
+ header: ReactNode | ((column: DataTableColumn<TData>) => ReactNode);
9
+ cell?: (value: unknown, row: TData, rowIndex: number) => ReactNode;
10
+ enableSearch?: boolean;
11
+ };
12
+ type DataTableColumnDef<TData> = DataTableColumn<TData>;
13
+ type DataTableRootProps<TData> = {
14
+ data: TData[];
15
+ columns: DataTableColumn<TData>[];
16
+ children: ReactNode;
17
+ isLoading?: boolean;
18
+ pageSize?: number;
19
+ getRowId?: (row: TData, index: number) => string;
20
+ className?: string;
21
+ };
22
+
23
+ type DataTableContextValue<TData> = {
24
+ data: TData[];
25
+ columns: DataTableColumn<TData>[];
26
+ filteredData: TData[];
27
+ pageData: TData[];
28
+ pageIndex: number;
29
+ pageSize: number;
30
+ pageCount: number;
31
+ globalFilter: string;
32
+ isLoading: boolean;
33
+ getRowId: (row: TData, index: number) => string;
34
+ setGlobalFilter: (value: string) => void;
35
+ setPageIndex: (value: number) => void;
36
+ };
37
+ declare function useDataTable<TData>(): DataTableContextValue<TData>;
38
+ declare function DataTableRoot<TData>({ data, columns, children, isLoading, pageSize, getRowId, className, }: DataTableRootProps<TData>): React.JSX.Element;
39
+
40
+ type CellState = "valid" | "invalid" | "pending";
41
+ type DataGridValue = string | number | boolean | null | undefined;
42
+ type DataGridApi<TData extends Record<string, unknown>> = {
43
+ rows: TData[];
44
+ columns: DataGridColumn<TData>[];
45
+ getRowId: (row: TData, index: number) => string;
46
+ getRow: (rowId: string) => TData | undefined;
47
+ getCellValue: (rowId: string, columnId: string) => DataGridValue;
48
+ updateCell: (rowId: string, columnId: string, value: DataGridValue) => void;
49
+ updateRows: (updater: (rows: TData[]) => TData[]) => void;
50
+ };
51
+ type UseDataGridOptions<TData extends Record<string, unknown>> = {
52
+ columnIds?: string[];
53
+ columns?: DataGridColumn<TData>[];
54
+ initialRows?: TData[];
55
+ createEmptyRow?: () => TData;
56
+ getRowId?: (row: TData, index: number) => string;
57
+ };
58
+ declare function useDataGrid<TData extends Record<string, unknown>>({ columnIds, columns, initialRows, getRowId, }?: UseDataGridOptions<TData>): DataGridApi<TData>;
59
+ declare function DataGrid<TData extends Record<string, unknown>>({ grid, children, className, }: {
60
+ grid: DataGridApi<TData>;
61
+ children?: React.ReactNode;
62
+ className?: string;
63
+ }): React.JSX.Element;
64
+ declare function DataGridRow({ row, rowId, children, className, }: {
65
+ row?: Record<string, unknown>;
66
+ rowId?: string;
67
+ children?: React.ReactNode;
68
+ className?: string;
69
+ }): React.JSX.Element;
70
+ type DataGridColumn<TData = Record<string, unknown>> = {
71
+ id: string;
72
+ header?: React.ReactNode;
73
+ accessorKey?: keyof TData & string;
74
+ width?: number;
75
+ };
76
+ declare function DataGridColumn({ column, children, className, }: {
77
+ column: DataGridColumn;
78
+ children?: React.ReactNode;
79
+ className?: string;
80
+ }): React.JSX.Element;
81
+ declare function DataGridCell({ row, rowId, columnId, children, state, className, }: {
82
+ row?: Record<string, unknown>;
83
+ rowId?: string;
84
+ columnId: string;
85
+ children?: React.ReactNode;
86
+ state?: CellState;
87
+ className?: string;
88
+ }): React.JSX.Element;
89
+ declare function GridTextCell({ value, onChange, placeholder, }: {
90
+ value?: string;
91
+ onChange?: (value: string) => void;
92
+ placeholder?: string;
93
+ }): React.JSX.Element;
94
+ declare function GridNumberCell({ value, onChange, }: {
95
+ value?: number;
96
+ onChange?: (value: number) => void;
97
+ }): React.JSX.Element;
98
+ declare function GridComboboxCell({ options, value, onChange, }: {
99
+ options: {
100
+ label: string;
101
+ value: string;
102
+ }[];
103
+ value?: string;
104
+ onChange?: (value: string) => void;
105
+ }): React.JSX.Element;
106
+ declare function DataTableColumnResize(): React.JSX.Element;
107
+ declare function DataGridClipboard({ children, }: {
108
+ children?: React.ReactNode;
109
+ }): React.JSX.Element;
110
+ declare function DataGridFillHandle({ children, }: {
111
+ children?: React.ReactNode;
112
+ }): React.JSX.Element;
113
+ declare function DataGridMove({ children }: {
114
+ children?: React.ReactNode;
115
+ }): React.JSX.Element;
116
+
117
+ export { type CellState as C, type DataGridApi as D, GridComboboxCell as G, type UseDataGridOptions as U, useDataTable as a, DataGrid as b, DataGridCell as c, DataGridClipboard as d, DataGridColumn as e, DataGridFillHandle as f, DataGridMove as g, DataGridRow as h, type DataTableColumn as i, type DataTableColumnDef as j, DataTableColumnResize as k, DataTableRoot as l, type DataTableRootProps as m, GridNumberCell as n, GridTextCell as o, useDataGrid as u };
@@ -1,4 +1,7 @@
1
+ import { D as DataGridApi } from '../data-grid-C0CBtxDL.js';
2
+ export { u as useDataGrid, a as useDataTable } from '../data-grid-C0CBtxDL.js';
1
3
  export { NuqsAdapter } from 'nuqs/adapters/next/app';
4
+ import 'react';
2
5
 
3
6
  declare function useFullscreen(): {
4
7
  toggleFullscreen: () => Promise<void>;
@@ -54,4 +57,58 @@ declare function useSearchParams(): {
54
57
  transactionPage: number;
55
58
  };
56
59
 
57
- export { searchFocus, useFullscreen, useMediaQuery, useMounted, useNative, useSearchParams };
60
+ declare function useDataTablePagination(): {
61
+ pageIndex: number;
62
+ pageSize: number;
63
+ pageCount: number;
64
+ canPreviousPage: boolean;
65
+ canNextPage: boolean;
66
+ goToPage: (value: number) => void;
67
+ previousPage: () => void;
68
+ nextPage: () => void;
69
+ firstPage: () => void;
70
+ lastPage: () => void;
71
+ };
72
+
73
+ declare function useDataTableRows<TData>(): {
74
+ data: TData[];
75
+ rows: TData[];
76
+ pageRows: TData[];
77
+ filteredRows: TData[];
78
+ totalRows: number;
79
+ isLoading: boolean;
80
+ };
81
+
82
+ declare function useDataTableSearch(): {
83
+ search: string;
84
+ setSearch: (value: string) => void;
85
+ clearSearch: () => void;
86
+ };
87
+
88
+ declare function useDataGridClipboard(): {
89
+ copy: (value: string) => Promise<void>;
90
+ read: () => Promise<string>;
91
+ };
92
+
93
+ declare function useDataGridFillHandle(): {
94
+ enabled: boolean;
95
+ };
96
+
97
+ declare function useDataGridMove(): {
98
+ enabled: boolean;
99
+ };
100
+
101
+ declare function useGridChanges<TData extends Record<string, unknown>>(grid: DataGridApi<TData>, options?: {
102
+ initialRows?: TData[];
103
+ }): {
104
+ dirtyRowIds: Set<string>;
105
+ updateCell: (rowId: string, columnId: string, value: unknown) => void;
106
+ getChangeSet: () => {
107
+ created: TData[];
108
+ updated: TData[];
109
+ deleted: TData[];
110
+ };
111
+ reset: () => void;
112
+ };
113
+
114
+ export { searchFocus, useDataGridClipboard, useDataGridFillHandle, useDataGridMove, useDataTablePagination, useDataTableRows, useDataTableSearch, useFullscreen, useGridChanges, useMediaQuery, useMounted, useNative, useSearchParams };
@@ -10,9 +10,14 @@ import {
10
10
  useNative
11
11
  } from "../chunk-RT2YVQ2Y.js";
12
12
  import {
13
+ useDataGrid,
14
+ useDataTable,
15
+ useDataTablePagination,
16
+ useDataTableRows,
17
+ useDataTableSearch,
13
18
  useMediaQuery,
14
19
  useMounted
15
- } from "../chunk-C3RGHTDI.js";
20
+ } from "../chunk-ULUHD3E2.js";
16
21
  import "../chunk-ATPUW3SQ.js";
17
22
 
18
23
  // src/hooks/useSearchParams.ts
@@ -254,10 +259,72 @@ function useSearchParams() {
254
259
  )
255
260
  };
256
261
  }
262
+
263
+ // src/ui/data-table/hooks/use-data-grid-clipboard.ts
264
+ function useDataGridClipboard() {
265
+ return {
266
+ copy: async (value) => navigator.clipboard?.writeText(value),
267
+ read: async () => navigator.clipboard?.readText() ?? ""
268
+ };
269
+ }
270
+
271
+ // src/ui/data-table/hooks/use-data-grid-fill-handle.ts
272
+ function useDataGridFillHandle() {
273
+ return { enabled: true };
274
+ }
275
+
276
+ // src/ui/data-table/hooks/use-data-grid-move.ts
277
+ function useDataGridMove() {
278
+ return { enabled: true };
279
+ }
280
+
281
+ // src/ui/data-table/hooks/use-grid-changes.ts
282
+ import * as React2 from "react";
283
+ function useGridChanges(grid, options = {}) {
284
+ const initialRows = options.initialRows ?? [];
285
+ const [dirtyRowIds, setDirtyRowIds] = React2.useState(/* @__PURE__ */ new Set());
286
+ const updateCell = React2.useCallback(
287
+ (rowId, columnId, value) => {
288
+ grid.updateCell(rowId, columnId, value);
289
+ setDirtyRowIds((current) => new Set(current).add(rowId));
290
+ },
291
+ [grid]
292
+ );
293
+ const getChangeSet = React2.useCallback(() => {
294
+ const created = [];
295
+ const updated = [];
296
+ const initialById = new Map(
297
+ initialRows.map((row, index) => [grid.getRowId(row, index), row])
298
+ );
299
+ for (const row of grid.rows) {
300
+ const rowId = grid.getRowId(row, grid.rows.indexOf(row));
301
+ if (!dirtyRowIds.has(rowId)) continue;
302
+ if (initialById.has(rowId)) updated.push(row);
303
+ else created.push(row);
304
+ }
305
+ return { created, updated, deleted: [] };
306
+ }, [dirtyRowIds, grid, initialRows]);
307
+ const reset = React2.useCallback(() => setDirtyRowIds(/* @__PURE__ */ new Set()), []);
308
+ return {
309
+ dirtyRowIds,
310
+ updateCell,
311
+ getChangeSet,
312
+ reset
313
+ };
314
+ }
257
315
  export {
258
316
  NuqsAdapter,
259
317
  searchFocus,
318
+ useDataGrid,
319
+ useDataGridClipboard,
320
+ useDataGridFillHandle,
321
+ useDataGridMove,
322
+ useDataTable,
323
+ useDataTablePagination,
324
+ useDataTableRows,
325
+ useDataTableSearch,
260
326
  useFullscreen,
327
+ useGridChanges,
261
328
  useMediaQuery,
262
329
  useMounted,
263
330
  useNative,