@ncds/ui-admin 1.8.9 → 1.8.12

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.
Files changed (44) hide show
  1. package/dist/cjs/src/components/data-display/data-grid/DataGrid.js +3 -1
  2. package/dist/cjs/src/components/data-display/table/Table.js +326 -75
  3. package/dist/cjs/src/components/data-display/table/dnd-context.js +15 -0
  4. package/dist/cjs/src/components/data-display/table/dnd-preview.js +127 -0
  5. package/dist/cjs/src/components/index.js +11 -0
  6. package/dist/cjs/src/components/navigation/context-tab/ContextTab.js +233 -0
  7. package/dist/cjs/src/components/navigation/context-tab/index.js +16 -0
  8. package/dist/cjs/src/components/navigation/context-tab/useContextTabScroll.js +84 -0
  9. package/dist/esm/src/components/data-display/data-grid/DataGrid.js +3 -1
  10. package/dist/esm/src/components/data-display/table/Table.js +328 -77
  11. package/dist/esm/src/components/data-display/table/dnd-context.js +10 -0
  12. package/dist/esm/src/components/data-display/table/dnd-preview.js +121 -0
  13. package/dist/esm/src/components/index.js +1 -0
  14. package/dist/esm/src/components/navigation/context-tab/ContextTab.js +226 -0
  15. package/dist/esm/src/components/navigation/context-tab/index.js +1 -0
  16. package/dist/esm/src/components/navigation/context-tab/useContextTabScroll.js +77 -0
  17. package/dist/temp/src/components/data-display/data-grid/DataGrid.js +1 -1
  18. package/dist/temp/src/components/data-display/data-grid/DataGrid.types.d.ts +5 -0
  19. package/dist/temp/src/components/data-display/table/Table.d.ts +14 -4
  20. package/dist/temp/src/components/data-display/table/Table.js +172 -14
  21. package/dist/temp/src/components/data-display/table/dnd-context.d.ts +12 -0
  22. package/dist/temp/src/components/data-display/table/dnd-context.js +10 -0
  23. package/dist/temp/src/components/data-display/table/dnd-preview.d.ts +6 -0
  24. package/dist/temp/src/components/data-display/table/dnd-preview.js +120 -0
  25. package/dist/temp/src/components/data-display/table/types.d.ts +24 -1
  26. package/dist/temp/src/components/index.d.ts +1 -0
  27. package/dist/temp/src/components/index.js +1 -0
  28. package/dist/temp/src/components/navigation/context-tab/ContextTab.d.ts +18 -0
  29. package/dist/temp/src/components/navigation/context-tab/ContextTab.js +103 -0
  30. package/dist/temp/src/components/navigation/context-tab/index.d.ts +1 -0
  31. package/dist/temp/src/components/navigation/context-tab/index.js +1 -0
  32. package/dist/temp/src/components/navigation/context-tab/useContextTabScroll.d.ts +22 -0
  33. package/dist/temp/src/components/navigation/context-tab/useContextTabScroll.js +65 -0
  34. package/dist/types/src/components/data-display/data-grid/DataGrid.types.d.ts +5 -0
  35. package/dist/types/src/components/data-display/table/Table.d.ts +14 -4
  36. package/dist/types/src/components/data-display/table/dnd-context.d.ts +12 -0
  37. package/dist/types/src/components/data-display/table/dnd-preview.d.ts +6 -0
  38. package/dist/types/src/components/data-display/table/types.d.ts +24 -1
  39. package/dist/types/src/components/index.d.ts +1 -0
  40. package/dist/types/src/components/navigation/context-tab/ContextTab.d.ts +18 -0
  41. package/dist/types/src/components/navigation/context-tab/index.d.ts +1 -0
  42. package/dist/types/src/components/navigation/context-tab/useContextTabScroll.d.ts +22 -0
  43. package/dist/ui-admin/assets/styles/style.css +324 -2
  44. package/package.json +2 -2
@@ -82,7 +82,8 @@ const DataGridTable = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
82
82
  hoverable,
83
83
  selectable,
84
84
  horizontalScroll,
85
- minWidth
85
+ minWidth,
86
+ draggable
86
87
  } = _ref5;
