@react-spectrum/list 3.0.0-beta.0 → 3.0.0-nightly-4980928d3-240906

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 (230) hide show
  1. package/dist/DragPreview.main.js +79 -0
  2. package/dist/DragPreview.main.js.map +1 -0
  3. package/dist/DragPreview.mjs +74 -0
  4. package/dist/DragPreview.module.js +74 -0
  5. package/dist/DragPreview.module.js.map +1 -0
  6. package/dist/InsertionIndicator.main.js +49 -0
  7. package/dist/InsertionIndicator.main.js.map +1 -0
  8. package/dist/InsertionIndicator.mjs +44 -0
  9. package/dist/InsertionIndicator.module.js +44 -0
  10. package/dist/InsertionIndicator.module.js.map +1 -0
  11. package/dist/ListView.main.js +299 -0
  12. package/dist/ListView.main.js.map +1 -0
  13. package/dist/ListView.mjs +293 -0
  14. package/dist/ListView.module.js +293 -0
  15. package/dist/ListView.module.js.map +1 -0
  16. package/dist/ListViewItem.main.js +252 -0
  17. package/dist/ListViewItem.main.js.map +1 -0
  18. package/dist/ListViewItem.mjs +247 -0
  19. package/dist/ListViewItem.module.js +247 -0
  20. package/dist/ListViewItem.module.js.map +1 -0
  21. package/dist/ListViewLayout.main.js +69 -0
  22. package/dist/ListViewLayout.main.js.map +1 -0
  23. package/dist/ListViewLayout.mjs +64 -0
  24. package/dist/ListViewLayout.module.js +64 -0
  25. package/dist/ListViewLayout.module.js.map +1 -0
  26. package/dist/RootDropIndicator.main.js +46 -0
  27. package/dist/RootDropIndicator.main.js.map +1 -0
  28. package/dist/RootDropIndicator.mjs +37 -0
  29. package/dist/RootDropIndicator.module.js +37 -0
  30. package/dist/RootDropIndicator.module.js.map +1 -0
  31. package/dist/ar-AE.main.js +7 -0
  32. package/dist/ar-AE.main.js.map +1 -0
  33. package/dist/ar-AE.mjs +9 -0
  34. package/dist/ar-AE.module.js +9 -0
  35. package/dist/ar-AE.module.js.map +1 -0
  36. package/dist/bg-BG.main.js +7 -0
  37. package/dist/bg-BG.main.js.map +1 -0
  38. package/dist/bg-BG.mjs +9 -0
  39. package/dist/bg-BG.module.js +9 -0
  40. package/dist/bg-BG.module.js.map +1 -0
  41. package/dist/cs-CZ.main.js +7 -0
  42. package/dist/cs-CZ.main.js.map +1 -0
  43. package/dist/cs-CZ.mjs +9 -0
  44. package/dist/cs-CZ.module.js +9 -0
  45. package/dist/cs-CZ.module.js.map +1 -0
  46. package/dist/da-DK.main.js +7 -0
  47. package/dist/da-DK.main.js.map +1 -0
  48. package/dist/da-DK.mjs +9 -0
  49. package/dist/da-DK.module.js +9 -0
  50. package/dist/da-DK.module.js.map +1 -0
  51. package/dist/de-DE.main.js +7 -0
  52. package/dist/de-DE.main.js.map +1 -0
  53. package/dist/de-DE.mjs +9 -0
  54. package/dist/de-DE.module.js +9 -0
  55. package/dist/de-DE.module.js.map +1 -0
  56. package/dist/el-GR.main.js +7 -0
  57. package/dist/el-GR.main.js.map +1 -0
  58. package/dist/el-GR.mjs +9 -0
  59. package/dist/el-GR.module.js +9 -0
  60. package/dist/el-GR.module.js.map +1 -0
  61. package/dist/en-US.main.js +7 -0
  62. package/dist/en-US.main.js.map +1 -0
  63. package/dist/en-US.mjs +9 -0
  64. package/dist/en-US.module.js +9 -0
  65. package/dist/en-US.module.js.map +1 -0
  66. package/dist/es-ES.main.js +7 -0
  67. package/dist/es-ES.main.js.map +1 -0
  68. package/dist/es-ES.mjs +9 -0
  69. package/dist/es-ES.module.js +9 -0
  70. package/dist/es-ES.module.js.map +1 -0
  71. package/dist/et-EE.main.js +7 -0
  72. package/dist/et-EE.main.js.map +1 -0
  73. package/dist/et-EE.mjs +9 -0
  74. package/dist/et-EE.module.js +9 -0
  75. package/dist/et-EE.module.js.map +1 -0
  76. package/dist/fi-FI.main.js +7 -0
  77. package/dist/fi-FI.main.js.map +1 -0
  78. package/dist/fi-FI.mjs +9 -0
  79. package/dist/fi-FI.module.js +9 -0
  80. package/dist/fi-FI.module.js.map +1 -0
  81. package/dist/fr-FR.main.js +7 -0
  82. package/dist/fr-FR.main.js.map +1 -0
  83. package/dist/fr-FR.mjs +9 -0
  84. package/dist/fr-FR.module.js +9 -0
  85. package/dist/fr-FR.module.js.map +1 -0
  86. package/dist/he-IL.main.js +7 -0
  87. package/dist/he-IL.main.js.map +1 -0
  88. package/dist/he-IL.mjs +9 -0
  89. package/dist/he-IL.module.js +9 -0
  90. package/dist/he-IL.module.js.map +1 -0
  91. package/dist/hr-HR.main.js +7 -0
  92. package/dist/hr-HR.main.js.map +1 -0
  93. package/dist/hr-HR.mjs +9 -0
  94. package/dist/hr-HR.module.js +9 -0
  95. package/dist/hr-HR.module.js.map +1 -0
  96. package/dist/hu-HU.main.js +7 -0
  97. package/dist/hu-HU.main.js.map +1 -0
  98. package/dist/hu-HU.mjs +9 -0
  99. package/dist/hu-HU.module.js +9 -0
  100. package/dist/hu-HU.module.js.map +1 -0
  101. package/dist/import.mjs +19 -0
  102. package/dist/intlStrings.main.js +108 -0
  103. package/dist/intlStrings.main.js.map +1 -0
  104. package/dist/intlStrings.mjs +110 -0
  105. package/dist/intlStrings.module.js +110 -0
  106. package/dist/intlStrings.module.js.map +1 -0
  107. package/dist/it-IT.main.js +7 -0
  108. package/dist/it-IT.main.js.map +1 -0
  109. package/dist/it-IT.mjs +9 -0
  110. package/dist/it-IT.module.js +9 -0
  111. package/dist/it-IT.module.js.map +1 -0
  112. package/dist/ja-JP.main.js +7 -0
  113. package/dist/ja-JP.main.js.map +1 -0
  114. package/dist/ja-JP.mjs +9 -0
  115. package/dist/ja-JP.module.js +9 -0
  116. package/dist/ja-JP.module.js.map +1 -0
  117. package/dist/ko-KR.main.js +7 -0
  118. package/dist/ko-KR.main.js.map +1 -0
  119. package/dist/ko-KR.mjs +9 -0
  120. package/dist/ko-KR.module.js +9 -0
  121. package/dist/ko-KR.module.js.map +1 -0
  122. package/dist/lt-LT.main.js +7 -0
  123. package/dist/lt-LT.main.js.map +1 -0
  124. package/dist/lt-LT.mjs +9 -0
  125. package/dist/lt-LT.module.js +9 -0
  126. package/dist/lt-LT.module.js.map +1 -0
  127. package/dist/lv-LV.main.js +7 -0
  128. package/dist/lv-LV.main.js.map +1 -0
  129. package/dist/lv-LV.mjs +9 -0
  130. package/dist/lv-LV.module.js +9 -0
  131. package/dist/lv-LV.module.js.map +1 -0
  132. package/dist/main.js +14 -962
  133. package/dist/main.js.map +1 -1
  134. package/dist/module.js +12 -964
  135. package/dist/module.js.map +1 -1
  136. package/dist/nb-NO.main.js +7 -0
  137. package/dist/nb-NO.main.js.map +1 -0
  138. package/dist/nb-NO.mjs +9 -0
  139. package/dist/nb-NO.module.js +9 -0
  140. package/dist/nb-NO.module.js.map +1 -0
  141. package/dist/nl-NL.main.js +7 -0
  142. package/dist/nl-NL.main.js.map +1 -0
  143. package/dist/nl-NL.mjs +9 -0
  144. package/dist/nl-NL.module.js +9 -0
  145. package/dist/nl-NL.module.js.map +1 -0
  146. package/dist/pl-PL.main.js +7 -0
  147. package/dist/pl-PL.main.js.map +1 -0
  148. package/dist/pl-PL.mjs +9 -0
  149. package/dist/pl-PL.module.js +9 -0
  150. package/dist/pl-PL.module.js.map +1 -0
  151. package/dist/pt-BR.main.js +7 -0
  152. package/dist/pt-BR.main.js.map +1 -0
  153. package/dist/pt-BR.mjs +9 -0
  154. package/dist/pt-BR.module.js +9 -0
  155. package/dist/pt-BR.module.js.map +1 -0
  156. package/dist/pt-PT.main.js +7 -0
  157. package/dist/pt-PT.main.js.map +1 -0
  158. package/dist/pt-PT.mjs +9 -0
  159. package/dist/pt-PT.module.js +9 -0
  160. package/dist/pt-PT.module.js.map +1 -0
  161. package/dist/ro-RO.main.js +7 -0
  162. package/dist/ro-RO.main.js.map +1 -0
  163. package/dist/ro-RO.mjs +9 -0
  164. package/dist/ro-RO.module.js +9 -0
  165. package/dist/ro-RO.module.js.map +1 -0
  166. package/dist/ru-RU.main.js +7 -0
  167. package/dist/ru-RU.main.js.map +1 -0
  168. package/dist/ru-RU.mjs +9 -0
  169. package/dist/ru-RU.module.js +9 -0
  170. package/dist/ru-RU.module.js.map +1 -0
  171. package/dist/sk-SK.main.js +7 -0
  172. package/dist/sk-SK.main.js.map +1 -0
  173. package/dist/sk-SK.mjs +9 -0
  174. package/dist/sk-SK.module.js +9 -0
  175. package/dist/sk-SK.module.js.map +1 -0
  176. package/dist/sl-SI.main.js +7 -0
  177. package/dist/sl-SI.main.js.map +1 -0
  178. package/dist/sl-SI.mjs +9 -0
  179. package/dist/sl-SI.module.js +9 -0
  180. package/dist/sl-SI.module.js.map +1 -0
  181. package/dist/sr-SP.main.js +7 -0
  182. package/dist/sr-SP.main.js.map +1 -0
  183. package/dist/sr-SP.mjs +9 -0
  184. package/dist/sr-SP.module.js +9 -0
  185. package/dist/sr-SP.module.js.map +1 -0
  186. package/dist/styles.d09a6cc6.css +839 -0
  187. package/dist/styles.d09a6cc6.css.map +1 -0
  188. package/dist/styles_css.main.js +197 -0
  189. package/dist/styles_css.main.js.map +1 -0
  190. package/dist/styles_css.mjs +199 -0
  191. package/dist/styles_css.module.js +199 -0
  192. package/dist/styles_css.module.js.map +1 -0
  193. package/dist/sv-SE.main.js +7 -0
  194. package/dist/sv-SE.main.js.map +1 -0
  195. package/dist/sv-SE.mjs +9 -0
  196. package/dist/sv-SE.module.js +9 -0
  197. package/dist/sv-SE.module.js.map +1 -0
  198. package/dist/tr-TR.main.js +7 -0
  199. package/dist/tr-TR.main.js.map +1 -0
  200. package/dist/tr-TR.mjs +9 -0
  201. package/dist/tr-TR.module.js +9 -0
  202. package/dist/tr-TR.module.js.map +1 -0
  203. package/dist/types.d.ts +33 -5
  204. package/dist/types.d.ts.map +1 -1
  205. package/dist/uk-UA.main.js +7 -0
  206. package/dist/uk-UA.main.js.map +1 -0
  207. package/dist/uk-UA.mjs +9 -0
  208. package/dist/uk-UA.module.js +9 -0
  209. package/dist/uk-UA.module.js.map +1 -0
  210. package/dist/zh-CN.main.js +7 -0
  211. package/dist/zh-CN.main.js.map +1 -0
  212. package/dist/zh-CN.mjs +9 -0
  213. package/dist/zh-CN.module.js +9 -0
  214. package/dist/zh-CN.module.js.map +1 -0
  215. package/dist/zh-TW.main.js +7 -0
  216. package/dist/zh-TW.main.js.map +1 -0
  217. package/dist/zh-TW.mjs +9 -0
  218. package/dist/zh-TW.module.js +9 -0
  219. package/dist/zh-TW.module.js.map +1 -0
  220. package/package.json +39 -43
  221. package/src/DragPreview.tsx +20 -8
  222. package/src/InsertionIndicator.tsx +3 -3
  223. package/src/ListView.tsx +187 -178
  224. package/src/ListViewItem.tsx +30 -17
  225. package/src/ListViewLayout.ts +66 -0
  226. package/src/RootDropIndicator.tsx +6 -7
  227. package/src/index.ts +13 -0
  228. package/src/styles.css +195 -68
  229. package/LICENSE +0 -201
  230. package/dist/main.css +0 -1
