@react-spectrum/table 3.12.11-nightly.4674 → 3.12.11-nightly.4681
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.
- package/dist/InsertionIndicator.main.js +1 -1
- package/dist/InsertionIndicator.main.js.map +1 -1
- package/dist/InsertionIndicator.mjs +1 -1
- package/dist/InsertionIndicator.module.js +1 -1
- package/dist/InsertionIndicator.module.js.map +1 -1
- package/dist/Resizer.main.js +4 -1
- package/dist/Resizer.main.js.map +1 -1
- package/dist/Resizer.mjs +5 -3
- package/dist/Resizer.module.js +5 -3
- package/dist/Resizer.module.js.map +1 -1
- package/dist/RootDropIndicator.main.js +1 -1
- package/dist/RootDropIndicator.main.js.map +1 -1
- package/dist/RootDropIndicator.mjs +1 -1
- package/dist/RootDropIndicator.module.js +1 -1
- package/dist/RootDropIndicator.module.js.map +1 -1
- package/dist/TableViewBase.main.js +80 -75
- package/dist/TableViewBase.main.js.map +1 -1
- package/dist/TableViewBase.mjs +82 -77
- package/dist/TableViewBase.module.js +82 -77
- package/dist/TableViewBase.module.js.map +1 -1
- package/package.json +32 -31
- package/src/InsertionIndicator.tsx +1 -1
- package/src/Resizer.tsx +8 -4
- package/src/RootDropIndicator.tsx +1 -1
- package/src/TableViewBase.tsx +110 -84
|
@@ -9,7 +9,6 @@ var $982885d0a34882ea$exports = require("./table_vars_css.main.js");
|
|
|
9
9
|
require("./table.b13eee90.css");
|
|
10
10
|
var $4afcd54cfd94dbb9$exports = require("./table_css.main.js");
|
|
11
11
|
var $idLTj$spectrumiconsuiArrowDownSmall = require("@spectrum-icons/ui/ArrowDownSmall");
|
|
12
|
-
var $idLTj$reactariautils = require("@react-aria/utils");
|
|
13
12
|
var $idLTj$reactspectrumcheckbox = require("@react-spectrum/checkbox");
|
|
14
13
|
var $idLTj$spectrumiconsuiChevronDownMedium = require("@spectrum-icons/ui/ChevronDownMedium");
|
|
15
14
|
var $idLTj$spectrumiconsuiChevronLeftMedium = require("@spectrum-icons/ui/ChevronLeftMedium");
|
|
@@ -17,14 +16,16 @@ var $idLTj$spectrumiconsuiChevronRightMedium = require("@spectrum-icons/ui/Chevr
|
|
|
17
16
|
var $idLTj$reactspectrumutils = require("@react-spectrum/utils");
|
|
18
17
|
var $idLTj$reactariafocus = require("@react-aria/focus");
|
|
19
18
|
var $idLTj$reactariainteractions = require("@react-aria/interactions");
|
|
19
|
+
var $idLTj$reactariautils = require("@react-aria/utils");
|
|
20
20
|
var $idLTj$reactspectrummenu = require("@react-spectrum/menu");
|
|
21
21
|
var $idLTj$reactstatelyvirtualizer = require("@react-stately/virtualizer");
|
|
22
22
|
var $idLTj$reactariavirtualizer = require("@react-aria/virtualizer");
|
|
23
23
|
var $idLTj$spectrumiconsuiListGripper = require("@spectrum-icons/ui/ListGripper");
|
|
24
|
+
var $idLTj$reactariaselection = require("@react-aria/selection");
|
|
24
25
|
var $idLTj$reactspectrumprogress = require("@react-spectrum/progress");
|
|
25
26
|
var $idLTj$react = require("react");
|
|
26
|
-
var $idLTj$reactstatelytable = require("@react-stately/table");
|
|
27
27
|
var $idLTj$reactstatelylayout = require("@react-stately/layout");
|
|
28
|
+
var $idLTj$reactstatelytable = require("@react-stately/table");
|
|
28
29
|
var $idLTj$reactspectrumtooltip = require("@react-spectrum/tooltip");
|
|
29
30
|
var $idLTj$reactariabutton = require("@react-aria/button");
|
|
30
31
|
var $idLTj$reactariai18n = require("@react-aria/i18n");
|
|
@@ -83,6 +84,7 @@ $parcel$export(module.exports, "TableViewBase", () => $e39c6de4eb69450d$export$5
|
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
|
|
87
|
+
|
|
86
88
|
|
|
87
89
|
|
|
88
90
|
const $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT = {
|
|
@@ -146,25 +148,6 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
146
148
|
]);
|
|
147
149
|
let { styleProps: styleProps } = (0, $idLTj$reactspectrumutils.useStyleProps)(props);
|
|
148
150
|
let { scale: scale } = (0, $idLTj$reactspectrumprovider.useProvider)();
|
|
149
|
-
const getDefaultWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
|
|
150
|
-
if (hideHeader) {
|
|
151
|
-
let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
152
|
-
return showDivider ? width + 1 : width;
|
|
153
|
-
} else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
154
|
-
else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
155
|
-
}, [
|
|
156
|
-
scale
|
|
157
|
-
]);
|
|
158
|
-
const getDefaultMinWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
|
|
159
|
-
if (hideHeader) {
|
|
160
|
-
let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
161
|
-
return showDivider ? width + 1 : width;
|
|
162
|
-
} else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
163
|
-
else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
164
|
-
return 75;
|
|
165
|
-
}, [
|
|
166
|
-
scale
|
|
167
|
-
]);
|
|
168
151
|
// Starts when the user selects resize from the menu, ends when resizing ends
|
|
169
152
|
// used to control the visibility of the resizer Nubbin
|
|
170
153
|
let [isInResizeMode, setIsInResizeMode] = (0, $idLTj$react.useState)(false);
|
|
@@ -173,44 +156,23 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
173
156
|
// with table layout, so we need to track it here
|
|
174
157
|
let [, setIsResizing] = (0, $idLTj$react.useState)(false);
|
|
175
158
|
let domRef = (0, $idLTj$reactspectrumutils.useDOMRef)(ref);
|
|
176
|
-
let headerRef = (0, $idLTj$react.useRef)();
|
|
177
|
-
let bodyRef = (0, $idLTj$react.useRef)();
|
|
159
|
+
let headerRef = (0, $idLTj$react.useRef)(undefined);
|
|
160
|
+
let bodyRef = (0, $idLTj$react.useRef)(undefined);
|
|
178
161
|
let density = props.density || 'regular';
|
|
179
|
-
let
|
|
180
|
-
getDefaultWidth: getDefaultWidth,
|
|
181
|
-
getDefaultMinWidth: getDefaultMinWidth
|
|
182
|
-
}), [
|
|
183
|
-
getDefaultWidth,
|
|
184
|
-
getDefaultMinWidth
|
|
185
|
-
]);
|
|
186
|
-
let tableLayout = (0, $idLTj$react.useMemo)(()=>new (0, $idLTj$reactstatelylayout.TableLayout)({
|
|
162
|
+
let layout = (0, $idLTj$react.useMemo)(()=>new (0, $idLTj$reactstatelylayout.TableLayout)({
|
|
187
163
|
// If props.rowHeight is auto, then use estimated heights based on scale, otherwise use fixed heights.
|
|
188
164
|
rowHeight: props.overflowMode === 'wrap' ? null : $e39c6de4eb69450d$var$ROW_HEIGHTS[density][scale],
|
|
189
165
|
estimatedRowHeight: props.overflowMode === 'wrap' ? $e39c6de4eb69450d$var$ROW_HEIGHTS[density][scale] : null,
|
|
190
166
|
headingHeight: props.overflowMode === 'wrap' ? null : $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT[scale],
|
|
191
167
|
estimatedHeadingHeight: props.overflowMode === 'wrap' ? $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT[scale] : null,
|
|
192
|
-
|
|
193
|
-
|
|
168
|
+
scrollContainer: 'body',
|
|
169
|
+
enableEmptyState: true
|
|
194
170
|
}), // don't recompute when state.collection changes, only used for initial value
|
|
195
171
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
196
172
|
[
|
|
197
173
|
props.overflowMode,
|
|
198
174
|
scale,
|
|
199
|
-
density
|
|
200
|
-
columnLayout
|
|
201
|
-
]);
|
|
202
|
-
// Use a proxy so that a new object is created for each render so that alternate instances aren't affected by mutation.
|
|
203
|
-
// This can be thought of as equivalent to `{…tableLayout, tableState: state}`, but works with classes as well.
|
|
204
|
-
let layout = (0, $idLTj$react.useMemo)(()=>{
|
|
205
|
-
let proxy = new Proxy(tableLayout, {
|
|
206
|
-
get (target, prop, receiver) {
|
|
207
|
-
return prop === 'tableState' ? state : Reflect.get(target, prop, receiver);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
return proxy;
|
|
211
|
-
}, [
|
|
212
|
-
state,
|
|
213
|
-
tableLayout
|
|
175
|
+
density
|
|
214
176
|
]);
|
|
215
177
|
let dragState;
|
|
216
178
|
let preview = (0, $idLTj$react.useRef)(null);
|
|
@@ -232,7 +194,12 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
232
194
|
selectionManager: state.selectionManager
|
|
233
195
|
});
|
|
234
196
|
droppableCollection = dragAndDropHooks.useDroppableCollection({
|
|
235
|
-
keyboardDelegate:
|
|
197
|
+
keyboardDelegate: new (0, $idLTj$reactariaselection.ListKeyboardDelegate)({
|
|
198
|
+
collection: state.collection,
|
|
199
|
+
disabledKeys: state.selectionManager.disabledKeys,
|
|
200
|
+
ref: domRef,
|
|
201
|
+
layoutDelegate: layout
|
|
202
|
+
}),
|
|
236
203
|
dropTargetDelegate: layout
|
|
237
204
|
}, dropState, domRef);
|
|
238
205
|
isRootDropTarget = dropState.isDropTarget({
|
|
@@ -242,12 +209,13 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
242
209
|
let { gridProps: gridProps } = (0, $idLTj$reactariatable.useTable)({
|
|
243
210
|
...props,
|
|
244
211
|
isVirtualized: true,
|
|
245
|
-
|
|
212
|
+
layoutDelegate: layout,
|
|
246
213
|
onRowAction: onAction,
|
|
247
214
|
scrollRef: bodyRef
|
|
248
215
|
}, state, domRef);
|
|
249
216
|
let [headerMenuOpen, setHeaderMenuOpen] = (0, $idLTj$react.useState)(false);
|
|
250
217
|
let [headerRowHovered, setHeaderRowHovered] = (0, $idLTj$react.useState)(false);
|
|
218
|
+
// This overrides collection view's renderWrapper to support DOM hierarchy.
|
|
251
219
|
let renderWrapper = (0, $idLTj$react.useCallback)((parent, reusableView, children, renderChildren)=>{
|
|
252
220
|
if (reusableView.viewType === 'rowgroup') return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableRowGroup, {
|
|
253
221
|
key: reusableView.key,
|
|
@@ -409,9 +377,8 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
409
377
|
'spectrum-Table--isVerticalScrollbarVisible': isVerticalScrollbarVisible,
|
|
410
378
|
'spectrum-Table--isHorizontalScrollbarVisible': isHorizontalScrollbarVisible
|
|
411
379
|
}, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), 'react-spectrum-Table'), styleProps.className),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
layout: tableLayout,
|
|
380
|
+
tableState: state,
|
|
381
|
+
layout: layout,
|
|
415
382
|
collection: state.collection,
|
|
416
383
|
focusedKey: focusedKey,
|
|
417
384
|
renderView: renderView,
|
|
@@ -442,11 +409,37 @@ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
|
|
|
442
409
|
// This is a custom Virtualizer that also has a header that syncs its scroll position with the body.
|
|
443
410
|
function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
444
411
|
var _layout_getLayoutInfo;
|
|
445
|
-
let { layout: layout, collection: collection, focusedKey: focusedKey, renderView: renderView, renderWrapper: renderWrapper, domRef: domRef, bodyRef: bodyRef, headerRef: headerRef, onVisibleRectChange: onVisibleRectChangeProp, isFocusVisible: isFocusVisible, isVirtualDragging: isVirtualDragging, isRootDropTarget: isRootDropTarget, ...otherProps } = props;
|
|
412
|
+
let { tableState: tableState, layout: layout, collection: collection, focusedKey: focusedKey, renderView: renderView, renderWrapper: renderWrapper, domRef: domRef, bodyRef: bodyRef, headerRef: headerRef, onVisibleRectChange: onVisibleRectChangeProp, isFocusVisible: isFocusVisible, isVirtualDragging: isVirtualDragging, isRootDropTarget: isRootDropTarget, ...otherProps } = props;
|
|
446
413
|
let { direction: direction } = (0, $idLTj$reactariai18n.useLocale)();
|
|
447
414
|
let loadingState = collection.body.props.loadingState;
|
|
448
415
|
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
449
416
|
let onLoadMore = collection.body.props.onLoadMore;
|
|
417
|
+
let [tableWidth, setTableWidth] = (0, $idLTj$react.useState)(0);
|
|
418
|
+
let { scale: scale } = (0, $idLTj$reactspectrumprovider.useProvider)();
|
|
419
|
+
const getDefaultWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
|
|
420
|
+
if (hideHeader) {
|
|
421
|
+
let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
422
|
+
return showDivider ? width + 1 : width;
|
|
423
|
+
} else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
424
|
+
else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
425
|
+
}, [
|
|
426
|
+
scale
|
|
427
|
+
]);
|
|
428
|
+
const getDefaultMinWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
|
|
429
|
+
if (hideHeader) {
|
|
430
|
+
let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
431
|
+
return showDivider ? width + 1 : width;
|
|
432
|
+
} else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
433
|
+
else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
434
|
+
return 75;
|
|
435
|
+
}, [
|
|
436
|
+
scale
|
|
437
|
+
]);
|
|
438
|
+
let columnResizeState = (0, $idLTj$reactstatelytable.useTableColumnResizeState)({
|
|
439
|
+
tableWidth: tableWidth,
|
|
440
|
+
getDefaultWidth: getDefaultWidth,
|
|
441
|
+
getDefaultMinWidth: getDefaultMinWidth
|
|
442
|
+
}, tableState);
|
|
450
443
|
let state = (0, $idLTj$reactstatelyvirtualizer.useVirtualizerState)({
|
|
451
444
|
layout: layout,
|
|
452
445
|
collection: collection,
|
|
@@ -460,6 +453,11 @@ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
|
460
453
|
focusedKey
|
|
461
454
|
]) : new Set(), [
|
|
462
455
|
focusedKey
|
|
456
|
+
]),
|
|
457
|
+
layoutOptions: (0, $idLTj$react.useMemo)(()=>({
|
|
458
|
+
columnWidths: columnResizeState.columnWidths
|
|
459
|
+
}), [
|
|
460
|
+
columnResizeState.columnWidths
|
|
463
461
|
])
|
|
464
462
|
});
|
|
465
463
|
let memoedVirtualizerProps = (0, $idLTj$react.useMemo)(()=>({
|
|
@@ -474,7 +472,11 @@ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
|
474
472
|
onLoadMore
|
|
475
473
|
]);
|
|
476
474
|
let { virtualizerProps: virtualizerProps, scrollViewProps: { onVisibleRectChange: onVisibleRectChange } } = (0, $idLTj$reactariavirtualizer.useVirtualizer)(memoedVirtualizerProps, state, domRef);
|
|
477
|
-
let onVisibleRectChangeMemo = (0, $idLTj$react.
|
|
475
|
+
let onVisibleRectChangeMemo = (0, $idLTj$react.useCallback)((rect)=>{
|
|
476
|
+
setTableWidth(rect.width);
|
|
477
|
+
onVisibleRectChange(rect);
|
|
478
|
+
onVisibleRectChangeProp(rect);
|
|
479
|
+
}, [
|
|
478
480
|
onVisibleRectChange,
|
|
479
481
|
onVisibleRectChangeProp
|
|
480
482
|
]);
|
|
@@ -503,27 +505,27 @@ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
|
503
505
|
bodyRef,
|
|
504
506
|
headerRef
|
|
505
507
|
]);
|
|
506
|
-
let resizerPosition = layout.
|
|
508
|
+
let resizerPosition = columnResizeState.resizingColumn != null ? layout.getLayoutInfo(columnResizeState.resizingColumn).rect.maxX - 2 : 0;
|
|
507
509
|
let resizerAtEdge = resizerPosition > Math.max(state.virtualizer.contentSize.width, state.virtualizer.visibleRect.width) - 3;
|
|
508
510
|
// this should be fine, every movement of the resizer causes a rerender
|
|
509
511
|
// scrolling can cause it to lag for a moment, but it's always updated
|
|
510
512
|
let resizerInVisibleRegion = resizerPosition < state.virtualizer.visibleRect.maxX;
|
|
511
513
|
let shouldHardCornerResizeCorner = resizerAtEdge && resizerInVisibleRegion;
|
|
512
514
|
// minimize re-render caused on Resizers by memoing this
|
|
513
|
-
let resizingColumnWidth =
|
|
515
|
+
let resizingColumnWidth = columnResizeState.resizingColumn != null ? columnResizeState.getColumnWidth(columnResizeState.resizingColumn) : 0;
|
|
514
516
|
let resizingColumn = (0, $idLTj$react.useMemo)(()=>({
|
|
515
517
|
width: resizingColumnWidth,
|
|
516
|
-
key:
|
|
518
|
+
key: columnResizeState.resizingColumn
|
|
517
519
|
}), [
|
|
518
520
|
resizingColumnWidth,
|
|
519
|
-
|
|
521
|
+
columnResizeState.resizingColumn
|
|
520
522
|
]);
|
|
521
523
|
let mergedProps = (0, $idLTj$reactariautils.mergeProps)(otherProps, virtualizerProps, isVirtualDragging && {
|
|
522
524
|
tabIndex: null
|
|
523
525
|
});
|
|
524
526
|
let firstColumn = collection.columns[0];
|
|
525
527
|
let scrollPadding = 0;
|
|
526
|
-
if (firstColumn.props.isSelectionCell || firstColumn.props.isDragButtonCell) scrollPadding =
|
|
528
|
+
if (firstColumn.props.isSelectionCell || firstColumn.props.isDragButtonCell) scrollPadding = columnResizeState.getColumnWidth(firstColumn.key);
|
|
527
529
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$export$d288a7dd40372bc.Provider, {
|
|
528
530
|
value: resizingColumn
|
|
529
531
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
|
|
@@ -540,7 +542,9 @@ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
|
540
542
|
scrollPaddingInlineStart: scrollPadding
|
|
541
543
|
},
|
|
542
544
|
ref: headerRef
|
|
543
|
-
},
|
|
545
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $2877766f94c67a67$exports.ResizeStateContext).Provider, {
|
|
546
|
+
value: columnResizeState
|
|
547
|
+
}, state.visibleViews[0])), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavirtualizer.ScrollView), {
|
|
544
548
|
className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), 'spectrum-Table-body', {
|
|
545
549
|
'focus-ring': isFocusVisible,
|
|
546
550
|
'spectrum-Table-body--resizerAtTableEdge': shouldHardCornerResizeCorner
|
|
@@ -571,7 +575,7 @@ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
|
|
|
571
575
|
style: {
|
|
572
576
|
[direction === 'ltr' ? 'left' : 'right']: `${resizerPosition}px`,
|
|
573
577
|
height: `${Math.max(state.virtualizer.contentSize.height, state.virtualizer.visibleRect.height)}px`,
|
|
574
|
-
display:
|
|
578
|
+
display: columnResizeState.resizingColumn ? 'block' : 'none'
|
|
575
579
|
}
|
|
576
580
|
})))));
|
|
577
581
|
}
|
|
@@ -677,7 +681,8 @@ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
|
|
|
677
681
|
let ref = (0, $idLTj$react.useRef)(null);
|
|
678
682
|
let triggerRef = (0, $idLTj$react.useRef)(null);
|
|
679
683
|
let resizingRef = (0, $idLTj$react.useRef)(null);
|
|
680
|
-
let { state: state,
|
|
684
|
+
let { state: state, onResizeStart: onResizeStart, onResize: onResize, onResizeEnd: onResizeEnd, headerRowHovered: headerRowHovered, setIsInResizeMode: setIsInResizeMode, isEmpty: isEmpty, isInResizeMode: isInResizeMode, headerMenuOpen: headerMenuOpen, setHeaderMenuOpen: setHeaderMenuOpen } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
685
|
+
let columnResizeState = (0, $idLTj$react.useContext)((0, $2877766f94c67a67$exports.ResizeStateContext));
|
|
681
686
|
let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), '@react-spectrum/table');
|
|
682
687
|
let { pressProps: pressProps, isPressed: isPressed } = (0, $idLTj$reactariainteractions.usePress)({
|
|
683
688
|
isDisabled: isEmpty
|
|
@@ -706,7 +711,7 @@ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
|
|
|
706
711
|
state.sort(column.key, 'descending');
|
|
707
712
|
break;
|
|
708
713
|
case 'resize':
|
|
709
|
-
|
|
714
|
+
columnResizeState.startResize(column.key);
|
|
710
715
|
setIsInResizeMode(true);
|
|
711
716
|
state.setKeyboardNavigationDisabled(true);
|
|
712
717
|
break;
|
|
@@ -733,7 +738,7 @@ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
|
|
|
733
738
|
}, [
|
|
734
739
|
allowsSorting
|
|
735
740
|
]);
|
|
736
|
-
let resizingColumn =
|
|
741
|
+
let resizingColumn = columnResizeState.resizingColumn;
|
|
737
742
|
let showResizer = !isEmpty && (headerRowHovered && (0, $idLTj$reactariainteractions.getInteractionModality)() !== 'keyboard' || resizingColumn != null);
|
|
738
743
|
let alignment = 'start';
|
|
739
744
|
let menuAlign = 'start';
|
|
@@ -798,7 +803,7 @@ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
|
|
|
798
803
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $18b3deb5c431fa13$exports.Nubbin), null)))));
|
|
799
804
|
}
|
|
800
805
|
function $e39c6de4eb69450d$var$TableSelectAllCell({ column: column }) {
|
|
801
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
806
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
802
807
|
let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
803
808
|
let isSingleSelectionMode = state.selectionManager.selectionMode === 'single';
|
|
804
809
|
let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
|
|
@@ -830,7 +835,7 @@ function $e39c6de4eb69450d$var$TableSelectAllCell({ column: column }) {
|
|
|
830
835
|
})));
|
|
831
836
|
}
|
|
832
837
|
function $e39c6de4eb69450d$var$TableDragHeaderCell({ column: column }) {
|
|
833
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
838
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
834
839
|
let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
835
840
|
let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
|
|
836
841
|
node: column,
|
|
@@ -880,7 +885,7 @@ function $e39c6de4eb69450d$export$cd7c5802f9e21187() {
|
|
|
880
885
|
}
|
|
881
886
|
function $e39c6de4eb69450d$var$TableRow({ item: item, children: children, layoutInfo: layoutInfo, parent: parent, ...otherProps }) {
|
|
882
887
|
var _state_collection_rows_find, _layout_getContentSize, _layout_virtualizer;
|
|
883
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
888
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
884
889
|
let { state: state, layout: layout, dragAndDropHooks: dragAndDropHooks, isTableDraggable: isTableDraggable, isTableDroppable: isTableDroppable, dragState: dragState, dropState: dropState } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
885
890
|
let isSelected = state.selectionManager.isSelected(item.key);
|
|
886
891
|
let { rowProps: rowProps, hasAction: hasAction, allowsSelection: allowsSelection } = (0, $idLTj$reactariatable.useTableRow)({
|
|
@@ -922,7 +927,7 @@ function $e39c6de4eb69450d$var$TableRow({ item: item, children: children, layout
|
|
|
922
927
|
let droppableItem;
|
|
923
928
|
let isDropTarget;
|
|
924
929
|
let dropIndicator;
|
|
925
|
-
let dropIndicatorRef = (0, $idLTj$react.useRef)();
|
|
930
|
+
let dropIndicatorRef = (0, $idLTj$react.useRef)(undefined);
|
|
926
931
|
if (isTableDroppable) {
|
|
927
932
|
let target = {
|
|
928
933
|
type: 'item',
|
|
@@ -935,7 +940,7 @@ function $e39c6de4eb69450d$var$TableRow({ item: item, children: children, layout
|
|
|
935
940
|
target: target
|
|
936
941
|
}, dropState, dropIndicatorRef);
|
|
937
942
|
}
|
|
938
|
-
let dragButtonRef = (0, ($parcel$interopDefault($idLTj$react))).useRef();
|
|
943
|
+
let dragButtonRef = (0, ($parcel$interopDefault($idLTj$react))).useRef(undefined);
|
|
939
944
|
let { buttonProps: dragButtonProps } = (0, $idLTj$reactariabutton.useButton)({
|
|
940
945
|
...draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragButtonProps,
|
|
941
946
|
elementType: 'div'
|
|
@@ -1005,7 +1010,7 @@ function $e39c6de4eb69450d$var$TableRow({ item: item, children: children, layout
|
|
|
1005
1010
|
}
|
|
1006
1011
|
function $e39c6de4eb69450d$var$TableHeaderRow({ item: item, children: children, layoutInfo: layoutInfo, parent: parent, ...props }) {
|
|
1007
1012
|
let { state: state, headerMenuOpen: headerMenuOpen } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
1008
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
1013
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
1009
1014
|
let { rowProps: rowProps } = (0, $idLTj$reactariatable.useTableHeaderRow)({
|
|
1010
1015
|
node: item,
|
|
1011
1016
|
isVirtualized: true
|
|
@@ -1022,7 +1027,7 @@ function $e39c6de4eb69450d$var$TableHeaderRow({ item: item, children: children,
|
|
|
1022
1027
|
}, children);
|
|
1023
1028
|
}
|
|
1024
1029
|
function $e39c6de4eb69450d$var$TableDragCell({ cell: cell }) {
|
|
1025
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
1030
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
1026
1031
|
let { state: state, isTableDraggable: isTableDraggable } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
1027
1032
|
let isDisabled = state.disabledKeys.has(cell.parentKey);
|
|
1028
1033
|
let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
|
|
@@ -1040,7 +1045,7 @@ function $e39c6de4eb69450d$var$TableDragCell({ cell: cell }) {
|
|
|
1040
1045
|
}, isTableDraggable && !isDisabled && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$DragButton, null)));
|
|
1041
1046
|
}
|
|
1042
1047
|
function $e39c6de4eb69450d$var$TableCheckboxCell({ cell: cell }) {
|
|
1043
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
1048
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
1044
1049
|
let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
1045
1050
|
let isDisabled = state.disabledKeys.has(cell.parentKey);
|
|
1046
1051
|
let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
|
|
@@ -1069,7 +1074,7 @@ function $e39c6de4eb69450d$var$TableCell({ cell: cell }) {
|
|
|
1069
1074
|
let { scale: scale } = (0, $idLTj$reactspectrumprovider.useProvider)();
|
|
1070
1075
|
let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
1071
1076
|
let isExpandableTable = 'expandedKeys' in state;
|
|
1072
|
-
let ref = (0, $idLTj$react.useRef)();
|
|
1077
|
+
let ref = (0, $idLTj$react.useRef)(undefined);
|
|
1073
1078
|
let columnProps = cell.column.props;
|
|
1074
1079
|
let isDisabled = state.disabledKeys.has(cell.parentKey);
|
|
1075
1080
|
let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
|
|
@@ -1146,7 +1151,7 @@ function $e39c6de4eb69450d$var$ExpandableRowChevron({ cell: cell }) {
|
|
|
1146
1151
|
// TODO: move some/all of the chevron button setup into a separate hook?
|
|
1147
1152
|
let { direction: direction } = (0, $idLTj$reactariai18n.useLocale)();
|
|
1148
1153
|
let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
|
|
1149
|
-
let expandButtonRef = (0, $idLTj$react.useRef)();
|
|
1154
|
+
let expandButtonRef = (0, $idLTj$react.useRef)(undefined);
|
|
1150
1155
|
let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), '@react-spectrum/table');
|
|
1151
1156
|
let isExpanded;
|
|
1152
1157
|
if ('expandedKeys' in state) isExpanded = state.expandedKeys === 'all' || state.expandedKeys.has(cell.parentKey);
|