@react-spectrum/table 3.12.9-nightly.4555 → 3.12.9-nightly.4560

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 (107) hide show
  1. package/dist/DragPreview.main.js +54 -0
  2. package/dist/DragPreview.main.js.map +1 -0
  3. package/dist/DragPreview.mjs +49 -0
  4. package/dist/DragPreview.module.js +49 -0
  5. package/dist/DragPreview.module.js.map +1 -0
  6. package/dist/InsertionIndicator.main.js +63 -0
  7. package/dist/InsertionIndicator.main.js.map +1 -0
  8. package/dist/InsertionIndicator.mjs +58 -0
  9. package/dist/InsertionIndicator.module.js +58 -0
  10. package/dist/InsertionIndicator.module.js.map +1 -0
  11. package/dist/Nubbin.main.js +62 -0
  12. package/dist/Nubbin.main.js.map +1 -0
  13. package/dist/Nubbin.mjs +53 -0
  14. package/dist/Nubbin.module.js +53 -0
  15. package/dist/Nubbin.module.js.map +1 -0
  16. package/dist/Resizer.main.js +143 -0
  17. package/dist/Resizer.main.js.map +1 -0
  18. package/dist/Resizer.mjs +138 -0
  19. package/dist/Resizer.module.js +138 -0
  20. package/dist/Resizer.module.js.map +1 -0
  21. package/dist/RootDropIndicator.main.js +57 -0
  22. package/dist/RootDropIndicator.main.js.map +1 -0
  23. package/dist/RootDropIndicator.mjs +48 -0
  24. package/dist/RootDropIndicator.module.js +48 -0
  25. package/dist/RootDropIndicator.module.js.map +1 -0
  26. package/dist/TableView.main.js +50 -0
  27. package/dist/TableView.main.js.map +1 -0
  28. package/dist/TableView.mjs +41 -0
  29. package/dist/TableView.module.js +41 -0
  30. package/dist/TableView.module.js.map +1 -0
  31. package/dist/TableViewBase.main.js +1193 -0
  32. package/dist/TableViewBase.main.js.map +1 -0
  33. package/dist/TableViewBase.mjs +1186 -0
  34. package/dist/TableViewBase.module.js +1186 -0
  35. package/dist/TableViewBase.module.js.map +1 -0
  36. package/dist/TableViewWrapper.main.js +46 -0
  37. package/dist/TableViewWrapper.main.js.map +1 -0
  38. package/dist/TableViewWrapper.mjs +37 -0
  39. package/dist/TableViewWrapper.module.js +37 -0
  40. package/dist/TableViewWrapper.module.js.map +1 -0
  41. package/dist/TreeGridTableView.main.js +50 -0
  42. package/dist/TreeGridTableView.main.js.map +1 -0
  43. package/dist/TreeGridTableView.mjs +41 -0
  44. package/dist/TreeGridTableView.module.js +41 -0
  45. package/dist/TreeGridTableView.module.js.map +1 -0
  46. package/dist/ar-AE.mjs +1 -1
  47. package/dist/bg-BG.mjs +1 -1
  48. package/dist/cs-CZ.mjs +1 -1
  49. package/dist/da-DK.mjs +1 -1
  50. package/dist/de-DE.mjs +1 -1
  51. package/dist/el-GR.mjs +1 -1
  52. package/dist/en-US.mjs +1 -1
  53. package/dist/es-ES.mjs +1 -1
  54. package/dist/et-EE.mjs +1 -1
  55. package/dist/fi-FI.mjs +1 -1
  56. package/dist/fr-FR.mjs +1 -1
  57. package/dist/he-IL.mjs +1 -1
  58. package/dist/hr-HR.mjs +1 -1
  59. package/dist/hu-HU.mjs +1 -1
  60. package/dist/import.mjs +2 -1930
  61. package/dist/intlStrings.main.js +108 -0
  62. package/dist/intlStrings.main.js.map +1 -0
  63. package/dist/intlStrings.mjs +110 -0
  64. package/dist/intlStrings.module.js +110 -0
  65. package/dist/intlStrings.module.js.map +1 -0
  66. package/dist/it-IT.mjs +1 -1
  67. package/dist/ja-JP.mjs +1 -1
  68. package/dist/ko-KR.mjs +1 -1
  69. package/dist/lt-LT.mjs +1 -1
  70. package/dist/lv-LV.mjs +1 -1
  71. package/dist/main.js +2 -1926
  72. package/dist/main.js.map +1 -1
  73. package/dist/module.js +2 -1930
  74. package/dist/module.js.map +1 -1
  75. package/dist/nb-NO.mjs +1 -1
  76. package/dist/nl-NL.mjs +1 -1
  77. package/dist/pl-PL.mjs +1 -1
  78. package/dist/pt-BR.mjs +1 -1
  79. package/dist/pt-PT.mjs +1 -1
  80. package/dist/ro-RO.mjs +1 -1
  81. package/dist/ru-RU.mjs +1 -1
  82. package/dist/sk-SK.mjs +1 -1
  83. package/dist/sl-SI.mjs +1 -1
  84. package/dist/sr-SP.mjs +1 -1
  85. package/dist/sv-SE.mjs +1 -1
  86. package/dist/table.b13eee90.css +220 -0
  87. package/dist/table.b13eee90.css.map +1 -0
  88. package/dist/table_css.main.js +74 -0
  89. package/dist/table_css.main.js.map +1 -0
  90. package/dist/table_css.mjs +76 -0
  91. package/dist/table_css.module.js +76 -0
  92. package/dist/table_css.module.js.map +1 -0
  93. package/dist/table_vars_css.main.js +197 -0
  94. package/dist/table_vars_css.main.js.map +1 -0
  95. package/dist/table_vars_css.mjs +199 -0
  96. package/dist/table_vars_css.module.js +199 -0
  97. package/dist/table_vars_css.module.js.map +1 -0
  98. package/dist/tr-TR.mjs +1 -1
  99. package/dist/uk-UA.mjs +1 -1
  100. package/dist/{main.css → vars.42570ef3.css} +1 -221
  101. package/dist/vars.42570ef3.css.map +1 -0
  102. package/dist/zh-CN.mjs +1 -1
  103. package/dist/zh-TW.mjs +1 -1
  104. package/package.json +28 -28
  105. package/dist/main.css.map +0 -1
  106. package/dist/module.css +0 -1208
  107. package/dist/module.css.map +0 -1