87
88
  return (0, _jsxRuntime.jsx)("div", {
88
89
  ref: ref,
@@ -96,6 +97,7 @@ const DataGridTable = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
96
97
  selectable: selectable,
97
98
  horizontalScroll: horizontalScroll,
98
99
  minWidth: minWidth,
100
+ draggable: draggable,
99
101
  children: children
100
102
  })
101
103
  });
@@ -5,10 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Table = void 0;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
+ var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
9
+ var _disableNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview");
10
+ var _element = require("@atlaskit/pragmatic-drag-and-drop-auto-scroll/element");
11
+ var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
8
12
  var _uiAdminIcon = require("@ncds/ui-admin-icon");
9
13
  var _classnames = _interopRequireDefault(require("classnames"));
10
14
  var _react = require("react");
11
15
  var _FloatingContext = require("../../../contexts/FloatingContext");
16
+ var _dndContext = require("./dnd-context");
17
+ var _dndPreview = require("./dnd-preview");
12
18
  var _useTableScrollbars = require("./useTableScrollbars");
13
19
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
20
  // 가로 스크롤 디자인 기준 폭 — 14인치 모니터 + LNB 고려한 디자인 권장 너비
@@ -50,35 +56,254 @@ Header.displayName = 'Table.Header';
50
56
  const Body = _ref2 => {
51
57
  let {
52
58
  children,
53
- className
59
+ className,
60
+ onRowDrop
54
61
  } = _ref2;
62
+ const {
63
+ tableId
64
+ } = (0, _react.useContext)(_dndContext.TableDndContext);
65
+ // onRowDrop 참조를 ref로 유지 — 콜백이 매 렌더마다 재생성되어도 effect가 재구독하지 않도록
66
+ const onRowDropRef = (0, _react.useRef)(onRowDrop);
67
+ onRowDropRef.current = onRowDrop;
68
+ (0, _react.useEffect)(() => {
69
+ return (0, _adapter.monitorForElements)({
70
+ canMonitor: _ref3 => {
71
+ let {
72
+ source
73
+ } = _ref3;
74
+ return source.data.tableId === tableId;
75
+ },
76
+ onDrop: _ref4 => {
77
+ let {
78
+ source,
79
+ location
80
+ } = _ref4;
81
+ if (!onRowDropRef.current) return;
82
+ const target = location.current.dropTargets[0];
83
+ if (!target) return;
84
+ const fromId = source.data.id;
85
+ const toId = target.data.id;
86
+ if (typeof fromId !== 'string' || typeof toId !== 'string' || fromId === toId) return;
87
+ const edge = (0, _closestEdge.extractClosestEdge)(target.data);
88
+ onRowDropRef.current(fromId, toId, edge === 'bottom' ? 'bottom' : 'top');
89
+ }
90
+ });
91
+ }, [tableId]);
55
92
  return (0, _jsxRuntime.jsx)("tbody", {
56
93
  className: (0, _classnames.default)('ncua-table__body', className),
57
94
  children: children
58
95
  });
59
96
  };
60
97
  Body.displayName = 'Table.Body';
