@react-spectrum/table 3.7.2-nightly.3764 → 3.7.2-nightly.3785
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/import.mjs +469 -75
- package/dist/main.css +1 -1
- package/dist/main.js +467 -73
- package/dist/main.js.map +1 -1
- package/dist/module.js +469 -75
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +43 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +31 -27
- package/src/DragPreview.tsx +109 -0
- package/src/InsertionIndicator.tsx +50 -0
- package/src/Resizer.tsx +10 -9
- package/src/RootDropIndicator.tsx +28 -0
- package/src/TableView.tsx +382 -54
- package/src/cursors/Cur_MoveHorizontal_9_9.svg +7 -0
- package/src/cursors/Cur_MoveToLeft_9_9.svg +5 -0
- package/src/cursors/Cur_MoveToRight_9_9.svg +5 -0
- package/src/index.ts +2 -1
- package/src/table.css +182 -0
package/dist/import.mjs
CHANGED
|
@@ -9,8 +9,9 @@ import {useFocusRing as $gyhAV$useFocusRing, FocusScope as $gyhAV$FocusScope, Fo
|
|
|
9
9
|
import {getInteractionModality as $gyhAV$getInteractionModality, usePress as $gyhAV$usePress, useHover as $gyhAV$useHover} from "@react-aria/interactions";
|
|
10
10
|
import {MenuTrigger as $gyhAV$MenuTrigger, Menu as $gyhAV$Menu, Item as $gyhAV$Item} from "@react-spectrum/menu";
|
|
11
11
|
import {layoutInfoToStyle as $gyhAV$layoutInfoToStyle, VirtualizerItem as $gyhAV$VirtualizerItem, setScrollLeft as $gyhAV$setScrollLeft, useVirtualizer as $gyhAV$useVirtualizer, ScrollView as $gyhAV$ScrollView} from "@react-aria/virtualizer";
|
|
12
|
+
import $gyhAV$spectrumiconsuiListGripper from "@spectrum-icons/ui/ListGripper";
|
|
12
13
|
import {ProgressCircle as $gyhAV$ProgressCircle} from "@react-spectrum/progress";
|
|
13
|
-
import $gyhAV$react, {useContext as $gyhAV$useContext,
|
|
14
|
+
import $gyhAV$react, {useContext as $gyhAV$useContext, useRef as $gyhAV$useRef, useEffect as $gyhAV$useEffect, useState as $gyhAV$useState, useCallback as $gyhAV$useCallback, useMemo as $gyhAV$useMemo} from "react";
|
|
14
15
|
import {useVirtualizerState as $gyhAV$useVirtualizerState} from "@react-stately/virtualizer";
|
|
15
16
|
import {TableLayout as $gyhAV$TableLayout} from "@react-stately/layout";
|
|
16
17
|
import {TooltipTrigger as $gyhAV$TooltipTrigger, Tooltip as $gyhAV$Tooltip} from "@react-spectrum/tooltip";
|
|
@@ -18,8 +19,9 @@ import {useButton as $gyhAV$useButton} from "@react-aria/button";
|
|
|
18
19
|
import {useLocale as $gyhAV$useLocale, useLocalizedStringFormatter as $gyhAV$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
19
20
|
import {useProviderProps as $gyhAV$useProviderProps, useProvider as $gyhAV$useProvider} from "@react-spectrum/provider";
|
|
20
21
|
import {useTable as $gyhAV$useTable, useTableRowGroup as $gyhAV$useTableRowGroup, useTableColumnHeader as $gyhAV$useTableColumnHeader, useTableSelectAllCheckbox as $gyhAV$useTableSelectAllCheckbox, useTableRow as $gyhAV$useTableRow, useTableHeaderRow as $gyhAV$useTableHeaderRow, useTableCell as $gyhAV$useTableCell, useTableSelectionCheckbox as $gyhAV$useTableSelectionCheckbox, useTableColumnResize as $gyhAV$useTableColumnResize} from "@react-aria/table";
|
|
21
|
-
import {VisuallyHidden as $gyhAV$VisuallyHidden} from "@react-aria/visually-hidden";
|
|
22
|
+
import {VisuallyHidden as $gyhAV$VisuallyHidden, useVisuallyHidden as $gyhAV$useVisuallyHidden} from "@react-aria/visually-hidden";
|
|
22
23
|
import $gyhAV$reactdom from "react-dom";
|
|
24
|
+
import {Flex as $gyhAV$Flex} from "@react-spectrum/layout";
|
|
23
25
|
|
|
24
26
|
function $parcel$interopDefault(a) {
|
|
25
27
|
return a && a.__esModule ? a.default : a;
|
|
@@ -55,6 +57,122 @@ function $parcel$export(e, n, v, s) {
|
|
|
55
57
|
|
|
56
58
|
|
|
57
59
|
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var $325bc3d43b25708b$exports = {};
|
|
63
|
+
|
|
64
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table", () => $325bc3d43b25708b$export$8cc7e6e5f955c192, (v) => $325bc3d43b25708b$export$8cc7e6e5f955c192 = v);
|
|
65
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cell", () => $325bc3d43b25708b$export$19015e98090cea63, (v) => $325bc3d43b25708b$export$19015e98090cea63 = v);
|
|
66
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cellWrapper", () => $325bc3d43b25708b$export$ea1d9f40910c509, (v) => $325bc3d43b25708b$export$ea1d9f40910c509 = v);
|
|
67
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cell--alignStart", () => $325bc3d43b25708b$export$25d7f56ba6d0d442, (v) => $325bc3d43b25708b$export$25d7f56ba6d0d442 = v);
|
|
68
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cell--alignCenter", () => $325bc3d43b25708b$export$14101ea2699002fc, (v) => $325bc3d43b25708b$export$14101ea2699002fc = v);
|
|
69
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cell--alignEnd", () => $325bc3d43b25708b$export$c594335f8535fc47, (v) => $325bc3d43b25708b$export$c594335f8535fc47 = v);
|
|
70
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-centeredWrapper", () => $325bc3d43b25708b$export$8bffb31c98aaf8d5, (v) => $325bc3d43b25708b$export$8bffb31c98aaf8d5 = v);
|
|
71
|
+
$parcel$export($325bc3d43b25708b$exports, "resize-ew", () => $325bc3d43b25708b$export$649f0fca6895dd60, (v) => $325bc3d43b25708b$export$649f0fca6895dd60 = v);
|
|
72
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-columnResizer--ewresize", () => $325bc3d43b25708b$export$a1b113e03a5ee3de, (v) => $325bc3d43b25708b$export$a1b113e03a5ee3de = v);
|
|
73
|
+
$parcel$export($325bc3d43b25708b$exports, "resize-e", () => $325bc3d43b25708b$export$7c4671d507759106, (v) => $325bc3d43b25708b$export$7c4671d507759106 = v);
|
|
74
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-columnResizer--eresize", () => $325bc3d43b25708b$export$44b07791dc26fbe2, (v) => $325bc3d43b25708b$export$44b07791dc26fbe2 = v);
|
|
75
|
+
$parcel$export($325bc3d43b25708b$exports, "resize-w", () => $325bc3d43b25708b$export$f87ceeb5dfa395aa, (v) => $325bc3d43b25708b$export$f87ceeb5dfa395aa = v);
|
|
76
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-columnResizer--wresize", () => $325bc3d43b25708b$export$625aeffc18827554, (v) => $325bc3d43b25708b$export$625aeffc18827554 = v);
|
|
77
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-row-dragPreview", () => $325bc3d43b25708b$export$ba71e6bcd70242c7, (v) => $325bc3d43b25708b$export$ba71e6bcd70242c7 = v);
|
|
78
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-row-dragPreview--multiple", () => $325bc3d43b25708b$export$3d73889014dd20dd, (v) => $325bc3d43b25708b$export$3d73889014dd20dd = v);
|
|
79
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-row-badge", () => $325bc3d43b25708b$export$3559001d7e84a6da, (v) => $325bc3d43b25708b$export$3559001d7e84a6da = v);
|
|
80
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-body--dropTarget", () => $325bc3d43b25708b$export$2698e8974a57cb61, (v) => $325bc3d43b25708b$export$2698e8974a57cb61 = v);
|
|
81
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-InsertionIndicator", () => $325bc3d43b25708b$export$e0940649899bb056, (v) => $325bc3d43b25708b$export$e0940649899bb056 = v);
|
|
82
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-InsertionIndicator--dropTarget", () => $325bc3d43b25708b$export$e246eff99e77d045, (v) => $325bc3d43b25708b$export$e246eff99e77d045 = v);
|
|
83
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-dragButtonCell", () => $325bc3d43b25708b$export$8d6d420175da304f, (v) => $325bc3d43b25708b$export$8d6d420175da304f = v);
|
|
84
|
+
$parcel$export($325bc3d43b25708b$exports, "spectrum-Table-row-draghandle-button", () => $325bc3d43b25708b$export$13875dd576e00f26, (v) => $325bc3d43b25708b$export$13875dd576e00f26 = v);
|
|
85
|
+
$parcel$export($325bc3d43b25708b$exports, "focus-ring", () => $325bc3d43b25708b$export$f39a09f249340e2a, (v) => $325bc3d43b25708b$export$f39a09f249340e2a = v);
|
|
86
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-dragButtonHeadCell", () => $325bc3d43b25708b$export$3c106e5e58486b14, (v) => $325bc3d43b25708b$export$3c106e5e58486b14 = v);
|
|
87
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-row--dropTarget", () => $325bc3d43b25708b$export$5e4ce8d9f081b812, (v) => $325bc3d43b25708b$export$5e4ce8d9f081b812 = v);
|
|
88
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-cellWrapper--dropTarget", () => $325bc3d43b25708b$export$374244a7e6e6e484, (v) => $325bc3d43b25708b$export$374244a7e6e6e484 = v);
|
|
89
|
+
$parcel$export($325bc3d43b25708b$exports, "react-spectrum-Table-row", () => $325bc3d43b25708b$export$a2af12d9c37814bd, (v) => $325bc3d43b25708b$export$a2af12d9c37814bd = v);
|
|
90
|
+
var $325bc3d43b25708b$export$8cc7e6e5f955c192;
|
|
91
|
+
var $325bc3d43b25708b$export$19015e98090cea63;
|
|
92
|
+
var $325bc3d43b25708b$export$ea1d9f40910c509;
|
|
93
|
+
var $325bc3d43b25708b$export$25d7f56ba6d0d442;
|
|
94
|
+
var $325bc3d43b25708b$export$14101ea2699002fc;
|
|
95
|
+
var $325bc3d43b25708b$export$c594335f8535fc47;
|
|
96
|
+
var $325bc3d43b25708b$export$8bffb31c98aaf8d5;
|
|
97
|
+
var $325bc3d43b25708b$export$649f0fca6895dd60;
|
|
98
|
+
var $325bc3d43b25708b$export$a1b113e03a5ee3de;
|
|
99
|
+
var $325bc3d43b25708b$export$7c4671d507759106;
|
|
100
|
+
var $325bc3d43b25708b$export$44b07791dc26fbe2;
|
|
101
|
+
var $325bc3d43b25708b$export$f87ceeb5dfa395aa;
|
|
102
|
+
var $325bc3d43b25708b$export$625aeffc18827554;
|
|
103
|
+
var $325bc3d43b25708b$export$ba71e6bcd70242c7;
|
|
104
|
+
var $325bc3d43b25708b$export$3d73889014dd20dd;
|
|
105
|
+
var $325bc3d43b25708b$export$3559001d7e84a6da;
|
|
106
|
+
var $325bc3d43b25708b$export$2698e8974a57cb61;
|
|
107
|
+
var $325bc3d43b25708b$export$e0940649899bb056;
|
|
108
|
+
var $325bc3d43b25708b$export$e246eff99e77d045;
|
|
109
|
+
var $325bc3d43b25708b$export$8d6d420175da304f;
|
|
110
|
+
var $325bc3d43b25708b$export$13875dd576e00f26;
|
|
111
|
+
var $325bc3d43b25708b$export$f39a09f249340e2a;
|
|
112
|
+
var $325bc3d43b25708b$export$3c106e5e58486b14;
|
|
113
|
+
var $325bc3d43b25708b$export$5e4ce8d9f081b812;
|
|
114
|
+
var $325bc3d43b25708b$export$374244a7e6e6e484;
|
|
115
|
+
var $325bc3d43b25708b$export$a2af12d9c37814bd;
|
|
116
|
+
$325bc3d43b25708b$export$8cc7e6e5f955c192 = "react-spectrum-Table_e844a7";
|
|
117
|
+
$325bc3d43b25708b$export$19015e98090cea63 = "react-spectrum-Table-cell_e844a7";
|
|
118
|
+
$325bc3d43b25708b$export$ea1d9f40910c509 = "react-spectrum-Table-cellWrapper_e844a7";
|
|
119
|
+
$325bc3d43b25708b$export$25d7f56ba6d0d442 = "react-spectrum-Table-cell--alignStart_e844a7";
|
|
120
|
+
$325bc3d43b25708b$export$14101ea2699002fc = "react-spectrum-Table-cell--alignCenter_e844a7";
|
|
121
|
+
$325bc3d43b25708b$export$c594335f8535fc47 = "react-spectrum-Table-cell--alignEnd_e844a7";
|
|
122
|
+
$325bc3d43b25708b$export$8bffb31c98aaf8d5 = "react-spectrum-Table-centeredWrapper_e844a7";
|
|
123
|
+
$325bc3d43b25708b$export$649f0fca6895dd60 = "resize-ew_e844a7";
|
|
124
|
+
$325bc3d43b25708b$export$a1b113e03a5ee3de = "react-spectrum-Table-columnResizer--ewresize_e844a7";
|
|
125
|
+
$325bc3d43b25708b$export$7c4671d507759106 = "resize-e_e844a7";
|
|
126
|
+
$325bc3d43b25708b$export$44b07791dc26fbe2 = "react-spectrum-Table-columnResizer--eresize_e844a7";
|
|
127
|
+
$325bc3d43b25708b$export$f87ceeb5dfa395aa = "resize-w_e844a7";
|
|
128
|
+
$325bc3d43b25708b$export$625aeffc18827554 = "react-spectrum-Table-columnResizer--wresize_e844a7";
|
|
129
|
+
$325bc3d43b25708b$export$ba71e6bcd70242c7 = "react-spectrum-Table-row-dragPreview_e844a7";
|
|
130
|
+
$325bc3d43b25708b$export$3d73889014dd20dd = "react-spectrum-Table-row-dragPreview--multiple_e844a7";
|
|
131
|
+
$325bc3d43b25708b$export$3559001d7e84a6da = "react-spectrum-Table-row-badge_e844a7";
|
|
132
|
+
$325bc3d43b25708b$export$2698e8974a57cb61 = "react-spectrum-Table-body--dropTarget_e844a7";
|
|
133
|
+
$325bc3d43b25708b$export$e0940649899bb056 = "react-spectrum-Table-InsertionIndicator_e844a7";
|
|
134
|
+
$325bc3d43b25708b$export$e246eff99e77d045 = "react-spectrum-Table-InsertionIndicator--dropTarget_e844a7";
|
|
135
|
+
$325bc3d43b25708b$export$8d6d420175da304f = "react-spectrum-Table-dragButtonCell_e844a7";
|
|
136
|
+
$325bc3d43b25708b$export$13875dd576e00f26 = "spectrum-Table-row-draghandle-button_e844a7";
|
|
137
|
+
$325bc3d43b25708b$export$f39a09f249340e2a = "focus-ring_e844a7";
|
|
138
|
+
$325bc3d43b25708b$export$3c106e5e58486b14 = "react-spectrum-dragButtonHeadCell_e844a7";
|
|
139
|
+
$325bc3d43b25708b$export$5e4ce8d9f081b812 = "react-spectrum-Table-row--dropTarget_e844a7";
|
|
140
|
+
$325bc3d43b25708b$export$374244a7e6e6e484 = "react-spectrum-Table-cellWrapper--dropTarget_e844a7";
|
|
141
|
+
$325bc3d43b25708b$export$a2af12d9c37814bd = "react-spectrum-Table-row_e844a7";
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
function $7ee9a922ee4e8032$export$2c0bab5914a9d088(props) {
|
|
147
|
+
let { dropState: dropState , dragAndDropHooks: dragAndDropHooks } = (0, $d14697b14e638114$export$3cb274deb6c2d854)();
|
|
148
|
+
const { target: target , rowProps: rowProps } = props;
|
|
149
|
+
let ref = (0, $gyhAV$useRef)();
|
|
150
|
+
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator(props, dropState, ref);
|
|
151
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $gyhAV$useVisuallyHidden)();
|
|
152
|
+
let isDropTarget = dropState.isDropTarget(target);
|
|
153
|
+
if (!isDropTarget && dropIndicatorProps["aria-hidden"]) return null;
|
|
154
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
position: "absolute",
|
|
157
|
+
top: rowProps.style.top + (target.dropPosition === "after" ? rowProps.style.height : 0),
|
|
158
|
+
width: rowProps.style.width
|
|
159
|
+
},
|
|
160
|
+
role: "row",
|
|
161
|
+
"aria-hidden": dropIndicatorProps["aria-hidden"]
|
|
162
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
163
|
+
role: "gridcell",
|
|
164
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table-InsertionIndicator", {
|
|
165
|
+
"react-spectrum-Table-InsertionIndicator--dropTarget": isDropTarget
|
|
166
|
+
})
|
|
167
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
168
|
+
...visuallyHiddenProps,
|
|
169
|
+
role: "button",
|
|
170
|
+
...dropIndicatorProps,
|
|
171
|
+
ref: ref
|
|
172
|
+
})));
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
58
176
|
var $467944769c14687b$exports = {};
|
|
59
177
|
var $daf541512f75fd9b$exports = {};
|
|
60
178
|
$daf541512f75fd9b$exports = {
|
|
@@ -129,7 +247,8 @@ $4040b78666bdeb49$exports = {
|
|
|
129
247
|
"sortAscending": `Sort Ascending`,
|
|
130
248
|
"sortDescending": `Sort Descending`,
|
|
131
249
|
"resizeColumn": `Resize column`,
|
|
132
|
-
"columnResizer": `Column resizer
|
|
250
|
+
"columnResizer": `Column resizer`,
|
|
251
|
+
"drag": `Drag`
|
|
133
252
|
};
|
|
134
253
|
|
|
135
254
|
|
|
@@ -470,6 +589,7 @@ $467944769c14687b$exports = {
|
|
|
470
589
|
|
|
471
590
|
|
|
472
591
|
|
|
592
|
+
|
|
473
593
|
/*
|
|
474
594
|
* Copyright 2022 Adobe. All rights reserved.
|
|
475
595
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -529,6 +649,7 @@ function $cb7d341e8868d81d$export$d9658cdf8c86807() {
|
|
|
529
649
|
|
|
530
650
|
|
|
531
651
|
|
|
652
|
+
|
|
532
653
|
var $bd5d41f647a296c3$exports = {};
|
|
533
654
|
|
|
534
655
|
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table", () => $bd5d41f647a296c3$export$455c59d2b5bafef0, (v) => $bd5d41f647a296c3$export$455c59d2b5bafef0 = v);
|
|
@@ -579,12 +700,6 @@ $parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-colResizeIndicator", (
|
|
|
579
700
|
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-colResizeIndicator--visible", () => $bd5d41f647a296c3$export$b0bdf5d269bf857, (v) => $bd5d41f647a296c3$export$b0bdf5d269bf857 = v);
|
|
580
701
|
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-colResizeNubbin", () => $bd5d41f647a296c3$export$12c7b2fb4df461f8, (v) => $bd5d41f647a296c3$export$12c7b2fb4df461f8 = v);
|
|
581
702
|
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-colResizeNubbin--visible", () => $bd5d41f647a296c3$export$56a3c5ebd77d19bf, (v) => $bd5d41f647a296c3$export$56a3c5ebd77d19bf = v);
|
|
582
|
-
$parcel$export($bd5d41f647a296c3$exports, "resize-ew", () => $bd5d41f647a296c3$export$649f0fca6895dd60, (v) => $bd5d41f647a296c3$export$649f0fca6895dd60 = v);
|
|
583
|
-
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-columnResizer--ewresize", () => $bd5d41f647a296c3$export$1ae46a38f6cf4c29, (v) => $bd5d41f647a296c3$export$1ae46a38f6cf4c29 = v);
|
|
584
|
-
$parcel$export($bd5d41f647a296c3$exports, "resize-e", () => $bd5d41f647a296c3$export$7c4671d507759106, (v) => $bd5d41f647a296c3$export$7c4671d507759106 = v);
|
|
585
|
-
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-columnResizer--eresize", () => $bd5d41f647a296c3$export$a051348d523fc956, (v) => $bd5d41f647a296c3$export$a051348d523fc956 = v);
|
|
586
|
-
$parcel$export($bd5d41f647a296c3$exports, "resize-w", () => $bd5d41f647a296c3$export$f87ceeb5dfa395aa, (v) => $bd5d41f647a296c3$export$f87ceeb5dfa395aa = v);
|
|
587
|
-
$parcel$export($bd5d41f647a296c3$exports, "spectrum-Table-columnResizer--wresize", () => $bd5d41f647a296c3$export$5d01542627c9931d, (v) => $bd5d41f647a296c3$export$5d01542627c9931d = v);
|
|
588
703
|
$parcel$export($bd5d41f647a296c3$exports, "is-hovered", () => $bd5d41f647a296c3$export$b8813cd5d7824ce7, (v) => $bd5d41f647a296c3$export$b8813cd5d7824ce7 = v);
|
|
589
704
|
$parcel$export($bd5d41f647a296c3$exports, "is-active", () => $bd5d41f647a296c3$export$20fd0f7cd4e6112f, (v) => $bd5d41f647a296c3$export$20fd0f7cd4e6112f = v);
|
|
590
705
|
$parcel$export($bd5d41f647a296c3$exports, "is-disabled", () => $bd5d41f647a296c3$export$d35bc1e505d1ebbf, (v) => $bd5d41f647a296c3$export$d35bc1e505d1ebbf = v);
|
|
@@ -638,12 +753,6 @@ var $bd5d41f647a296c3$export$3a270f8fab5daa8b;
|
|
|
638
753
|
var $bd5d41f647a296c3$export$b0bdf5d269bf857;
|
|
639
754
|
var $bd5d41f647a296c3$export$12c7b2fb4df461f8;
|
|
640
755
|
var $bd5d41f647a296c3$export$56a3c5ebd77d19bf;
|
|
641
|
-
var $bd5d41f647a296c3$export$649f0fca6895dd60;
|
|
642
|
-
var $bd5d41f647a296c3$export$1ae46a38f6cf4c29;
|
|
643
|
-
var $bd5d41f647a296c3$export$7c4671d507759106;
|
|
644
|
-
var $bd5d41f647a296c3$export$a051348d523fc956;
|
|
645
|
-
var $bd5d41f647a296c3$export$f87ceeb5dfa395aa;
|
|
646
|
-
var $bd5d41f647a296c3$export$5d01542627c9931d;
|
|
647
756
|
var $bd5d41f647a296c3$export$b8813cd5d7824ce7;
|
|
648
757
|
var $bd5d41f647a296c3$export$20fd0f7cd4e6112f;
|
|
649
758
|
var $bd5d41f647a296c3$export$d35bc1e505d1ebbf;
|
|
@@ -697,12 +806,6 @@ $bd5d41f647a296c3$export$3a270f8fab5daa8b = "spectrum-Table-colResizeIndicator_d
|
|
|
697
806
|
$bd5d41f647a296c3$export$b0bdf5d269bf857 = "spectrum-Table-colResizeIndicator--visible_d0fc74";
|
|
698
807
|
$bd5d41f647a296c3$export$12c7b2fb4df461f8 = "spectrum-Table-colResizeNubbin_d0fc74";
|
|
699
808
|
$bd5d41f647a296c3$export$56a3c5ebd77d19bf = "spectrum-Table-colResizeNubbin--visible_d0fc74";
|
|
700
|
-
$bd5d41f647a296c3$export$649f0fca6895dd60 = "resize-ew_d0fc74";
|
|
701
|
-
$bd5d41f647a296c3$export$1ae46a38f6cf4c29 = "spectrum-Table-columnResizer--ewresize_d0fc74";
|
|
702
|
-
$bd5d41f647a296c3$export$7c4671d507759106 = "resize-e_d0fc74";
|
|
703
|
-
$bd5d41f647a296c3$export$a051348d523fc956 = "spectrum-Table-columnResizer--eresize_d0fc74";
|
|
704
|
-
$bd5d41f647a296c3$export$f87ceeb5dfa395aa = "resize-w_d0fc74";
|
|
705
|
-
$bd5d41f647a296c3$export$5d01542627c9931d = "spectrum-Table-columnResizer--wresize_d0fc74";
|
|
706
809
|
$bd5d41f647a296c3$export$b8813cd5d7824ce7 = "is-hovered_d0fc74";
|
|
707
810
|
$bd5d41f647a296c3$export$20fd0f7cd4e6112f = "is-active_d0fc74";
|
|
708
811
|
$bd5d41f647a296c3$export$d35bc1e505d1ebbf = "is-disabled_d0fc74";
|
|
@@ -715,9 +818,9 @@ $bd5d41f647a296c3$export$d3861fcb1e5f6a2b = "spectrum-Table-colResizeIndicator--
|
|
|
715
818
|
|
|
716
819
|
|
|
717
820
|
let $fc695d2eafc2b351$var$CURSOR_CLASSES = {
|
|
718
|
-
w: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
719
|
-
e: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
720
|
-
ew: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
821
|
+
w: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "resize-w"),
|
|
822
|
+
e: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "resize-e"),
|
|
823
|
+
ew: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "resize-ew")
|
|
721
824
|
};
|
|
722
825
|
function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
723
826
|
let { column: column , showResizer: showResizer } = props;
|
|
@@ -753,7 +856,7 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
753
856
|
};
|
|
754
857
|
}, []);
|
|
755
858
|
let { inputProps: inputProps , resizerProps: resizerProps } = (0, $gyhAV$useTableColumnResize)((0, $gyhAV$mergeProps)(props, {
|
|
756
|
-
label: stringFormatter.format("columnResizer"),
|
|
859
|
+
"aria-label": stringFormatter.format("columnResizer"),
|
|
757
860
|
isDisabled: isEmpty,
|
|
758
861
|
shouldResizeOnFocus: true,
|
|
759
862
|
onResizeStart: ()=>{
|
|
@@ -789,11 +892,11 @@ function $fc695d2eafc2b351$var$Resizer(props, ref) {
|
|
|
789
892
|
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
790
893
|
role: "presentation",
|
|
791
894
|
style: style,
|
|
792
|
-
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-columnResizer", {
|
|
793
|
-
"spectrum-Table-columnResizer--ewresize": !(isEResizable && isWResizable),
|
|
794
|
-
"spectrum-Table-columnResizer--eresize": direction === "rtl" ? isWResizable : isEResizable,
|
|
795
|
-
"spectrum-Table-columnResizer--wresize": direction === "rtl" ? isEResizable : isWResizable
|
|
796
|
-
}),
|
|
895
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-columnResizer", (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), {
|
|
896
|
+
"react-spectrum-Table-columnResizer--ewresize": !(isEResizable && isWResizable),
|
|
897
|
+
"react-spectrum-Table-columnResizer--eresize": direction === "rtl" ? isWResizable : isEResizable,
|
|
898
|
+
"react-spectrum-Table-columnResizer--wresize": direction === "rtl" ? isEResizable : isWResizable
|
|
899
|
+
})),
|
|
797
900
|
...resizerProps
|
|
798
901
|
}, /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$VisuallyHidden), null, /*#__PURE__*/ (0, $gyhAV$react).createElement("input", {
|
|
799
902
|
ref: ref,
|
|
@@ -823,29 +926,86 @@ const $fc695d2eafc2b351$export$48a76196cafe3b93 = /*#__PURE__*/ (0, $gyhAV$react
|
|
|
823
926
|
|
|
824
927
|
|
|
825
928
|
|
|
826
|
-
var $325bc3d43b25708b$exports = {};
|
|
827
929
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
$
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
$
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
930
|
+
|
|
931
|
+
function $4e6fc36ba71ba405$export$d30a7814cfd4033e() {
|
|
932
|
+
let { dropState: dropState , dragAndDropHooks: dragAndDropHooks , state: state } = (0, $d14697b14e638114$export$3cb274deb6c2d854)();
|
|
933
|
+
let ref = (0, $gyhAV$useRef)();
|
|
934
|
+
let { dropIndicatorProps: dropIndicatorProps } = dragAndDropHooks.useDropIndicator({
|
|
935
|
+
target: {
|
|
936
|
+
type: "root"
|
|
937
|
+
}
|
|
938
|
+
}, dropState, ref);
|
|
939
|
+
let isDropTarget = dropState.isDropTarget({
|
|
940
|
+
type: "root"
|
|
941
|
+
});
|
|
942
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $gyhAV$useVisuallyHidden)();
|
|
943
|
+
if (!isDropTarget && dropIndicatorProps["aria-hidden"]) return null;
|
|
944
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
945
|
+
role: "row",
|
|
946
|
+
"aria-hidden": dropIndicatorProps["aria-hidden"]
|
|
947
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
948
|
+
role: "gridcell",
|
|
949
|
+
"aria-selected": "false",
|
|
950
|
+
"aria-colspan": state.collection.columns.length
|
|
951
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
952
|
+
role: "button",
|
|
953
|
+
...visuallyHiddenProps,
|
|
954
|
+
...dropIndicatorProps,
|
|
955
|
+
ref: ref
|
|
956
|
+
})));
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
/*
|
|
961
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
962
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
963
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
964
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
965
|
+
*
|
|
966
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
967
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
968
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
969
|
+
* governing permissions and limitations under the License.
|
|
970
|
+
*/
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
function $daa6ead3d9d3506a$export$110dbec0c8ae54d1(props) {
|
|
976
|
+
let { cell: cell } = props;
|
|
977
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
978
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-cell", (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table-cell"))
|
|
979
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("span", {
|
|
980
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-cellContents")
|
|
981
|
+
}, cell.rendered));
|
|
982
|
+
}
|
|
983
|
+
function $daa6ead3d9d3506a$export$905ab40ac2179daa(props) {
|
|
984
|
+
let { item: item , children: children , itemCount: itemCount , density: density , layout: layout , maxWidth: maxWidth , rowHeaderColumnKeys: rowHeaderColumnKeys } = props;
|
|
985
|
+
let { height: height } = layout.getLayoutInfo(item.key).rect;
|
|
986
|
+
let isDraggingMultiple = itemCount > 1;
|
|
987
|
+
// @ts-ignore
|
|
988
|
+
let cells = [
|
|
989
|
+
...children
|
|
990
|
+
].filter((cell)=>rowHeaderColumnKeys.has(cell.column.key));
|
|
991
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$Flex), {
|
|
992
|
+
justifyContent: "space-between",
|
|
993
|
+
UNSAFE_style: {
|
|
994
|
+
height: height,
|
|
995
|
+
maxWidth: maxWidth
|
|
996
|
+
},
|
|
997
|
+
UNSAFE_className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-row", (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table-row", "react-spectrum-Table-row-dragPreview", {
|
|
998
|
+
"react-spectrum-Table-row-dragPreview--multiple": isDraggingMultiple
|
|
999
|
+
}, `react-spectrum-Table-row-dragPreview--${density}`))
|
|
1000
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", null, cells.map((cell)=>/*#__PURE__*/ (0, $gyhAV$react).createElement($daa6ead3d9d3506a$export$110dbec0c8ae54d1, {
|
|
1001
|
+
key: cell.key,
|
|
1002
|
+
cell: cell
|
|
1003
|
+
}))), isDraggingMultiple && /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1004
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table-row-badge")
|
|
1005
|
+
}, itemCount));
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
|
|
849
1009
|
|
|
850
1010
|
|
|
851
1011
|
|
|
@@ -882,6 +1042,10 @@ const $d14697b14e638114$var$SELECTION_CELL_DEFAULT_WIDTH = {
|
|
|
882
1042
|
medium: 38,
|
|
883
1043
|
large: 48
|
|
884
1044
|
};
|
|
1045
|
+
const $d14697b14e638114$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH = {
|
|
1046
|
+
medium: 16,
|
|
1047
|
+
large: 20
|
|
1048
|
+
};
|
|
885
1049
|
const $d14697b14e638114$var$TableContext = /*#__PURE__*/ (0, $gyhAV$react).createContext(null);
|
|
886
1050
|
function $d14697b14e638114$export$3cb274deb6c2d854() {
|
|
887
1051
|
return (0, $gyhAV$useContext)($d14697b14e638114$var$TableContext);
|
|
@@ -891,25 +1055,39 @@ function $d14697b14e638114$export$3f8f74b6bfd2c5df() {
|
|
|
891
1055
|
return (0, $gyhAV$useContext)($d14697b14e638114$var$VirtualizerContext);
|
|
892
1056
|
}
|
|
893
1057
|
function $d14697b14e638114$var$TableView(props, ref) {
|
|
1058
|
+
var _dropState_target;
|
|
894
1059
|
props = (0, $gyhAV$useProviderProps)(props);
|
|
895
|
-
let { isQuiet: isQuiet , onAction: onAction , onResizeStart: propsOnResizeStart , onResizeEnd: propsOnResizeEnd } = props;
|
|
1060
|
+
let { isQuiet: isQuiet , onAction: onAction , onResizeStart: propsOnResizeStart , onResizeEnd: propsOnResizeEnd , dragAndDropHooks: dragAndDropHooks } = props;
|
|
1061
|
+
let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
|
|
1062
|
+
let isTableDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
|
|
1063
|
+
let dragHooksProvided = (0, $gyhAV$useRef)(isTableDraggable);
|
|
1064
|
+
let dropHooksProvided = (0, $gyhAV$useRef)(isTableDroppable);
|
|
1065
|
+
(0, $gyhAV$useEffect)(()=>{
|
|
1066
|
+
if (dragHooksProvided.current !== isTableDraggable) console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
|
|
1067
|
+
if (dropHooksProvided.current !== isTableDroppable) console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
|
|
1068
|
+
}, [
|
|
1069
|
+
isTableDraggable,
|
|
1070
|
+
isTableDroppable
|
|
1071
|
+
]);
|
|
896
1072
|
let { styleProps: styleProps } = (0, $gyhAV$useStyleProps)(props);
|
|
897
1073
|
let [showSelectionCheckboxes, setShowSelectionCheckboxes] = (0, $gyhAV$useState)(props.selectionStyle !== "highlight");
|
|
898
1074
|
let { direction: direction } = (0, $gyhAV$useLocale)();
|
|
899
1075
|
let { scale: scale } = (0, $gyhAV$useProvider)();
|
|
900
|
-
const getDefaultWidth = (0, $gyhAV$useCallback)(({ props: { hideHeader: hideHeader , isSelectionCell: isSelectionCell , showDivider: showDivider } })=>{
|
|
1076
|
+
const getDefaultWidth = (0, $gyhAV$useCallback)(({ props: { hideHeader: hideHeader , isSelectionCell: isSelectionCell , showDivider: showDivider , isDragButtonCell: isDragButtonCell } })=>{
|
|
901
1077
|
if (hideHeader) {
|
|
902
1078
|
let width = $d14697b14e638114$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
903
1079
|
return showDivider ? width + 1 : width;
|
|
904
1080
|
} else if (isSelectionCell) return $d14697b14e638114$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
1081
|
+
else if (isDragButtonCell) return $d14697b14e638114$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
905
1082
|
}, [
|
|
906
1083
|
scale
|
|
907
1084
|
]);
|
|
908
|
-
const getDefaultMinWidth = (0, $gyhAV$useCallback)(({ props: { hideHeader: hideHeader , isSelectionCell: isSelectionCell , showDivider: showDivider } })=>{
|
|
1085
|
+
const getDefaultMinWidth = (0, $gyhAV$useCallback)(({ props: { hideHeader: hideHeader , isSelectionCell: isSelectionCell , showDivider: showDivider , isDragButtonCell: isDragButtonCell } })=>{
|
|
909
1086
|
if (hideHeader) {
|
|
910
1087
|
let width = $d14697b14e638114$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
|
|
911
1088
|
return showDivider ? width + 1 : width;
|
|
912
1089
|
} else if (isSelectionCell) return $d14697b14e638114$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
|
|
1090
|
+
else if (isDragButtonCell) return $d14697b14e638114$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
|
|
913
1091
|
return 75;
|
|
914
1092
|
}, [
|
|
915
1093
|
scale
|
|
@@ -924,6 +1102,7 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
924
1102
|
let state = (0, $gyhAV$useTableState)({
|
|
925
1103
|
...props,
|
|
926
1104
|
showSelectionCheckboxes: showSelectionCheckboxes,
|
|
1105
|
+
showDragButtons: isTableDraggable,
|
|
927
1106
|
selectionBehavior: props.selectionStyle === "highlight" ? "replace" : "toggle"
|
|
928
1107
|
});
|
|
929
1108
|
// If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...
|
|
@@ -970,6 +1149,33 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
970
1149
|
state,
|
|
971
1150
|
tableLayout
|
|
972
1151
|
]);
|
|
1152
|
+
let dragState;
|
|
1153
|
+
let preview = (0, $gyhAV$useRef)(null);
|
|
1154
|
+
if (isTableDraggable) {
|
|
1155
|
+
dragState = dragAndDropHooks.useDraggableCollectionState({
|
|
1156
|
+
collection: state.collection,
|
|
1157
|
+
selectionManager: state.selectionManager,
|
|
1158
|
+
preview: preview
|
|
1159
|
+
});
|
|
1160
|
+
dragAndDropHooks.useDraggableCollection({}, dragState, domRef);
|
|
1161
|
+
}
|
|
1162
|
+
let DragPreview = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.DragPreview;
|
|
1163
|
+
let dropState;
|
|
1164
|
+
let droppableCollection;
|
|
1165
|
+
let isRootDropTarget;
|
|
1166
|
+
if (isTableDroppable) {
|
|
1167
|
+
dropState = dragAndDropHooks.useDroppableCollectionState({
|
|
1168
|
+
collection: state.collection,
|
|
1169
|
+
selectionManager: state.selectionManager
|
|
1170
|
+
});
|
|
1171
|
+
droppableCollection = dragAndDropHooks.useDroppableCollection({
|
|
1172
|
+
keyboardDelegate: layout,
|
|
1173
|
+
dropTargetDelegate: layout
|
|
1174
|
+
}, dropState, domRef);
|
|
1175
|
+
isRootDropTarget = dropState.isDropTarget({
|
|
1176
|
+
type: "root"
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
973
1179
|
let { gridProps: gridProps } = (0, $gyhAV$useTable)({
|
|
974
1180
|
...props,
|
|
975
1181
|
isVirtualized: true,
|
|
@@ -984,7 +1190,9 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
984
1190
|
if (reusableView.viewType === "rowgroup") return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableRowGroup, {
|
|
985
1191
|
key: reusableView.key,
|
|
986
1192
|
style: style
|
|
987
|
-
},
|
|
1193
|
+
}, isTableDroppable && /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $4e6fc36ba71ba405$export$d30a7814cfd4033e), {
|
|
1194
|
+
key: "root"
|
|
1195
|
+
}), renderChildren(children));
|
|
988
1196
|
if (reusableView.viewType === "header") return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableHeader, {
|
|
989
1197
|
key: reusableView.key,
|
|
990
1198
|
style: style
|
|
@@ -993,7 +1201,9 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
993
1201
|
key: reusableView.key,
|
|
994
1202
|
item: reusableView.content,
|
|
995
1203
|
style: style,
|
|
996
|
-
hasActions: onAction
|
|
1204
|
+
hasActions: onAction,
|
|
1205
|
+
isTableDroppable: isTableDroppable,
|
|
1206
|
+
isTableDraggable: isTableDraggable
|
|
997
1207
|
}, renderChildren(children));
|
|
998
1208
|
if (reusableView.viewType === "headerrow") return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableHeaderRow, {
|
|
999
1209
|
onHoverChange: setHeaderRowHovered,
|
|
@@ -1001,12 +1211,25 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1001
1211
|
style: style,
|
|
1002
1212
|
item: reusableView.content
|
|
1003
1213
|
}, renderChildren(children));
|
|
1214
|
+
let isDropTarget;
|
|
1215
|
+
let isRootDroptarget;
|
|
1216
|
+
if (isTableDroppable) {
|
|
1217
|
+
if (parent.content) isDropTarget = dropState.isDropTarget({
|
|
1218
|
+
type: "item",
|
|
1219
|
+
dropPosition: "on",
|
|
1220
|
+
key: parent.content.key
|
|
1221
|
+
});
|
|
1222
|
+
isRootDroptarget = dropState.isDropTarget({
|
|
1223
|
+
type: "root"
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1004
1226
|
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$VirtualizerItem), {
|
|
1005
1227
|
key: reusableView.key,
|
|
1006
1228
|
reusableView: reusableView,
|
|
1007
1229
|
parent: parent,
|
|
1008
1230
|
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-cellWrapper", (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), {
|
|
1009
|
-
"react-spectrum-Table-cellWrapper": !reusableView.layoutInfo.estimatedSize
|
|
1231
|
+
"react-spectrum-Table-cellWrapper": !reusableView.layoutInfo.estimatedSize,
|
|
1232
|
+
"react-spectrum-Table-cellWrapper--dropTarget": isDropTarget || isRootDroptarget
|
|
1010
1233
|
}))
|
|
1011
1234
|
});
|
|
1012
1235
|
};
|
|
@@ -1022,6 +1245,9 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1022
1245
|
if (item.props.isSelectionCell) return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableCheckboxCell, {
|
|
1023
1246
|
cell: item
|
|
1024
1247
|
});
|
|
1248
|
+
if (item.props.isDragButtonCell) return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableDragCell, {
|
|
1249
|
+
cell: item
|
|
1250
|
+
});
|
|
1025
1251
|
return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableCell, {
|
|
1026
1252
|
cell: item
|
|
1027
1253
|
});
|
|
@@ -1036,6 +1262,9 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1036
1262
|
if (item.props.isSelectionCell) return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableSelectAllCell, {
|
|
1037
1263
|
column: item
|
|
1038
1264
|
});
|
|
1265
|
+
if (item.props.isDragButtonCell) return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableDragHeaderCell, {
|
|
1266
|
+
column: item
|
|
1267
|
+
});
|
|
1039
1268
|
// TODO: consider this case, what if we have hidden headers and a empty table
|
|
1040
1269
|
if (item.props.hideHeader) return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$TooltipTrigger), {
|
|
1041
1270
|
placement: "top",
|
|
@@ -1102,9 +1331,19 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1102
1331
|
setIsInResizeMode,
|
|
1103
1332
|
setIsResizing
|
|
1104
1333
|
]);
|
|
1334
|
+
let focusedKey = state.selectionManager.focusedKey;
|
|
1335
|
+
if ((dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === "item") focusedKey = dropState.target.key;
|
|
1336
|
+
let mergedProps = (0, $gyhAV$mergeProps)(isTableDroppable && (droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps), gridProps, focusProps, (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging()) && {
|
|
1337
|
+
tabIndex: null
|
|
1338
|
+
});
|
|
1105
1339
|
return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableContext.Provider, {
|
|
1106
1340
|
value: {
|
|
1107
1341
|
state: state,
|
|
1342
|
+
dragState: dragState,
|
|
1343
|
+
dropState: dropState,
|
|
1344
|
+
dragAndDropHooks: dragAndDropHooks,
|
|
1345
|
+
isTableDraggable: isTableDraggable,
|
|
1346
|
+
isTableDroppable: isTableDroppable,
|
|
1108
1347
|
layout: layout,
|
|
1109
1348
|
onResizeStart: onResizeStart,
|
|
1110
1349
|
onResize: props.onResize,
|
|
@@ -1115,10 +1354,11 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1115
1354
|
isEmpty: isEmpty,
|
|
1116
1355
|
onFocusedResizer: onFocusedResizer,
|
|
1117
1356
|
headerMenuOpen: headerMenuOpen,
|
|
1118
|
-
setHeaderMenuOpen: setHeaderMenuOpen
|
|
1357
|
+
setHeaderMenuOpen: setHeaderMenuOpen,
|
|
1358
|
+
shouldShowCheckboxes: shouldShowCheckboxes
|
|
1119
1359
|
}
|
|
1120
1360
|
}, /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableVirtualizer, {
|
|
1121
|
-
...
|
|
1361
|
+
...mergedProps,
|
|
1122
1362
|
...styleProps,
|
|
1123
1363
|
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table", `spectrum-Table--${density}`, {
|
|
1124
1364
|
"spectrum-Table--quiet": isQuiet,
|
|
@@ -1129,18 +1369,38 @@ function $d14697b14e638114$var$TableView(props, ref) {
|
|
|
1129
1369
|
}, (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table"), styleProps.className),
|
|
1130
1370
|
layout: layout,
|
|
1131
1371
|
collection: state.collection,
|
|
1132
|
-
focusedKey:
|
|
1372
|
+
focusedKey: focusedKey,
|
|
1133
1373
|
renderView: renderView,
|
|
1134
1374
|
renderWrapper: renderWrapper,
|
|
1135
1375
|
onVisibleRectChange: onVisibleRectChange,
|
|
1136
1376
|
domRef: domRef,
|
|
1137
1377
|
headerRef: headerRef,
|
|
1138
1378
|
bodyRef: bodyRef,
|
|
1139
|
-
isFocusVisible: isFocusVisible
|
|
1379
|
+
isFocusVisible: isFocusVisible,
|
|
1380
|
+
isVirtualDragging: dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging(),
|
|
1381
|
+
isRootDropTarget: isRootDropTarget
|
|
1382
|
+
}), DragPreview && isTableDraggable && /*#__PURE__*/ (0, $gyhAV$react).createElement(DragPreview, {
|
|
1383
|
+
ref: preview
|
|
1384
|
+
}, ()=>{
|
|
1385
|
+
let item = state.collection.getItem(dragState.draggedKey);
|
|
1386
|
+
let rowHeaderColumnKeys = state.collection.rowHeaderColumnKeys;
|
|
1387
|
+
let itemCount = dragState.draggingKeys.size;
|
|
1388
|
+
let maxWidth = bodyRef.current.getBoundingClientRect().width;
|
|
1389
|
+
let children = state.collection.getChildren(item.key);
|
|
1390
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $daa6ead3d9d3506a$export$905ab40ac2179daa), {
|
|
1391
|
+
layout: layout,
|
|
1392
|
+
item: item,
|
|
1393
|
+
children: children,
|
|
1394
|
+
itemCount: itemCount,
|
|
1395
|
+
density: density,
|
|
1396
|
+
direction: direction,
|
|
1397
|
+
maxWidth: maxWidth,
|
|
1398
|
+
rowHeaderColumnKeys: rowHeaderColumnKeys
|
|
1399
|
+
});
|
|
1140
1400
|
}));
|
|
1141
1401
|
}
|
|
1142
1402
|
// This is a custom Virtualizer that also has a header that syncs its scroll position with the body.
|
|
1143
|
-
function $d14697b14e638114$var$TableVirtualizer({ layout: layout , collection: collection , focusedKey: focusedKey , renderView: renderView , renderWrapper: renderWrapper , domRef: domRef , bodyRef: bodyRef , headerRef: headerRef , onVisibleRectChange: onVisibleRectChangeProp , isFocusVisible: isFocusVisible , ...otherProps }) {
|
|
1403
|
+
function $d14697b14e638114$var$TableVirtualizer({ 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 }) {
|
|
1144
1404
|
var _layout_getLayoutInfo;
|
|
1145
1405
|
let { direction: direction } = (0, $gyhAV$useLocale)();
|
|
1146
1406
|
let loadingState = collection.body.props.loadingState;
|
|
@@ -1172,7 +1432,7 @@ function $d14697b14e638114$var$TableVirtualizer({ layout: layout , collection: c
|
|
|
1172
1432
|
shouldScrollY: (item === null || item === void 0 ? void 0 : item.type) !== "column",
|
|
1173
1433
|
// Offset scroll position by width of selection cell
|
|
1174
1434
|
// (which is sticky and will overlap the cell we're scrolling to).
|
|
1175
|
-
offsetX: column.props.isSelectionCell ? layout.getColumnWidth(column.key) : 0
|
|
1435
|
+
offsetX: column.props.isSelectionCell || column.props.isDragButtonCell ? layout.getColumnWidth(column.key) : 0
|
|
1176
1436
|
});
|
|
1177
1437
|
// Sync the scroll positions of the column headers and the body so scrollIntoViewport can
|
|
1178
1438
|
// properly decide if the column is outside the viewport or not
|
|
@@ -1189,6 +1449,7 @@ function $d14697b14e638114$var$TableVirtualizer({ layout: layout , collection: c
|
|
|
1189
1449
|
state.virtualizer
|
|
1190
1450
|
]);
|
|
1191
1451
|
let { virtualizerProps: virtualizerProps } = (0, $gyhAV$useVirtualizer)({
|
|
1452
|
+
tabIndex: otherProps.tabIndex,
|
|
1192
1453
|
focusedKey: focusedKey,
|
|
1193
1454
|
scrollToItem: scrollToItem
|
|
1194
1455
|
}, state, domRef);
|
|
@@ -1257,10 +1518,13 @@ function $d14697b14e638114$var$TableVirtualizer({ layout: layout , collection: c
|
|
|
1257
1518
|
resizingColumnWidth,
|
|
1258
1519
|
layout.resizingColumn
|
|
1259
1520
|
]);
|
|
1521
|
+
let mergedProps = (0, $gyhAV$mergeProps)(otherProps, virtualizerProps, isVirtualDragging && {
|
|
1522
|
+
tabIndex: null
|
|
1523
|
+
});
|
|
1260
1524
|
return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$VirtualizerContext.Provider, {
|
|
1261
1525
|
value: resizingColumn
|
|
1262
1526
|
}, /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$FocusScope), null, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1263
|
-
...
|
|
1527
|
+
...mergedProps,
|
|
1264
1528
|
ref: domRef
|
|
1265
1529
|
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1266
1530
|
role: "presentation",
|
|
@@ -1279,8 +1543,10 @@ function $d14697b14e638114$var$TableVirtualizer({ layout: layout , collection: c
|
|
|
1279
1543
|
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-body", {
|
|
1280
1544
|
"focus-ring": isFocusVisible,
|
|
1281
1545
|
"spectrum-Table-body--resizerAtTableEdge": shouldHardCornerResizeCorner
|
|
1282
|
-
}),
|
|
1283
|
-
|
|
1546
|
+
}, (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), {
|
|
1547
|
+
"react-spectrum-Table-body--dropTarget": !!isRootDropTarget
|
|
1548
|
+
})),
|
|
1549
|
+
tabIndex: isVirtualDragging ? null : -1,
|
|
1284
1550
|
style: {
|
|
1285
1551
|
flex: 1
|
|
1286
1552
|
},
|
|
@@ -1582,6 +1848,22 @@ function $d14697b14e638114$var$TableSelectAllCell({ column: column }) {
|
|
|
1582
1848
|
UNSAFE_className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-checkbox")
|
|
1583
1849
|
})));
|
|
1584
1850
|
}
|
|
1851
|
+
function $d14697b14e638114$var$TableDragHeaderCell({ column: column }) {
|
|
1852
|
+
let ref = (0, $gyhAV$useRef)();
|
|
1853
|
+
let { state: state } = $d14697b14e638114$export$3cb274deb6c2d854();
|
|
1854
|
+
let { columnHeaderProps: columnHeaderProps } = (0, $gyhAV$useTableColumnHeader)({
|
|
1855
|
+
node: column,
|
|
1856
|
+
isVirtualized: true
|
|
1857
|
+
}, state, ref);
|
|
1858
|
+
let stringFormatter = (0, $gyhAV$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($467944769c14687b$exports))));
|
|
1859
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$FocusRing), {
|
|
1860
|
+
focusRingClass: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "focus-ring")
|
|
1861
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1862
|
+
...columnHeaderProps,
|
|
1863
|
+
ref: ref,
|
|
1864
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-headCell", (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-dragButtonHeadCell"))
|
|
1865
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$VisuallyHidden), null, stringFormatter.format("drag"))));
|
|
1866
|
+
}
|
|
1585
1867
|
function $d14697b14e638114$var$TableRowGroup({ children: children , ...otherProps }) {
|
|
1586
1868
|
let { rowGroupProps: rowGroupProps } = (0, $gyhAV$useTableRowGroup)();
|
|
1587
1869
|
return /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
@@ -1589,16 +1871,39 @@ function $d14697b14e638114$var$TableRowGroup({ children: children , ...otherProp
|
|
|
1589
1871
|
...otherProps
|
|
1590
1872
|
}, children);
|
|
1591
1873
|
}
|
|
1592
|
-
function $d14697b14e638114$var$
|
|
1874
|
+
function $d14697b14e638114$var$DragButton() {
|
|
1875
|
+
let { dragButtonProps: dragButtonProps , dragButtonRef: dragButtonRef , isFocusVisibleWithin: isFocusVisibleWithin } = $d14697b14e638114$export$cd7c5802f9e21187();
|
|
1876
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $gyhAV$useVisuallyHidden)();
|
|
1877
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$FocusRing), {
|
|
1878
|
+
focusRingClass: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "focus-ring")
|
|
1879
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1880
|
+
...dragButtonProps,
|
|
1881
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "spectrum-Table-row-draghandle-button"),
|
|
1882
|
+
style: !isFocusVisibleWithin ? {
|
|
1883
|
+
...visuallyHiddenProps.style
|
|
1884
|
+
} : {},
|
|
1885
|
+
ref: dragButtonRef,
|
|
1886
|
+
draggable: "true"
|
|
1887
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$spectrumiconsuiListGripper), {
|
|
1888
|
+
UNSAFE_className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))))
|
|
1889
|
+
})));
|
|
1890
|
+
}
|
|
1891
|
+
const $d14697b14e638114$var$TableRowContext = /*#__PURE__*/ (0, $gyhAV$react).createContext(null);
|
|
1892
|
+
function $d14697b14e638114$export$cd7c5802f9e21187() {
|
|
1893
|
+
return (0, $gyhAV$useContext)($d14697b14e638114$var$TableRowContext);
|
|
1894
|
+
}
|
|
1895
|
+
function $d14697b14e638114$var$TableRow({ item: item , children: children , hasActions: hasActions , isTableDraggable: isTableDraggable , isTableDroppable: isTableDroppable , ...otherProps }) {
|
|
1593
1896
|
var _state_collection_rows_find, _layout_getContentSize, _layout_virtualizer;
|
|
1594
1897
|
let ref = (0, $gyhAV$useRef)();
|
|
1595
|
-
let { state: state , layout: layout } = $d14697b14e638114$export$3cb274deb6c2d854();
|
|
1898
|
+
let { state: state , layout: layout , dragAndDropHooks: dragAndDropHooks , dragState: dragState , dropState: dropState } = $d14697b14e638114$export$3cb274deb6c2d854();
|
|
1596
1899
|
let allowsInteraction = state.selectionManager.selectionMode !== "none" || hasActions;
|
|
1597
1900
|
let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
|
|
1901
|
+
let isDroppable = isTableDroppable && !isDisabled;
|
|
1598
1902
|
let isSelected = state.selectionManager.isSelected(item.key);
|
|
1599
1903
|
let { rowProps: rowProps } = (0, $gyhAV$useTableRow)({
|
|
1600
1904
|
node: item,
|
|
1601
|
-
isVirtualized: true
|
|
1905
|
+
isVirtualized: true,
|
|
1906
|
+
shouldSelectOnPressUp: isTableDraggable
|
|
1602
1907
|
}, state, ref);
|
|
1603
1908
|
let { pressProps: pressProps , isPressed: isPressed } = (0, $gyhAV$usePress)({
|
|
1604
1909
|
isDisabled: isDisabled
|
|
@@ -1612,7 +1917,6 @@ function $d14697b14e638114$var$TableRow({ item: item , children: children , hasA
|
|
|
1612
1917
|
let { hoverProps: hoverProps , isHovered: isHovered } = (0, $gyhAV$useHover)({
|
|
1613
1918
|
isDisabled: isDisabled
|
|
1614
1919
|
});
|
|
1615
|
-
let props = (0, $gyhAV$mergeProps)(rowProps, otherProps, focusWithinProps, focusProps, hoverProps, pressProps);
|
|
1616
1920
|
let isFirstRow = ((_state_collection_rows_find = state.collection.rows.find((row)=>row.level === 1)) === null || _state_collection_rows_find === void 0 ? void 0 : _state_collection_rows_find.key) === item.key;
|
|
1617
1921
|
let isLastRow = item.nextKey == null;
|
|
1618
1922
|
// Figure out if the TableView content is equal or greater in height to the container. If so, we'll need to round the bottom
|
|
@@ -1621,8 +1925,70 @@ function $d14697b14e638114$var$TableRow({ item: item , children: children , hasA
|
|
|
1621
1925
|
if (isLastRow) {
|
|
1622
1926
|
if (((_layout_getContentSize = layout.getContentSize()) === null || _layout_getContentSize === void 0 ? void 0 : _layout_getContentSize.height) >= ((_layout_virtualizer = layout.virtualizer) === null || _layout_virtualizer === void 0 ? void 0 : _layout_virtualizer.getVisibleRect().height)) isFlushWithContainerBottom = true;
|
|
1623
1927
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1928
|
+
let draggableItem;
|
|
1929
|
+
if (isTableDraggable) {
|
|
1930
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1931
|
+
draggableItem = dragAndDropHooks.useDraggableItem({
|
|
1932
|
+
key: item.key,
|
|
1933
|
+
hasDragButton: true
|
|
1934
|
+
}, dragState);
|
|
1935
|
+
if (isDisabled) draggableItem = null;
|
|
1936
|
+
}
|
|
1937
|
+
let droppableItem;
|
|
1938
|
+
let isDropTarget;
|
|
1939
|
+
let dropIndicator;
|
|
1940
|
+
let dropIndicatorRef = (0, $gyhAV$useRef)();
|
|
1941
|
+
if (isTableDroppable) {
|
|
1942
|
+
let target = {
|
|
1943
|
+
type: "item",
|
|
1944
|
+
key: item.key,
|
|
1945
|
+
dropPosition: "on"
|
|
1946
|
+
};
|
|
1947
|
+
isDropTarget = dropState.isDropTarget(target);
|
|
1948
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1949
|
+
dropIndicator = dragAndDropHooks.useDropIndicator({
|
|
1950
|
+
target: target
|
|
1951
|
+
}, dropState, dropIndicatorRef);
|
|
1952
|
+
}
|
|
1953
|
+
let dragButtonRef = (0, $gyhAV$react).useRef();
|
|
1954
|
+
let { buttonProps: dragButtonProps } = (0, $gyhAV$useButton)({
|
|
1955
|
+
...draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragButtonProps,
|
|
1956
|
+
elementType: "div"
|
|
1957
|
+
}, dragButtonRef);
|
|
1958
|
+
let props = (0, $gyhAV$mergeProps)(rowProps, otherProps, focusWithinProps, focusProps, hoverProps, pressProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, // Remove tab index from list row if performing a screenreader drag. This prevents TalkBack from focusing the row,
|
|
1959
|
+
// allowing for single swipe navigation between row drop indicator
|
|
1960
|
+
(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging()) && {
|
|
1961
|
+
tabIndex: null
|
|
1962
|
+
});
|
|
1963
|
+
let dropProps = isDroppable ? droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps : {
|
|
1964
|
+
"aria-hidden": droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps["aria-hidden"]
|
|
1965
|
+
};
|
|
1966
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = (0, $gyhAV$useVisuallyHidden)();
|
|
1967
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$TableRowContext.Provider, {
|
|
1968
|
+
value: {
|
|
1969
|
+
dragButtonProps: dragButtonProps,
|
|
1970
|
+
dragButtonRef: dragButtonRef,
|
|
1971
|
+
isFocusVisibleWithin: isFocusVisibleWithin
|
|
1972
|
+
}
|
|
1973
|
+
}, isTableDroppable && isFirstRow && /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $7ee9a922ee4e8032$export$2c0bab5914a9d088), {
|
|
1974
|
+
rowProps: props,
|
|
1975
|
+
key: `${item.key}-before`,
|
|
1976
|
+
target: {
|
|
1977
|
+
key: item.key,
|
|
1978
|
+
type: "item",
|
|
1979
|
+
dropPosition: "before"
|
|
1980
|
+
}
|
|
1981
|
+
}), isTableDroppable && !(dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.isHidden) && /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1982
|
+
role: "row",
|
|
1983
|
+
...visuallyHiddenProps
|
|
1984
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1985
|
+
role: "gridcell"
|
|
1986
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1987
|
+
role: "button",
|
|
1988
|
+
...dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.dropIndicatorProps,
|
|
1989
|
+
ref: dropIndicatorRef
|
|
1990
|
+
}))), /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
1991
|
+
...(0, $gyhAV$mergeProps)(props, dropProps),
|
|
1626
1992
|
ref: ref,
|
|
1627
1993
|
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-row", {
|
|
1628
1994
|
"is-active": isPressed,
|
|
@@ -1636,8 +2002,18 @@ function $d14697b14e638114$var$TableRow({ item: item , children: children , hasA
|
|
|
1636
2002
|
"spectrum-Table-row--firstRow": isFirstRow,
|
|
1637
2003
|
"spectrum-Table-row--lastRow": isLastRow,
|
|
1638
2004
|
"spectrum-Table-row--isFlushBottom": isFlushWithContainerBottom
|
|
1639
|
-
})
|
|
1640
|
-
|
|
2005
|
+
}, (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), {
|
|
2006
|
+
"react-spectrum-Table-row--dropTarget": isDropTarget
|
|
2007
|
+
}))
|
|
2008
|
+
}, children), isTableDroppable && /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $7ee9a922ee4e8032$export$2c0bab5914a9d088), {
|
|
2009
|
+
rowProps: props,
|
|
2010
|
+
key: `${item.key}-after`,
|
|
2011
|
+
target: {
|
|
2012
|
+
key: item.key,
|
|
2013
|
+
type: "item",
|
|
2014
|
+
dropPosition: "after"
|
|
2015
|
+
}
|
|
2016
|
+
}));
|
|
1641
2017
|
}
|
|
1642
2018
|
function $d14697b14e638114$var$TableHeaderRow({ item: item , children: children , style: style , ...props }) {
|
|
1643
2019
|
let { state: state , headerMenuOpen: headerMenuOpen } = $d14697b14e638114$export$3cb274deb6c2d854();
|
|
@@ -1656,6 +2032,24 @@ function $d14697b14e638114$var$TableHeaderRow({ item: item , children: children
|
|
|
1656
2032
|
style: style
|
|
1657
2033
|
}, children);
|
|
1658
2034
|
}
|
|
2035
|
+
function $d14697b14e638114$var$TableDragCell({ cell: cell }) {
|
|
2036
|
+
let ref = (0, $gyhAV$useRef)();
|
|
2037
|
+
let { state: state , isTableDraggable: isTableDraggable } = $d14697b14e638114$export$3cb274deb6c2d854();
|
|
2038
|
+
let isDisabled = state.disabledKeys.has(cell.parentKey);
|
|
2039
|
+
let { gridCellProps: gridCellProps } = (0, $gyhAV$useTableCell)({
|
|
2040
|
+
node: cell,
|
|
2041
|
+
isVirtualized: true
|
|
2042
|
+
}, state, ref);
|
|
2043
|
+
return /*#__PURE__*/ (0, $gyhAV$react).createElement((0, $gyhAV$FocusRing), {
|
|
2044
|
+
focusRingClass: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "focus-ring")
|
|
2045
|
+
}, /*#__PURE__*/ (0, $gyhAV$react).createElement("div", {
|
|
2046
|
+
...gridCellProps,
|
|
2047
|
+
ref: ref,
|
|
2048
|
+
className: (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($bd5d41f647a296c3$exports))), "spectrum-Table-cell", {
|
|
2049
|
+
"is-disabled": isDisabled
|
|
2050
|
+
}, (0, $gyhAV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($325bc3d43b25708b$exports))), "react-spectrum-Table-cell", "react-spectrum-Table-dragButtonCell"))
|
|
2051
|
+
}, isTableDraggable && !isDisabled && /*#__PURE__*/ (0, $gyhAV$react).createElement($d14697b14e638114$var$DragButton, null)));
|
|
2052
|
+
}
|
|
1659
2053
|
function $d14697b14e638114$var$TableCheckboxCell({ cell: cell }) {
|
|
1660
2054
|
let ref = (0, $gyhAV$useRef)();
|
|
1661
2055
|
let { state: state } = $d14697b14e638114$export$3cb274deb6c2d854();
|