@@ -0,0 +1,1193 @@
1
+ var $c44674ca7612e997$exports = require("./InsertionIndicator.main.js");
2
+ var $1a3d6ad53eb75d54$exports = require("./intlStrings.main.js");
3
+ var $18b3deb5c431fa13$exports = require("./Nubbin.main.js");
4
+ var $2877766f94c67a67$exports = require("./Resizer.main.js");
5
+ var $4a98adf416b1ae5d$exports = require("./RootDropIndicator.main.js");
6
+ var $f65d44d222cc509b$exports = require("./DragPreview.main.js");
7
+ require("./vars.42570ef3.css");
8
+ var $982885d0a34882ea$exports = require("./table_vars_css.main.js");
9
+ require("./table.b13eee90.css");
10
+ var $4afcd54cfd94dbb9$exports = require("./table_css.main.js");
11
+ var $idLTj$spectrumiconsuiArrowDownSmall = require("@spectrum-icons/ui/ArrowDownSmall");
12
+ var $idLTj$reactariautils = require("@react-aria/utils");
13
+ var $idLTj$reactspectrumcheckbox = require("@react-spectrum/checkbox");
14
+ var $idLTj$spectrumiconsuiChevronDownMedium = require("@spectrum-icons/ui/ChevronDownMedium");
15
+ var $idLTj$spectrumiconsuiChevronLeftMedium = require("@spectrum-icons/ui/ChevronLeftMedium");
16
+ var $idLTj$spectrumiconsuiChevronRightMedium = require("@spectrum-icons/ui/ChevronRightMedium");
17
+ var $idLTj$reactspectrumutils = require("@react-spectrum/utils");
18
+ var $idLTj$reactariafocus = require("@react-aria/focus");
19
+ var $idLTj$reactariainteractions = require("@react-aria/interactions");
20
+ var $idLTj$reactspectrummenu = require("@react-spectrum/menu");
21
+ var $idLTj$reactariavirtualizer = require("@react-aria/virtualizer");
22
+ var $idLTj$spectrumiconsuiListGripper = require("@spectrum-icons/ui/ListGripper");
23
+ var $idLTj$reactspectrumprogress = require("@react-spectrum/progress");
24
+ var $idLTj$react = require("react");
25
+ var $idLTj$reactstatelyvirtualizer = require("@react-stately/virtualizer");
26
+ var $idLTj$reactstatelytable = require("@react-stately/table");
27
+ var $idLTj$reactstatelylayout = require("@react-stately/layout");
28
+ var $idLTj$reactspectrumtooltip = require("@react-spectrum/tooltip");
29
+ var $idLTj$reactariabutton = require("@react-aria/button");
30
+ var $idLTj$reactariai18n = require("@react-aria/i18n");
31
+ var $idLTj$reactspectrumprovider = require("@react-spectrum/provider");
32
+ var $idLTj$reactariatable = require("@react-aria/table");
33
+ var $idLTj$reactariavisuallyhidden = require("@react-aria/visually-hidden");
34
+
35
+
36
+ function $parcel$interopDefault(a) {
37
+ return a && a.__esModule ? a.default : a;
38
+ }
39
+
40
+ function $parcel$export(e, n, v, s) {
41
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
42
+ }
43
+
44
+ $parcel$export(module.exports, "useTableContext", () => $e39c6de4eb69450d$export$3cb274deb6c2d854);
45
+ $parcel$export(module.exports, "useVirtualizerContext", () => $e39c6de4eb69450d$export$3f8f74b6bfd2c5df);
46
+ $parcel$export(module.exports, "TableViewBase", () => $e39c6de4eb69450d$export$517e02184d273d69);
47
+ /*
48
+ * Copyright 2023 Adobe. All rights reserved.
49
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
50
+ * you may not use this file except in compliance with the License. You may obtain a copy
51
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
52
+ *
53
+ * Unless required by applicable law or agreed to in writing, software distributed under
54
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
55
+ * OF ANY KIND, either express or implied. See the License for the specific language
56
+ * governing permissions and limitations under the License.
57
+ */
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+ const $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT = {
89
+ medium: 34,
90
+ large: 40
91
+ };
92
+ const $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH = {
93
+ medium: 38,
94
+ large: 46
95
+ };
96
+ const $e39c6de4eb69450d$var$ROW_HEIGHTS = {
97
+ compact: {
98
+ medium: 32,
99
+ large: 40
100
+ },
101
+ regular: {
102
+ medium: 40,
103
+ large: 50
104
+ },
105
+ spacious: {
106
+ medium: 48,
107
+ large: 60
108
+ }
109
+ };
110
+ const $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH = {
111
+ medium: 38,
112
+ large: 48
113
+ };
114
+ const $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH = {
115
+ medium: 16,
116
+ large: 20
117
+ };
118
+ const $e39c6de4eb69450d$var$LEVEL_OFFSET_WIDTH = {
119
+ medium: 16,
120
+ large: 20
121
+ };
122
+ const $e39c6de4eb69450d$export$93e4b0b2cc49b648 = /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createContext(null);
123
+ function $e39c6de4eb69450d$export$3cb274deb6c2d854() {
124
+ return (0, $idLTj$react.useContext)($e39c6de4eb69450d$export$93e4b0b2cc49b648);
125
+ }
126
+ const $e39c6de4eb69450d$export$d288a7dd40372bc = /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createContext(null);
127
+ function $e39c6de4eb69450d$export$3f8f74b6bfd2c5df() {
128
+ return (0, $idLTj$react.useContext)($e39c6de4eb69450d$export$d288a7dd40372bc);
129
+ }
130
+ function $e39c6de4eb69450d$var$TableViewBase(props, ref) {
131
+ var _dropState_target;
132
+ props = (0, $idLTj$reactspectrumprovider.useProviderProps)(props);
133
+ let { isQuiet: isQuiet, onAction: onAction, onResizeStart: propsOnResizeStart, onResizeEnd: propsOnResizeEnd, dragAndDropHooks: dragAndDropHooks, state: state } = props;
134
+ let isTableDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
135
+ let isTableDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
136
+ let dragHooksProvided = (0, $idLTj$react.useRef)(isTableDraggable);
137
+ let dropHooksProvided = (0, $idLTj$react.useRef)(isTableDroppable);
138
+ (0, $idLTj$react.useEffect)(()=>{
139
+ 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.");
140
+ 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.");
141
+ if ("expandedKeys" in state && (isTableDraggable || isTableDroppable)) console.warn("Drag and drop is not yet fully supported with expandable rows and may produce unexpected results.");
142
+ }, [
143
+ isTableDraggable,
144
+ isTableDroppable,
145
+ state
146
+ ]);
147
+ let { styleProps: styleProps } = (0, $idLTj$reactspectrumutils.useStyleProps)(props);
148
+ let { direction: direction } = (0, $idLTj$reactariai18n.useLocale)();
149
+ let { scale: scale } = (0, $idLTj$reactspectrumprovider.useProvider)();
150
+ const getDefaultWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
151
+ if (hideHeader) {
152
+ let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
153
+ return showDivider ? width + 1 : width;
154
+ } else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
155
+ else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
156
+ }, [
157
+ scale
158
+ ]);
159
+ const getDefaultMinWidth = (0, $idLTj$react.useCallback)(({ props: { hideHeader: hideHeader, isSelectionCell: isSelectionCell, showDivider: showDivider, isDragButtonCell: isDragButtonCell } })=>{
160
+ if (hideHeader) {
161
+ let width = $e39c6de4eb69450d$var$DEFAULT_HIDE_HEADER_CELL_WIDTH[scale];
162
+ return showDivider ? width + 1 : width;
163
+ } else if (isSelectionCell) return $e39c6de4eb69450d$var$SELECTION_CELL_DEFAULT_WIDTH[scale];
164
+ else if (isDragButtonCell) return $e39c6de4eb69450d$var$DRAG_BUTTON_CELL_DEFAULT_WIDTH[scale];
165
+ return 75;
166
+ }, [
167
+ scale
168
+ ]);
169
+ // Starts when the user selects resize from the menu, ends when resizing ends
170
+ // used to control the visibility of the resizer Nubbin
171
+ let [isInResizeMode, setIsInResizeMode] = (0, $idLTj$react.useState)(false);
172
+ // Starts when the resizer is actually moved
173
+ // entering resizing/exiting resizing doesn't trigger a render
174
+ // with table layout, so we need to track it here
175
+ let [, setIsResizing] = (0, $idLTj$react.useState)(false);
176
+ let domRef = (0, $idLTj$reactspectrumutils.useDOMRef)(ref);
177
+ let headerRef = (0, $idLTj$react.useRef)();
178
+ let bodyRef = (0, $idLTj$react.useRef)();
179
+ let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), "@react-spectrum/table");
180
+ let density = props.density || "regular";
181
+ let columnLayout = (0, $idLTj$react.useMemo)(()=>new (0, $idLTj$reactstatelytable.TableColumnLayout)({
182
+ getDefaultWidth: getDefaultWidth,
183
+ getDefaultMinWidth: getDefaultMinWidth
184
+ }), [
185
+ getDefaultWidth,
186
+ getDefaultMinWidth
187
+ ]);
188
+ let tableLayout = (0, $idLTj$react.useMemo)(()=>new (0, $idLTj$reactstatelylayout.TableLayout)({
189
+ // If props.rowHeight is auto, then use estimated heights based on scale, otherwise use fixed heights.
190
+ rowHeight: props.overflowMode === "wrap" ? null : $e39c6de4eb69450d$var$ROW_HEIGHTS[density][scale],
191
+ estimatedRowHeight: props.overflowMode === "wrap" ? $e39c6de4eb69450d$var$ROW_HEIGHTS[density][scale] : null,
192
+ headingHeight: props.overflowMode === "wrap" ? null : $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT[scale],
193
+ estimatedHeadingHeight: props.overflowMode === "wrap" ? $e39c6de4eb69450d$var$DEFAULT_HEADER_HEIGHT[scale] : null,
194
+ columnLayout: columnLayout,
195
+ initialCollection: state.collection
196
+ }), // don't recompute when state.collection changes, only used for initial value
197
+ // eslint-disable-next-line react-hooks/exhaustive-deps
198
+ [
199
+ props.overflowMode,
200
+ scale,
201
+ density,
202
+ columnLayout
203
+ ]);
204
+ // Use a proxy so that a new object is created for each render so that alternate instances aren't affected by mutation.
205
+ // This can be thought of as equivalent to `{…tableLayout, tableState: state}`, but works with classes as well.
206
+ let layout = (0, $idLTj$react.useMemo)(()=>{
207
+ let proxy = new Proxy(tableLayout, {
208
+ get (target, prop, receiver) {
209
+ return prop === "tableState" ? state : Reflect.get(target, prop, receiver);
210
+ }
211
+ });
212
+ return proxy;
213
+ }, [
214
+ state,
215
+ tableLayout
216
+ ]);
217
+ let dragState;
218
+ let preview = (0, $idLTj$react.useRef)(null);
219
+ if (isTableDraggable) {
220
+ dragState = dragAndDropHooks.useDraggableCollectionState({
221
+ collection: state.collection,
222
+ selectionManager: state.selectionManager,
223
+ preview: preview
224
+ });
225
+ dragAndDropHooks.useDraggableCollection({}, dragState, domRef);
226
+ }
227
+ let DragPreview = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.DragPreview;
228
+ let dropState;
229
+ let droppableCollection;
230
+ let isRootDropTarget;
231
+ if (isTableDroppable) {
232
+ dropState = dragAndDropHooks.useDroppableCollectionState({
233
+ collection: state.collection,
234
+ selectionManager: state.selectionManager
235
+ });
236
+ droppableCollection = dragAndDropHooks.useDroppableCollection({
237
+ keyboardDelegate: layout,
238
+ dropTargetDelegate: layout
239
+ }, dropState, domRef);
240
+ isRootDropTarget = dropState.isDropTarget({
241
+ type: "root"
242
+ });
243
+ }
244
+ let { gridProps: gridProps } = (0, $idLTj$reactariatable.useTable)({
245
+ ...props,
246
+ isVirtualized: true,
247
+ layout: layout,
248
+ onRowAction: onAction
249
+ }, state, domRef);
250
+ let [headerMenuOpen, setHeaderMenuOpen] = (0, $idLTj$react.useState)(false);
251
+ let [headerRowHovered, setHeaderRowHovered] = (0, $idLTj$react.useState)(false);
252
+ let renderWrapper = (parent, reusableView, children, renderChildren)=>{
253
+ let style = (0, $idLTj$reactariavirtualizer.layoutInfoToStyle)(reusableView.layoutInfo, direction, parent && parent.layoutInfo);
254
+ if (style.overflow === "hidden") style.overflow = "visible"; // needed to support position: sticky
255
+ if (reusableView.viewType === "rowgroup") return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableRowGroup, {
256
+ key: reusableView.key,
257
+ style: style
258
+ }, isTableDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $4a98adf416b1ae5d$exports.RootDropIndicator), {
259
+ key: "root"
260
+ }), renderChildren(children));
261
+ if (reusableView.viewType === "header") return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableHeader, {
262
+ key: reusableView.key,
263
+ style: style
264
+ }, renderChildren(children));
265
+ if (reusableView.viewType === "row") return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableRow, {
266
+ key: reusableView.key,
267
+ item: reusableView.content,
268
+ style: style,
269
+ hasActions: onAction,
270
+ isTableDroppable: isTableDroppable,
271
+ isTableDraggable: isTableDraggable
272
+ }, renderChildren(children));
273
+ if (reusableView.viewType === "headerrow") return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableHeaderRow, {
274
+ onHoverChange: setHeaderRowHovered,
275
+ key: reusableView.key,
276
+ style: style,
277
+ item: reusableView.content
278
+ }, renderChildren(children));
279
+ let isDropTarget;
280
+ let isRootDroptarget;
281
+ if (isTableDroppable) {
282
+ if (parent.content) isDropTarget = dropState.isDropTarget({
283
+ type: "item",
284
+ dropPosition: "on",
285
+ key: parent.content.key
286
+ });
287
+ isRootDroptarget = dropState.isDropTarget({
288
+ type: "root"
289
+ });
290
+ }
291
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavirtualizer.VirtualizerItem), {
292
+ key: reusableView.key,
293
+ layoutInfo: reusableView.layoutInfo,
294
+ virtualizer: reusableView.virtualizer,
295
+ parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo,
296
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-cellWrapper", (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), {
297
+ "react-spectrum-Table-cellWrapper": !reusableView.layoutInfo.estimatedSize,
298
+ "react-spectrum-Table-cellWrapper--dropTarget": isDropTarget || isRootDroptarget
299
+ }))
300
+ }, reusableView.rendered);
301
+ };
302
+ let renderView = (type, item)=>{
303
+ switch(type){
304
+ case "header":
305
+ case "rowgroup":
306
+ case "section":
307
+ case "row":
308
+ case "headerrow":
309
+ return null;
310
+ case "cell":
311
+ if (item.props.isSelectionCell) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableCheckboxCell, {
312
+ cell: item
313
+ });
314
+ if (item.props.isDragButtonCell) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableDragCell, {
315
+ cell: item
316
+ });
317
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableCell, {
318
+ cell: item
319
+ });
320
+ case "placeholder":
321
+ // TODO: move to react-aria?
322
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
323
+ role: "gridcell",
324
+ "aria-colindex": item.index + 1,
325
+ "aria-colspan": item.colspan > 1 ? item.colspan : null
326
+ });
327
+ case "column":
328
+ if (item.props.isSelectionCell) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableSelectAllCell, {
329
+ column: item
330
+ });
331
+ if (item.props.isDragButtonCell) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableDragHeaderCell, {
332
+ column: item
333
+ });
334
+ // TODO: consider this case, what if we have hidden headers and a empty table
335
+ if (item.props.hideHeader) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrumtooltip.TooltipTrigger), {
336
+ placement: "top",
337
+ trigger: "focus"
338
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableColumnHeader, {
339
+ column: item
340
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrumtooltip.Tooltip), {
341
+ placement: "top"
342
+ }, item.rendered));
343
+ if (item.props.allowsResizing && !item.hasChildNodes) return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$ResizableTableColumnHeader, {
344
+ tableRef: domRef,
345
+ column: item
346
+ });
347
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableColumnHeader, {
348
+ column: item
349
+ });
350
+ case "loader":
351
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$CenteredWrapper, null, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrumprogress.ProgressCircle), {
352
+ isIndeterminate: true,
353
+ "aria-label": state.collection.size > 0 ? stringFormatter.format("loadingMore") : stringFormatter.format("loading")
354
+ }));
355
+ case "empty":
356
+ {
357
+ let emptyState = props.renderEmptyState ? props.renderEmptyState() : null;
358
+ if (emptyState == null) return null;
359
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$CenteredWrapper, null, emptyState);
360
+ }
361
+ }
362
+ };
363
+ let [isVerticalScrollbarVisible, setVerticalScollbarVisible] = (0, $idLTj$react.useState)(false);
364
+ let [isHorizontalScrollbarVisible, setHorizontalScollbarVisible] = (0, $idLTj$react.useState)(false);
365
+ let viewport = (0, $idLTj$react.useRef)({
366
+ x: 0,
367
+ y: 0,
368
+ width: 0,
369
+ height: 0
370
+ });
371
+ let onVisibleRectChange = (0, $idLTj$react.useCallback)((e)=>{
372
+ if (viewport.current.width === e.width && viewport.current.height === e.height) return;
373
+ viewport.current = e;
374
+ if (bodyRef.current) {
375
+ setVerticalScollbarVisible(bodyRef.current.clientWidth + 2 < bodyRef.current.offsetWidth);
376
+ setHorizontalScollbarVisible(bodyRef.current.clientHeight + 2 < bodyRef.current.offsetHeight);
377
+ }
378
+ }, []);
379
+ let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $idLTj$reactariafocus.useFocusRing)();
380
+ let isEmpty = state.collection.size === 0;
381
+ let onFocusedResizer = ()=>{
382
+ bodyRef.current.scrollLeft = headerRef.current.scrollLeft;
383
+ };
384
+ let onResizeStart = (0, $idLTj$react.useCallback)((widths)=>{
385
+ setIsResizing(true);
386
+ propsOnResizeStart === null || propsOnResizeStart === void 0 ? void 0 : propsOnResizeStart(widths);
387
+ }, [
388
+ setIsResizing,
389
+ propsOnResizeStart
390
+ ]);
391
+ let onResizeEnd = (0, $idLTj$react.useCallback)((widths)=>{
392
+ setIsInResizeMode(false);
393
+ setIsResizing(false);
394
+ propsOnResizeEnd === null || propsOnResizeEnd === void 0 ? void 0 : propsOnResizeEnd(widths);
395
+ }, [
396
+ propsOnResizeEnd,
397
+ setIsInResizeMode,
398
+ setIsResizing
399
+ ]);
400
+ let focusedKey = state.selectionManager.focusedKey;
401
+ 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;
402
+ let mergedProps = (0, $idLTj$reactariautils.mergeProps)(isTableDroppable && (droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps), gridProps, focusProps, (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging()) && {
403
+ tabIndex: null
404
+ });
405
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$export$93e4b0b2cc49b648.Provider, {
406
+ value: {
407
+ state: state,
408
+ dragState: dragState,
409
+ dropState: dropState,
410
+ dragAndDropHooks: dragAndDropHooks,
411
+ isTableDraggable: isTableDraggable,
412
+ isTableDroppable: isTableDroppable,
413
+ layout: layout,
414
+ onResizeStart: onResizeStart,
415
+ onResize: props.onResize,
416
+ onResizeEnd: onResizeEnd,
417
+ headerRowHovered: headerRowHovered,
418
+ isInResizeMode: isInResizeMode,
419
+ setIsInResizeMode: setIsInResizeMode,
420
+ isEmpty: isEmpty,
421
+ onFocusedResizer: onFocusedResizer,
422
+ headerMenuOpen: headerMenuOpen,
423
+ setHeaderMenuOpen: setHeaderMenuOpen
424
+ }
425
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableVirtualizer, {
426
+ ...mergedProps,
427
+ ...styleProps,
428
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table", `spectrum-Table--${density}`, {
429
+ "spectrum-Table--quiet": isQuiet,
430
+ "spectrum-Table--wrap": props.overflowMode === "wrap",
431
+ "spectrum-Table--loadingMore": state.collection.body.props.loadingState === "loadingMore",
432
+ "spectrum-Table--isVerticalScrollbarVisible": isVerticalScrollbarVisible,
433
+ "spectrum-Table--isHorizontalScrollbarVisible": isHorizontalScrollbarVisible
434
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table"), styleProps.className),
435
+ layout: layout,
436
+ collection: state.collection,
437
+ focusedKey: focusedKey,
438
+ renderView: renderView,
439
+ renderWrapper: renderWrapper,
440
+ onVisibleRectChange: onVisibleRectChange,
441
+ domRef: domRef,
442
+ headerRef: headerRef,
443
+ bodyRef: bodyRef,
444
+ isFocusVisible: isFocusVisible,
445
+ isVirtualDragging: dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging(),
446
+ isRootDropTarget: isRootDropTarget
447
+ }), DragPreview && isTableDraggable && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement(DragPreview, {
448
+ ref: preview
449
+ }, ()=>{
450
+ if (dragAndDropHooks.renderPreview) return dragAndDropHooks.renderPreview(dragState.draggingKeys, dragState.draggedKey);
451
+ let itemCount = dragState.draggingKeys.size;
452
+ let maxWidth = bodyRef.current.getBoundingClientRect().width;
453
+ let height = $e39c6de4eb69450d$var$ROW_HEIGHTS[density][scale];
454
+ let itemText = state.collection.getTextValue(dragState.draggedKey);
455
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $f65d44d222cc509b$exports.DragPreview), {
456
+ itemText: itemText,
457
+ itemCount: itemCount,
458
+ height: height,
459
+ maxWidth: maxWidth
460
+ });
461
+ }));
462
+ }
463
+ // This is a custom Virtualizer that also has a header that syncs its scroll position with the body.
464
+ function $e39c6de4eb69450d$var$TableVirtualizer(props) {
465
+ var _layout_getLayoutInfo;
466
+ 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;
467
+ let { direction: direction } = (0, $idLTj$reactariai18n.useLocale)();
468
+ let loadingState = collection.body.props.loadingState;
469
+ let isLoading = loadingState === "loading" || loadingState === "loadingMore";
470
+ let onLoadMore = collection.body.props.onLoadMore;
471
+ let transitionDuration = 220;
472
+ if (isLoading) transitionDuration = 160;
473
+ if (layout.resizingColumn != null) // while resizing, prop changes should not cause animations
474
+ transitionDuration = 0;
475
+ let state = (0, $idLTj$reactstatelyvirtualizer.useVirtualizerState)({
476
+ layout: layout,
477
+ collection: collection,
478
+ renderView: renderView,
479
+ renderWrapper: renderWrapper,
480
+ onVisibleRectChange (rect) {
481
+ bodyRef.current.scrollTop = rect.y;
482
+ (0, $idLTj$reactariavirtualizer.setScrollLeft)(bodyRef.current, direction, rect.x);
483
+ },
484
+ transitionDuration: transitionDuration
485
+ });
486
+ let scrollToItem = (0, $idLTj$react.useCallback)((key)=>{
487
+ let item = collection.getItem(key);
488
+ let column = collection.columns[0];
489
+ let virtualizer = state.virtualizer;
490
+ virtualizer.scrollToItem(key, {
491
+ duration: 0,
492
+ // Prevent scrolling to the top when clicking on column headers.
493
+ shouldScrollY: (item === null || item === void 0 ? void 0 : item.type) !== "column",
494
+ // Offset scroll position by width of selection cell
495
+ // (which is sticky and will overlap the cell we're scrolling to).
496
+ offsetX: column.props.isSelectionCell || column.props.isDragButtonCell ? layout.getColumnWidth(column.key) : 0
497
+ });
498
+ // Sync the scroll positions of the column headers and the body so scrollIntoViewport can
499
+ // properly decide if the column is outside the viewport or not
500
+ headerRef.current.scrollLeft = bodyRef.current.scrollLeft;
501
+ }, [
502
+ collection,
503
+ bodyRef,
504
+ headerRef,
505
+ layout,
506
+ state.virtualizer
507
+ ]);
508
+ let memoedVirtualizerProps = (0, $idLTj$react.useMemo)(()=>({
509
+ tabIndex: otherProps.tabIndex,
510
+ focusedKey: focusedKey,
511
+ scrollToItem: scrollToItem,
512
+ isLoading: isLoading,
513
+ onLoadMore: onLoadMore
514
+ }), [
515
+ otherProps.tabIndex,
516
+ focusedKey,
517
+ scrollToItem,
518
+ isLoading,
519
+ onLoadMore
520
+ ]);
521
+ let { virtualizerProps: virtualizerProps, scrollViewProps: { onVisibleRectChange: onVisibleRectChange } } = (0, $idLTj$reactariavirtualizer.useVirtualizer)(memoedVirtualizerProps, state, domRef);
522
+ // this effect runs whenever the contentSize changes, it doesn't matter what the content size is
523
+ // only that it changes in a resize, and when that happens, we want to sync the body to the
524
+ // header scroll position
525
+ (0, $idLTj$react.useEffect)(()=>{
526
+ if ((0, $idLTj$reactariainteractions.getInteractionModality)() === "keyboard" && headerRef.current.contains(document.activeElement)) {
527
+ (0, $idLTj$reactariautils.scrollIntoView)(headerRef.current, document.activeElement);
528
+ (0, $idLTj$reactariautils.scrollIntoViewport)(document.activeElement, {
529
+ containingElement: domRef.current
530
+ });
531
+ bodyRef.current.scrollLeft = headerRef.current.scrollLeft;
532
+ }
533
+ }, [
534
+ state.contentSize,
535
+ headerRef,
536
+ bodyRef,
537
+ domRef
538
+ ]);
539
+ let headerHeight = ((_layout_getLayoutInfo = layout.getLayoutInfo("header")) === null || _layout_getLayoutInfo === void 0 ? void 0 : _layout_getLayoutInfo.rect.height) || 0;
540
+ // Sync the scroll position from the table body to the header container.
541
+ let onScroll = (0, $idLTj$react.useCallback)(()=>{
542
+ headerRef.current.scrollLeft = bodyRef.current.scrollLeft;
543
+ }, [
544
+ bodyRef,
545
+ headerRef
546
+ ]);
547
+ let resizerPosition = layout.getResizerPosition() - 2;
548
+ let resizerAtEdge = resizerPosition > Math.max(state.virtualizer.contentSize.width, state.virtualizer.visibleRect.width) - 3;
549
+ // this should be fine, every movement of the resizer causes a rerender
550
+ // scrolling can cause it to lag for a moment, but it's always updated
551
+ let resizerInVisibleRegion = resizerPosition < state.virtualizer.visibleRect.maxX;
552
+ let shouldHardCornerResizeCorner = resizerAtEdge && resizerInVisibleRegion;
553
+ // minimize re-render caused on Resizers by memoing this
554
+ let resizingColumnWidth = layout.getColumnWidth(layout.resizingColumn);
555
+ let resizingColumn = (0, $idLTj$react.useMemo)(()=>({
556
+ width: resizingColumnWidth,
557
+ key: layout.resizingColumn
558
+ }), [
559
+ resizingColumnWidth,
560
+ layout.resizingColumn
561
+ ]);
562
+ let mergedProps = (0, $idLTj$reactariautils.mergeProps)(otherProps, virtualizerProps, isVirtualDragging && {
563
+ tabIndex: null
564
+ });
565
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$export$d288a7dd40372bc.Provider, {
566
+ value: resizingColumn
567
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
568
+ ...mergedProps,
569
+ ref: domRef
570
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
571
+ role: "presentation",
572
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headWrapper"),
573
+ style: {
574
+ height: headerHeight,
575
+ overflow: "hidden",
576
+ position: "relative",
577
+ willChange: state.isScrolling ? "scroll-position" : undefined,
578
+ transition: state.isAnimating ? `none ${state.virtualizer.transitionDuration}ms` : undefined
579
+ },
580
+ ref: headerRef
581
+ }, state.visibleViews[0]), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavirtualizer.ScrollView), {
582
+ role: "presentation",
583
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-body", {
584
+ "focus-ring": isFocusVisible,
585
+ "spectrum-Table-body--resizerAtTableEdge": shouldHardCornerResizeCorner
586
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-body", {
587
+ "react-spectrum-Table-body--dropTarget": !!isRootDropTarget
588
+ })),
589
+ tabIndex: isVirtualDragging ? null : -1,
590
+ style: {
591
+ flex: 1
592
+ },
593
+ innerStyle: {
594
+ overflow: "visible",
595
+ transition: state.isAnimating ? `none ${state.virtualizer.transitionDuration}ms` : undefined
596
+ },
597
+ ref: bodyRef,
598
+ contentSize: state.contentSize,
599
+ onVisibleRectChange: (0, $idLTj$reactariautils.chain)(onVisibleRectChange, onVisibleRectChangeProp),
600
+ onScrollStart: state.startScrolling,
601
+ onScrollEnd: state.endScrolling,
602
+ onScroll: onScroll
603
+ }, state.visibleViews[1], /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
604
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-bodyResizeIndicator"),
605
+ style: {
606
+ [direction === "ltr" ? "left" : "right"]: `${resizerPosition}px`,
607
+ height: `${Math.max(state.virtualizer.contentSize.height, state.virtualizer.visibleRect.height)}px`,
608
+ display: layout.resizingColumn ? "block" : "none"
609
+ }
610
+ })))));
611
+ }
612
+ function $e39c6de4eb69450d$var$TableHeader({ children: children, ...otherProps }) {
613
+ let { rowGroupProps: rowGroupProps } = (0, $idLTj$reactariatable.useTableRowGroup)();
614
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
615
+ ...rowGroupProps,
616
+ ...otherProps,
617
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-head")
618
+ }, children);
619
+ }
620
+ function $e39c6de4eb69450d$var$TableColumnHeader(props) {
621
+ var _state_sortDescriptor, _state_sortDescriptor1, _state_sortDescriptor2, _state_sortDescriptor3;
622
+ let { column: column } = props;
623
+ let ref = (0, $idLTj$react.useRef)(null);
624
+ let { state: state, isEmpty: isEmpty } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
625
+ let { pressProps: pressProps, isPressed: isPressed } = (0, $idLTj$reactariainteractions.usePress)({
626
+ isDisabled: isEmpty
627
+ });
628
+ let columnProps = column.props;
629
+ (0, $idLTj$react.useEffect)(()=>{
630
+ if (column.hasChildNodes && columnProps.allowsResizing) console.warn(`Column key: ${column.key}. Columns with child columns don't allow resizing.`);
631
+ }, [
632
+ column.hasChildNodes,
633
+ column.key,
634
+ columnProps.allowsResizing
635
+ ]);
636
+ let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
637
+ node: column,
638
+ isVirtualized: true
639
+ }, state, ref);
640
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $idLTj$reactariainteractions.useHover)({
641
+ ...props,
642
+ isDisabled: isEmpty
643
+ });
644
+ const allProps = [
645
+ columnHeaderProps,
646
+ hoverProps,
647
+ pressProps
648
+ ];
649
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
650
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
651
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
652
+ ...(0, $idLTj$reactariautils.mergeProps)(...allProps),
653
+ ref: ref,
654
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCell", {
655
+ "is-active": isPressed,
656
+ "is-sortable": columnProps.allowsSorting,
657
+ "is-sorted-desc": ((_state_sortDescriptor = state.sortDescriptor) === null || _state_sortDescriptor === void 0 ? void 0 : _state_sortDescriptor.column) === column.key && ((_state_sortDescriptor1 = state.sortDescriptor) === null || _state_sortDescriptor1 === void 0 ? void 0 : _state_sortDescriptor1.direction) === "descending",
658
+ "is-sorted-asc": ((_state_sortDescriptor2 = state.sortDescriptor) === null || _state_sortDescriptor2 === void 0 ? void 0 : _state_sortDescriptor2.column) === column.key && ((_state_sortDescriptor3 = state.sortDescriptor) === null || _state_sortDescriptor3 === void 0 ? void 0 : _state_sortDescriptor3.direction) === "ascending",
659
+ "is-hovered": isHovered,
660
+ "spectrum-Table-cell--hideHeader": columnProps.hideHeader
661
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-cell", {
662
+ "react-spectrum-Table-cell--alignCenter": columnProps.align === "center" || column.colspan > 1,
663
+ "react-spectrum-Table-cell--alignEnd": columnProps.align === "end"
664
+ }))
665
+ }, columnProps.allowsSorting && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiArrowDownSmall))), {
666
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-sortedIcon")
667
+ }), columnProps.hideHeader ? /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavisuallyhidden.VisuallyHidden), null, column.rendered) : /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
668
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCellContents")
669
+ }, column.rendered)));
670
+ }
671
+ let $e39c6de4eb69450d$var$_TableColumnHeaderButton = (props, ref)=>{
672
+ let { focusProps: focusProps, alignment: alignment, ...otherProps } = props;
673
+ let { isEmpty: isEmpty } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
674
+ let domRef = (0, $idLTj$reactspectrumutils.useFocusableRef)(ref);
675
+ let { buttonProps: buttonProps } = (0, $idLTj$reactariabutton.useButton)({
676
+ ...otherProps,
677
+ elementType: "div",
678
+ isDisabled: isEmpty
679
+ }, domRef);
680
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $idLTj$reactariainteractions.useHover)({
681
+ ...otherProps,
682
+ isDisabled: isEmpty
683
+ });
684
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
685
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCellContents", {
686
+ "is-hovered": isHovered
687
+ }),
688
+ ...hoverProps
689
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
690
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCellButton", {
691
+ "spectrum-Table-headCellButton--alignStart": alignment === "start",
692
+ "spectrum-Table-headCellButton--alignCenter": alignment === "center",
693
+ "spectrum-Table-headCellButton--alignEnd": alignment === "end"
694
+ }),
695
+ ...(0, $idLTj$reactariautils.mergeProps)(buttonProps, focusProps),
696
+ ref: domRef
697
+ }, props.children));
698
+ };
699
+ let $e39c6de4eb69450d$var$TableColumnHeaderButton = /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).forwardRef($e39c6de4eb69450d$var$_TableColumnHeaderButton);
700
+ function $e39c6de4eb69450d$var$ResizableTableColumnHeader(props) {
701
+ var _column_props, _state_sortDescriptor, _state_sortDescriptor1, _state_sortDescriptor2, _state_sortDescriptor3;
702
+ let { column: column } = props;
703
+ let ref = (0, $idLTj$react.useRef)(null);
704
+ let triggerRef = (0, $idLTj$react.useRef)(null);
705
+ let resizingRef = (0, $idLTj$react.useRef)(null);
706
+ let { state: state, layout: layout, onResizeStart: onResizeStart, onResize: onResize, onResizeEnd: onResizeEnd, headerRowHovered: headerRowHovered, setIsInResizeMode: setIsInResizeMode, isEmpty: isEmpty, isInResizeMode: isInResizeMode, headerMenuOpen: headerMenuOpen, setHeaderMenuOpen: setHeaderMenuOpen } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
707
+ let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), "@react-spectrum/table");
708
+ let { pressProps: pressProps, isPressed: isPressed } = (0, $idLTj$reactariainteractions.usePress)({
709
+ isDisabled: isEmpty
710
+ });
711
+ let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
712
+ node: column,
713
+ isVirtualized: true
714
+ }, state, ref);
715
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $idLTj$reactariainteractions.useHover)({
716
+ ...props,
717
+ isDisabled: isEmpty || headerMenuOpen
718
+ });
719
+ const allProps = [
720
+ columnHeaderProps,
721
+ pressProps,
722
+ hoverProps
723
+ ];
724
+ let columnProps = column.props;
725
+ let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $idLTj$reactariafocus.useFocusRing)();
726
+ const onMenuSelect = (key)=>{
727
+ switch(key){
728
+ case "sort-asc":
729
+ state.sort(column.key, "ascending");
730
+ break;
731
+ case "sort-desc":
732
+ state.sort(column.key, "descending");
733
+ break;
734
+ case "resize":
735
+ layout.startResize(column.key);
736
+ setIsInResizeMode(true);
737
+ state.setKeyboardNavigationDisabled(true);
738
+ break;
739
+ }
740
+ };
741
+ let allowsSorting = (_column_props = column.props) === null || _column_props === void 0 ? void 0 : _column_props.allowsSorting;
742
+ let items = (0, $idLTj$react.useMemo)(()=>{
743
+ let options = [
744
+ allowsSorting ? {
745
+ label: stringFormatter.format("sortAscending"),
746
+ id: "sort-asc"
747
+ } : undefined,
748
+ allowsSorting ? {
749
+ label: stringFormatter.format("sortDescending"),
750
+ id: "sort-desc"
751
+ } : undefined,
752
+ {
753
+ label: stringFormatter.format("resizeColumn"),
754
+ id: "resize"
755
+ }
756
+ ];
757
+ return options;
758
+ // eslint-disable-next-line react-hooks/exhaustive-deps
759
+ }, [
760
+ allowsSorting
761
+ ]);
762
+ let resizingColumn = layout.resizingColumn;
763
+ let showResizer = !isEmpty && (headerRowHovered && (0, $idLTj$reactariainteractions.getInteractionModality)() !== "keyboard" || resizingColumn != null);
764
+ let alignment = "start";
765
+ let menuAlign = "start";
766
+ if (columnProps.align === "center" || column.colspan > 1) alignment = "center";
767
+ else if (columnProps.align === "end") {
768
+ alignment = "end";
769
+ menuAlign = "end";
770
+ }
771
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
772
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
773
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
774
+ ...(0, $idLTj$reactariautils.mergeProps)(...allProps),
775
+ ref: ref,
776
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCell", {
777
+ "is-active": isPressed,
778
+ "is-resizable": columnProps.allowsResizing,
779
+ "is-sortable": columnProps.allowsSorting,
780
+ "is-sorted-desc": ((_state_sortDescriptor = state.sortDescriptor) === null || _state_sortDescriptor === void 0 ? void 0 : _state_sortDescriptor.column) === column.key && ((_state_sortDescriptor1 = state.sortDescriptor) === null || _state_sortDescriptor1 === void 0 ? void 0 : _state_sortDescriptor1.direction) === "descending",
781
+ "is-sorted-asc": ((_state_sortDescriptor2 = state.sortDescriptor) === null || _state_sortDescriptor2 === void 0 ? void 0 : _state_sortDescriptor2.column) === column.key && ((_state_sortDescriptor3 = state.sortDescriptor) === null || _state_sortDescriptor3 === void 0 ? void 0 : _state_sortDescriptor3.direction) === "ascending",
782
+ "is-hovered": isHovered,
783
+ "focus-ring": isFocusVisible,
784
+ "spectrum-Table-cell--hideHeader": columnProps.hideHeader
785
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-cell", {
786
+ "react-spectrum-Table-cell--alignCenter": alignment === "center",
787
+ "react-spectrum-Table-cell--alignEnd": alignment === "end"
788
+ }))
789
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrummenu.MenuTrigger), {
790
+ onOpenChange: setHeaderMenuOpen,
791
+ align: menuAlign
792
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableColumnHeaderButton, {
793
+ alignment: alignment,
794
+ ref: triggerRef,
795
+ focusProps: focusProps
796
+ }, columnProps.allowsSorting && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiArrowDownSmall))), {
797
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-sortedIcon")
798
+ }), columnProps.hideHeader ? /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavisuallyhidden.VisuallyHidden), null, column.rendered) : /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
799
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headerCellText")
800
+ }, column.rendered), columnProps.allowsResizing && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiChevronDownMedium))), {
801
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-menuChevron")
802
+ })), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrummenu.Menu), {
803
+ onAction: onMenuSelect,
804
+ minWidth: "size-2000",
805
+ items: items
806
+ }, (item)=>/*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrummenu.Item), null, item.label))), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $2877766f94c67a67$exports.Resizer), {
807
+ ref: resizingRef,
808
+ column: column,
809
+ showResizer: showResizer,
810
+ onResizeStart: onResizeStart,
811
+ onResize: onResize,
812
+ onResizeEnd: onResizeEnd,
813
+ triggerRef: (0, $idLTj$reactspectrumutils.useUnwrapDOMRef)(triggerRef)
814
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
815
+ "aria-hidden": true,
816
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-colResizeIndicator", {
817
+ "spectrum-Table-colResizeIndicator--visible": resizingColumn != null,
818
+ "spectrum-Table-colResizeIndicator--resizing": resizingColumn === column.key
819
+ })
820
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
821
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-colResizeNubbin", {
822
+ "spectrum-Table-colResizeNubbin--visible": isInResizeMode && resizingColumn === column.key
823
+ })
824
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $18b3deb5c431fa13$exports.Nubbin), null)))));
825
+ }
826
+ function $e39c6de4eb69450d$var$TableSelectAllCell({ column: column }) {
827
+ let ref = (0, $idLTj$react.useRef)();
828
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
829
+ let isSingleSelectionMode = state.selectionManager.selectionMode === "single";
830
+ let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
831
+ node: column,
832
+ isVirtualized: true
833
+ }, state, ref);
834
+ let { checkboxProps: checkboxProps } = (0, $idLTj$reactariatable.useTableSelectAllCheckbox)(state);
835
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $idLTj$reactariainteractions.useHover)({});
836
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
837
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
838
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
839
+ ...(0, $idLTj$reactariautils.mergeProps)(columnHeaderProps, hoverProps),
840
+ ref: ref,
841
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCell", "spectrum-Table-checkboxCell", {
842
+ "is-hovered": isHovered
843
+ })
844
+ }, /*
845
+ In single selection mode, the checkbox will be hidden.
846
+ So to avoid leaving a column header with no accessible content,
847
+ we use a VisuallyHidden component to include the aria-label from the checkbox,
848
+ which for single selection will be "Select."
849
+ */ isSingleSelectionMode && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavisuallyhidden.VisuallyHidden), null, checkboxProps["aria-label"]), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrumcheckbox.Checkbox), {
850
+ ...checkboxProps,
851
+ isEmphasized: true,
852
+ UNSAFE_style: isSingleSelectionMode ? {
853
+ visibility: "hidden"
854
+ } : undefined,
855
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-checkbox")
856
+ })));
857
+ }
858
+ function $e39c6de4eb69450d$var$TableDragHeaderCell({ column: column }) {
859
+ let ref = (0, $idLTj$react.useRef)();
860
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
861
+ let { columnHeaderProps: columnHeaderProps } = (0, $idLTj$reactariatable.useTableColumnHeader)({
862
+ node: column,
863
+ isVirtualized: true
864
+ }, state, ref);
865
+ let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), "@react-spectrum/table");
866
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
867
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
868
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
869
+ ...columnHeaderProps,
870
+ ref: ref,
871
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-headCell", (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-headCell", "react-spectrum-Table-dragButtonHeadCell"))
872
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariavisuallyhidden.VisuallyHidden), null, stringFormatter.format("drag"))));
873
+ }
874
+ function $e39c6de4eb69450d$var$TableRowGroup({ children: children, ...otherProps }) {
875
+ let { rowGroupProps: rowGroupProps } = (0, $idLTj$reactariatable.useTableRowGroup)();
876
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
877
+ ...rowGroupProps,
878
+ ...otherProps
879
+ }, children);
880
+ }
881
+ function $e39c6de4eb69450d$var$DragButton() {
882
+ let { dragButtonProps: dragButtonProps, dragButtonRef: dragButtonRef, isFocusVisibleWithin: isFocusVisibleWithin } = $e39c6de4eb69450d$export$cd7c5802f9e21187();
883
+ let { visuallyHiddenProps: visuallyHiddenProps } = (0, $idLTj$reactariavisuallyhidden.useVisuallyHidden)();
884
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
885
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "focus-ring")
886
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
887
+ ...dragButtonProps,
888
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-dragButton"),
889
+ style: !isFocusVisibleWithin ? {
890
+ ...visuallyHiddenProps.style
891
+ } : {},
892
+ ref: dragButtonRef,
893
+ draggable: "true"
894
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiListGripper))), {
895
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))))
896
+ })));
897
+ }
898
+ const $e39c6de4eb69450d$var$TableRowContext = /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createContext(null);
899
+ function $e39c6de4eb69450d$export$cd7c5802f9e21187() {
900
+ return (0, $idLTj$react.useContext)($e39c6de4eb69450d$var$TableRowContext);
901
+ }
902
+ function $e39c6de4eb69450d$var$TableRow({ item: item, children: children, hasActions: hasActions, isTableDraggable: isTableDraggable, isTableDroppable: isTableDroppable, ...otherProps }) {
903
+ var _state_collection_rows_find, _layout_getContentSize, _layout_virtualizer;
904
+ let ref = (0, $idLTj$react.useRef)();
905
+ let { state: state, layout: layout, dragAndDropHooks: dragAndDropHooks, dragState: dragState, dropState: dropState } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
906
+ let allowsInteraction = state.selectionManager.selectionMode !== "none" || hasActions;
907
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
908
+ let isDroppable = isTableDroppable && !isDisabled;
909
+ let isSelected = state.selectionManager.isSelected(item.key);
910
+ let { rowProps: rowProps } = (0, $idLTj$reactariatable.useTableRow)({
911
+ node: item,
912
+ isVirtualized: true,
913
+ shouldSelectOnPressUp: isTableDraggable
914
+ }, state, ref);
915
+ let { pressProps: pressProps, isPressed: isPressed } = (0, $idLTj$reactariainteractions.usePress)({
916
+ isDisabled: isDisabled
917
+ });
918
+ // The row should show the focus background style when any cell inside it is focused.
919
+ // If the row itself is focused, then it should have a blue focus indicator on the left.
920
+ let { isFocusVisible: isFocusVisibleWithin, focusProps: focusWithinProps } = (0, $idLTj$reactariafocus.useFocusRing)({
921
+ within: true
922
+ });
923
+ let { isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $idLTj$reactariafocus.useFocusRing)();
924
+ let { hoverProps: hoverProps, isHovered: isHovered } = (0, $idLTj$reactariainteractions.useHover)({
925
+ isDisabled: isDisabled
926
+ });
927
+ 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;
928
+ let isLastRow = item.nextKey == null;
929
+ // Figure out if the TableView content is equal or greater in height to the container. If so, we'll need to round the bottom
930
+ // border corners of the last row when selected.
931
+ let isFlushWithContainerBottom = false;
932
+ if (isLastRow) {
933
+ 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;
934
+ }
935
+ let draggableItem;
936
+ if (isTableDraggable) {
937
+ // eslint-disable-next-line react-hooks/rules-of-hooks
938
+ draggableItem = dragAndDropHooks.useDraggableItem({
939
+ key: item.key,
940
+ hasDragButton: true
941
+ }, dragState);
942
+ if (isDisabled) draggableItem = null;
943
+ }
944
+ let droppableItem;
945
+ let isDropTarget;
946
+ let dropIndicator;
947
+ let dropIndicatorRef = (0, $idLTj$react.useRef)();
948
+ if (isTableDroppable) {
949
+ let target = {
950
+ type: "item",
951
+ key: item.key,
952
+ dropPosition: "on"
953
+ };
954
+ isDropTarget = dropState.isDropTarget(target);
955
+ // eslint-disable-next-line react-hooks/rules-of-hooks
956
+ dropIndicator = dragAndDropHooks.useDropIndicator({
957
+ target: target
958
+ }, dropState, dropIndicatorRef);
959
+ }
960
+ let dragButtonRef = (0, ($parcel$interopDefault($idLTj$react))).useRef();
961
+ let { buttonProps: dragButtonProps } = (0, $idLTj$reactariabutton.useButton)({
962
+ ...draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragButtonProps,
963
+ elementType: "div"
964
+ }, dragButtonRef);
965
+ let props = (0, $idLTj$reactariautils.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,
966
+ // allowing for single swipe navigation between row drop indicator
967
+ (dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.isVirtualDragging()) && {
968
+ tabIndex: null
969
+ });
970
+ let dropProps = isDroppable ? droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps : {
971
+ "aria-hidden": droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps["aria-hidden"]
972
+ };
973
+ let { visuallyHiddenProps: visuallyHiddenProps } = (0, $idLTj$reactariavisuallyhidden.useVisuallyHidden)();
974
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$TableRowContext.Provider, {
975
+ value: {
976
+ dragButtonProps: dragButtonProps,
977
+ dragButtonRef: dragButtonRef,
978
+ isFocusVisibleWithin: isFocusVisibleWithin
979
+ }
980
+ }, isTableDroppable && isFirstRow && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $c44674ca7612e997$exports.InsertionIndicator), {
981
+ rowProps: props,
982
+ key: `${item.key}-before`,
983
+ target: {
984
+ key: item.key,
985
+ type: "item",
986
+ dropPosition: "before"
987
+ }
988
+ }), isTableDroppable && !(dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.isHidden) && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
989
+ role: "row",
990
+ ...visuallyHiddenProps
991
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
992
+ role: "gridcell"
993
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
994
+ role: "button",
995
+ ...dropIndicator === null || dropIndicator === void 0 ? void 0 : dropIndicator.dropIndicatorProps,
996
+ ref: dropIndicatorRef
997
+ }))), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
998
+ ...(0, $idLTj$reactariautils.mergeProps)(props, dropProps),
999
+ ref: ref,
1000
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-row", {
1001
+ "is-active": isPressed,
1002
+ "is-selected": isSelected,
1003
+ "spectrum-Table-row--highlightSelection": state.selectionManager.selectionBehavior === "replace",
1004
+ "is-next-selected": state.selectionManager.isSelected(item.nextKey),
1005
+ "is-focused": isFocusVisibleWithin,
1006
+ "focus-ring": isFocusVisible,
1007
+ "is-hovered": isHovered,
1008
+ "is-disabled": isDisabled,
1009
+ "spectrum-Table-row--firstRow": isFirstRow,
1010
+ "spectrum-Table-row--lastRow": isLastRow,
1011
+ "spectrum-Table-row--isFlushBottom": isFlushWithContainerBottom
1012
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-row", {
1013
+ "react-spectrum-Table-row--dropTarget": isDropTarget
1014
+ }))
1015
+ }, children), isTableDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $c44674ca7612e997$exports.InsertionIndicator), {
1016
+ rowProps: props,
1017
+ key: `${item.key}-after`,
1018
+ target: {
1019
+ key: item.key,
1020
+ type: "item",
1021
+ dropPosition: "after"
1022
+ }
1023
+ }));
1024
+ }
1025
+ function $e39c6de4eb69450d$var$TableHeaderRow({ item: item, children: children, style: style, ...props }) {
1026
+ let { state: state, headerMenuOpen: headerMenuOpen } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1027
+ let ref = (0, $idLTj$react.useRef)();
1028
+ let { rowProps: rowProps } = (0, $idLTj$reactariatable.useTableHeaderRow)({
1029
+ node: item,
1030
+ isVirtualized: true
1031
+ }, state, ref);
1032
+ let { hoverProps: hoverProps } = (0, $idLTj$reactariainteractions.useHover)({
1033
+ ...props,
1034
+ isDisabled: headerMenuOpen
1035
+ });
1036
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1037
+ ...(0, $idLTj$reactariautils.mergeProps)(rowProps, hoverProps),
1038
+ ref: ref,
1039
+ style: style
1040
+ }, children);
1041
+ }
1042
+ function $e39c6de4eb69450d$var$TableDragCell({ cell: cell }) {
1043
+ let ref = (0, $idLTj$react.useRef)();
1044
+ let { state: state, isTableDraggable: isTableDraggable } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1045
+ let isDisabled = state.disabledKeys.has(cell.parentKey);
1046
+ let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
1047
+ node: cell,
1048
+ isVirtualized: true
1049
+ }, state, ref);
1050
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
1051
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
1052
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1053
+ ...gridCellProps,
1054
+ ref: ref,
1055
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-cell", {
1056
+ "is-disabled": isDisabled
1057
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-cell", "react-spectrum-Table-dragButtonCell"))
1058
+ }, isTableDraggable && !isDisabled && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$DragButton, null)));
1059
+ }
1060
+ function $e39c6de4eb69450d$var$TableCheckboxCell({ cell: cell }) {
1061
+ let ref = (0, $idLTj$react.useRef)();
1062
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1063
+ let isDisabled = state.disabledKeys.has(cell.parentKey);
1064
+ let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
1065
+ node: cell,
1066
+ isVirtualized: true
1067
+ }, state, ref);
1068
+ let { checkboxProps: checkboxProps } = (0, $idLTj$reactariatable.useTableSelectionCheckbox)({
1069
+ key: cell.parentKey
1070
+ }, state);
1071
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
1072
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
1073
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1074
+ ...gridCellProps,
1075
+ ref: ref,
1076
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-cell", "spectrum-Table-checkboxCell", {
1077
+ "is-disabled": isDisabled
1078
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-cell"))
1079
+ }, state.selectionManager.selectionMode !== "none" && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactspectrumcheckbox.Checkbox), {
1080
+ ...checkboxProps,
1081
+ isEmphasized: true,
1082
+ isDisabled: isDisabled,
1083
+ UNSAFE_className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-checkbox")
1084
+ })));
1085
+ }
1086
+ function $e39c6de4eb69450d$var$TableCell({ cell: cell }) {
1087
+ let { scale: scale } = (0, $idLTj$reactspectrumprovider.useProvider)();
1088
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1089
+ let isExpandableTable = "expandedKeys" in state;
1090
+ let ref = (0, $idLTj$react.useRef)();
1091
+ let columnProps = cell.column.props;
1092
+ let isDisabled = state.disabledKeys.has(cell.parentKey);
1093
+ let { gridCellProps: gridCellProps } = (0, $idLTj$reactariatable.useTableCell)({
1094
+ node: cell,
1095
+ isVirtualized: true
1096
+ }, state, ref);
1097
+ let { id: id, ...otherGridCellProps } = gridCellProps;
1098
+ let isFirstRowHeaderCell = state.collection.rowHeaderColumnKeys.keys().next().value === cell.column.key;
1099
+ let isRowExpandable = false;
1100
+ let showExpandCollapseButton = false;
1101
+ let levelOffset = 0;
1102
+ if ("expandedKeys" in state) {
1103
+ var _state_keyMap_get_props_UNSTABLE_childItems, _state_keyMap_get, _state_keyMap_get_props_children, _state_keyMap_get_props, _state_keyMap_get1;
1104
+ isRowExpandable = ((_state_keyMap_get = state.keyMap.get(cell.parentKey)) === null || _state_keyMap_get === void 0 ? void 0 : (_state_keyMap_get_props_UNSTABLE_childItems = _state_keyMap_get.props.UNSTABLE_childItems) === null || _state_keyMap_get_props_UNSTABLE_childItems === void 0 ? void 0 : _state_keyMap_get_props_UNSTABLE_childItems.length) > 0 || ((_state_keyMap_get1 = state.keyMap.get(cell.parentKey)) === null || _state_keyMap_get1 === void 0 ? void 0 : (_state_keyMap_get_props = _state_keyMap_get1.props) === null || _state_keyMap_get_props === void 0 ? void 0 : (_state_keyMap_get_props_children = _state_keyMap_get_props.children) === null || _state_keyMap_get_props_children === void 0 ? void 0 : _state_keyMap_get_props_children.length) > state.userColumnCount;
1105
+ showExpandCollapseButton = isFirstRowHeaderCell && isRowExpandable;
1106
+ // Offset based on level, and add additional offset if there is no expand/collapse button on a row
1107
+ levelOffset = (cell.level - 2) * $e39c6de4eb69450d$var$LEVEL_OFFSET_WIDTH[scale] + (!showExpandCollapseButton ? $e39c6de4eb69450d$var$LEVEL_OFFSET_WIDTH[scale] * 2 : 0);
1108
+ }
1109
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, $idLTj$reactariafocus.FocusRing), {
1110
+ focusRingClass: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "focus-ring")
1111
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1112
+ ...otherGridCellProps,
1113
+ "aria-labelledby": id,
1114
+ ref: ref,
1115
+ style: isExpandableTable && isFirstRowHeaderCell ? {
1116
+ paddingInlineStart: levelOffset
1117
+ } : {},
1118
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-cell", {
1119
+ "spectrum-Table-cell--divider": columnProps.showDivider && cell.column.nextKey !== null,
1120
+ "spectrum-Table-cell--hideHeader": columnProps.hideHeader,
1121
+ "spectrum-Table-cell--hasExpandCollapseButton": showExpandCollapseButton,
1122
+ "is-disabled": isDisabled
1123
+ }, (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-cell", {
1124
+ "react-spectrum-Table-cell--alignStart": columnProps.align === "start",
1125
+ "react-spectrum-Table-cell--alignCenter": columnProps.align === "center",
1126
+ "react-spectrum-Table-cell--alignEnd": columnProps.align === "end"
1127
+ }))
1128
+ }, showExpandCollapseButton && /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement($e39c6de4eb69450d$var$ExpandableRowChevron, {
1129
+ cell: cell
1130
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("span", {
1131
+ id: id,
1132
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-cellContents")
1133
+ }, cell.rendered)));
1134
+ }
1135
+ function $e39c6de4eb69450d$var$ExpandableRowChevron({ cell: cell }) {
1136
+ // TODO: move some/all of the chevron button setup into a separate hook?
1137
+ let { direction: direction } = (0, $idLTj$reactariai18n.useLocale)();
1138
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1139
+ let expandButtonRef = (0, $idLTj$react.useRef)();
1140
+ let stringFormatter = (0, $idLTj$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($1a3d6ad53eb75d54$exports))), "@react-spectrum/table");
1141
+ let isExpanded;
1142
+ if ("expandedKeys" in state) isExpanded = state.expandedKeys === "all" || state.expandedKeys.has(cell.parentKey);
1143
+ // Will need to keep the chevron as a button for iOS VO at all times since VO doesn't focus the cell. Also keep as button if cellAction is defined by the user in the future
1144
+ let { buttonProps: buttonProps } = (0, $idLTj$reactariabutton.useButton)({
1145
+ // Desktop and mobile both toggle expansion of a native expandable row on mouse/touch up
1146
+ onPress: ()=>{
1147
+ state.toggleKey(cell.parentKey);
1148
+ if (!(0, $idLTj$reactariainteractions.isFocusVisible)()) {
1149
+ state.selectionManager.setFocused(true);
1150
+ state.selectionManager.setFocusedKey(cell.parentKey);
1151
+ }
1152
+ },
1153
+ elementType: "span",
1154
+ "aria-label": isExpanded ? stringFormatter.format("collapse") : stringFormatter.format("expand")
1155
+ }, expandButtonRef);
1156
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("span", {
1157
+ ...buttonProps,
1158
+ ref: expandButtonRef,
1159
+ // Override tabindex so that grid keyboard nav skips over it. Needs -1 so android talkback can actually "focus" it
1160
+ tabIndex: (0, $idLTj$reactariautils.isAndroid)() ? -1 : undefined,
1161
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($982885d0a34882ea$exports))), "spectrum-Table-expandButton", {
1162
+ "is-open": isExpanded
1163
+ })
1164
+ }, direction === "ltr" ? /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiChevronRightMedium))), null) : /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement((0, ($parcel$interopDefault($idLTj$spectrumiconsuiChevronLeftMedium))), null));
1165
+ }
1166
+ function $e39c6de4eb69450d$var$CenteredWrapper({ children: children }) {
1167
+ let { state: state } = $e39c6de4eb69450d$export$3cb274deb6c2d854();
1168
+ let rowProps;
1169
+ if ("expandedKeys" in state) {
1170
+ let topLevelRowCount = [
1171
+ ...state.keyMap.get(state.collection.body.key).childNodes
1172
+ ].length;
1173
+ rowProps = {
1174
+ "aria-level": 1,
1175
+ "aria-posinset": topLevelRowCount + 1,
1176
+ "aria-setsize": topLevelRowCount + 1
1177
+ };
1178
+ } else rowProps = {
1179
+ "aria-rowindex": state.collection.headerRows.length + state.collection.size + 1
1180
+ };
1181
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1182
+ role: "row",
1183
+ ...rowProps,
1184
+ className: (0, $idLTj$reactspectrumutils.classNames)((0, ($parcel$interopDefault($4afcd54cfd94dbb9$exports))), "react-spectrum-Table-centeredWrapper")
1185
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).createElement("div", {
1186
+ role: "rowheader",
1187
+ "aria-colspan": state.collection.columns.length
1188
+ }, children));
1189
+ }
1190
+ const $e39c6de4eb69450d$export$517e02184d273d69 = /*#__PURE__*/ (0, ($parcel$interopDefault($idLTj$react))).forwardRef($e39c6de4eb69450d$var$TableViewBase);
1191
+
1192
+
1193
+ //# sourceMappingURL=TableViewBase.main.js.map