@wallarm-org/design-system 2.4.0 → 2.5.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.
@@ -50,6 +50,9 @@ export interface TableContextValue<T extends RowData> {
50
50
  onStartReachedThreshold?: number;
51
51
  initialScrollToRowId?: string;
52
52
  onRowReorder?: (event: TableRowReorderEvent) => void;
53
+ getRowCanDrag?: (row: Row<DSTableFeatures, T>) => boolean;
54
+ renderFullWidthGroupRow?: (row: Row<DSTableFeatures, T>) => ReactNode;
55
+ renderFullWidthRow?: (row: Row<DSTableFeatures, T>) => ReactNode | undefined;
53
56
  onMasterCellClick?: (rowId: string) => void;
54
57
  activeRowId: string | null;
55
58
  onSettingsOpenChange?: (open: boolean) => void;
@@ -1,6 +1,17 @@
1
- import { type Ref } from 'react';
1
+ import { type ReactNode, type Ref } from 'react';
2
2
  import type { Row, RowData } from '@tanstack/react-table';
3
3
  import { type DSTableFeatures } from './lib/index.js';
4
+ interface TableFullWidthCellProps {
5
+ colSpan: number;
6
+ lastRow?: boolean;
7
+ dropIndicator?: 'above' | 'below';
8
+ children: ReactNode;
9
+ }
10
+ /**
11
+ * One cell spanning every data column — the body of a full-width row
12
+ * (`renderFullWidthRow`) or of a full-width group row (`groupRowSpan: 'full'`).
13
+ */
14
+ export declare const TableFullWidthCell: ({ colSpan, lastRow, dropIndicator, children, }: TableFullWidthCellProps) => import("react").JSX.Element;
4
15
  interface TableRowProps<T extends RowData> {
5
16
  row: Row<DSTableFeatures, T>;
6
17
  ref?: Ref<HTMLTableRowElement>;
@@ -4,7 +4,7 @@ import { memo } from "react";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  import { useTestId } from "../../utils/testId.js";
6
6
  import { DROP_INDICATOR_BASE } from "./classes.js";
7
- import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_SELECT_COLUMN_ID, isGroupRow, useRowDnd, useTableValue, withTableState } from "./lib/index.js";
7
+ import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_EXPAND_COLUMN_ID, TABLE_SELECT_COLUMN_ID, isGroupRow, useRenderEveryTime, useRowDnd, useTableValue, withTableState } from "./lib/index.js";
8
8
  import { Td, Tr } from "./primitives/index.js";
9
9
  import { TableBodyCell } from "./TableBody/TableBodyCell.js";
10
10
  import { useRowDndIndicator } from "./TableBody/TableBodyRowDndContext.js";
@@ -15,10 +15,51 @@ const SYSTEM_COLUMN_IDS = new Set([
15
15
  TABLE_SELECT_COLUMN_ID,
16
16
  TABLE_DRAG_HANDLE_COLUMN_ID
17
17
  ]);