61
- const Row = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
98
+ const Row = /*#__PURE__*/(0, _react.forwardRef)((_ref5, forwardedRef) => {
62
99
  let {
63
100
  children,
64
101
  className,
65
102
  selected,
66
103
  status,
104
+ dragId,
67
105
  ...rest
68
- } = _ref3;
69
- return (0, _jsxRuntime.jsx)("tr", {
70
- ref: ref,
71
- className: (0, _classnames.default)('ncua-table__row', className, {
72
- 'ncua-table__row--selected': selected,
73
- 'ncua-table__row--warning': status === 'warning',
74
- 'ncua-table__row--error': status === 'error'
75
- }),
76
- ...rest,
77
- children: children
106
+ } = _ref5;
107
+ const {
108
+ isDraggable,
109
+ tableId
110
+ } = (0, _react.useContext)(_dndContext.TableDndContext);
111
+ const internalRef = (0, _react.useRef)(null);
112
+ const [closestEdge, setClosestEdge] = (0, _react.useState)(null);
113
+ const [isDragging, setIsDragging] = (0, _react.useState)(false);
114
+ const setRef = (0, _react.useCallback)(el => {
115
+ internalRef.current = el;
116
+ if (typeof forwardedRef === 'function') {
117
+ forwardedRef(el);
118
+ } else if (forwardedRef) {
119
+ forwardedRef.current = el;
120
+ }
121
+ }, [forwardedRef]);
122
+ (0, _react.useEffect)(() => {
123
+ if (!isDraggable || !dragId || !internalRef.current) return;
124
+ return (0, _adapter.dropTargetForElements)({
125
+ element: internalRef.current,
126
+ getData: _ref6 => {
127
+ let {
128
+ input,
129
+ element
130
+ } = _ref6;
131
+ return (0, _closestEdge.attachClosestEdge)({
132
+ id: dragId,
133
+ tableId
134
+ }, {
135
+ input,
136
+ element,
137
+ allowedEdges: ['top', 'bottom']
138
+ });
139
+ },
140
+ onDragEnter: _ref7 => {
141
+ let {
142
+ self,
143
+ source
144
+ } = _ref7;
145
+ if (source.data.id === dragId) return;
146
+ const edge = (0, _closestEdge.extractClosestEdge)(self.data);
147
+ setClosestEdge(edge === 'bottom' && internalRef.current?.nextElementSibling ? null : edge);
148
+ },
149
+ onDrag: _ref8 => {
150
+ let {
151
+ self,
152
+ source
153
+ } = _ref8;
154
+ if (source.data.id === dragId) return;
155
+ const edge = (0, _closestEdge.extractClosestEdge)(self.data);
156
+ setClosestEdge(edge === 'bottom' && internalRef.current?.nextElementSibling ? null : edge);
157
+ },
158
+ onDragLeave: () => setClosestEdge(null),
159
+ onDrop: () => setClosestEdge(null)
160
+ });
161
+ }, [isDraggable, dragId, tableId]);
162
+ return (0, _jsxRuntime.jsx)(_dndContext.RowDndContext.Provider, {
163
+ value: {
164
+ dragId,
165
+ setIsDragging
166
+ },
167
+ children: (0, _jsxRuntime.jsx)("tr", {
168
+ ref: setRef,
169
+ "data-draggable-id": dragId,
170
+ className: (0, _classnames.default)('ncua-table__row', className, {
171
+ 'ncua-table__row--selected': selected,
172
+ 'ncua-table__row--warning': status === 'warning',
173
+ 'ncua-table__row--error': status === 'error',
174
+ 'ncua-table__row--drag-over-top': closestEdge === 'top',
175
+ 'ncua-table__row--drag-over-bottom': closestEdge === 'bottom',
176
+ 'is-dragging': isDragging
177
+ }),
178
+ ...rest,
179
+ children: children
180
+ })
78
181
  });
79
182
  });
80
183
  Row.displayName = 'Table.Row';
81
- const HeaderCell = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
184
+ const DragHeaderCell = _ref9 => {
185
+ let {
186
+ className,
187
+ children
188
+ } = _ref9;
189
+ return (0, _jsxRuntime.jsx)("th", {
190
+ className: (0, _classnames.default)('ncua-table__header-cell', 'ncua-table__drag-header-cell', className),
191
+ children: (0, _jsxRuntime.jsxs)("span", {
192
+ className: "ncua-table__drag-cell-inner",
193
+ children: [(0, _jsxRuntime.jsx)("span", {
194
+ className: "ncua-table__drag-header-icon",
195
+ "aria-hidden": "true",
196
+ children: (0, _jsxRuntime.jsx)(_uiAdminIcon.DotsGrid02, {
197
+ width: 16,
198
+ height: 16
199
+ })
200
+ }), children]
201
+ })
202
+ });
203
+ };
204
+ DragHeaderCell.displayName = 'Table.DragHeaderCell';
205
+ const DragCell = _ref0 => {
206
+ let {
207
+ disabled,
208
+ className,
209
+ children
210
+ } = _ref0;
211
+ const {
212
+ isDraggable,
213
+ tableId
214
+ } = (0, _react.useContext)(_dndContext.TableDndContext);
215
+ const {
216
+ dragId,
217
+ setIsDragging
218
+ } = (0, _react.useContext)(_dndContext.RowDndContext);
219
+ const handleRef = (0, _react.useRef)(null);
220
+ (0, _react.useEffect)(() => {
221
+ if (!isDraggable || !dragId || !handleRef.current || disabled) return;
222
+ let overlay = null;
223
+ let removePointerMove = null;
224
+ let pendingPreview = null;
225
+ return (0, _adapter.draggable)({
226
+ element: handleRef.current,
227
+ getInitialData: () => ({
228
+ id: dragId,
229
+ tableId
230
+ }),
231
+ onGenerateDragPreview: _ref1 => {
232
+ let {
233
+ nativeSetDragImage,
234
+ location
235
+ } = _ref1;
236
+ if (!handleRef.current) return;
237
+ const rowEl = handleRef.current.closest('tr');
238
+ if (!rowEl) return;
239
+ (0, _disableNativeDragPreview.disableNativeDragPreview)({
240
+ nativeSetDragImage
241
+ });
242
+ const rowRect = rowEl.getBoundingClientRect();
243
+ const badgeHalf = _dndPreview.PREVIEW_BADGE_SIZE / 2;
244
+ const offsetX = Math.round(location.initial.input.clientX - rowRect.left) + badgeHalf;
245
+ const offsetY = Math.round(location.initial.input.clientY - rowRect.top) + badgeHalf;
246
+ const isSelected = rowEl.classList.contains('ncua-table__row--selected');
247
+ const bodyEl = rowEl.closest('.ncua-table__body');
248
+ const selectedRows = isSelected && bodyEl ? Array.from(bodyEl.querySelectorAll('.ncua-table__row--selected')) : [];
249
+ pendingPreview = {
250
+ rows: selectedRows.length > 1 ? selectedRows : [rowEl],
251
+ rowRect,
252
+ offsetX,
253
+ offsetY
254
+ };
255
+ },
256
+ onDragStart: _ref10 => {
257
+ let {
258
+ location
259
+ } = _ref10;
260
+ setIsDragging(true);
261
+ if (!pendingPreview) return;
262
+ const {
263
+ rows,
264
+ rowRect,
265
+ offsetX,
266
+ offsetY
267
+ } = pendingPreview;
268
+ overlay = (0, _dndPreview.buildDragPreview)(rows, rowRect);
269
+ overlay.style.left = `${Math.round(location.initial.input.clientX) - offsetX}px`;
270
+ overlay.style.top = `${Math.round(location.initial.input.clientY) - offsetY}px`;
271
+ document.body.appendChild(overlay);
272
+ const onDragOver = e => {
273
+ if (!overlay) return;
274
+ overlay.style.left = `${e.clientX - offsetX}px`;
275
+ overlay.style.top = `${e.clientY - offsetY}px`;
276
+ };
277
+ document.addEventListener('dragover', onDragOver);
278
+ removePointerMove = () => document.removeEventListener('dragover', onDragOver);
279
+ },
280
+ onDrop: () => {
281
+ setIsDragging(false);
282
+ removePointerMove?.();
283
+ removePointerMove = null;
284
+ overlay?.remove();
285
+ overlay = null;
286
+ pendingPreview = null;
287
+ }
288
+ });
289
+ }, [isDraggable, dragId, tableId, disabled, setIsDragging]);
290
+ return (0, _jsxRuntime.jsx)("td", {
291
+ className: (0, _classnames.default)('ncua-table__drag-cell', className),
292
+ children: (0, _jsxRuntime.jsxs)("span", {
293
+ className: "ncua-table__drag-cell-inner",
294
+ children: [isDraggable && (0, _jsxRuntime.jsx)("button", {
295
+ ref: handleRef,
296
+ type: "button",
297
+ className: "ncua-table__drag-handle",
298
+ "aria-label": "\uD589 \uC21C\uC11C \uBCC0\uACBD",
299
+ disabled: disabled,
300
+ children: (0, _jsxRuntime.jsx)(_uiAdminIcon.DotsGrid02, {})
301
+ }), children]
302
+ })
303
+ });
304
+ };
305
+ DragCell.displayName = 'Table.DragCell';
306
+ const HeaderCell = /*#__PURE__*/(0, _react.forwardRef)((_ref11, ref) => {
82
307
  let {
83
308
  children,
84
309
  className,
@@ -88,7 +313,7 @@ const HeaderCell = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
88
313
  minWidth,
89
314
  style,
90
315
  ...rest
91
- } = _ref4;
316
+ } = _ref11;
92
317
  const isSortable = sortDirection !== undefined && onSort !== undefined;
93
318
  const SortIcon = isSortable ? SORT_ICONS[sortDirection] : undefined;
94
319
  return (0, _jsxRuntime.jsx)("th", {
@@ -120,13 +345,13 @@ const HeaderCell = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
120
345
  });
121
346
  });
