@react-spectrum/list 3.0.0-alpha.10 → 3.0.0-alpha.11
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/main.css +1 -1
- package/dist/main.js +530 -338
- package/dist/main.js.map +1 -1
- package/dist/module.js +532 -340
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +3 -31
- package/dist/types.d.ts.map +1 -1
- package/package.json +39 -37
- package/src/DragPreview.tsx +28 -40
- package/src/InsertionIndicator.tsx +42 -0
- package/src/ListView.tsx +170 -120
- package/src/ListViewItem.tsx +129 -65
- package/src/RootDropIndicator.tsx +25 -0
- package/src/{listview.css → styles.css} +264 -33
package/dist/module.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import "./main.css";
|
|
2
2
|
import {Item as $75e4a7b01832b12d$re_export$Item} from "@react-stately/collections";
|
|
3
|
-
import {useDOMRef as $fWI2a$useDOMRef, useStyleProps as $fWI2a$useStyleProps, classNames as $fWI2a$classNames, SlotProvider as $fWI2a$SlotProvider, ClearSlots as $fWI2a$ClearSlots} from "@react-spectrum/utils";
|
|
4
|
-
import {
|
|
5
|
-
import {GridKeyboardDelegate as $fWI2a$GridKeyboardDelegate, useGrid as $fWI2a$useGrid, useGridRow as $fWI2a$useGridRow, useGridCell as $fWI2a$useGridCell, useGridSelectionCheckbox as $fWI2a$useGridSelectionCheckbox} from "@react-aria/grid";
|
|
3
|
+
import {useDOMRef as $fWI2a$useDOMRef, useStyleProps as $fWI2a$useStyleProps, classNames as $fWI2a$classNames, useHasChild as $fWI2a$useHasChild, SlotProvider as $fWI2a$SlotProvider, ClearSlots as $fWI2a$ClearSlots} from "@react-spectrum/utils";
|
|
4
|
+
import {useLayoutEffect as $fWI2a$useLayoutEffect, mergeProps as $fWI2a$mergeProps, filterDOMProps as $fWI2a$filterDOMProps} from "@react-aria/utils";
|
|
6
5
|
import {ListLayout as $fWI2a$ListLayout} from "@react-stately/layout";
|
|
7
6
|
import {useListState as $fWI2a$useListState} from "@react-stately/list";
|
|
8
7
|
import {ProgressCircle as $fWI2a$ProgressCircle} from "@react-spectrum/progress";
|
|
9
|
-
import $fWI2a$react, {useMemo as $fWI2a$useMemo, useRef as $fWI2a$useRef, useContext as $fWI2a$useContext} from "react";
|
|
8
|
+
import $fWI2a$react, {useMemo as $fWI2a$useMemo, useRef as $fWI2a$useRef, useState as $fWI2a$useState, useContext as $fWI2a$useContext} from "react";
|
|
9
|
+
import {Rect as $fWI2a$Rect} from "@react-stately/virtualizer";
|
|
10
10
|
import {useCollator as $fWI2a$useCollator, useMessageFormatter as $fWI2a$useMessageFormatter, useLocale as $fWI2a$useLocale} from "@react-aria/i18n";
|
|
11
|
+
import {useList as $fWI2a$useList, useListItem as $fWI2a$useListItem, useListSelectionCheckbox as $fWI2a$useListSelectionCheckbox} from "@react-aria/list";
|
|
11
12
|
import {useProvider as $fWI2a$useProvider, Provider as $fWI2a$Provider} from "@react-spectrum/provider";
|
|
12
13
|
import {Virtualizer as $fWI2a$Virtualizer} from "@react-aria/virtualizer";
|
|
13
|
-
import {
|
|
14
|
-
import {Grid as $fWI2a$Grid} from "@react-spectrum/layout";
|
|
14
|
+
import {useVisuallyHidden as $fWI2a$useVisuallyHidden} from "@react-aria/visually-hidden";
|
|
15
15
|
import {Checkbox as $fWI2a$Checkbox} from "@react-spectrum/checkbox";
|
|
16
16
|
import $fWI2a$spectrumiconsuiChevronLeftMedium from "@spectrum-icons/ui/ChevronLeftMedium";
|
|
17
17
|
import $fWI2a$spectrumiconsuiChevronRightMedium from "@spectrum-icons/ui/ChevronRightMedium";
|
|
18
|
+
import {CSSTransition as $fWI2a$CSSTransition} from "react-transition-group";
|
|
18
19
|
import {useFocusRing as $fWI2a$useFocusRing, FocusRing as $fWI2a$FocusRing} from "@react-aria/focus";
|
|
20
|
+
import {Grid as $fWI2a$Grid} from "@react-spectrum/layout";
|
|
21
|
+
import {useHover as $fWI2a$useHover, isFocusVisible as $fWI2a$isFocusVisible} from "@react-aria/interactions";
|
|
19
22
|
import $fWI2a$spectrumiconsuiListGripper from "@spectrum-icons/ui/ListGripper";
|
|
20
|
-
import {
|
|
23
|
+
import {Text as $fWI2a$Text} from "@react-spectrum/text";
|
|
21
24
|
import {useButton as $fWI2a$useButton} from "@react-aria/button";
|
|
22
|
-
import {useHover as $fWI2a$useHover, usePress as $fWI2a$usePress} from "@react-aria/interactions";
|
|
23
|
-
import {useVisuallyHidden as $fWI2a$useVisuallyHidden} from "@react-aria/visually-hidden";
|
|
24
25
|
|
|
25
26
|
function $parcel$interopDefault(a) {
|
|
26
27
|
return a && a.__esModule ? a.default : a;
|
|
@@ -31,183 +32,197 @@ function $parcel$export(e, n, v, s) {
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
$parcel$export($
|
|
38
|
-
$parcel$export($
|
|
39
|
-
$parcel$export($
|
|
40
|
-
$parcel$export($
|
|
41
|
-
$parcel$export($
|
|
42
|
-
$parcel$export($
|
|
43
|
-
$parcel$export($
|
|
44
|
-
$parcel$export($
|
|
45
|
-
$parcel$export($
|
|
46
|
-
$parcel$export($
|
|
47
|
-
$parcel$export($
|
|
48
|
-
$parcel$export($
|
|
49
|
-
$parcel$export($
|
|
50
|
-
$parcel$export($
|
|
51
|
-
$parcel$export($
|
|
52
|
-
$parcel$export($
|
|
53
|
-
$parcel$export($
|
|
54
|
-
$parcel$export($
|
|
55
|
-
$parcel$export($
|
|
56
|
-
$parcel$export($
|
|
57
|
-
$parcel$export($
|
|
58
|
-
$parcel$export($
|
|
59
|
-
$parcel$export($
|
|
60
|
-
$parcel$export($
|
|
61
|
-
$parcel$export($
|
|
62
|
-
$parcel$export($
|
|
63
|
-
$parcel$export($
|
|
64
|
-
$parcel$export($
|
|
65
|
-
$parcel$export($
|
|
66
|
-
$parcel$export($
|
|
67
|
-
$parcel$export($
|
|
68
|
-
$parcel$export($
|
|
69
|
-
$parcel$export($
|
|
70
|
-
$parcel$export($
|
|
71
|
-
$parcel$export($
|
|
72
|
-
$parcel$export($
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var $
|
|
90
|
-
var $
|
|
91
|
-
var $
|
|
92
|
-
var $
|
|
93
|
-
var $
|
|
94
|
-
var $
|
|
95
|
-
var $
|
|
96
|
-
var $
|
|
97
|
-
var $
|
|
98
|
-
var $
|
|
99
|
-
var $
|
|
100
|
-
var $
|
|
101
|
-
var $
|
|
102
|
-
var $
|
|
103
|
-
var $
|
|
104
|
-
var $
|
|
105
|
-
var $
|
|
106
|
-
var $
|
|
107
|
-
var $
|
|
108
|
-
var $
|
|
109
|
-
$
|
|
110
|
-
$
|
|
111
|
-
$
|
|
112
|
-
$
|
|
113
|
-
$
|
|
114
|
-
$
|
|
115
|
-
$
|
|
116
|
-
$
|
|
117
|
-
$
|
|
118
|
-
$
|
|
119
|
-
$
|
|
120
|
-
$
|
|
121
|
-
$
|
|
122
|
-
$
|
|
123
|
-
$
|
|
124
|
-
$
|
|
125
|
-
$
|
|
126
|
-
$
|
|
127
|
-
$
|
|
128
|
-
$
|
|
129
|
-
$
|
|
130
|
-
$
|
|
131
|
-
$
|
|
132
|
-
$
|
|
133
|
-
$
|
|
134
|
-
$
|
|
135
|
-
$
|
|
136
|
-
$
|
|
137
|
-
$
|
|
138
|
-
$
|
|
139
|
-
$
|
|
140
|
-
$
|
|
141
|
-
$
|
|
142
|
-
$
|
|
143
|
-
$
|
|
144
|
-
$
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
35
|
+
var $c8bc378300208597$exports = {};
|
|
36
|
+
|
|
37
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView", () => $c8bc378300208597$export$4ad4709e9aee8e02, (v) => $c8bc378300208597$export$4ad4709e9aee8e02 = v);
|
|
38
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView-row", () => $c8bc378300208597$export$f80410436c6352c8, (v) => $c8bc378300208597$export$f80410436c6352c8 = v);
|
|
39
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--emphasized", () => $c8bc378300208597$export$eb0d5352b2a55473, (v) => $c8bc378300208597$export$eb0d5352b2a55473 = v);
|
|
40
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem", () => $c8bc378300208597$export$ce8c93b50eec2d4f, (v) => $c8bc378300208597$export$ce8c93b50eec2d4f = v);
|
|
41
|
+
$parcel$export($c8bc378300208597$exports, "is-selected", () => $c8bc378300208597$export$1e0fb04f31d3c22a, (v) => $c8bc378300208597$export$1e0fb04f31d3c22a = v);
|
|
42
|
+
$parcel$export($c8bc378300208597$exports, "is-hovered", () => $c8bc378300208597$export$b8813cd5d7824ce7, (v) => $c8bc378300208597$export$b8813cd5d7824ce7 = v);
|
|
43
|
+
$parcel$export($c8bc378300208597$exports, "is-active", () => $c8bc378300208597$export$20fd0f7cd4e6112f, (v) => $c8bc378300208597$export$20fd0f7cd4e6112f = v);
|
|
44
|
+
$parcel$export($c8bc378300208597$exports, "focus-ring", () => $c8bc378300208597$export$f39a09f249340e2a, (v) => $c8bc378300208597$export$f39a09f249340e2a = v);
|
|
45
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem--firstRow", () => $c8bc378300208597$export$60162f05499b7560, (v) => $c8bc378300208597$export$60162f05499b7560 = v);
|
|
46
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--quiet", () => $c8bc378300208597$export$b01cb9680b0b8d22, (v) => $c8bc378300208597$export$b01cb9680b0b8d22 = v);
|
|
47
|
+
$parcel$export($c8bc378300208597$exports, "is-next-selected", () => $c8bc378300208597$export$53aa811f86efbfad, (v) => $c8bc378300208597$export$53aa811f86efbfad = v);
|
|
48
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem--isFlushBottom", () => $c8bc378300208597$export$f9ed481cac4d935a, (v) => $c8bc378300208597$export$f9ed481cac4d935a = v);
|
|
49
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--loadingMore", () => $c8bc378300208597$export$5aa06adeaa92dbca, (v) => $c8bc378300208597$export$5aa06adeaa92dbca = v);
|
|
50
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem--lastRow", () => $c8bc378300208597$export$659c081622dc13b0, (v) => $c8bc378300208597$export$659c081622dc13b0 = v);
|
|
51
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--isVerticalScrollbarVisible", () => $c8bc378300208597$export$1bf50375883926, (v) => $c8bc378300208597$export$1bf50375883926 = v);
|
|
52
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--isHorizontalScrollbarVisible", () => $c8bc378300208597$export$d9b13621bc5dd4d1, (v) => $c8bc378300208597$export$d9b13621bc5dd4d1 = v);
|
|
53
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--wrap", () => $c8bc378300208597$export$68b45d42c77fe1cf, (v) => $c8bc378300208597$export$68b45d42c77fe1cf = v);
|
|
54
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-content", () => $c8bc378300208597$export$dc2b0b08d47555, (v) => $c8bc378300208597$export$dc2b0b08d47555 = v);
|
|
55
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-description", () => $c8bc378300208597$export$5d2adfeb248e654a, (v) => $c8bc378300208597$export$5d2adfeb248e654a = v);
|
|
56
|
+
$parcel$export($c8bc378300208597$exports, "round-tops", () => $c8bc378300208597$export$3b4577d06eb82ec0, (v) => $c8bc378300208597$export$3b4577d06eb82ec0 = v);
|
|
57
|
+
$parcel$export($c8bc378300208597$exports, "round-bottoms", () => $c8bc378300208597$export$8a26470723c97997, (v) => $c8bc378300208597$export$8a26470723c97997 = v);
|
|
58
|
+
$parcel$export($c8bc378300208597$exports, "is-focused", () => $c8bc378300208597$export$e7dc768d35940237, (v) => $c8bc378300208597$export$e7dc768d35940237 = v);
|
|
59
|
+
$parcel$export($c8bc378300208597$exports, "is-disabled", () => $c8bc378300208597$export$d35bc1e505d1ebbf, (v) => $c8bc378300208597$export$d35bc1e505d1ebbf = v);
|
|
60
|
+
$parcel$export($c8bc378300208597$exports, "has-checkbox", () => $c8bc378300208597$export$27f4d14f7fc5b94, (v) => $c8bc378300208597$export$27f4d14f7fc5b94 = v);
|
|
61
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-grid", () => $c8bc378300208597$export$aaaf83100348d389, (v) => $c8bc378300208597$export$aaaf83100348d389 = v);
|
|
62
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-draghandle-container", () => $c8bc378300208597$export$f385e7456ddfee84, (v) => $c8bc378300208597$export$f385e7456ddfee84 = v);
|
|
63
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-draghandle-button", () => $c8bc378300208597$export$4784f0c2ec8bbf7b, (v) => $c8bc378300208597$export$4784f0c2ec8bbf7b = v);
|
|
64
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkboxWrapper", () => $c8bc378300208597$export$41a33ae9818c51be, (v) => $c8bc378300208597$export$41a33ae9818c51be = v);
|
|
65
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkbox", () => $c8bc378300208597$export$f979f76ca45242f2, (v) => $c8bc378300208597$export$f979f76ca45242f2 = v);
|
|
66
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-icon", () => $c8bc378300208597$export$2b56ca744bd31ebd, (v) => $c8bc378300208597$export$2b56ca744bd31ebd = v);
|
|
67
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-image", () => $c8bc378300208597$export$1260770e51d5a8c4, (v) => $c8bc378300208597$export$1260770e51d5a8c4 = v);
|
|
68
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--hasDescription", () => $c8bc378300208597$export$7c9efe74c4b77579, (v) => $c8bc378300208597$export$7c9efe74c4b77579 = v);
|
|
69
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-actions", () => $c8bc378300208597$export$26480389595d4515, (v) => $c8bc378300208597$export$26480389595d4515 = v);
|
|
70
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-actionmenu", () => $c8bc378300208597$export$58dfda3903289699, (v) => $c8bc378300208597$export$58dfda3903289699 = v);
|
|
71
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-parentIndicator", () => $c8bc378300208597$export$39b42a8a24290c17, (v) => $c8bc378300208597$export$39b42a8a24290c17 = v);
|
|
72
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-dragPreview", () => $c8bc378300208597$export$84286d36e5c00c55, (v) => $c8bc378300208597$export$84286d36e5c00c55 = v);
|
|
73
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-badge", () => $c8bc378300208597$export$6498e436231eea33, (v) => $c8bc378300208597$export$6498e436231eea33 = v);
|
|
74
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-dragPreview--multiple", () => $c8bc378300208597$export$2fb3c7c2d5c0d720, (v) => $c8bc378300208597$export$2fb3c7c2d5c0d720 = v);
|
|
75
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--hasAnyChildren", () => $c8bc378300208597$export$7150e72e440612bf, (v) => $c8bc378300208597$export$7150e72e440612bf = v);
|
|
76
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-parentIndicator--hasChildItems", () => $c8bc378300208597$export$c29dcfa80dab8c88, (v) => $c8bc378300208597$export$c29dcfa80dab8c88 = v);
|
|
77
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--compact", () => $c8bc378300208597$export$1f55b27adf96a61e, (v) => $c8bc378300208597$export$1f55b27adf96a61e = v);
|
|
78
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--spacious", () => $c8bc378300208597$export$cbd30c7809acdd81, (v) => $c8bc378300208597$export$cbd30c7809acdd81 = v);
|
|
79
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--draggable", () => $c8bc378300208597$export$a2d35348c0cc9bca, (v) => $c8bc378300208597$export$a2d35348c0cc9bca = v);
|
|
80
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem--dropTarget", () => $c8bc378300208597$export$8afa006321ee3a8f, (v) => $c8bc378300208597$export$8afa006321ee3a8f = v);
|
|
81
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView--dropTarget", () => $c8bc378300208597$export$d9ba3f873d0eaec6, (v) => $c8bc378300208597$export$d9ba3f873d0eaec6 = v);
|
|
82
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView-centeredWrapper", () => $c8bc378300208597$export$1b66ee5cd8394caf, (v) => $c8bc378300208597$export$1b66ee5cd8394caf = v);
|
|
83
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListView-centeredWrapper--loadingMore", () => $c8bc378300208597$export$6b3b7792abd9e5f4, (v) => $c8bc378300208597$export$6b3b7792abd9e5f4 = v);
|
|
84
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewInsertionIndicator", () => $c8bc378300208597$export$2a6a235e0baff403, (v) => $c8bc378300208597$export$2a6a235e0baff403 = v);
|
|
85
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewInsertionIndicator--dropTarget", () => $c8bc378300208597$export$927a243805a411ca, (v) => $c8bc378300208597$export$927a243805a411ca = v);
|
|
86
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkbox--enter", () => $c8bc378300208597$export$9dc11c0e0825a249, (v) => $c8bc378300208597$export$9dc11c0e0825a249 = v);
|
|
87
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkbox--enterActive", () => $c8bc378300208597$export$f89865e352230a35, (v) => $c8bc378300208597$export$f89865e352230a35 = v);
|
|
88
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkbox--exit", () => $c8bc378300208597$export$867c05a16e5d2a7c, (v) => $c8bc378300208597$export$867c05a16e5d2a7c = v);
|
|
89
|
+
$parcel$export($c8bc378300208597$exports, "react-spectrum-ListViewItem-checkbox--exitActive", () => $c8bc378300208597$export$61b66671605f1b1a, (v) => $c8bc378300208597$export$61b66671605f1b1a = v);
|
|
90
|
+
var $c8bc378300208597$export$4ad4709e9aee8e02;
|
|
91
|
+
var $c8bc378300208597$export$f80410436c6352c8;
|
|
92
|
+
var $c8bc378300208597$export$eb0d5352b2a55473;
|
|
93
|
+
var $c8bc378300208597$export$ce8c93b50eec2d4f;
|
|
94
|
+
var $c8bc378300208597$export$1e0fb04f31d3c22a;
|
|
95
|
+
var $c8bc378300208597$export$b8813cd5d7824ce7;
|
|
96
|
+
var $c8bc378300208597$export$20fd0f7cd4e6112f;
|
|
97
|
+
var $c8bc378300208597$export$f39a09f249340e2a;
|
|
98
|
+
var $c8bc378300208597$export$60162f05499b7560;
|
|
99
|
+
var $c8bc378300208597$export$b01cb9680b0b8d22;
|
|
100
|
+
var $c8bc378300208597$export$53aa811f86efbfad;
|
|
101
|
+
var $c8bc378300208597$export$f9ed481cac4d935a;
|
|
102
|
+
var $c8bc378300208597$export$5aa06adeaa92dbca;
|
|
103
|
+
var $c8bc378300208597$export$659c081622dc13b0;
|
|
104
|
+
var $c8bc378300208597$export$1bf50375883926;
|
|
105
|
+
var $c8bc378300208597$export$d9b13621bc5dd4d1;
|
|
106
|
+
var $c8bc378300208597$export$68b45d42c77fe1cf;
|
|
107
|
+
var $c8bc378300208597$export$dc2b0b08d47555;
|
|
108
|
+
var $c8bc378300208597$export$5d2adfeb248e654a;
|
|
109
|
+
var $c8bc378300208597$export$3b4577d06eb82ec0;
|
|
110
|
+
var $c8bc378300208597$export$8a26470723c97997;
|
|
111
|
+
var $c8bc378300208597$export$e7dc768d35940237;
|
|
112
|
+
var $c8bc378300208597$export$d35bc1e505d1ebbf;
|
|
113
|
+
var $c8bc378300208597$export$27f4d14f7fc5b94;
|
|
114
|
+
var $c8bc378300208597$export$aaaf83100348d389;
|
|
115
|
+
var $c8bc378300208597$export$f385e7456ddfee84;
|
|
116
|
+
var $c8bc378300208597$export$4784f0c2ec8bbf7b;
|
|
117
|
+
var $c8bc378300208597$export$41a33ae9818c51be;
|
|
118
|
+
var $c8bc378300208597$export$f979f76ca45242f2;
|
|
119
|
+
var $c8bc378300208597$export$2b56ca744bd31ebd;
|
|
120
|
+
var $c8bc378300208597$export$1260770e51d5a8c4;
|
|
121
|
+
var $c8bc378300208597$export$7c9efe74c4b77579;
|
|
122
|
+
var $c8bc378300208597$export$26480389595d4515;
|
|
123
|
+
var $c8bc378300208597$export$58dfda3903289699;
|
|
124
|
+
var $c8bc378300208597$export$39b42a8a24290c17;
|
|
125
|
+
var $c8bc378300208597$export$84286d36e5c00c55;
|
|
126
|
+
var $c8bc378300208597$export$6498e436231eea33;
|
|
127
|
+
var $c8bc378300208597$export$2fb3c7c2d5c0d720;
|
|
128
|
+
var $c8bc378300208597$export$7150e72e440612bf;
|
|
129
|
+
var $c8bc378300208597$export$c29dcfa80dab8c88;
|
|
130
|
+
var $c8bc378300208597$export$1f55b27adf96a61e;
|
|
131
|
+
var $c8bc378300208597$export$cbd30c7809acdd81;
|
|
132
|
+
var $c8bc378300208597$export$a2d35348c0cc9bca;
|
|
133
|
+
var $c8bc378300208597$export$8afa006321ee3a8f;
|
|
134
|
+
var $c8bc378300208597$export$d9ba3f873d0eaec6;
|
|
135
|
+
var $c8bc378300208597$export$1b66ee5cd8394caf;
|
|
136
|
+
var $c8bc378300208597$export$6b3b7792abd9e5f4;
|
|
137
|
+
var $c8bc378300208597$export$2a6a235e0baff403;
|
|
138
|
+
var $c8bc378300208597$export$927a243805a411ca;
|
|
139
|
+
var $c8bc378300208597$export$9dc11c0e0825a249;
|
|
140
|
+
var $c8bc378300208597$export$f89865e352230a35;
|
|
141
|
+
var $c8bc378300208597$export$867c05a16e5d2a7c;
|
|
142
|
+
var $c8bc378300208597$export$61b66671605f1b1a;
|
|
143
|
+
$c8bc378300208597$export$4ad4709e9aee8e02 = "react-spectrum-ListView_dd5487";
|
|
144
|
+
$c8bc378300208597$export$f80410436c6352c8 = "react-spectrum-ListView-row_dd5487";
|
|
145
|
+
$c8bc378300208597$export$eb0d5352b2a55473 = "react-spectrum-ListView--emphasized_dd5487";
|
|
146
|
+
$c8bc378300208597$export$ce8c93b50eec2d4f = "react-spectrum-ListViewItem_dd5487";
|
|
147
|
+
$c8bc378300208597$export$1e0fb04f31d3c22a = "is-selected_dd5487";
|
|
148
|
+
$c8bc378300208597$export$b8813cd5d7824ce7 = "is-hovered_dd5487";
|
|
149
|
+
$c8bc378300208597$export$20fd0f7cd4e6112f = "is-active_dd5487";
|
|
150
|
+
$c8bc378300208597$export$f39a09f249340e2a = "focus-ring_dd5487";
|
|
151
|
+
$c8bc378300208597$export$60162f05499b7560 = "react-spectrum-ListViewItem--firstRow_dd5487";
|
|
152
|
+
$c8bc378300208597$export$b01cb9680b0b8d22 = "react-spectrum-ListView--quiet_dd5487";
|
|
153
|
+
$c8bc378300208597$export$53aa811f86efbfad = "is-next-selected_dd5487";
|
|
154
|
+
$c8bc378300208597$export$f9ed481cac4d935a = "react-spectrum-ListViewItem--isFlushBottom_dd5487";
|
|
155
|
+
$c8bc378300208597$export$5aa06adeaa92dbca = "react-spectrum-ListView--loadingMore_dd5487";
|
|
156
|
+
$c8bc378300208597$export$659c081622dc13b0 = "react-spectrum-ListViewItem--lastRow_dd5487";
|
|
157
|
+
$c8bc378300208597$export$1bf50375883926 = "react-spectrum-ListView--isVerticalScrollbarVisible_dd5487";
|
|
158
|
+
$c8bc378300208597$export$d9b13621bc5dd4d1 = "react-spectrum-ListView--isHorizontalScrollbarVisible_dd5487";
|
|
159
|
+
$c8bc378300208597$export$68b45d42c77fe1cf = "react-spectrum-ListView--wrap_dd5487";
|
|
160
|
+
$c8bc378300208597$export$dc2b0b08d47555 = "react-spectrum-ListViewItem-content_dd5487";
|
|
161
|
+
$c8bc378300208597$export$5d2adfeb248e654a = "react-spectrum-ListViewItem-description_dd5487";
|
|
162
|
+
$c8bc378300208597$export$3b4577d06eb82ec0 = "round-tops_dd5487";
|
|
163
|
+
$c8bc378300208597$export$8a26470723c97997 = "round-bottoms_dd5487";
|
|
164
|
+
$c8bc378300208597$export$e7dc768d35940237 = "is-focused_dd5487";
|
|
165
|
+
$c8bc378300208597$export$d35bc1e505d1ebbf = "is-disabled_dd5487";
|
|
166
|
+
$c8bc378300208597$export$27f4d14f7fc5b94 = "has-checkbox_dd5487";
|
|
167
|
+
$c8bc378300208597$export$aaaf83100348d389 = "react-spectrum-ListViewItem-grid_dd5487";
|
|
168
|
+
$c8bc378300208597$export$f385e7456ddfee84 = "react-spectrum-ListViewItem-draghandle-container_dd5487";
|
|
169
|
+
$c8bc378300208597$export$4784f0c2ec8bbf7b = "react-spectrum-ListViewItem-draghandle-button_dd5487";
|
|
170
|
+
$c8bc378300208597$export$41a33ae9818c51be = "react-spectrum-ListViewItem-checkboxWrapper_dd5487";
|
|
171
|
+
$c8bc378300208597$export$f979f76ca45242f2 = "react-spectrum-ListViewItem-checkbox_dd5487";
|
|
172
|
+
$c8bc378300208597$export$2b56ca744bd31ebd = "react-spectrum-ListViewItem-icon_dd5487";
|
|
173
|
+
$c8bc378300208597$export$1260770e51d5a8c4 = "react-spectrum-ListViewItem-image_dd5487";
|
|
174
|
+
$c8bc378300208597$export$7c9efe74c4b77579 = "react-spectrum-ListView--hasDescription_dd5487";
|
|
175
|
+
$c8bc378300208597$export$26480389595d4515 = "react-spectrum-ListViewItem-actions_dd5487";
|
|
176
|
+
$c8bc378300208597$export$58dfda3903289699 = "react-spectrum-ListViewItem-actionmenu_dd5487";
|
|
177
|
+
$c8bc378300208597$export$39b42a8a24290c17 = "react-spectrum-ListViewItem-parentIndicator_dd5487";
|
|
178
|
+
$c8bc378300208597$export$84286d36e5c00c55 = "react-spectrum-ListViewItem-dragPreview_dd5487";
|
|
179
|
+
$c8bc378300208597$export$6498e436231eea33 = "react-spectrum-ListViewItem-badge_dd5487";
|
|
180
|
+
$c8bc378300208597$export$2fb3c7c2d5c0d720 = "react-spectrum-ListViewItem-dragPreview--multiple_dd5487";
|
|
181
|
+
$c8bc378300208597$export$7150e72e440612bf = "react-spectrum-ListView--hasAnyChildren_dd5487";
|
|
182
|
+
$c8bc378300208597$export$c29dcfa80dab8c88 = "react-spectrum-ListViewItem-parentIndicator--hasChildItems_dd5487";
|
|
183
|
+
$c8bc378300208597$export$1f55b27adf96a61e = "react-spectrum-ListView--compact_dd5487";
|
|
184
|
+
$c8bc378300208597$export$cbd30c7809acdd81 = "react-spectrum-ListView--spacious_dd5487";
|
|
185
|
+
$c8bc378300208597$export$a2d35348c0cc9bca = "react-spectrum-ListView--draggable_dd5487";
|
|
186
|
+
$c8bc378300208597$export$8afa006321ee3a8f = "react-spectrum-ListViewItem--dropTarget_dd5487";
|
|
187
|
+
$c8bc378300208597$export$d9ba3f873d0eaec6 = "react-spectrum-ListView--dropTarget_dd5487";
|
|
188
|
+
$c8bc378300208597$export$1b66ee5cd8394caf = "react-spectrum-ListView-centeredWrapper_dd5487";
|
|
189
|
+
$c8bc378300208597$export$6b3b7792abd9e5f4 = "react-spectrum-ListView-centeredWrapper--loadingMore_dd5487";
|
|
190
|
+
$c8bc378300208597$export$2a6a235e0baff403 = "react-spectrum-ListViewInsertionIndicator_dd5487";
|
|
191
|
+
$c8bc378300208597$export$927a243805a411ca = "react-spectrum-ListViewInsertionIndicator--dropTarget_dd5487";
|
|
192
|
+
$c8bc378300208597$export$9dc11c0e0825a249 = "react-spectrum-ListViewItem-checkbox--enter_dd5487";
|
|
193
|
+
$c8bc378300208597$export$f89865e352230a35 = "react-spectrum-ListViewItem-checkbox--enterActive_dd5487";
|
|
194
|
+
$c8bc378300208597$export$867c05a16e5d2a7c = "react-spectrum-ListViewItem-checkbox--exit_dd5487";
|
|
195
|
+
$c8bc378300208597$export$61b66671605f1b1a = "react-spectrum-ListViewItem-checkbox--exitActive_dd5487";
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
function $0a834ddbc989a3e3$export$2e2bcd8739ae039(props) {
|
|
202
|
+
let { dropState: dropState , dropHooks: dropHooks } = $fWI2a$useContext($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
|
|
203
|
+
const { target: target , isPresentationOnly: isPresentationOnly } = props;
|
|
204
|
+
let ref = $fWI2a$useRef();
|
|
205
|
+
let { dropIndicatorProps: dropIndicatorProps } = dropHooks.useDropIndicator(props, dropState, ref);
|
|
206
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = $fWI2a$useVisuallyHidden();
|
|
207
|
+
let isDropTarget = dropState.isDropTarget(target);
|
|
208
|
+
return(/*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
209
|
+
role: "row",
|
|
210
|
+
"aria-hidden": dropIndicatorProps['aria-hidden']
|
|
158
211
|
}, /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
'react-spectrum-ListViewItem-dragPreview--multiple': isDraggingMultiple
|
|
212
|
+
role: "gridcell",
|
|
213
|
+
"aria-selected": "false",
|
|
214
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewInsertionIndicator', {
|
|
215
|
+
'react-spectrum-ListViewInsertionIndicator--dropTarget': isDropTarget
|
|
164
216
|
})
|
|
165
|
-
}, /*#__PURE__*/ $fWI2a$react.createElement(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
text: {
|
|
173
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-content']
|
|
174
|
-
},
|
|
175
|
-
description: {
|
|
176
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-description']
|
|
177
|
-
},
|
|
178
|
-
icon: {
|
|
179
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-icon'],
|
|
180
|
-
size: 'M'
|
|
181
|
-
},
|
|
182
|
-
image: {
|
|
183
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-image']
|
|
184
|
-
},
|
|
185
|
-
link: {
|
|
186
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-content'],
|
|
187
|
-
isQuiet: true
|
|
188
|
-
},
|
|
189
|
-
actionButton: {
|
|
190
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-actions'],
|
|
191
|
-
isQuiet: true
|
|
192
|
-
},
|
|
193
|
-
actionGroup: {
|
|
194
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-actions'],
|
|
195
|
-
isQuiet: true,
|
|
196
|
-
density: 'compact'
|
|
197
|
-
},
|
|
198
|
-
actionMenu: {
|
|
199
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-actionmenu'],
|
|
200
|
-
isQuiet: true
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}, typeof item.rendered === 'string' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Content, null, item.rendered) : item.rendered, isDraggingMultiple && /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
204
|
-
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports)), 'react-spectrum-ListViewItem-badge')
|
|
205
|
-
}, itemCount))))));
|
|
217
|
+
}, !isPresentationOnly && /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
218
|
+
...visuallyHiddenProps,
|
|
219
|
+
role: "button",
|
|
220
|
+
...dropIndicatorProps,
|
|
221
|
+
ref: ref
|
|
222
|
+
}))));
|
|
206
223
|
}
|
|
207
224
|
|
|
208
225
|
|
|
209
|
-
|
|
210
|
-
|
|
211
226
|
var $8d8b0a0ae222979e$exports = {};
|
|
212
227
|
var $a8be062dce739a7d$exports = {};
|
|
213
228
|
$a8be062dce739a7d$exports = JSON.parse("{\"loading\":\"جارٍ التحميل...\",\"loadingMore\":\"جارٍ تحميل المزيد...\"}");
|
|
@@ -400,157 +415,264 @@ $8d8b0a0ae222979e$exports = {
|
|
|
400
415
|
|
|
401
416
|
|
|
402
417
|
|
|
418
|
+
|
|
419
|
+
|
|
403
420
|
|
|
404
421
|
|
|
405
422
|
|
|
406
423
|
function $d7c07ca2efc5ba02$export$c6bde0c04b033c0e(props) {
|
|
407
424
|
var ref, ref1;
|
|
408
|
-
let { item: item , isEmphasized: isEmphasized
|
|
409
|
-
let
|
|
410
|
-
...item.childNodes
|
|
411
|
-
][0];
|
|
412
|
-
let { state: state , dragState: dragState , onAction: onAction , isListDraggable: isListDraggable , layout: layout } = $fWI2a$useContext($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
|
|
425
|
+
let { item: item , isEmphasized: isEmphasized } = props;
|
|
426
|
+
let { state: state , dragState: dragState , dropState: dropState , isListDraggable: isListDraggable , isListDroppable: isListDroppable , layout: layout , dragHooks: dragHooks , dropHooks: dropHooks , loadingState: loadingState } = $fWI2a$useContext($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
|
|
413
427
|
let { direction: direction } = $fWI2a$useLocale();
|
|
414
428
|
let rowRef = $fWI2a$useRef();
|
|
415
|
-
let cellRef = $fWI2a$useRef();
|
|
416
429
|
let { isFocusVisible: isFocusVisibleWithin , focusProps: focusWithinProps } = $fWI2a$useFocusRing({
|
|
417
430
|
within: true
|
|
418
431
|
});
|
|
419
432
|
let { isFocusVisible: isFocusVisible , focusProps: focusProps } = $fWI2a$useFocusRing();
|
|
420
|
-
let
|
|
421
|
-
let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
|
|
422
|
-
let isDraggable = (dragState === null || dragState === void 0 ? void 0 : dragState.isDraggable(item.key)) && !isDisabled;
|
|
423
|
-
let { hoverProps: hoverProps , isHovered: isHovered } = $fWI2a$useHover({
|
|
424
|
-
isDisabled: isDisabled
|
|
425
|
-
});
|
|
426
|
-
let { pressProps: pressProps , isPressed: isPressed } = $fWI2a$usePress({
|
|
427
|
-
isDisabled: isDisabled
|
|
428
|
-
});
|
|
429
|
-
let { rowProps: rowProps } = $fWI2a$useGridRow({
|
|
433
|
+
let { rowProps: rowProps , gridCellProps: gridCellProps , isPressed: isPressed , isSelected: isSelected , isDisabled: isDisabled , allowsSelection: allowsSelection , hasAction: hasAction } = $fWI2a$useListItem({
|
|
430
434
|
node: item,
|
|
431
435
|
isVirtualized: true,
|
|
432
|
-
onAction: onAction ? ()=>onAction(item.key)
|
|
433
|
-
: undefined,
|
|
434
436
|
shouldSelectOnPressUp: isListDraggable
|
|
435
437
|
}, state, rowRef);
|
|
436
|
-
let
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}
|
|
440
|
-
let
|
|
441
|
-
if (isListDraggable) // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
442
|
-
draggableItem = dragHooks.useDraggableItem({
|
|
443
|
-
key: item.key
|
|
444
|
-
}, dragState);
|
|
445
|
-
const mergedProps = $fWI2a$mergeProps(gridCellProps, hoverProps, focusWithinProps, focusProps);
|
|
446
|
-
let { checkboxProps: checkboxProps } = $fWI2a$useGridSelectionCheckbox({
|
|
447
|
-
...props,
|
|
438
|
+
let isDroppable = isListDroppable && !isDisabled;
|
|
439
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $fWI2a$useHover({
|
|
440
|
+
isDisabled: !allowsSelection && !hasAction
|
|
441
|
+
});
|
|
442
|
+
let { checkboxProps: checkboxProps } = $fWI2a$useListSelectionCheckbox({
|
|
448
443
|
key: item.key
|
|
449
444
|
}, state);
|
|
445
|
+
let hasDescription = $fWI2a$useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-description']}`, rowRef);
|
|
446
|
+
let draggableItem;
|
|
447
|
+
if (isListDraggable) {
|
|
448
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
449
|
+
draggableItem = dragHooks.useDraggableItem({
|
|
450
|
+
key: item.key
|
|
451
|
+
}, dragState);
|
|
452
|
+
if (isDisabled) draggableItem = null;
|
|
453
|
+
}
|
|
454
|
+
let droppableItem;
|
|
455
|
+
let isDropTarget;
|
|
456
|
+
if (isListDroppable) {
|
|
457
|
+
let target = {
|
|
458
|
+
type: 'item',
|
|
459
|
+
key: item.key,
|
|
460
|
+
dropPosition: 'on'
|
|
461
|
+
};
|
|
462
|
+
isDropTarget = dropState.isDropTarget(target);
|
|
463
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
464
|
+
droppableItem = dropHooks.useDroppableItem({
|
|
465
|
+
target: target
|
|
466
|
+
}, dropState, rowRef);
|
|
467
|
+
}
|
|
450
468
|
let dragButtonRef = $fWI2a$react.useRef();
|
|
451
469
|
let { buttonProps: buttonProps } = $fWI2a$useButton({
|
|
452
470
|
...draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragButtonProps,
|
|
453
471
|
elementType: 'div'
|
|
454
472
|
}, dragButtonRef);
|
|
455
|
-
let chevron =
|
|
456
|
-
if (item.props.hasChildItems) chevron = direction === 'ltr' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$spectrumiconsuiChevronRightMedium, {
|
|
473
|
+
let chevron = direction === 'ltr' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$spectrumiconsuiChevronRightMedium, {
|
|
457
474
|
"aria-hidden": "true",
|
|
458
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
475
|
+
UNSAFE_className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem-parentIndicator', {
|
|
476
|
+
'react-spectrum-ListViewItem-parentIndicator--hasChildItems': item.props.hasChildItems,
|
|
477
|
+
'is-disabled': !hasAction
|
|
478
|
+
})
|
|
459
479
|
}) : /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$spectrumiconsuiChevronLeftMedium, {
|
|
460
480
|
"aria-hidden": "true",
|
|
461
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
481
|
+
UNSAFE_className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem-parentIndicator', {
|
|
482
|
+
'react-spectrum-ListViewItem-parentIndicator--hasChildItems': item.props.hasChildItems,
|
|
483
|
+
'is-disabled': !hasAction
|
|
484
|
+
})
|
|
462
485
|
});
|
|
463
486
|
let showCheckbox = state.selectionManager.selectionMode !== 'none' && state.selectionManager.selectionBehavior === 'toggle';
|
|
464
|
-
let isSelected = state.selectionManager.isSelected(item.key);
|
|
465
|
-
let showDragHandle = isDraggable && isFocusVisibleWithin;
|
|
466
487
|
let { visuallyHiddenProps: visuallyHiddenProps } = $fWI2a$useVisuallyHidden();
|
|
488
|
+
const mergedProps = $fWI2a$mergeProps(rowProps, draggableItem === null || draggableItem === void 0 ? void 0 : draggableItem.dragProps, isDroppable && (droppableItem === null || droppableItem === void 0 ? void 0 : droppableItem.dropProps), hoverProps, focusWithinProps, focusProps);
|
|
467
489
|
let isFirstRow = item.prevKey == null;
|
|
468
490
|
let isLastRow = item.nextKey == null;
|
|
469
491
|
// Figure out if the ListView content is equal or greater in height to the container. If so, we'll need to round the bottom
|
|
470
492
|
// border corners of the last row when selected and we can get rid of the bottom border if it isn't selected to avoid border overlap
|
|
471
493
|
// with bottom border
|
|
472
494
|
let isFlushWithContainerBottom = false;
|
|
473
|
-
if (isLastRow) {
|
|
495
|
+
if (isLastRow && loadingState !== 'loadingMore') {
|
|
474
496
|
if (((ref = layout.getContentSize()) === null || ref === void 0 ? void 0 : ref.height) >= ((ref1 = layout.virtualizer) === null || ref1 === void 0 ? void 0 : ref1.getVisibleRect().height)) isFlushWithContainerBottom = true;
|
|
475
497
|
}
|
|
498
|
+
// previous item isn't selected
|
|
499
|
+
// and the previous item isn't focused or, if it is focused, then if focus globally isn't visible or just focus isn't in the listview
|
|
500
|
+
let roundTops = !state.selectionManager.isSelected(item.prevKey) && (state.selectionManager.focusedKey !== item.prevKey || !($fWI2a$isFocusVisible() && state.selectionManager.isFocused));
|
|
501
|
+
let roundBottoms = !state.selectionManager.isSelected(item.nextKey) && (state.selectionManager.focusedKey !== item.nextKey || !($fWI2a$isFocusVisible() && state.selectionManager.isFocused));
|
|
502
|
+
let content = typeof item.rendered === 'string' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Text, null, item.rendered) : item.rendered;
|
|
503
|
+
if (isDisabled) content = /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Provider, {
|
|
504
|
+
isDisabled: true
|
|
505
|
+
}, content);
|
|
476
506
|
return(/*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
477
|
-
|
|
478
|
-
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($
|
|
479
|
-
'focus-ring': isFocusVisible
|
|
507
|
+
...mergedProps,
|
|
508
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListView-row', {
|
|
509
|
+
'focus-ring': isFocusVisible,
|
|
510
|
+
'round-tops': roundTops || isHovered && !isSelected && state.selectionManager.focusedKey !== item.key,
|
|
511
|
+
'round-bottoms': roundBottoms || isHovered && !isSelected && state.selectionManager.focusedKey !== item.key
|
|
480
512
|
}),
|
|
481
513
|
ref: rowRef
|
|
482
514
|
}, /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
483
|
-
|
|
515
|
+
// TODO: refactor the css here now that we are focusing the row?
|
|
516
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem', {
|
|
484
517
|
'is-active': isPressed,
|
|
485
518
|
'is-focused': isFocusVisibleWithin,
|
|
486
519
|
'focus-ring': isFocusVisible,
|
|
487
520
|
'is-hovered': isHovered,
|
|
488
521
|
'is-selected': isSelected,
|
|
522
|
+
'is-disabled': isDisabled,
|
|
523
|
+
'is-prev-selected': state.selectionManager.isSelected(item.prevKey),
|
|
489
524
|
'is-next-selected': state.selectionManager.isSelected(item.nextKey),
|
|
490
525
|
'react-spectrum-ListViewItem--highlightSelection': state.selectionManager.selectionBehavior === 'replace' && (isSelected || state.selectionManager.isSelected(item.nextKey)),
|
|
491
|
-
'react-spectrum-ListViewItem--
|
|
526
|
+
'react-spectrum-ListViewItem--dropTarget': !!isDropTarget,
|
|
492
527
|
'react-spectrum-ListViewItem--firstRow': isFirstRow,
|
|
493
528
|
'react-spectrum-ListViewItem--lastRow': isLastRow,
|
|
494
|
-
'react-spectrum-ListViewItem--isFlushBottom': isFlushWithContainerBottom
|
|
529
|
+
'react-spectrum-ListViewItem--isFlushBottom': isFlushWithContainerBottom,
|
|
530
|
+
'react-spectrum-ListViewItem--hasDescription': hasDescription
|
|
495
531
|
}),
|
|
496
|
-
|
|
497
|
-
...mergedProps
|
|
532
|
+
...gridCellProps
|
|
498
533
|
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Grid, {
|
|
499
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
534
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-grid']
|
|
500
535
|
}, isListDraggable && /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
501
|
-
className: (/*@__PURE__*/$parcel$interopDefault($
|
|
502
|
-
},
|
|
503
|
-
focusRingClass: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($
|
|
536
|
+
className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-draghandle-container']
|
|
537
|
+
}, !isDisabled && /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$FocusRing, {
|
|
538
|
+
focusRingClass: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'focus-ring')
|
|
504
539
|
}, /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
505
540
|
...buttonProps,
|
|
506
|
-
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($
|
|
507
|
-
style: !
|
|
541
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem-draghandle-button'),
|
|
542
|
+
style: !isFocusVisibleWithin ? {
|
|
508
543
|
...visuallyHiddenProps.style
|
|
509
544
|
} : {
|
|
510
545
|
},
|
|
511
546
|
ref: dragButtonRef,
|
|
512
547
|
draggable: "true"
|
|
513
|
-
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$spectrumiconsuiListGripper, null)))),
|
|
514
|
-
|
|
548
|
+
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$spectrumiconsuiListGripper, null)))), /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$CSSTransition, {
|
|
549
|
+
in: showCheckbox,
|
|
550
|
+
unmountOnExit: true,
|
|
551
|
+
classNames: {
|
|
552
|
+
enter: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkbox--enter'],
|
|
553
|
+
enterActive: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkbox--enterActive'],
|
|
554
|
+
exit: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkbox--exit'],
|
|
555
|
+
exitActive: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkbox--exitActive']
|
|
556
|
+
},
|
|
557
|
+
timeout: 160
|
|
558
|
+
}, /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
559
|
+
className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkboxWrapper']
|
|
560
|
+
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Checkbox, {
|
|
515
561
|
...checkboxProps,
|
|
562
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-checkbox'],
|
|
516
563
|
isEmphasized: isEmphasized
|
|
517
|
-
}), /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$SlotProvider, {
|
|
564
|
+
}))), /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$SlotProvider, {
|
|
518
565
|
slots: {
|
|
519
|
-
content: {
|
|
520
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($7a33fe9cdec6aaae$exports))['react-spectrum-ListViewItem-content']
|
|
521
|
-
},
|
|
522
566
|
text: {
|
|
523
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
567
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-content']
|
|
524
568
|
},
|
|
525
569
|
description: {
|
|
526
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
570
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-description']
|
|
527
571
|
},
|
|
528
572
|
icon: {
|
|
529
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
573
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-icon'],
|
|
530
574
|
size: 'M'
|
|
531
575
|
},
|
|
532
576
|
image: {
|
|
533
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
577
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-image']
|
|
534
578
|
},
|
|
535
|
-
|
|
536
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
579
|
+
actionButton: {
|
|
580
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actions'],
|
|
537
581
|
isQuiet: true
|
|
538
582
|
},
|
|
583
|
+
actionGroup: {
|
|
584
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actions'],
|
|
585
|
+
isQuiet: true,
|
|
586
|
+
density: 'compact'
|
|
587
|
+
},
|
|
588
|
+
actionMenu: {
|
|
589
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actionmenu'],
|
|
590
|
+
isQuiet: true
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}, content, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$ClearSlots, null, chevron))))));
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
function $41a60729487a82d7$export$2e2bcd8739ae039() {
|
|
605
|
+
let { dropState: dropState , dropHooks: dropHooks } = $fWI2a$useContext($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
|
|
606
|
+
let dropRef = $fWI2a$useRef();
|
|
607
|
+
let { dropIndicatorProps: dropIndicatorProps } = dropHooks.useDropIndicator({
|
|
608
|
+
target: {
|
|
609
|
+
type: 'root'
|
|
610
|
+
}
|
|
611
|
+
}, dropState, dropRef);
|
|
612
|
+
let { visuallyHiddenProps: visuallyHiddenProps } = $fWI2a$useVisuallyHidden();
|
|
613
|
+
if (dropIndicatorProps['aria-hidden']) return null;
|
|
614
|
+
return(/*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
615
|
+
role: "option",
|
|
616
|
+
"aria-selected": "false",
|
|
617
|
+
...visuallyHiddenProps,
|
|
618
|
+
...dropIndicatorProps,
|
|
619
|
+
ref: dropRef
|
|
620
|
+
}));
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
function $cd61e55c47e3c0f5$export$905ab40ac2179daa(props) {
|
|
630
|
+
let { item: item , itemCount: itemCount , itemHeight: itemHeight } = props;
|
|
631
|
+
let isDraggingMultiple = itemCount > 1;
|
|
632
|
+
return(/*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
633
|
+
style: {
|
|
634
|
+
height: itemHeight
|
|
635
|
+
},
|
|
636
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem', 'react-spectrum-ListViewItem-dragPreview', {
|
|
637
|
+
'react-spectrum-ListViewItem-dragPreview--multiple': isDraggingMultiple
|
|
638
|
+
})
|
|
639
|
+
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Grid, {
|
|
640
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-grid']
|
|
641
|
+
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$SlotProvider, {
|
|
642
|
+
slots: {
|
|
643
|
+
content: {
|
|
644
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-content']
|
|
645
|
+
},
|
|
646
|
+
text: {
|
|
647
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-content']
|
|
648
|
+
},
|
|
649
|
+
description: {
|
|
650
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-description']
|
|
651
|
+
},
|
|
652
|
+
icon: {
|
|
653
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-icon'],
|
|
654
|
+
size: 'M'
|
|
655
|
+
},
|
|
656
|
+
image: {
|
|
657
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-image']
|
|
658
|
+
},
|
|
539
659
|
actionButton: {
|
|
540
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
660
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actions'],
|
|
541
661
|
isQuiet: true
|
|
542
662
|
},
|
|
543
663
|
actionGroup: {
|
|
544
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
664
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actions'],
|
|
545
665
|
isQuiet: true,
|
|
546
666
|
density: 'compact'
|
|
547
667
|
},
|
|
548
668
|
actionMenu: {
|
|
549
|
-
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($
|
|
669
|
+
UNSAFE_className: (/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports))['react-spectrum-ListViewItem-actionmenu'],
|
|
550
670
|
isQuiet: true
|
|
551
671
|
}
|
|
552
672
|
}
|
|
553
|
-
}, typeof item.rendered === 'string' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$
|
|
673
|
+
}, typeof item.rendered === 'string' ? /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Text, null, item.rendered) : item.rendered, isDraggingMultiple && /*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
674
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListViewItem-badge')
|
|
675
|
+
}, itemCount)))));
|
|
554
676
|
}
|
|
555
677
|
|
|
556
678
|
|
|
@@ -558,7 +680,6 @@ function $d7c07ca2efc5ba02$export$c6bde0c04b033c0e(props) {
|
|
|
558
680
|
|
|
559
681
|
|
|
560
682
|
|
|
561
|
-
|
|
562
683
|
const $f85fb77f9d4cbc6c$export$870039b0abfe3de0 = /*#__PURE__*/ $fWI2a$react.createContext(null);
|
|
563
684
|
const $f85fb77f9d4cbc6c$var$ROW_HEIGHTS = {
|
|
564
685
|
compact: {
|
|
@@ -574,7 +695,7 @@ const $f85fb77f9d4cbc6c$var$ROW_HEIGHTS = {
|
|
|
574
695
|
large: 60
|
|
575
696
|
}
|
|
576
697
|
};
|
|
577
|
-
function $f85fb77f9d4cbc6c$
|
|
698
|
+
function $f85fb77f9d4cbc6c$var$useListLayout(state, density, allowDisabledKeyFocus) {
|
|
578
699
|
let { scale: scale } = $fWI2a$useProvider();
|
|
579
700
|
let collator = $fWI2a$useCollator({
|
|
580
701
|
usage: 'search',
|
|
@@ -585,120 +706,158 @@ function $f85fb77f9d4cbc6c$export$bea90da51ec70dea(state, density) {
|
|
|
585
706
|
estimatedRowHeight: $f85fb77f9d4cbc6c$var$ROW_HEIGHTS[density][scale],
|
|
586
707
|
padding: 0,
|
|
587
708
|
collator: collator,
|
|
588
|
-
loaderHeight: isEmpty ? null : $f85fb77f9d4cbc6c$var$ROW_HEIGHTS[density][scale]
|
|
709
|
+
loaderHeight: isEmpty ? null : $f85fb77f9d4cbc6c$var$ROW_HEIGHTS[density][scale],
|
|
710
|
+
allowDisabledKeyFocus: allowDisabledKeyFocus
|
|
589
711
|
})
|
|
590
712
|
, [
|
|
591
713
|
collator,
|
|
592
714
|
scale,
|
|
593
715
|
density,
|
|
594
|
-
isEmpty
|
|
716
|
+
isEmpty,
|
|
717
|
+
allowDisabledKeyFocus
|
|
595
718
|
]);
|
|
596
719
|
layout.collection = state.collection;
|
|
597
720
|
layout.disabledKeys = state.disabledKeys;
|
|
598
721
|
return layout;
|
|
599
722
|
}
|
|
600
723
|
function $f85fb77f9d4cbc6c$var$ListView(props, ref) {
|
|
601
|
-
|
|
724
|
+
var ref1;
|
|
725
|
+
let { density: density = 'regular' , onLoadMore: onLoadMore , loadingState: loadingState , isQuiet: isQuiet , overflowMode: overflowMode = 'truncate' , onAction: onAction , dragHooks: dragHooks , dropHooks: dropHooks , ...otherProps } = props;
|
|
602
726
|
let isListDraggable = !!dragHooks;
|
|
727
|
+
let isListDroppable = !!dropHooks;
|
|
603
728
|
let dragHooksProvided = $fWI2a$useRef(isListDraggable);
|
|
729
|
+
let dropHooksProvided = $fWI2a$useRef(isListDroppable);
|
|
604
730
|
if (dragHooksProvided.current !== isListDraggable) console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');
|
|
731
|
+
if (dropHooksProvided.current !== isListDroppable) console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');
|
|
605
732
|
let domRef = $fWI2a$useDOMRef(ref);
|
|
606
|
-
let
|
|
607
|
-
let formatMessage = $fWI2a$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($8d8b0a0ae222979e$exports)));
|
|
608
|
-
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
609
|
-
let { styleProps: styleProps } = $fWI2a$useStyleProps(props);
|
|
610
|
-
let { direction: direction , locale: locale } = $fWI2a$useLocale();
|
|
611
|
-
let collator = $fWI2a$useCollator({
|
|
612
|
-
usage: 'search',
|
|
613
|
-
sensitivity: 'base'
|
|
614
|
-
});
|
|
615
|
-
let gridCollection = $fWI2a$useMemo(()=>new $fWI2a$GridCollection({
|
|
616
|
-
columnCount: 1,
|
|
617
|
-
items: [
|
|
618
|
-
...collection
|
|
619
|
-
].map((item)=>({
|
|
620
|
-
...item,
|
|
621
|
-
hasChildNodes: true,
|
|
622
|
-
childNodes: [
|
|
623
|
-
{
|
|
624
|
-
key: `cell-${item.key}`,
|
|
625
|
-
type: 'cell',
|
|
626
|
-
index: 0,
|
|
627
|
-
value: null,
|
|
628
|
-
level: 0,
|
|
629
|
-
rendered: null,
|
|
630
|
-
textValue: item.textValue,
|
|
631
|
-
hasChildNodes: false,
|
|
632
|
-
childNodes: []
|
|
633
|
-
}
|
|
634
|
-
]
|
|
635
|
-
})
|
|
636
|
-
)
|
|
637
|
-
})
|
|
638
|
-
, [
|
|
639
|
-
collection
|
|
640
|
-
]);
|
|
641
|
-
let state = $fWI2a$useGridState({
|
|
733
|
+
let state = $fWI2a$useListState({
|
|
642
734
|
...props,
|
|
643
|
-
collection: gridCollection,
|
|
644
|
-
focusMode: 'cell',
|
|
645
735
|
selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'
|
|
646
736
|
});
|
|
647
|
-
let
|
|
648
|
-
let
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
direction: direction,
|
|
653
|
-
collator: collator,
|
|
654
|
-
// Focus the ListView cell instead of the row so that focus doesn't change with left/right arrow keys when there aren't any
|
|
655
|
-
// focusable children in the cell.
|
|
656
|
-
focusMode: 'cell'
|
|
657
|
-
})
|
|
658
|
-
, [
|
|
659
|
-
state,
|
|
660
|
-
domRef,
|
|
661
|
-
direction,
|
|
662
|
-
collator
|
|
663
|
-
]);
|
|
664
|
-
let provider = $fWI2a$useProvider();
|
|
737
|
+
let { collection: collection , selectionManager: selectionManager } = state;
|
|
738
|
+
let formatMessage = $fWI2a$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($8d8b0a0ae222979e$exports)));
|
|
739
|
+
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
740
|
+
let { styleProps: styleProps } = $fWI2a$useStyleProps(props);
|
|
741
|
+
let layout = $f85fb77f9d4cbc6c$var$useListLayout(state, props.density || 'regular', state.selectionManager.disabledBehavior === 'selection');
|
|
665
742
|
let dragState;
|
|
743
|
+
let preview = $fWI2a$useRef(null);
|
|
666
744
|
if (isListDraggable) dragState = dragHooks.useDraggableCollectionState({
|
|
667
|
-
collection:
|
|
668
|
-
selectionManager:
|
|
669
|
-
|
|
670
|
-
let item = state.collection.getItem(draggedKey);
|
|
671
|
-
let itemCount = draggingKeys.size;
|
|
672
|
-
let itemHeight = layout.getLayoutInfo(draggedKey).rect.height;
|
|
673
|
-
return(/*#__PURE__*/ $fWI2a$react.createElement($cd61e55c47e3c0f5$export$905ab40ac2179daa, {
|
|
674
|
-
item: item,
|
|
675
|
-
itemCount: itemCount,
|
|
676
|
-
itemHeight: itemHeight,
|
|
677
|
-
provider: provider,
|
|
678
|
-
locale: locale
|
|
679
|
-
}));
|
|
680
|
-
}
|
|
745
|
+
collection: collection,
|
|
746
|
+
selectionManager: selectionManager,
|
|
747
|
+
preview: preview
|
|
681
748
|
});
|
|
682
|
-
let
|
|
749
|
+
let DragPreview = dragHooks === null || dragHooks === void 0 ? void 0 : dragHooks.DragPreview;
|
|
750
|
+
let dropState;
|
|
751
|
+
let droppableCollection;
|
|
752
|
+
let isRootDropTarget;
|
|
753
|
+
if (isListDroppable) {
|
|
754
|
+
dropState = dropHooks.useDroppableCollectionState({
|
|
755
|
+
collection: collection,
|
|
756
|
+
selectionManager: selectionManager
|
|
757
|
+
});
|
|
758
|
+
droppableCollection = dropHooks.useDroppableCollection({
|
|
759
|
+
keyboardDelegate: layout,
|
|
760
|
+
getDropTargetFromPoint (x, y) {
|
|
761
|
+
let closest = null;
|
|
762
|
+
let closestDistance = Infinity;
|
|
763
|
+
let closestDir = null;
|
|
764
|
+
x += domRef.current.scrollLeft;
|
|
765
|
+
y += domRef.current.scrollTop;
|
|
766
|
+
let visible = layout.getVisibleLayoutInfos(new $fWI2a$Rect(x - 50, y - 50, x + 50, y + 50));
|
|
767
|
+
for (let layoutInfo of visible){
|
|
768
|
+
let r = layoutInfo.rect;
|
|
769
|
+
let points = [
|
|
770
|
+
[
|
|
771
|
+
r.x,
|
|
772
|
+
r.y + 4,
|
|
773
|
+
'before'
|
|
774
|
+
],
|
|
775
|
+
[
|
|
776
|
+
r.maxX,
|
|
777
|
+
r.y + 4,
|
|
778
|
+
'before'
|
|
779
|
+
],
|
|
780
|
+
[
|
|
781
|
+
r.x,
|
|
782
|
+
r.maxY - 8,
|
|
783
|
+
'after'
|
|
784
|
+
],
|
|
785
|
+
[
|
|
786
|
+
r.maxX,
|
|
787
|
+
r.maxY - 8,
|
|
788
|
+
'after'
|
|
789
|
+
]
|
|
790
|
+
];
|
|
791
|
+
for (let [px, py, dir] of points){
|
|
792
|
+
let dx = px - x;
|
|
793
|
+
let dy = py - y;
|
|
794
|
+
let d = dx * dx + dy * dy;
|
|
795
|
+
if (d < closestDistance) {
|
|
796
|
+
closestDistance = d;
|
|
797
|
+
closest = layoutInfo;
|
|
798
|
+
closestDir = dir;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
// TODO: Best way to implement only for when closest can be dropped on
|
|
802
|
+
// TODO: Figure out the typescript for this
|
|
803
|
+
// @ts-ignore
|
|
804
|
+
if (y >= r.y + 10 && y <= r.maxY - 10 && collection.getItem(closest.key).value.type === 'folder') closestDir = 'on';
|
|
805
|
+
}
|
|
806
|
+
let key = closest === null || closest === void 0 ? void 0 : closest.key;
|
|
807
|
+
if (key) return {
|
|
808
|
+
type: 'item',
|
|
809
|
+
key: key,
|
|
810
|
+
dropPosition: closestDir
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
}, dropState, domRef);
|
|
814
|
+
isRootDropTarget = dropState.isDropTarget({
|
|
815
|
+
type: 'root'
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
let { gridProps: gridProps } = $fWI2a$useList({
|
|
683
819
|
...props,
|
|
684
820
|
isVirtualized: true,
|
|
685
|
-
keyboardDelegate:
|
|
821
|
+
keyboardDelegate: layout,
|
|
822
|
+
onAction: onAction
|
|
686
823
|
}, state, domRef);
|
|
687
824
|
// Sync loading state into the layout.
|
|
688
825
|
layout.isLoading = isLoading;
|
|
689
|
-
let focusedKey =
|
|
690
|
-
|
|
691
|
-
|
|
826
|
+
let focusedKey = selectionManager.focusedKey;
|
|
827
|
+
if ((dropState === null || dropState === void 0 ? void 0 : (ref1 = dropState.target) === null || ref1 === void 0 ? void 0 : ref1.type) === 'item') focusedKey = dropState.target.key;
|
|
828
|
+
// wait for layout to get accurate measurements
|
|
829
|
+
let [isVerticalScrollbarVisible, setVerticalScollbarVisible] = $fWI2a$useState(false);
|
|
830
|
+
let [isHorizontalScrollbarVisible, setHorizontalScollbarVisible] = $fWI2a$useState(false);
|
|
831
|
+
$fWI2a$useLayoutEffect(()=>{
|
|
832
|
+
if (domRef.current) {
|
|
833
|
+
// 2 is the width of the border which is not part of the box size
|
|
834
|
+
setVerticalScollbarVisible(domRef.current.clientWidth + 2 < domRef.current.offsetWidth);
|
|
835
|
+
setHorizontalScollbarVisible(domRef.current.clientHeight + 2 < domRef.current.offsetHeight);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
let hasAnyChildren = $fWI2a$useMemo(()=>[
|
|
839
|
+
...collection
|
|
840
|
+
].some((item)=>item.hasChildNodes
|
|
841
|
+
)
|
|
842
|
+
, [
|
|
843
|
+
collection
|
|
844
|
+
]);
|
|
692
845
|
return(/*#__PURE__*/ $fWI2a$react.createElement($f85fb77f9d4cbc6c$export$870039b0abfe3de0.Provider, {
|
|
693
846
|
value: {
|
|
694
847
|
state: state,
|
|
695
|
-
keyboardDelegate: keyboardDelegate,
|
|
696
848
|
dragState: dragState,
|
|
849
|
+
dropState: dropState,
|
|
850
|
+
dragHooks: dragHooks,
|
|
851
|
+
dropHooks: dropHooks,
|
|
697
852
|
onAction: onAction,
|
|
698
853
|
isListDraggable: isListDraggable,
|
|
699
|
-
|
|
854
|
+
isListDroppable: isListDroppable,
|
|
855
|
+
layout: layout,
|
|
856
|
+
loadingState: loadingState
|
|
700
857
|
}
|
|
701
858
|
}, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$Virtualizer, {
|
|
859
|
+
...$fWI2a$mergeProps(isListDroppable && (droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps), gridProps),
|
|
860
|
+
...$fWI2a$filterDOMProps(otherProps),
|
|
702
861
|
...gridProps,
|
|
703
862
|
...styleProps,
|
|
704
863
|
isLoading: isLoading,
|
|
@@ -706,29 +865,62 @@ function $f85fb77f9d4cbc6c$var$ListView(props, ref) {
|
|
|
706
865
|
ref: domRef,
|
|
707
866
|
focusedKey: focusedKey,
|
|
708
867
|
scrollDirection: "vertical",
|
|
709
|
-
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($
|
|
868
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListView', `react-spectrum-ListView--${density}`, 'react-spectrum-ListView--emphasized', {
|
|
710
869
|
'react-spectrum-ListView--quiet': isQuiet,
|
|
711
|
-
'react-spectrum-ListView--
|
|
712
|
-
'react-spectrum-ListView--
|
|
870
|
+
'react-spectrum-ListView--loadingMore': loadingState === 'loadingMore',
|
|
871
|
+
'react-spectrum-ListView--draggable': !!isListDraggable,
|
|
872
|
+
'react-spectrum-ListView--dropTarget': !!isRootDropTarget,
|
|
873
|
+
'react-spectrum-ListView--isVerticalScrollbarVisible': isVerticalScrollbarVisible,
|
|
874
|
+
'react-spectrum-ListView--isHorizontalScrollbarVisible': isHorizontalScrollbarVisible,
|
|
875
|
+
'react-spectrum-ListView--hasAnyChildren': hasAnyChildren,
|
|
876
|
+
'react-spectrum-ListView--wrap': overflowMode === 'wrap'
|
|
713
877
|
}, styleProps.className),
|
|
714
878
|
layout: layout,
|
|
715
|
-
collection:
|
|
716
|
-
transitionDuration:
|
|
879
|
+
collection: collection,
|
|
880
|
+
transitionDuration: isLoading ? 160 : 220
|
|
717
881
|
}, (type, item)=>{
|
|
718
|
-
if (type === 'item') return(/*#__PURE__*/ $fWI2a$react.createElement($
|
|
882
|
+
if (type === 'item') return(/*#__PURE__*/ $fWI2a$react.createElement($fWI2a$react.Fragment, null, isListDroppable && collection.getKeyBefore(item.key) == null && /*#__PURE__*/ $fWI2a$react.createElement($41a60729487a82d7$export$2e2bcd8739ae039, {
|
|
883
|
+
key: "root"
|
|
884
|
+
}), isListDroppable && /*#__PURE__*/ $fWI2a$react.createElement($0a834ddbc989a3e3$export$2e2bcd8739ae039, {
|
|
885
|
+
key: `${item.key}-before`,
|
|
886
|
+
target: {
|
|
887
|
+
key: item.key,
|
|
888
|
+
type: 'item',
|
|
889
|
+
dropPosition: 'before'
|
|
890
|
+
}
|
|
891
|
+
}), /*#__PURE__*/ $fWI2a$react.createElement($d7c07ca2efc5ba02$export$c6bde0c04b033c0e, {
|
|
719
892
|
item: item,
|
|
720
893
|
isEmphasized: true,
|
|
721
|
-
|
|
722
|
-
})
|
|
894
|
+
hasActions: !!onAction
|
|
895
|
+
}), isListDroppable && /*#__PURE__*/ $fWI2a$react.createElement($0a834ddbc989a3e3$export$2e2bcd8739ae039, {
|
|
896
|
+
key: `${item.key}-after`,
|
|
897
|
+
target: {
|
|
898
|
+
key: item.key,
|
|
899
|
+
type: 'item',
|
|
900
|
+
dropPosition: 'after'
|
|
901
|
+
},
|
|
902
|
+
isPresentationOnly: collection.getKeyAfter(item.key) !== null
|
|
903
|
+
})));
|
|
723
904
|
else if (type === 'loader') return(/*#__PURE__*/ $fWI2a$react.createElement($f85fb77f9d4cbc6c$var$CenteredWrapper, null, /*#__PURE__*/ $fWI2a$react.createElement($fWI2a$ProgressCircle, {
|
|
724
905
|
isIndeterminate: true,
|
|
725
|
-
"aria-label":
|
|
906
|
+
"aria-label": collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')
|
|
726
907
|
})));
|
|
727
908
|
else if (type === 'placeholder') {
|
|
728
909
|
let emptyState = props.renderEmptyState ? props.renderEmptyState() : null;
|
|
729
910
|
if (emptyState == null) return null;
|
|
730
911
|
return(/*#__PURE__*/ $fWI2a$react.createElement($f85fb77f9d4cbc6c$var$CenteredWrapper, null, emptyState));
|
|
731
912
|
}
|
|
913
|
+
}), DragPreview && isListDraggable && /*#__PURE__*/ $fWI2a$react.createElement(DragPreview, {
|
|
914
|
+
ref: preview
|
|
915
|
+
}, ()=>{
|
|
916
|
+
let item = state.collection.getItem(dragState.draggedKey);
|
|
917
|
+
let itemCount = dragState.draggingKeys.size;
|
|
918
|
+
let itemHeight = layout.getLayoutInfo(dragState.draggedKey).rect.height;
|
|
919
|
+
return(/*#__PURE__*/ $fWI2a$react.createElement($cd61e55c47e3c0f5$export$905ab40ac2179daa, {
|
|
920
|
+
item: item,
|
|
921
|
+
itemCount: itemCount,
|
|
922
|
+
itemHeight: itemHeight
|
|
923
|
+
}));
|
|
732
924
|
})));
|
|
733
925
|
}
|
|
734
926
|
function $f85fb77f9d4cbc6c$var$CenteredWrapper({ children: children }) {
|
|
@@ -736,7 +928,7 @@ function $f85fb77f9d4cbc6c$var$CenteredWrapper({ children: children }) {
|
|
|
736
928
|
return(/*#__PURE__*/ $fWI2a$react.createElement("div", {
|
|
737
929
|
role: "row",
|
|
738
930
|
"aria-rowindex": state.collection.size + 1,
|
|
739
|
-
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($
|
|
931
|
+
className: $fWI2a$classNames((/*@__PURE__*/$parcel$interopDefault($c8bc378300208597$exports)), 'react-spectrum-ListView-centeredWrapper', {
|
|
740
932
|
'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0
|
|
741
933
|
})
|
|
742
934
|
}, /*#__PURE__*/ $fWI2a$react.createElement("div", {
|