18
+ const TableFullWidthCell = (t0)=>{
19
+ const $ = compiler_runtime_c(12);
20
+ const { colSpan, lastRow, dropIndicator, children } = t0;
21
+ const t1 = dropIndicator && DROP_INDICATOR_BASE;
22
+ const t2 = "above" === dropIndicator && "after:top-0";
23
+ const t3 = "below" === dropIndicator && "after:-bottom-px";
24
+ let t4;
25
+ if ($[0] !== t1 || $[1] !== t2 || $[2] !== t3) {
26
+ t4 = cn("align-middle", t1, t2, t3);
27
+ $[0] = t1;
28
+ $[1] = t2;
29
+ $[2] = t3;
30
+ $[3] = t4;
31
+ } else t4 = $[3];
32
+ let t5;
33
+ if ($[4] !== dropIndicator) {
34
+ t5 = dropIndicator ? {
35
+ overflow: "visible"
36
+ } : void 0;
37
+ $[4] = dropIndicator;
38
+ $[5] = t5;
39
+ } else t5 = $[5];
40
+ let t6;
41
+ if ($[6] !== children || $[7] !== colSpan || $[8] !== lastRow || $[9] !== t4 || $[10] !== t5) {
42
+ t6 = /*#__PURE__*/ jsx(Td, {
43
+ pinned: false,
44
+ lastRow: lastRow,
45
+ colSpan: colSpan,
46
+ className: t4,
47
+ style: t5,
48
+ children: children
49
+ });
50
+ $[6] = children;
51
+ $[7] = colSpan;
52
+ $[8] = lastRow;
53
+ $[9] = t4;
54
+ $[10] = t5;
55
+ $[11] = t6;
56
+ } else t6 = $[11];
57
+ return t6;
58
+ };
18
59
  const TableRowInner = (t0)=>{
19
- const $ = compiler_runtime_c(97);
60
+ const $ = compiler_runtime_c(112);
20
61
  const { row, ref, "data-index": dataIndex } = t0;
21
- const { table, expandingEnabled, activeRowId, isLoading, renderExpandedRow, stretch, hasSubRowGrouping, showEmptyGroups, allLeafColumns } = useTableContext();
62
+ const { table, expandingEnabled, activeRowId, isLoading, renderExpandedRow, stretch, hasSubRowGrouping, showEmptyGroups, allLeafColumns, renderFullWidthGroupRow, renderFullWidthRow } = useTableContext();
22
63
  const testId = useTestId("row");
23
64
  const { canDnd, isDragging, setNodeRef, style: dndStyle, attributes, listeners } = useRowDnd(row);
24
65
  const { activeId, overId } = useRowDndIndicator();
@@ -63,23 +104,34 @@ const TableRowInner = (t0)=>{
63
104
  } else t5 = $[11];
64
105
  const isLastModelRow = useTableValue(t5);
65
106
  const isPreviewActive = activeRowId === row.id;
107
+ let t6;
108
+ if ($[12] !== isGroupParent || $[13] !== renderFullWidthGroupRow || $[14] !== renderFullWidthRow || $[15] !== row) {
109
+ t6 = ()=>isGroupParent ? renderFullWidthGroupRow?.(row) : renderFullWidthRow?.(row);
110
+ $[12] = isGroupParent;
111
+ $[13] = renderFullWidthGroupRow;
112
+ $[14] = renderFullWidthRow;
113
+ $[15] = row;
114
+ $[16] = t6;
115
+ } else t6 = $[16];
116
+ const fullWidthContent = useRenderEveryTime(t6);
117
+ const isFullWidth = void 0 !== fullWidthContent;
66
118
  const isLastTableRow = !isLoading && isLastModelRow;
67
119
  const hasExpandedContent = expandingEnabled && !!renderExpandedRow && isExpanded;
68
120
  const isLastRow = isLastTableRow && !hasExpandedContent;
69
121
  const isLastRowExpanded = isLastTableRow && hasExpandedContent;
70
- let t6;
71
- if ($[12] !== canDnd || $[13] !== ref || $[14] !== setNodeRef) {
72
- t6 = (node)=>{
122
+ let t7;
123
+ if ($[17] !== canDnd || $[18] !== ref || $[19] !== setNodeRef) {
124
+ t7 = (node)=>{
73
125
  if (canDnd) setNodeRef(node);
74
126
  if ("function" == typeof ref) ref(node);
75
127
  else if (ref) ref.current = node;
76
128
  };
77
- $[12] = canDnd;
78
- $[13] = ref;
79
- $[14] = setNodeRef;
80
- $[15] = t6;
81
- } else t6 = $[15];
82
- const composedRef = t6;
129
+ $[17] = canDnd;
130
+ $[18] = ref;
131
+ $[19] = setNodeRef;
132
+ $[20] = t7;
133
+ } else t7 = $[20];
134
+ const composedRef = t7;
83
135
  if (isGroupParent) {
84
136
  let T0;
85
137
  let t10;
@@ -91,171 +143,183 @@ const TableRowInner = (t0)=>{
91
143
  let t16;
92
144
  let t17;
93
145
  let t18;
94
- let t7;
146
+ let t19;
147
+ let t20;
95
148
  let t8;
96
149
  let t9;
97
- if ($[16] !== allLeafColumns || $[17] !== cells || $[18] !== composedRef || $[19] !== dataIndex || $[20] !== hasSubRowGrouping || $[21] !== isExpanded || $[22] !== isLastRow || $[23] !== isPreviewActive || $[24] !== isSelected || $[25] !== row.id || $[26] !== table.state || $[27] !== testId) {
150
+ if ($[21] !== allLeafColumns || $[22] !== cells || $[23] !== composedRef || $[24] !== dataIndex || $[25] !== fullWidthContent || $[26] !== hasSubRowGrouping || $[27] !== isExpanded || $[28] !== isFullWidth || $[29] !== isLastRow || $[30] !== isPreviewActive || $[31] !== isSelected || $[32] !== row.id || $[33] !== table.state || $[34] !== testId) {
98
151
  const systemCells = cells.filter(_temp);
99
152
  const dataCells = cells.filter(_temp2);
100
153
  const firstDataCell = dataCells[0];
101
- let t19;
102
- if ($[41] !== allLeafColumns || $[42] !== hasSubRowGrouping || $[43] !== isExpanded) {
103
- t19 = hasSubRowGrouping && isExpanded ? {
154
+ let t21;
155
+ if ($[49] !== allLeafColumns || $[50] !== hasSubRowGrouping || $[51] !== isExpanded) {
156
+ t21 = hasSubRowGrouping && isExpanded ? {
104
157
  position: "sticky",
105
158
  top: allLeafColumns.some(_temp3) ? 48 : 32,
106
159
  zIndex: 20
107
160
  } : void 0;
108
- $[41] = allLeafColumns;
109
- $[42] = hasSubRowGrouping;
110
- $[43] = isExpanded;
111
- $[44] = t19;
112
- } else t19 = $[44];
113
- const stickyStyle = t19;
161
+ $[49] = allLeafColumns;
162
+ $[50] = hasSubRowGrouping;
163
+ $[51] = isExpanded;
164
+ $[52] = t21;
165
+ } else t21 = $[52];
166
+ const stickyStyle = t21;
114
167
  T0 = Tr;
115
- t7 = composedRef;
116
- t8 = dataIndex;
117
- t9 = row.id;
118
- t10 = testId;
119
- t11 = "group/row";
120
- t12 = isSelected || void 0;
121
- t13 = isPreviewActive || void 0;
122
- t14 = isSelected || void 0;
123
- t15 = stickyStyle;
124
- let t20;
125
- if ($[45] !== isLastRow) {
126
- t20 = (cell)=>/*#__PURE__*/ jsx(TableBodyCell, {
168
+ t8 = composedRef;
169
+ t9 = dataIndex;
170
+ t10 = row.id;
171
+ t11 = testId;
172
+ t12 = "group/row";
173
+ t13 = isSelected || void 0;
174
+ t14 = isPreviewActive || void 0;
175
+ t15 = isSelected || void 0;
176
+ t16 = stickyStyle;
177
+ let t22;
178
+ if ($[53] !== isLastRow) {
179
+ t22 = (cell)=>/*#__PURE__*/ jsx(TableBodyCell, {
127
180
  cell: cell,
128
181
  disablePinnedShadow: true,
129
182
  lastRow: isLastRow
130
183
  }, cell.id);
131
- $[45] = isLastRow;
132
- $[46] = t20;
133
- } else t20 = $[46];
134
- t16 = systemCells.map(t20);
135
- t17 = firstDataCell && /*#__PURE__*/ jsx(TableBodyCell, {
184
+ $[53] = isLastRow;
185
+ $[54] = t22;
186
+ } else t22 = $[54];
187
+ t17 = systemCells.map(t22);
188
+ t18 = isFullWidth && /*#__PURE__*/ jsx(TableFullWidthCell, {
189
+ colSpan: dataCells.length,
190
+ lastRow: isLastRow,
191
+ children: fullWidthContent
192
+ });
193
+ t19 = !isFullWidth && firstDataCell && /*#__PURE__*/ jsx(TableBodyCell, {
136
194
  cell: firstDataCell,
137
195
  className: "border-r-0",
138
196
  disablePinnedShadow: true,
139
197
  lastRow: isLastRow
140
198
  });
141
- t18 = withTableState(table.state, ()=>dataCells.slice(1).map((cell_0)=>/*#__PURE__*/ jsx(Td, {
199
+ t20 = withTableState(table.state, ()=>(isFullWidth ? [] : dataCells).slice(1).map((cell_0)=>/*#__PURE__*/ jsx(Td, {
142
200
  className: cn("border-b border-border-primary-light bg-bg-surface-2 overlay", "group-hover/row:overlay-states-primary-hover group-data-[selected]/row:overlay-states-primary-active", "group-data-[preview-active]/row:overlay-states-primary-hover group-has-[[data-state=open]]/row:overlay-states-primary-hover", isLastRow && "border-b-0"),
143
201
  style: {
144
202
  width: cell_0.column.getSize()
145
203
  },
146
204
  "aria-hidden": "true"
147
205
  }, cell_0.id)));
148
- $[16] = allLeafColumns;
149
- $[17] = cells;
150
- $[18] = composedRef;
151
- $[19] = dataIndex;
152
- $[20] = hasSubRowGrouping;
153
- $[21] = isExpanded;
154
- $[22] = isLastRow;
155
- $[23] = isPreviewActive;
156
- $[24] = isSelected;
157
- $[25] = row.id;
158
- $[26] = table.state;
159
- $[27] = testId;
160
- $[28] = T0;
161
- $[29] = t10;
162
- $[30] = t11;
163
- $[31] = t12;
164
- $[32] = t13;
165
- $[33] = t14;
166
- $[34] = t15;
167
- $[35] = t16;
168
- $[36] = t17;
169
- $[37] = t18;
170
- $[38] = t7;
171
- $[39] = t8;
172
- $[40] = t9;
206
+ $[21] = allLeafColumns;
207
+ $[22] = cells;
208
+ $[23] = composedRef;
209
+ $[24] = dataIndex;
210
+ $[25] = fullWidthContent;
211
+ $[26] = hasSubRowGrouping;
212
+ $[27] = isExpanded;
213
+ $[28] = isFullWidth;
214
+ $[29] = isLastRow;
215
+ $[30] = isPreviewActive;
216
+ $[31] = isSelected;
217
+ $[32] = row.id;
218
+ $[33] = table.state;
219
+ $[34] = testId;
220
+ $[35] = T0;
221
+ $[36] = t10;
222
+ $[37] = t11;
223
+ $[38] = t12;
224
+ $[39] = t13;
225
+ $[40] = t14;
226
+ $[41] = t15;
227
+ $[42] = t16;
228
+ $[43] = t17;
229
+ $[44] = t18;
230
+ $[45] = t19;
231
+ $[46] = t20;
232
+ $[47] = t8;
233
+ $[48] = t9;
173
234
  } else {
174
- T0 = $[28];
175
- t10 = $[29];
176
- t11 = $[30];
177
- t12 = $[31];
178
- t13 = $[32];
179
- t14 = $[33];
180
- t15 = $[34];
181
- t16 = $[35];
182
- t17 = $[36];
183
- t18 = $[37];
184
- t7 = $[38];
185
- t8 = $[39];
186
- t9 = $[40];
235
+ T0 = $[35];
236
+ t10 = $[36];
237
+ t11 = $[37];
238
+ t12 = $[38];
239
+ t13 = $[39];
240
+ t14 = $[40];
241
+ t15 = $[41];
242
+ t16 = $[42];
243
+ t17 = $[43];
244
+ t18 = $[44];
245
+ t19 = $[45];
246
+ t20 = $[46];
247
+ t8 = $[47];
248
+ t9 = $[48];
187
249
  }
188
- let t19;
189
- if ($[47] !== stretch) {
190
- t19 = !stretch && /*#__PURE__*/ jsx(Td, {
250
+ let t21;
251
+ if ($[55] !== stretch) {
252
+ t21 = !stretch && /*#__PURE__*/ jsx(Td, {
191
253
  pinned: false,
192
254
  "aria-hidden": true
193
255
  });
194
- $[47] = stretch;
195
- $[48] = t19;
196
- } else t19 = $[48];
197
- let t20;
198
- if ($[49] !== T0 || $[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t13 || $[54] !== t14 || $[55] !== t15 || $[56] !== t16 || $[57] !== t17 || $[58] !== t18 || $[59] !== t19 || $[60] !== t7 || $[61] !== t8 || $[62] !== t9) {
199
- t20 = /*#__PURE__*/ jsxs(T0, {
200
- ref: t7,
201
- "data-index": t8,
202
- "data-row-id": t9,
203
- "data-testid": t10,
204
- className: t11,
205
- "data-selected": t12,
206
- "data-preview-active": t13,
207
- "aria-selected": t14,
208
- style: t15,
256
+ $[55] = stretch;
257
+ $[56] = t21;
258
+ } else t21 = $[56];
259
+ let t22;
260
+ if ($[57] !== T0 || $[58] !== t10 || $[59] !== t11 || $[60] !== t12 || $[61] !== t13 || $[62] !== t14 || $[63] !== t15 || $[64] !== t16 || $[65] !== t17 || $[66] !== t18 || $[67] !== t19 || $[68] !== t20 || $[69] !== t21 || $[70] !== t8 || $[71] !== t9) {
261
+ t22 = /*#__PURE__*/ jsxs(T0, {
262
+ ref: t8,
263
+ "data-index": t9,
264
+ "data-row-id": t10,
265
+ "data-testid": t11,
266
+ className: t12,
267
+ "data-selected": t13,
268
+ "data-preview-active": t14,
269
+ "aria-selected": t15,
270
+ style: t16,
209
271
  children: [
210
- t16,
211
272
  t17,
212
273
  t18,
213
- t19
274
+ t19,
275
+ t20,
276
+ t21
214
277
  ]
215
278
  });
216
- $[49] = T0;
217
- $[50] = t10;
218
- $[51] = t11;
219
- $[52] = t12;
220
- $[53] = t13;
221
- $[54] = t14;
222
- $[55] = t15;
223
- $[56] = t16;
224
- $[57] = t17;
225
- $[58] = t18;
226
- $[59] = t19;
227
- $[60] = t7;
228
- $[61] = t8;
229
- $[62] = t9;
230
- $[63] = t20;
231
- } else t20 = $[63];
232
- let t21;
233
- if ($[64] !== expandingEnabled || $[65] !== isLastRowExpanded || $[66] !== row) {
234
- t21 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
279
+ $[57] = T0;
280
+ $[58] = t10;
281
+ $[59] = t11;
282
+ $[60] = t12;
283
+ $[61] = t13;
284
+ $[62] = t14;
285
+ $[63] = t15;
286
+ $[64] = t16;
287
+ $[65] = t17;
288
+ $[66] = t18;
289
+ $[67] = t19;
290
+ $[68] = t20;
291
+ $[69] = t21;
292
+ $[70] = t8;
293
+ $[71] = t9;
294
+ $[72] = t22;
295
+ } else t22 = $[72];
296
+ let t23;
297
+ if ($[73] !== expandingEnabled || $[74] !== isLastRowExpanded || $[75] !== row) {
298
+ t23 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
235
299
  row: row,
236
300
  lastRow: isLastRowExpanded
237
301
  });
238
- $[64] = expandingEnabled;
239
- $[65] = isLastRowExpanded;
240
- $[66] = row;
241
- $[67] = t21;
242
- } else t21 = $[67];
243
- let t22;
244
- if ($[68] !== t20 || $[69] !== t21) {
245
- t22 = /*#__PURE__*/ jsxs(Fragment, {
302
+ $[73] = expandingEnabled;
303
+ $[74] = isLastRowExpanded;
304
+ $[75] = row;
305
+ $[76] = t23;
306
+ } else t23 = $[76];
307
+ let t24;
308
+ if ($[77] !== t22 || $[78] !== t23) {
309
+ t24 = /*#__PURE__*/ jsxs(Fragment, {
246
310
  children: [
247
- t20,
248
- t21
311
+ t22,
312
+ t23
249
313
  ]
250
314
  });
251
- $[68] = t20;
252
- $[69] = t21;
253
- $[70] = t22;
254
- } else t22 = $[70];
255
- return t22;
315
+ $[77] = t22;
316
+ $[78] = t23;
317
+ $[79] = t24;
318
+ } else t24 = $[79];
319
+ return t24;
256
320
  }
257
- let t7;
258
- if ($[71] !== activeId || $[72] !== attributes || $[73] !== cells || $[74] !== composedRef || $[75] !== dataIndex || $[76] !== dndStyle || $[77] !== isDragging || $[78] !== isLastRow || $[79] !== isPreviewActive || $[80] !== isSelected || $[81] !== listeners || $[82] !== overId || $[83] !== row.depth || $[84] !== row.id || $[85] !== stretch || $[86] !== table || $[87] !== testId) {
321
+ let t8;
322
+ if ($[80] !== activeId || $[81] !== attributes || $[82] !== canDnd || $[83] !== cells || $[84] !== composedRef || $[85] !== dataIndex || $[86] !== dndStyle || $[87] !== fullWidthContent || $[88] !== isDragging || $[89] !== isFullWidth || $[90] !== isLastRow || $[91] !== isPreviewActive || $[92] !== isSelected || $[93] !== listeners || $[94] !== overId || $[95] !== row.depth || $[96] !== row.id || $[97] !== stretch || $[98] !== table || $[99] !== testId) {
259
323
  let dropIndicator;
260
324
  if (overId === row.id && null != activeId && activeId !== row.id) {
261
325
  const modelRows = table.getRowModel().rows;
@@ -263,7 +327,14 @@ const TableRowInner = (t0)=>{
263
327
  const overIndex = modelRows.findIndex((r_0)=>r_0.id === row.id);
264
328
  if (-1 !== activeIndex && -1 !== overIndex) dropIndicator = activeIndex < overIndex ? "below" : "above";
265
329
  }
266
- t7 = /*#__PURE__*/ jsxs(Tr, {
330
+ let t9;
331
+ if ($[101] !== cells || $[102] !== isFullWidth) {
332
+ t9 = isFullWidth ? cells.filter(_temp4) : cells;
333
+ $[101] = cells;
334
+ $[102] = isFullWidth;
335
+ $[103] = t9;
336
+ } else t9 = $[103];
337
+ t8 = /*#__PURE__*/ jsxs(Tr, {
267
338
  ref: composedRef,
268
339
  "data-index": dataIndex,
269
340
  "data-row-id": row.id,
@@ -276,16 +347,23 @@ const TableRowInner = (t0)=>{
276
347
  "data-depth": row.depth > 0 ? row.depth : void 0,
277
348
  style: dndStyle,
278
349
  children: [
279
- cells.map((cell_1)=>{
280
- const isDragHandle = cell_1.column.id === TABLE_DRAG_HANDLE_COLUMN_ID;
350
+ t9.map((cell_1)=>{
351
+ const isDragHandle = canDnd && cell_1.column.id === TABLE_DRAG_HANDLE_COLUMN_ID;
281
352
  return /*#__PURE__*/ jsx(TableBodyCell, {
282
353
  cell: cell_1,
283
354
  dragListeners: isDragHandle ? listeners : void 0,
284
355
  dragAttributes: isDragHandle ? attributes : void 0,
356
+ disablePinnedShadow: isFullWidth,
285
357
  lastRow: isLastRow,
286
358
  dropIndicator: dropIndicator
287
359
  }, cell_1.id);
288
360
  }),
361
+ isFullWidth && /*#__PURE__*/ jsx(TableFullWidthCell, {
362
+ colSpan: cells.filter(_temp5).length,
363
+ lastRow: isLastRow,
364
+ dropIndicator: dropIndicator,
365
+ children: fullWidthContent
366
+ }),
289
367
  !stretch && /*#__PURE__*/ jsx(Td, {
290
368
  pinned: false,
291
369
  "aria-hidden": true,
@@ -296,51 +374,54 @@ const TableRowInner = (t0)=>{
296
374
  })
297
375
  ]
298
376
  });
299
- $[71] = activeId;
300
- $[72] = attributes;
301
- $[73] = cells;
302
- $[74] = composedRef;
303
- $[75] = dataIndex;
304
- $[76] = dndStyle;
305
- $[77] = isDragging;
306
- $[78] = isLastRow;
307
- $[79] = isPreviewActive;
308
- $[80] = isSelected;
309
- $[81] = listeners;
310
- $[82] = overId;
311
- $[83] = row.depth;
312
- $[84] = row.id;
313
- $[85] = stretch;
314
- $[86] = table;
315
- $[87] = testId;
316
- $[88] = t7;
317
- } else t7 = $[88];
318
- let t8;
319
- if ($[89] !== dndStyle || $[90] !== expandingEnabled || $[91] !== isLastRowExpanded || $[92] !== row) {
320
- t8 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
377
+ $[80] = activeId;
378
+ $[81] = attributes;
379
+ $[82] = canDnd;
380
+ $[83] = cells;
381
+ $[84] = composedRef;
382
+ $[85] = dataIndex;
383
+ $[86] = dndStyle;
384
+ $[87] = fullWidthContent;
385
+ $[88] = isDragging;
386
+ $[89] = isFullWidth;
387
+ $[90] = isLastRow;
388
+ $[91] = isPreviewActive;
389
+ $[92] = isSelected;
390
+ $[93] = listeners;
391
+ $[94] = overId;
392
+ $[95] = row.depth;
393
+ $[96] = row.id;
394
+ $[97] = stretch;
395
+ $[98] = table;
396
+ $[99] = testId;
397
+ $[100] = t8;
398
+ } else t8 = $[100];
399
+ let t9;
400
+ if ($[104] !== dndStyle || $[105] !== expandingEnabled || $[106] !== isLastRowExpanded || $[107] !== row) {
401
+ t9 = expandingEnabled && /*#__PURE__*/ jsx(TableRowExpanded, {
321
402
  row: row,
322
403
  dndStyle: dndStyle,
323
404
  lastRow: isLastRowExpanded
324
405
  });
325
- $[89] = dndStyle;
326
- $[90] = expandingEnabled;
327
- $[91] = isLastRowExpanded;
328
- $[92] = row;
329
- $[93] = t8;
330
- } else t8 = $[93];
331
- let t9;
332
- if ($[94] !== t7 || $[95] !== t8) {
333
- t9 = /*#__PURE__*/ jsxs(Fragment, {
406
+ $[104] = dndStyle;
407
+ $[105] = expandingEnabled;
408
+ $[106] = isLastRowExpanded;
409
+ $[107] = row;
410
+ $[108] = t9;
411
+ } else t9 = $[108];
412
+ let t10;
413
+ if ($[109] !== t8 || $[110] !== t9) {
414
+ t10 = /*#__PURE__*/ jsxs(Fragment, {
334
415
  children: [
335
- t7,
336
- t8
416
+ t8,
417
+ t9
337
418
  ]
338
419
  });
339
- $[94] = t7;
340
- $[95] = t8;
341
- $[96] = t9;
342
- } else t9 = $[96];
343
- return t9;
420
+ $[109] = t8;
421
+ $[110] = t9;
422
+ $[111] = t10;
423
+ } else t10 = $[111];
424
+ return t10;
344
425
  };
345
426
  TableRowInner.displayName = "TableRow";
346
427
  const TableRow = /*#__PURE__*/ memo(TableRowInner);
@@ -353,4 +434,10 @@ function _temp2(c_0) {
353
434
  function _temp3(c_1) {
354
435
  return c_1.columnDef.meta?.description?.type === "text";
355
436
  }
356
- export { TableRow };
437
+ function _temp4(c_2) {
438
+ return SYSTEM_COLUMN_IDS.has(c_2.column.id);
439
+ }
440
+ function _temp5(c_3) {
441
+ return !SYSTEM_COLUMN_IDS.has(c_3.column.id);
442
+ }
443
+ export { TableFullWidthCell, TableRow };
@@ -1,32 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
2
  import { GripVertical } from "../../../icons/index.js";
4
- import { useTableContext } from "../TableContext/useTableContext.js";
5
3
  import { TABLE_DRAG_HANDLE_COLUMN_ID, TABLE_DRAG_HANDLE_COLUMN_WIDTH } from "./constants.js";
6
- import { isGroupRow } from "./isGroupRow.js";
7
- import { useTableValue } from "./tableReactivity.js";
4
+ import { useRowCanDrag } from "./useRowDnd.js";
8
5
  const DragHandle = (t0)=>{
9
- const $ = c(5);
10
6
  const { row } = t0;
11
- const { showEmptyGroups } = useTableContext();
12
- let t1;
13
- if ($[0] !== row || $[1] !== showEmptyGroups) {
14
- t1 = ()=>isGroupRow(row, showEmptyGroups);
15
- $[0] = row;
16
- $[1] = showEmptyGroups;
17
- $[2] = t1;
18
- } else t1 = $[2];
19
- const isGroup = useTableValue(t1);
20
- let t2;
21
- if ($[3] !== isGroup) {
22
- t2 = isGroup ? null : /*#__PURE__*/ jsx(GripVertical, {
23
- size: "sm",
24
- className: "text-text-secondary"
25
- });
26
- $[3] = isGroup;
27
- $[4] = t2;
28
- } else t2 = $[4];
29
- return t2;
7
+ return useRowCanDrag(row) ? /*#__PURE__*/ jsx(GripVertical, {
8
+ size: "sm",
9
+ className: "text-text-secondary"
10
+ }) : null;
30
11
  };
31
12
  const createDragHandleColumn = ()=>({
32
13
  id: TABLE_DRAG_HANDLE_COLUMN_ID,
@@ -11,5 +11,7 @@ export interface UseRowDndResult {
11
11
  attributes: UseSortableReturn['attributes'];
12
12
  listeners: UseSortableReturn['listeners'];
13
13
  }
14
+ /** Whether the row can be dragged: never a group row, and only if `getRowCanDrag` allows it. */
15
+ export declare const useRowCanDrag: <T extends RowData>(row: Row<DSTableFeatures, T>) => boolean;
14
16
  export declare const useRowDnd: <T extends RowData>(row: Row<DSTableFeatures, T>) => UseRowDndResult;
15
17
  export {};