122
347
  HeaderCell.displayName = 'Table.HeaderCell';
123
- const Cell = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
348
+ const Cell = /*#__PURE__*/(0, _react.forwardRef)((_ref12, ref) => {
124
349
  let {
125
350
  children,
126
351
  className,
127
352
  isHeader,
128
353
  ...rest
129
- } = _ref5;
354
+ } = _ref12;
130
355
  if (isHeader) {
131
356
  return (0, _jsxRuntime.jsx)("th", {
132
357
  ref: ref,
@@ -144,55 +369,57 @@ const Cell = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) => {
144
369
  });
145
370
  });
146
371
  Cell.displayName = 'Table.Cell';
147
- const Footer = _ref6 => {
372
+ const Footer = _ref13 => {
148
373
  let {
149
374
  children,
150
375
  className
151
- } = _ref6;
376
+ } = _ref13;
152
377
  return (0, _jsxRuntime.jsx)("div", {
153
378
  className: (0, _classnames.default)('ncua-table__footer', className),
154
379
  children: children
155
380
  });
156
381
  };
157
382
  Footer.displayName = 'Table.Footer';
158
- const Pagination = _ref7 => {
383
+ const Pagination = _ref14 => {
159
384
  let {
160
385
  children,
161
386
  className
162
- } = _ref7;
387
+ } = _ref14;
163
388
  return (0, _jsxRuntime.jsx)("div", {
164
389
  className: (0, _classnames.default)('ncua-table__pagination', className),
165
390
  children: children
166
391
  });
167
392
  };