@@ -0,0 +1,299 @@
1
+ var $fc02fd49ab58c72e$exports = require("./InsertionIndicator.main.js");
2
+ var $2ebea2d8da6d3b78$exports = require("./intlStrings.main.js");
3
+ require("./styles.d09a6cc6.css");
4
+ var $279507a6f189e509$exports = require("./styles_css.main.js");
5
+ var $9eae7a1cb1535a6b$exports = require("./ListViewItem.main.js");
6
+ var $a0cb8c9f009bf274$exports = require("./ListViewLayout.main.js");
7
+ var $c59d3898f402f50b$exports = require("./RootDropIndicator.main.js");
8
+ var $3d665b19f7865ff9$exports = require("./DragPreview.main.js");
9
+ var $8lawJ$reactariagridlist = require("@react-aria/gridlist");
10
+ var $8lawJ$reactspectrumutils = require("@react-spectrum/utils");
11
+ var $8lawJ$reactariautils = require("@react-aria/utils");
12
+ var $8lawJ$reactariafocus = require("@react-aria/focus");
13
+ var $8lawJ$reactariaselection = require("@react-aria/selection");
14
+ var $8lawJ$reactstatelylist = require("@react-stately/list");
15
+ var $8lawJ$reactspectrumprogress = require("@react-spectrum/progress");
16
+ var $8lawJ$react = require("react");
17
+ var $8lawJ$reactariai18n = require("@react-aria/i18n");
18
+ var $8lawJ$reactspectrumprovider = require("@react-spectrum/provider");
19
+ var $8lawJ$reactariavirtualizer = require("@react-aria/virtualizer");
20
+
21
+
22
+ function $parcel$interopDefault(a) {
23
+ return a && a.__esModule ? a.default : a;
24
+ }
25
+
26
+ function $parcel$export(e, n, v, s) {
27
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
28
+ }
29
+
30
+ $parcel$export(module.exports, "ListViewContext", () => $60684b441be8e84c$export$870039b0abfe3de0);
31
+ $parcel$export(module.exports, "ListView", () => $60684b441be8e84c$export$84d0dd190d551cd1);
32
+ /*
33
+ * Copyright 2021 Adobe. All rights reserved.
34
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
35
+ * you may not use this file except in compliance with the License. You may obtain a copy
36
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
37
+ *
38
+ * Unless required by applicable law or agreed to in writing, software distributed under
39
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
40
+ * OF ANY KIND, either express or implied. See the License for the specific language
41
+ * governing permissions and limitations under the License.
42
+ */
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+ const $60684b441be8e84c$export$870039b0abfe3de0 = /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createContext(null);
61
+ const $60684b441be8e84c$var$ROW_HEIGHTS = {
62
+ compact: {
63
+ medium: 32,
64
+ large: 40
65
+ },
66
+ regular: {
67
+ medium: 40,
68
+ large: 50
69
+ },
70
+ spacious: {
71
+ medium: 48,
72
+ large: 60
73
+ }
74
+ };
75
+ function $60684b441be8e84c$var$useListLayout(state, density, overflowMode) {
76
+ let { scale: scale } = (0, $8lawJ$reactspectrumprovider.useProvider)();
77
+ let layout = (0, $8lawJ$react.useMemo)(()=>new (0, $a0cb8c9f009bf274$exports.ListViewLayout)({
78
+ estimatedRowHeight: $60684b441be8e84c$var$ROW_HEIGHTS[density][scale]
79
+ }), [
80
+ scale,
81
+ density,
82
+ overflowMode
83
+ ]);
84
+ return layout;
85
+ }
86
+ function $60684b441be8e84c$var$ListView(props, ref) {
87
+ var _dropState_target;
88
+ let { density: density = 'regular', loadingState: loadingState, onLoadMore: onLoadMore, isQuiet: isQuiet, overflowMode: overflowMode = 'truncate', onAction: onAction, dragAndDropHooks: dragAndDropHooks, renderEmptyState: renderEmptyState, ...otherProps } = props;
89
+ let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
90
+ let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
91
+ let dragHooksProvided = (0, $8lawJ$react.useRef)(isListDraggable);
92
+ let dropHooksProvided = (0, $8lawJ$react.useRef)(isListDroppable);
93
+ (0, $8lawJ$react.useEffect)(()=>{
94
+ 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.');
95
+ 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.');
96
+ }, [
97
+ isListDraggable,
98
+ isListDroppable
99
+ ]);
100
+ let domRef = (0, $8lawJ$reactspectrumutils.useDOMRef)(ref);
101
+ let state = (0, $8lawJ$reactstatelylist.useListState)({
102
+ ...props,
103
+ selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'
104
+ });
105
+ let { collection: collection, selectionManager: selectionManager } = state;
106
+ let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
107
+ let { styleProps: styleProps } = (0, $8lawJ$reactspectrumutils.useStyleProps)(props);
108
+ let dragState;
109
+ let preview = (0, $8lawJ$react.useRef)(null);
110
+ if (isListDraggable) {
111
+ dragState = dragAndDropHooks.useDraggableCollectionState({
112
+ collection: collection,
113
+ selectionManager: selectionManager,
114
+ preview: preview
115
+ });
116
+ dragAndDropHooks.useDraggableCollection({}, dragState, domRef);
117
+ }
118
+ let layout = $60684b441be8e84c$var$useListLayout(state, props.density || 'regular', overflowMode);
119
+ let DragPreview = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.DragPreview;
120
+ let dropState;
121
+ let droppableCollection;
122
+ let isRootDropTarget;
123
+ if (isListDroppable) {
124
+ dropState = dragAndDropHooks.useDroppableCollectionState({
125
+ collection: collection,
126
+ selectionManager: selectionManager
127
+ });
128
+ droppableCollection = dragAndDropHooks.useDroppableCollection({
129
+ keyboardDelegate: new (0, $8lawJ$reactariaselection.ListKeyboardDelegate)({
130
+ collection: collection,
131
+ disabledKeys: (dragState === null || dragState === void 0 ? void 0 : dragState.draggingKeys.size) ? null : selectionManager.disabledKeys,
132
+ ref: domRef,
133
+ layoutDelegate: layout
134
+ }),
135
+ dropTargetDelegate: layout
136
+ }, dropState, domRef);
137
+ isRootDropTarget = dropState.isDropTarget({
138
+ type: 'root'
139
+ });
140
+ }
141
+ let { gridProps: gridProps } = (0, $8lawJ$reactariagridlist.useGridList)({
142
+ ...props,
143
+ isVirtualized: true,
144
+ layoutDelegate: layout,
145
+ onAction: onAction
146
+ }, state, domRef);
147
+ let focusedKey = selectionManager.focusedKey;
148
+ let dropTargetKey = null;
149
+ if ((dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === 'item') {
150
+ dropTargetKey = dropState.target.key;
151
+ var _state_collection_getKeyAfter;
152
+ if (dropState.target.dropPosition === 'after') // Normalize to the "before" drop position since we only render those in the DOM.
153
+ dropTargetKey = (_state_collection_getKeyAfter = state.collection.getKeyAfter(dropTargetKey)) !== null && _state_collection_getKeyAfter !== void 0 ? _state_collection_getKeyAfter : dropTargetKey;
154
+ }
155
+ let persistedKeys = (0, $8lawJ$react.useMemo)(()=>{
156
+ return new Set([
157
+ focusedKey,
158
+ dropTargetKey
159
+ ].filter((k)=>k !== null));
160
+ }, [
161
+ focusedKey,
162
+ dropTargetKey
163
+ ]);
164
+ // wait for layout to get accurate measurements
165
+ let [isVerticalScrollbarVisible, setVerticalScollbarVisible] = (0, $8lawJ$react.useState)(false);
166
+ let [isHorizontalScrollbarVisible, setHorizontalScollbarVisible] = (0, $8lawJ$react.useState)(false);
167
+ // eslint-disable-next-line react-hooks/exhaustive-deps
168
+ (0, $8lawJ$reactariautils.useLayoutEffect)(()=>{
169
+ if (domRef.current) {
170
+ // 2 is the width of the border which is not part of the box size
171
+ setVerticalScollbarVisible(domRef.current.clientWidth + 2 < domRef.current.offsetWidth);
172
+ setHorizontalScollbarVisible(domRef.current.clientHeight + 2 < domRef.current.offsetHeight);
173
+ }
174
+ });
175
+ let hasAnyChildren = (0, $8lawJ$react.useMemo)(()=>[
176
+ ...collection
177
+ ].some((item)=>item.hasChildNodes), [
178
+ collection
179
+ ]);
180
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$export$870039b0abfe3de0.Provider, {
181
+ value: {
182
+ state: state,
183
+ dragState: dragState,
184
+ dropState: dropState,
185
+ dragAndDropHooks: dragAndDropHooks,
186
+ onAction: onAction,
187
+ isListDraggable: isListDraggable,
188
+ isListDroppable: isListDroppable,
189
+ layout: layout,
190
+ loadingState: loadingState,
191
+ renderEmptyState: renderEmptyState
192
+ }
193
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $8lawJ$reactariafocus.FocusScope), null, /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $8lawJ$reactariafocus.FocusRing), {
194
+ focusRingClass: (0, $8lawJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($279507a6f189e509$exports))), 'focus-ring')
195
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $8lawJ$reactariavirtualizer.Virtualizer), {
196
+ ...(0, $8lawJ$reactariautils.mergeProps)(isListDroppable && (droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps), gridProps),
197
+ ...(0, $8lawJ$reactariautils.filterDOMProps)(otherProps),
198
+ ...gridProps,
199
+ ...styleProps,
200
+ isLoading: isLoading,
201
+ onLoadMore: onLoadMore,
202
+ ref: domRef,
203
+ persistedKeys: persistedKeys,
204
+ scrollDirection: "vertical",
205
+ className: (0, $8lawJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($279507a6f189e509$exports))), 'react-spectrum-ListView', `react-spectrum-ListView--${density}`, 'react-spectrum-ListView--emphasized', {
206
+ 'react-spectrum-ListView--quiet': isQuiet,
207
+ 'react-spectrum-ListView--loadingMore': loadingState === 'loadingMore',
208
+ 'react-spectrum-ListView--draggable': !!isListDraggable,
209
+ 'react-spectrum-ListView--dropTarget': !!isRootDropTarget,
210
+ 'react-spectrum-ListView--isVerticalScrollbarVisible': isVerticalScrollbarVisible,
211
+ 'react-spectrum-ListView--isHorizontalScrollbarVisible': isHorizontalScrollbarVisible,
212
+ 'react-spectrum-ListView--hasAnyChildren': hasAnyChildren,
213
+ 'react-spectrum-ListView--wrap': overflowMode === 'wrap'
214
+ }, styleProps.className),
215
+ layout: layout,
216
+ layoutOptions: (0, $8lawJ$react.useMemo)(()=>({
217
+ isLoading: isLoading
218
+ }), [
219
+ isLoading
220
+ ]),
221
+ collection: collection
222
+ }, (0, $8lawJ$react.useCallback)((type, item)=>{
223
+ if (type === 'item') return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$var$Item, {
224
+ item: item
225
+ });
226
+ else if (type === 'loader') return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$var$LoadingView, null);
227
+ else if (type === 'placeholder') return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$var$EmptyState, null);
228
+ }, [])))), DragPreview && isListDraggable && /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement(DragPreview, {
229
+ ref: preview
230
+ }, ()=>{
231
+ if (dragAndDropHooks.renderPreview) return dragAndDropHooks.renderPreview(dragState.draggingKeys, dragState.draggedKey);
232
+ let item = state.collection.getItem(dragState.draggedKey);
233
+ let itemCount = dragState.draggingKeys.size;
234
+ let itemHeight = layout.getLayoutInfo(dragState.draggedKey).rect.height;
235
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $3d665b19f7865ff9$exports.DragPreview), {
236
+ item: item,
237
+ itemCount: itemCount,
238
+ itemHeight: itemHeight,
239
+ density: density
240
+ });
241
+ }));
242
+ }
243
+ function $60684b441be8e84c$var$Item({ item: item }) {
244
+ let { isListDroppable: isListDroppable, state: state, onAction: onAction } = (0, $8lawJ$react.useContext)($60684b441be8e84c$export$870039b0abfe3de0);
245
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, ($parcel$interopDefault($8lawJ$react))).Fragment, null, isListDroppable && state.collection.getKeyBefore(item.key) == null && /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $c59d3898f402f50b$exports.default), {
246
+ key: "root"
247
+ }), isListDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $fc02fd49ab58c72e$exports.default), {
248
+ key: `${item.key}-before`,
249
+ target: {
250
+ key: item.key,
251
+ type: 'item',
252
+ dropPosition: 'before'
253
+ }
254
+ }), /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $9eae7a1cb1535a6b$exports.ListViewItem), {
255
+ item: item,
256
+ isEmphasized: true,
257
+ hasActions: !!onAction
258
+ }), isListDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $fc02fd49ab58c72e$exports.default), {
259
+ key: `${item.key}-after`,
260
+ target: {
261
+ key: item.key,
262
+ type: 'item',
263
+ dropPosition: 'after'
264
+ },
265
+ isPresentationOnly: state.collection.getKeyAfter(item.key) != null
266
+ }));
267
+ }
268
+ function $60684b441be8e84c$var$LoadingView() {
269
+ let { state: state } = (0, $8lawJ$react.useContext)($60684b441be8e84c$export$870039b0abfe3de0);
270
+ let stringFormatter = (0, $8lawJ$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($2ebea2d8da6d3b78$exports))), '@react-spectrum/list');
271
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$var$CenteredWrapper, null, /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement((0, $8lawJ$reactspectrumprogress.ProgressCircle), {
272
+ isIndeterminate: true,
273
+ "aria-label": state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')
274
+ }));
275
+ }
276
+ function $60684b441be8e84c$var$EmptyState() {
277
+ let { renderEmptyState: renderEmptyState } = (0, $8lawJ$react.useContext)($60684b441be8e84c$export$870039b0abfe3de0);
278
+ let emptyState = renderEmptyState ? renderEmptyState() : null;
279
+ if (emptyState == null) return null;
280
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement($60684b441be8e84c$var$CenteredWrapper, null, emptyState);
281
+ }
282
+ function $60684b441be8e84c$var$CenteredWrapper({ children: children }) {
283
+ let { state: state } = (0, $8lawJ$react.useContext)($60684b441be8e84c$export$870039b0abfe3de0);
284
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement("div", {
285
+ role: "row",
286
+ "aria-rowindex": state.collection.size + 1,
287
+ className: (0, $8lawJ$reactspectrumutils.classNames)((0, ($parcel$interopDefault($279507a6f189e509$exports))), 'react-spectrum-ListView-centeredWrapper', {
288
+ 'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0
289
+ })
290
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($8lawJ$react))).createElement("div", {
291
+ role: "gridcell"
292
+ }, children));
293
+ }
294
+ /**
295
+ * A ListView displays a list of interactive items, and allows a user to navigate, select, or perform an action.
296
+ */ const $60684b441be8e84c$export$84d0dd190d551cd1 = /*#__PURE__*/ (0, ($parcel$interopD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AAGP;AAEA,SAAS,sCAAgB,YAAC,QAAQ,EAAC;IACjC,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,uBAAS,EAAE;IACzB,qBACE,0DAAC;QACC,MAAK;QACL,iBAAe,MAAM,UAAU,CAAC,IAAI,GAAG;QACvC,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAS,GACT,2CACA;YACE,wDAAwD,MAAM,UAAU,CAAC,IAAI,GAAG;QAClF;qBAEJ,0DAAC;QAAI,MAAK;OACP;AAIT;AAEA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/list/src/ListView.tsx"],"sourcesContent":["/*\n * Copyright 2021 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaGridListProps, useGridList} from '@react-aria/gridlist';\nimport {AsyncLoadable, DOMRef, Key, LoadingState, Node, SpectrumSelectionProps, StyleProps} from '@react-types/shared';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport type {DragAndDropHooks} from '@react-spectrum/dnd';\nimport type {DraggableCollectionState, DroppableCollectionState} from '@react-stately/dnd';\nimport type {DroppableCollectionResult} from '@react-aria/dnd';\nimport {filterDOMProps, mergeProps, useLayoutEffect} from '@react-aria/utils';\nimport {FocusRing, FocusScope} from '@react-aria/focus';\nimport InsertionIndicator from './InsertionIndicator';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport {ListState, useListState} from '@react-stately/list';\nimport listStyles from './styles.css';\nimport {ListViewItem} from './ListViewItem';\nimport {ListViewLayout} from './ListViewLayout';\nimport {ProgressCircle} from '@react-spectrum/progress';\nimport React, {JSX, ReactElement, useCallback, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport RootDropIndicator from './RootDropIndicator';\nimport {DragPreview as SpectrumDragPreview} from './DragPreview';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProvider} from '@react-spectrum/provider';\nimport {Virtualizer} from '@react-aria/virtualizer';\n\nexport interface SpectrumListViewProps<T> extends Omit<AriaGridListProps<T>, 'keyboardNavigationBehavior'>, StyleProps, SpectrumSelectionProps, Omit<AsyncLoadable, 'isLoading'> {\n /**\n * Sets the amount of vertical padding within each cell.\n * @default 'regular'\n */\n density?: 'compact' | 'regular' | 'spacious',\n /** Whether the ListView should be displayed with a quiet style. */\n isQuiet?: boolean,\n /** The current loading state of the ListView. Determines whether or not the progress circle should be shown. */\n loadingState?: LoadingState,\n /**\n * Sets the text behavior for the row contents.\n * @default 'truncate'\n */\n overflowMode?: 'truncate' | 'wrap',\n /** Sets what the ListView should render when there is no content to display. */\n renderEmptyState?: () => JSX.Element,\n /**\n * Handler that is called when a user performs an action on an item. The exact user event depends on\n * the collection's `selectionStyle` prop and the interaction modality.\n */\n onAction?: (key: Key) => void,\n /**\n * The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the ListView.\n */\n dragAndDropHooks?: DragAndDropHooks['dragAndDropHooks']\n}\n\ninterface ListViewContextValue<T> {\n state: ListState<T>,\n dragState: DraggableCollectionState,\n dropState: DroppableCollectionState,\n dragAndDropHooks: DragAndDropHooks['dragAndDropHooks'],\n onAction:(key: Key) => void,\n isListDraggable: boolean,\n isListDroppable: boolean,\n layout: ListViewLayout<T>,\n loadingState: LoadingState,\n renderEmptyState?: () => JSX.Element\n}\n\nexport const ListViewContext = React.createContext<ListViewContextValue<unknown>>(null);\n\nconst ROW_HEIGHTS = {\n compact: {\n medium: 32,\n large: 40\n },\n regular: {\n medium: 40,\n large: 50\n },\n spacious: {\n medium: 48,\n large: 60\n }\n};\n\nfunction useListLayout<T>(state: ListState<T>, density: SpectrumListViewProps<T>['density'], overflowMode: SpectrumListViewProps<T>['overflowMode']) {\n let {scale} = useProvider();\n let layout = useMemo(() =>\n new ListViewLayout<T>({\n estimatedRowHeight: ROW_HEIGHTS[density][scale]\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n , [scale, density, overflowMode]);\n\n return layout;\n}\n\nfunction ListView<T extends object>(props: SpectrumListViewProps<T>, ref: DOMRef<HTMLDivElement>) {\n let {\n density = 'regular',\n loadingState,\n onLoadMore,\n isQuiet,\n overflowMode = 'truncate',\n onAction,\n dragAndDropHooks,\n renderEmptyState,\n ...otherProps\n } = props;\n let isListDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n let isListDroppable = !!dragAndDropHooks?.useDroppableCollectionState;\n let dragHooksProvided = useRef(isListDraggable);\n let dropHooksProvided = useRef(isListDroppable);\n useEffect(() => {\n if (dragHooksProvided.current !== isListDraggable) {\n console.warn('Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n if (dropHooksProvided.current !== isListDroppable) {\n console.warn('Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.');\n }\n }, [isListDraggable, isListDroppable]);\n\n let domRef = useDOMRef(ref);\n let state = useListState({\n ...props,\n selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'\n });\n let {collection, selectionManager} = state;\n let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n\n let {styleProps} = useStyleProps(props);\n let dragState: DraggableCollectionState;\n let preview = useRef(null);\n if (isListDraggable) {\n dragState = dragAndDropHooks.useDraggableCollectionState({\n collection,\n selectionManager,\n preview\n });\n dragAndDropHooks.useDraggableCollection({}, dragState, domRef);\n }\n let layout = useListLayout(\n state,\n props.density || 'regular',\n overflowMode\n );\n\n let DragPreview = dragAndDropHooks?.DragPreview;\n let dropState: DroppableCollectionState;\n let droppableCollection: DroppableCollectionResult;\n let isRootDropTarget: boolean;\n if (isListDroppable) {\n dropState = dragAndDropHooks.useDroppableCollectionState({\n collection,\n selectionManager\n });\n droppableCollection = dragAndDropHooks.useDroppableCollection({\n keyboardDelegate: new ListKeyboardDelegate({\n collection,\n disabledKeys: dragState?.draggingKeys.size ? null : selectionManager.disabledKeys,\n ref: domRef,\n layoutDelegate: layout\n }),\n dropTargetDelegate: layout\n }, dropState, domRef);\n\n isRootDropTarget = dropState.isDropTarget({type: 'root'});\n }\n\n let {gridProps} = useGridList({\n ...props,\n isVirtualized: true,\n layoutDelegate: layout,\n onAction\n }, state, domRef);\n\n let focusedKey = selectionManager.focusedKey;\n let dropTargetKey: Key | null = null;\n if (dropState?.target?.type === 'item') {\n dropTargetKey = dropState.target.key;\n if (dropState.target.dropPosition === 'after') {\n // Normalize to the \"before\" drop position since we only render those in the DOM.\n dropTargetKey = state.collection.getKeyAfter(dropTargetKey) ?? dropTargetKey;\n }\n }\n\n let persistedKeys = useMemo(() => {\n return new Set([focusedKey, dropTargetKey].filter(k => k !== null));\n }, [focusedKey, dropTargetKey]);\n\n // wait for layout to get accurate measurements\n let [isVerticalScrollbarVisible, setVerticalScollbarVisible] = useState(false);\n let [isHorizontalScrollbarVisible, setHorizontalScollbarVisible] = useState(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(() => {\n if (domRef.current) {\n // 2 is the width of the border which is not part of the box size\n setVerticalScollbarVisible(domRef.current.clientWidth + 2 < domRef.current.offsetWidth);\n setHorizontalScollbarVisible(domRef.current.clientHeight + 2 < domRef.current.offsetHeight);\n }\n });\n\n let hasAnyChildren = useMemo(() => [...collection].some(item => item.hasChildNodes), [collection]);\n\n return (\n <ListViewContext.Provider value={{state, dragState, dropState, dragAndDropHooks, onAction, isListDraggable, isListDroppable, layout, loadingState, renderEmptyState}}>\n <FocusScope>\n <FocusRing focusRingClass={classNames(listStyles, 'focus-ring')}>\n <Virtualizer\n {...mergeProps(isListDroppable && droppableCollection?.collectionProps, gridProps)}\n {...filterDOMProps(otherProps)}\n {...gridProps}\n {...styleProps}\n isLoading={isLoading}\n onLoadMore={onLoadMore}\n ref={domRef}\n persistedKeys={persistedKeys}\n scrollDirection=\"vertical\"\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListView',\n `react-spectrum-ListView--${density}`,\n 'react-spectrum-ListView--emphasized',\n {\n 'react-spectrum-ListView--quiet': isQuiet,\n 'react-spectrum-ListView--loadingMore': loadingState === 'loadingMore',\n 'react-spectrum-ListView--draggable': !!isListDraggable,\n 'react-spectrum-ListView--dropTarget': !!isRootDropTarget,\n 'react-spectrum-ListView--isVerticalScrollbarVisible': isVerticalScrollbarVisible,\n 'react-spectrum-ListView--isHorizontalScrollbarVisible': isHorizontalScrollbarVisible,\n 'react-spectrum-ListView--hasAnyChildren': hasAnyChildren,\n 'react-spectrum-ListView--wrap': overflowMode === 'wrap'\n },\n styleProps.className\n )\n }\n layout={layout}\n layoutOptions={useMemo(() => ({isLoading}), [isLoading])}\n collection={collection}>\n {useCallback((type, item) => {\n if (type === 'item') {\n return <Item item={item} />;\n } else if (type === 'loader') {\n return <LoadingView />;\n } else if (type === 'placeholder') {\n return <EmptyState />;\n }\n }, [])}\n </Virtualizer>\n </FocusRing>\n </FocusScope>\n {DragPreview && isListDraggable &&\n <DragPreview ref={preview}>\n {() => {\n if (dragAndDropHooks.renderPreview) {\n return dragAndDropHooks.renderPreview(dragState.draggingKeys, dragState.draggedKey);\n }\n let item = state.collection.getItem(dragState.draggedKey);\n let itemCount = dragState.draggingKeys.size;\n let itemHeight = layout.getLayoutInfo(dragState.draggedKey).rect.height;\n return <SpectrumDragPreview item={item} itemCount={itemCount} itemHeight={itemHeight} density={density} />;\n }}\n </DragPreview>\n }\n </ListViewContext.Provider>\n );\n}\n\nfunction Item({item}: {item: Node<unknown>}) {\n let {isListDroppable, state, onAction} = useContext(ListViewContext);\n return (\n <>\n {isListDroppable && state.collection.getKeyBefore(item.key) == null &&\n <RootDropIndicator key=\"root\" />\n }\n {isListDroppable &&\n <InsertionIndicator\n key={`${item.key}-before`}\n target={{key: item.key, type: 'item', dropPosition: 'before'}} />\n }\n <ListViewItem item={item} isEmphasized hasActions={!!onAction} />\n {isListDroppable &&\n <InsertionIndicator\n key={`${item.key}-after`}\n target={{key: item.key, type: 'item', dropPosition: 'after'}}\n isPresentationOnly={state.collection.getKeyAfter(item.key) != null} />\n }\n </>\n );\n}\n\nfunction LoadingView() {\n let {state} = useContext(ListViewContext);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/list');\n return (\n <CenteredWrapper>\n <ProgressCircle\n isIndeterminate\n aria-label={state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')} />\n </CenteredWrapper>\n );\n}\n\nfunction EmptyState() {\n let {renderEmptyState} = useContext(ListViewContext);\n let emptyState = renderEmptyState ? renderEmptyState() : null;\n if (emptyState == null) {\n return null;\n }\n\n return (\n <CenteredWrapper>\n {emptyState}\n </CenteredWrapper>\n );\n}\n\nfunction CenteredWrapper({children}) {\n let {state} = useContext(ListViewContext);\n return (\n <div\n role=\"row\"\n aria-rowindex={state.collection.size + 1}\n className={\n classNames(\n listStyles,\n 'react-spectrum-ListView-centeredWrapper',\n {\n 'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0\n }\n )}>\n <div role=\"gridcell\">\n {children}\n </div>\n </div>\n );\n}\n\n/**\n * A ListView displays a list of interactive items, and allows a user to navigate, select, or perform an action.\n */\nconst _ListView = React.forwardRef(ListView) as <T>(props: SpectrumListViewProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {_ListView as ListView};\n"],"names":[],"version":3,"file":"ListView.main.js.map"}
@@ -0,0 +1,293 @@
1
+ import $0a834ddbc989a3e3$export$2e2bcd8739ae039 from "./InsertionIndicator.mjs";
2
+ import $6w3ZV$intlStringsmodulejs from "./intlStrings.mjs";
3
+ import "./styles.d09a6cc6.css";
4
+ import $6w3ZV$styles_cssmodulejs from "./styles_css.mjs";
5
+ import {ListViewItem as $d7c07ca2efc5ba02$export$c6bde0c04b033c0e} from "./ListViewItem.mjs";
6
+ import {ListViewLayout as $bc6cc67dd6240ebd$export$dab781655dfbb7d3} from "./ListViewLayout.mjs";
7
+ import $41a60729487a82d7$export$2e2bcd8739ae039 from "./RootDropIndicator.mjs";
8
+ import {DragPreview as $cd61e55c47e3c0f5$export$905ab40ac2179daa} from "./DragPreview.mjs";
9
+ import {useGridList as $6w3ZV$useGridList} from "@react-aria/gridlist";
10
+ import {useDOMRef as $6w3ZV$useDOMRef, useStyleProps as $6w3ZV$useStyleProps, classNames as $6w3ZV$classNames} from "@react-spectrum/utils";
11
+ import {useLayoutEffect as $6w3ZV$useLayoutEffect, mergeProps as $6w3ZV$mergeProps, filterDOMProps as $6w3ZV$filterDOMProps} from "@react-aria/utils";
12
+ import {FocusScope as $6w3ZV$FocusScope, FocusRing as $6w3ZV$FocusRing} from "@react-aria/focus";
13
+ import {ListKeyboardDelegate as $6w3ZV$ListKeyboardDelegate} from "@react-aria/selection";
14
+ import {useListState as $6w3ZV$useListState} from "@react-stately/list";
15
+ import {ProgressCircle as $6w3ZV$ProgressCircle} from "@react-spectrum/progress";
16
+ import $6w3ZV$react, {useMemo as $6w3ZV$useMemo, useRef as $6w3ZV$useRef, useEffect as $6w3ZV$useEffect, useState as $6w3ZV$useState, useCallback as $6w3ZV$useCallback, useContext as $6w3ZV$useContext} from "react";
17
+ import {useLocalizedStringFormatter as $6w3ZV$useLocalizedStringFormatter} from "@react-aria/i18n";
18
+ import {useProvider as $6w3ZV$useProvider} from "@react-spectrum/provider";
19
+ import {Virtualizer as $6w3ZV$Virtualizer} from "@react-aria/virtualizer";
20
+
21
+
22
+ function $parcel$interopDefault(a) {
23
+ return a && a.__esModule ? a.default : a;
24
+ }
25
+ /*
26
+ * Copyright 2021 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ const $f85fb77f9d4cbc6c$export$870039b0abfe3de0 = /*#__PURE__*/ (0, $6w3ZV$react).createContext(null);
54
+ const $f85fb77f9d4cbc6c$var$ROW_HEIGHTS = {
55
+ compact: {
56
+ medium: 32,
57
+ large: 40
58
+ },
59
+ regular: {
60
+ medium: 40,
61
+ large: 50
62
+ },
63
+ spacious: {
64
+ medium: 48,
65
+ large: 60
66
+ }
67
+ };
68
+ function $f85fb77f9d4cbc6c$var$useListLayout(state, density, overflowMode) {
69
+ let { scale: scale } = (0, $6w3ZV$useProvider)();
70
+ let layout = (0, $6w3ZV$useMemo)(()=>new (0, $bc6cc67dd6240ebd$export$dab781655dfbb7d3)({
71
+ estimatedRowHeight: $f85fb77f9d4cbc6c$var$ROW_HEIGHTS[density][scale]
72
+ }), [
73
+ scale,
74
+ density,
75
+ overflowMode
76
+ ]);
77
+ return layout;
78
+ }
79
+ function $f85fb77f9d4cbc6c$var$ListView(props, ref) {
80
+ var _dropState_target;
81
+ let { density: density = 'regular', loadingState: loadingState, onLoadMore: onLoadMore, isQuiet: isQuiet, overflowMode: overflowMode = 'truncate', onAction: onAction, dragAndDropHooks: dragAndDropHooks, renderEmptyState: renderEmptyState, ...otherProps } = props;
82
+ let isListDraggable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDraggableCollectionState);
83
+ let isListDroppable = !!(dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.useDroppableCollectionState);
84
+ let dragHooksProvided = (0, $6w3ZV$useRef)(isListDraggable);
85
+ let dropHooksProvided = (0, $6w3ZV$useRef)(isListDroppable);
86
+ (0, $6w3ZV$useEffect)(()=>{
87
+ 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.');
88
+ 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.');
89
+ }, [
90
+ isListDraggable,
91
+ isListDroppable
92
+ ]);
93
+ let domRef = (0, $6w3ZV$useDOMRef)(ref);
94
+ let state = (0, $6w3ZV$useListState)({
95
+ ...props,
96
+ selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'
97
+ });
98
+ let { collection: collection, selectionManager: selectionManager } = state;
99
+ let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
100
+ let { styleProps: styleProps } = (0, $6w3ZV$useStyleProps)(props);
101
+ let dragState;
102
+ let preview = (0, $6w3ZV$useRef)(null);
103
+ if (isListDraggable) {
104
+ dragState = dragAndDropHooks.useDraggableCollectionState({
105
+ collection: collection,
106
+ selectionManager: selectionManager,
107
+ preview: preview
108
+ });
109
+ dragAndDropHooks.useDraggableCollection({}, dragState, domRef);
110
+ }
111
+ let layout = $f85fb77f9d4cbc6c$var$useListLayout(state, props.density || 'regular', overflowMode);
112
+ let DragPreview = dragAndDropHooks === null || dragAndDropHooks === void 0 ? void 0 : dragAndDropHooks.DragPreview;
113
+ let dropState;
114
+ let droppableCollection;
115
+ let isRootDropTarget;
116
+ if (isListDroppable) {
117
+ dropState = dragAndDropHooks.useDroppableCollectionState({
118
+ collection: collection,
119
+ selectionManager: selectionManager
120
+ });
121
+ droppableCollection = dragAndDropHooks.useDroppableCollection({
122
+ keyboardDelegate: new (0, $6w3ZV$ListKeyboardDelegate)({
123
+ collection: collection,
124
+ disabledKeys: (dragState === null || dragState === void 0 ? void 0 : dragState.draggingKeys.size) ? null : selectionManager.disabledKeys,
125
+ ref: domRef,
126
+ layoutDelegate: layout
127
+ }),
128
+ dropTargetDelegate: layout
129
+ }, dropState, domRef);
130
+ isRootDropTarget = dropState.isDropTarget({
131
+ type: 'root'
132
+ });
133
+ }
134
+ let { gridProps: gridProps } = (0, $6w3ZV$useGridList)({
135
+ ...props,
136
+ isVirtualized: true,
137
+ layoutDelegate: layout,
138
+ onAction: onAction
139
+ }, state, domRef);
140
+ let focusedKey = selectionManager.focusedKey;
141
+ let dropTargetKey = null;
142
+ if ((dropState === null || dropState === void 0 ? void 0 : (_dropState_target = dropState.target) === null || _dropState_target === void 0 ? void 0 : _dropState_target.type) === 'item') {
143
+ dropTargetKey = dropState.target.key;
144
+ var _state_collection_getKeyAfter;
145
+ if (dropState.target.dropPosition === 'after') // Normalize to the "before" drop position since we only render those in the DOM.
146
+ dropTargetKey = (_state_collection_getKeyAfter = state.collection.getKeyAfter(dropTargetKey)) !== null && _state_collection_getKeyAfter !== void 0 ? _state_collection_getKeyAfter : dropTargetKey;
147
+ }
148
+ let persistedKeys = (0, $6w3ZV$useMemo)(()=>{
149
+ return new Set([
150
+ focusedKey,
151
+ dropTargetKey
152
+ ].filter((k)=>k !== null));
153
+ }, [
154
+ focusedKey,
155
+ dropTargetKey
156
+ ]);
157
+ // wait for layout to get accurate measurements
158
+ let [isVerticalScrollbarVisible, setVerticalScollbarVisible] = (0, $6w3ZV$useState)(false);
159
+ let [isHorizontalScrollbarVisible, setHorizontalScollbarVisible] = (0, $6w3ZV$useState)(false);
160
+ // eslint-disable-next-line react-hooks/exhaustive-deps
161
+ (0, $6w3ZV$useLayoutEffect)(()=>{
162
+ if (domRef.current) {
163
+ // 2 is the width of the border which is not part of the box size
164
+ setVerticalScollbarVisible(domRef.current.clientWidth + 2 < domRef.current.offsetWidth);
165
+ setHorizontalScollbarVisible(domRef.current.clientHeight + 2 < domRef.current.offsetHeight);
166
+ }
167
+ });
168
+ let hasAnyChildren = (0, $6w3ZV$useMemo)(()=>[
169
+ ...collection
170
+ ].some((item)=>item.hasChildNodes), [
171
+ collection
172
+ ]);
173
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$export$870039b0abfe3de0.Provider, {
174
+ value: {
175
+ state: state,
176
+ dragState: dragState,
177
+ dropState: dropState,
178
+ dragAndDropHooks: dragAndDropHooks,
179
+ onAction: onAction,
180
+ isListDraggable: isListDraggable,
181
+ isListDroppable: isListDroppable,
182
+ layout: layout,
183
+ loadingState: loadingState,
184
+ renderEmptyState: renderEmptyState
185
+ }
186
+ }, /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $6w3ZV$FocusScope), null, /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $6w3ZV$FocusRing), {
187
+ focusRingClass: (0, $6w3ZV$classNames)((0, ($parcel$interopDefault($6w3ZV$styles_cssmodulejs))), 'focus-ring')
188
+ }, /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $6w3ZV$Virtualizer), {
189
+ ...(0, $6w3ZV$mergeProps)(isListDroppable && (droppableCollection === null || droppableCollection === void 0 ? void 0 : droppableCollection.collectionProps), gridProps),
190
+ ...(0, $6w3ZV$filterDOMProps)(otherProps),
191
+ ...gridProps,
192
+ ...styleProps,
193
+ isLoading: isLoading,
194
+ onLoadMore: onLoadMore,
195
+ ref: domRef,
196
+ persistedKeys: persistedKeys,
197
+ scrollDirection: "vertical",
198
+ className: (0, $6w3ZV$classNames)((0, ($parcel$interopDefault($6w3ZV$styles_cssmodulejs))), 'react-spectrum-ListView', `react-spectrum-ListView--${density}`, 'react-spectrum-ListView--emphasized', {
199
+ 'react-spectrum-ListView--quiet': isQuiet,
200
+ 'react-spectrum-ListView--loadingMore': loadingState === 'loadingMore',
201
+ 'react-spectrum-ListView--draggable': !!isListDraggable,
202
+ 'react-spectrum-ListView--dropTarget': !!isRootDropTarget,
203
+ 'react-spectrum-ListView--isVerticalScrollbarVisible': isVerticalScrollbarVisible,
204
+ 'react-spectrum-ListView--isHorizontalScrollbarVisible': isHorizontalScrollbarVisible,
205
+ 'react-spectrum-ListView--hasAnyChildren': hasAnyChildren,
206
+ 'react-spectrum-ListView--wrap': overflowMode === 'wrap'
207
+ }, styleProps.className),
208
+ layout: layout,
209
+ layoutOptions: (0, $6w3ZV$useMemo)(()=>({
210
+ isLoading: isLoading
211
+ }), [
212
+ isLoading
213
+ ]),
214
+ collection: collection
215
+ }, (0, $6w3ZV$useCallback)((type, item)=>{
216
+ if (type === 'item') return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$var$Item, {
217
+ item: item
218
+ });
219
+ else if (type === 'loader') return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$var$LoadingView, null);
220
+ else if (type === 'placeholder') return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$var$EmptyState, null);
221
+ }, [])))), DragPreview && isListDraggable && /*#__PURE__*/ (0, $6w3ZV$react).createElement(DragPreview, {
222
+ ref: preview
223
+ }, ()=>{
224
+ if (dragAndDropHooks.renderPreview) return dragAndDropHooks.renderPreview(dragState.draggingKeys, dragState.draggedKey);
225
+ let item = state.collection.getItem(dragState.draggedKey);
226
+ let itemCount = dragState.draggingKeys.size;
227
+ let itemHeight = layout.getLayoutInfo(dragState.draggedKey).rect.height;
228
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $cd61e55c47e3c0f5$export$905ab40ac2179daa), {
229
+ item: item,
230
+ itemCount: itemCount,
231
+ itemHeight: itemHeight,
232
+ density: density
233
+ });
234
+ }));
235
+ }
236
+ function $f85fb77f9d4cbc6c$var$Item({ item: item }) {
237
+ let { isListDroppable: isListDroppable, state: state, onAction: onAction } = (0, $6w3ZV$useContext)($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
238
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $6w3ZV$react).Fragment, null, isListDroppable && state.collection.getKeyBefore(item.key) == null && /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $41a60729487a82d7$export$2e2bcd8739ae039), {
239
+ key: "root"
240
+ }), isListDroppable && /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $0a834ddbc989a3e3$export$2e2bcd8739ae039), {
241
+ key: `${item.key}-before`,
242
+ target: {
243
+ key: item.key,
244
+ type: 'item',
245
+ dropPosition: 'before'
246
+ }
247
+ }), /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $d7c07ca2efc5ba02$export$c6bde0c04b033c0e), {
248
+ item: item,
249
+ isEmphasized: true,
250
+ hasActions: !!onAction
251
+ }), isListDroppable && /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $0a834ddbc989a3e3$export$2e2bcd8739ae039), {
252
+ key: `${item.key}-after`,
253
+ target: {
254
+ key: item.key,
255
+ type: 'item',
256
+ dropPosition: 'after'
257
+ },
258
+ isPresentationOnly: state.collection.getKeyAfter(item.key) != null
259
+ }));
260
+ }
261
+ function $f85fb77f9d4cbc6c$var$LoadingView() {
262
+ let { state: state } = (0, $6w3ZV$useContext)($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
263
+ let stringFormatter = (0, $6w3ZV$useLocalizedStringFormatter)((0, ($parcel$interopDefault($6w3ZV$intlStringsmodulejs))), '@react-spectrum/list');
264
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$var$CenteredWrapper, null, /*#__PURE__*/ (0, $6w3ZV$react).createElement((0, $6w3ZV$ProgressCircle), {
265
+ isIndeterminate: true,
266
+ "aria-label": state.collection.size > 0 ? stringFormatter.format('loadingMore') : stringFormatter.format('loading')
267
+ }));
268
+ }
269
+ function $f85fb77f9d4cbc6c$var$EmptyState() {
270
+ let { renderEmptyState: renderEmptyState } = (0, $6w3ZV$useContext)($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
271
+ let emptyState = renderEmptyState ? renderEmptyState() : null;
272
+ if (emptyState == null) return null;
273
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement($f85fb77f9d4cbc6c$var$CenteredWrapper, null, emptyState);
274
+ }
275
+ function $f85fb77f9d4cbc6c$var$CenteredWrapper({ children: children }) {
276
+ let { state: state } = (0, $6w3ZV$useContext)($f85fb77f9d4cbc6c$export$870039b0abfe3de0);
277
+ return /*#__PURE__*/ (0, $6w3ZV$react).createElement("div", {
278
+ role: "row",
279
+ "aria-rowindex": state.collection.size + 1,
280
+ className: (0, $6w3ZV$classNames)((0, ($parcel$interopDefault($6w3ZV$styles_cssmodulejs))), 'react-spectrum-ListView-centeredWrapper', {
281
+ 'react-spectrum-ListView-centeredWrapper--loadingMore': state.collection.size > 0
282
+ })
283
+ }, /*#__PURE__*/ (0, $6w3ZV$react).createElement("div", {
284
+ role: "gridcell"
285
+ }, children));
286
+ }
287
+ /**
288
+ * A ListView displays a list of interactive items, and allows a user to navigate, select, or perform an action.
289
+ */ const $f85fb77f9d4cbc6c$export$84d0dd190d551cd1 = /*#__PURE__*/ (0, $6w3ZV$react).forwardRef($f85fb77f9d4cbc6c$var$ListView);
290
+
291
+
292
+ export {$f85fb77f9d4cbc6c$export$870039b0abfe3de0 as ListViewContext, $f85fb77f9d4cbc6c$export$84d0dd190d551cd1 as ListView};
293
+ //# sourceMappingURL=ListView.module.js.map