168
393
  Pagination.displayName = 'Table.Pagination';
169
- const ColGroup = _ref8 => {
394
+ const ColGroup = _ref15 => {
170
395
  let {
171
396
  widths,
172
397
  minWidths
173
- } = _ref8;
398
+ } = _ref15;
174
399
  const resolveColWidth = width => {
175
400
  if (width === undefined || width === 'auto') return undefined;
176
401
  if (typeof width === 'number') return `${width}px`;
177
402
  return width;
178
403
  };
179
404
  return (0, _jsxRuntime.jsx)("colgroup", {
180
- children: widths.map((width, index) =>
181
- // biome-ignore lint/suspicious/noArrayIndexKey: colgroup columns never reorder or change
182
- (0, _jsxRuntime.jsx)("col", {
183
- style: {
405
+ children: widths.map((width, index) => {
406
+ const colStyle = {
184
407
  width: resolveColWidth(width),
185
408
  minWidth: resolveColWidth(minWidths?.[index])
186
- }
187
- }, index))
409
+ };
410
+ // biome-ignore lint/suspicious/noArrayIndexKey: colgroup columns never reorder or change
411
+ return (0, _jsxRuntime.jsx)("col", {
412
+ style: colStyle
413
+ }, index);
414
+ })
188
415
  });
189
416
  };
190
417
  ColGroup.displayName = 'Table.ColGroup';
191
- const Empty = _ref9 => {
418
+ const Empty = _ref16 => {
192
419
  let {
193
420
  colSpan,
194
421
  children
195
- } = _ref9;
422
+ } = _ref16;
196
423
  return (0, _jsxRuntime.jsx)("tr", {
197
424
  children: (0, _jsxRuntime.jsx)("td", {
198
425
  colSpan: colSpan,
@@ -237,7 +464,7 @@ const sortChildren = children => {
237
464
  // ──────────────────────────────────────────────
238
465
  // Main Table component
239
466
  // ──────────────────────────────────────────────
240
- const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref0, ref) => {
467
+ const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref17, ref) => {
241
468
  let {
242
469
  type = 'horizontal',
243
470
  fixedHeader = false,
@@ -246,16 +473,21 @@ const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref0, ref) => {
246
473
  selectable = false,
247
474
  horizontalScroll = false,
248
475
  minWidth,
476
+ draggable = false,
249
477
  children,
250
478
  className,
251
479
  ...rest
252
- } = _ref0;
480
+ } = _ref17;
481
+ const tableIdRef = (0, _react.useRef)(`ncua-table-${Math.random().toString(_dndPreview.TABLE_DND_ID_RADIX).slice(_dndPreview.TABLE_DND_ID_SLICE_START, _dndPreview.TABLE_DND_ID_SLICE_END)}`);
482
+ const tableId = tableIdRef.current;
483
+ const effectiveDraggable = draggable && type === 'horizontal';
253
484
  const tableClasses = (0, _classnames.default)('ncua-table', className, {
254
485
  'ncua-table--horizontal': type === 'horizontal',
255
486
  'ncua-table--vertical': type === 'vertical',
256
487
  'ncua-table--fixed-header': fixedHeader,
257
488
  'ncua-table--hoverable': hoverable && type === 'horizontal',
258
- 'ncua-table--selectable': selectable
489
+ 'ncua-table--selectable': selectable,
490
+ 'ncua-table--draggable': effectiveDraggable
259
491
  });
260
492
  const {
261
493
  headerContent,
@@ -295,6 +527,13 @@ const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref0, ref) => {
295
527
  hScrollbarRef,
296
528
  hThumbRef
297
529
  });
530
+ // fixedHeader 모드에서 드래그 시 자동 스크롤
531
+ (0, _react.useEffect)(() => {
532
+ if (!effectiveDraggable || !fixedScrollEnabled || !scrollContainerRef.current) return;
533
+ return (0, _element.autoScrollForElements)({
534
+ element: scrollContainerRef.current
535
+ });
536
+ }, [effectiveDraggable, fixedScrollEnabled]);
298
537
  // <colgroup> + <thead> + <tbody> 묶음 — fixed-header 분기와 horizontalScroll 분기 모두에서 재사용
299
538
  const renderTable = () => (0, _jsxRuntime.jsxs)("table", {
300
539
  className: "ncua-table__table",
@@ -326,6 +565,10 @@ const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref0, ref) => {
326
565
  })]
327
566
  }) : renderTable();
328
567
  };
568
+ const dndContextValue = {
569
+ isDraggable: effectiveDraggable,
570
+ tableId
571
+ };
329
572
  // horizontalScroll=true 시 외곽 wrapper + FloatingProvider 부착.
330
573
  // 핵심 — __h-scroll-container 는 <table>(또는 scroll-area) 만 감싸고, footer/pagination 은
331
574
  // 그 바깥에서 항상 고정 위치. 세로 스크롤바는 h-scroll-container 형제로 배치되어
@@ -337,55 +580,61 @@ const TableComponent = /*#__PURE__*/(0, _react.forwardRef)((_ref0, ref) => {
337
580
  const innerStyle = {
338
581
  '--ncua-table-min-width': typeof resolvedMinWidth === 'number' ? `${resolvedMinWidth}px` : resolvedMinWidth
339
582
  };
340
- return (0, _jsxRuntime.jsx)(_FloatingContext.FloatingProvider, {
341
- value: FLOATING_PORTAL_VALUE,
342
- children: (0, _jsxRuntime.jsxs)("div", {
343
- ref: ref,
344
- className: "ncua-table-wrapper",
345
- style: WRAPPER_STYLE,
346
- children: [(0, _jsxRuntime.jsxs)("div", {
347
- className: tableClasses,
348
- ...rest,
583
+ return (0, _jsxRuntime.jsx)(_dndContext.TableDndContext.Provider, {
584
+ value: dndContextValue,
585
+ children: (0, _jsxRuntime.jsx)(_FloatingContext.FloatingProvider, {
586
+ value: FLOATING_PORTAL_VALUE,
587
+ children: (0, _jsxRuntime.jsxs)("div", {
588
+ ref: ref,
589
+ className: "ncua-table-wrapper",
590
+ style: WRAPPER_STYLE,
349
591
  children: [(0, _jsxRuntime.jsxs)("div", {
350
- ref: hScrollContainerRef,
351
- className: "ncua-table__h-scroll-container",
352
- children: [(0, _jsxRuntime.jsx)("div", {
353
- className: "ncua-table__h-scroll-inner",
354
- style: innerStyle,
355
- children: renderScrollableArea(false)
356
- }), (0, _jsxRuntime.jsx)("div", {
357
- ref: hScrollbarRef,
358
- className: "ncua-table__h-scrollbar",
592
+ className: tableClasses,
593
+ ...rest,
594
+ children: [(0, _jsxRuntime.jsxs)("div", {
595
+ ref: hScrollContainerRef,
596
+ className: "ncua-table__h-scroll-container",
597
+ children: [(0, _jsxRuntime.jsx)("div", {
598
+ className: "ncua-table__h-scroll-inner",
599
+ style: innerStyle,
600
+ children: renderScrollableArea(false)
601
+ }), (0, _jsxRuntime.jsx)("div", {
602
+ ref: hScrollbarRef,
603
+ className: "ncua-table__h-scrollbar",
604
+ "aria-hidden": "true",
605
+ children: (0, _jsxRuntime.jsx)("div", {
606
+ ref: hThumbRef,
607
+ className: "ncua-table__h-scrollbar-thumb",
608
+ onMouseDown: handleHThumbMouseDown
609
+ })
610
+ })]
611
+ }), fixedScrollEnabled && (0, _jsxRuntime.jsx)("div", {
612
+ ref: scrollbarRef,
613
+ className: "ncua-table__scrollbar",
359
614
  "aria-hidden": "true",
360
615
  children: (0, _jsxRuntime.jsx)("div", {
361
- ref: hThumbRef,
362
- className: "ncua-table__h-scrollbar-thumb",
363
- onMouseDown: handleHThumbMouseDown
616
+ ref: thumbRef,
617
+ className: "ncua-table__scrollbar-thumb",
618
+ onMouseDown: handleThumbMouseDown
364
619
  })
365
- })]
366
- }), fixedScrollEnabled && (0, _jsxRuntime.jsx)("div", {
367
- ref: scrollbarRef,
368
- className: "ncua-table__scrollbar",
369
- "aria-hidden": "true",
370
- children: (0, _jsxRuntime.jsx)("div", {
371
- ref: thumbRef,
372
- className: "ncua-table__scrollbar-thumb",
373
- onMouseDown: handleThumbMouseDown
374
- })
375
- }), footerContent]
376
- }), paginationContent]
620
+ }), footerContent]
621
+ }), paginationContent]
622
+ })
377
623
  })
378
624
  });
379
625
  }
380
- return (0, _jsxRuntime.jsxs)("div", {
381
- ref: ref,
382
- className: "ncua-table-wrapper",
383
- style: WRAPPER_STYLE,
384
- children: [(0, _jsxRuntime.jsxs)("div", {
385
- className: tableClasses,
386
- ...rest,
387
- children: [renderScrollableArea(), footerContent]
388
- }), paginationContent]
626
+ return (0, _jsxRuntime.jsx)(_dndContext.TableDndContext.Provider, {
627
+ value: dndContextValue,
628
+ children: (0, _jsxRuntime.jsxs)("div", {
629
+ ref: ref,
630
+ className: "ncua-table-wrapper",
631
+ style: WRAPPER_STYLE,
632
+ children: [(0, _jsxRuntime.jsxs)("div", {
633
+ className: tableClasses,
634
+ ...rest,
635
+ children: [renderScrollableArea(), footerContent]
636
+ }), paginationContent]
637
+ })
389
638
  });
390
639
  });
391
640
  TableComponent.displayName = 'Table';
@@ -396,6 +645,8 @@ const Table = exports.Table = Object.assign(TableComponent, {
396
645
  Header,
397
646
  Body,
398
647
  Row,
648
+ DragHeaderCell,
649
+ DragCell,
399
650
  HeaderCell,
400
651
  Cell,
401
652
  Footer,
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TableDndContext = exports.RowDndContext = void 0;
7
+ var _react = require("react");
8
+ const TableDndContext = exports.TableDndContext = /*#__PURE__*/(0, _react.createContext)({
9
+ isDraggable: false,
10
+ tableId: ''
11
+ });
12
+ const RowDndContext = exports.RowDndContext = /*#__PURE__*/(0, _react.createContext)({
13
+ dragId: undefined,
14
+ setIsDragging: _v => undefined
15
+ });