@react-spectrum/card 3.0.0-alpha.4 → 3.0.0-alpha.41

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 (240) hide show
  1. package/dist/BaseLayout.main.js +213 -0
  2. package/dist/BaseLayout.main.js.map +1 -0
  3. package/dist/BaseLayout.mjs +208 -0
  4. package/dist/BaseLayout.module.js +208 -0
  5. package/dist/BaseLayout.module.js.map +1 -0
  6. package/dist/Card.main.js +52 -0
  7. package/dist/Card.main.js.map +1 -0
  8. package/dist/Card.mjs +43 -0
  9. package/dist/Card.module.js +43 -0
  10. package/dist/Card.module.js.map +1 -0
  11. package/dist/CardBase.main.js +203 -0
  12. package/dist/CardBase.main.js.map +1 -0
  13. package/dist/CardBase.mjs +198 -0
  14. package/dist/CardBase.module.js +198 -0
  15. package/dist/CardBase.module.js.map +1 -0
  16. package/dist/CardView.main.js +238 -0
  17. package/dist/CardView.main.js.map +1 -0
  18. package/dist/CardView.mjs +233 -0
  19. package/dist/CardView.module.js +233 -0
  20. package/dist/CardView.module.js.map +1 -0
  21. package/dist/CardViewContext.main.js +32 -0
  22. package/dist/CardViewContext.main.js.map +1 -0
  23. package/dist/CardViewContext.mjs +22 -0
  24. package/dist/CardViewContext.module.js +22 -0
  25. package/dist/CardViewContext.module.js.map +1 -0
  26. package/dist/GalleryLayout.main.js +230 -0
  27. package/dist/GalleryLayout.main.js.map +1 -0
  28. package/dist/GalleryLayout.mjs +225 -0
  29. package/dist/GalleryLayout.module.js +225 -0
  30. package/dist/GalleryLayout.module.js.map +1 -0
  31. package/dist/GridLayout.main.js +175 -0
  32. package/dist/GridLayout.main.js.map +1 -0
  33. package/dist/GridLayout.mjs +170 -0
  34. package/dist/GridLayout.module.js +170 -0
  35. package/dist/GridLayout.module.js.map +1 -0
  36. package/dist/WaterfallLayout.main.js +182 -0
  37. package/dist/WaterfallLayout.main.js.map +1 -0
  38. package/dist/WaterfallLayout.mjs +177 -0
  39. package/dist/WaterfallLayout.module.js +177 -0
  40. package/dist/WaterfallLayout.module.js.map +1 -0
  41. package/dist/ar-AE.main.js +7 -0
  42. package/dist/ar-AE.main.js.map +1 -0
  43. package/dist/ar-AE.mjs +9 -0
  44. package/dist/ar-AE.module.js +9 -0
  45. package/dist/ar-AE.module.js.map +1 -0
  46. package/dist/bg-BG.main.js +7 -0
  47. package/dist/bg-BG.main.js.map +1 -0
  48. package/dist/bg-BG.mjs +9 -0
  49. package/dist/bg-BG.module.js +9 -0
  50. package/dist/bg-BG.module.js.map +1 -0
  51. package/dist/card_vars_css.main.js +116 -0
  52. package/dist/card_vars_css.main.js.map +1 -0
  53. package/dist/card_vars_css.mjs +118 -0
  54. package/dist/card_vars_css.module.js +118 -0
  55. package/dist/card_vars_css.module.js.map +1 -0
  56. package/dist/cs-CZ.main.js +7 -0
  57. package/dist/cs-CZ.main.js.map +1 -0
  58. package/dist/cs-CZ.mjs +9 -0
  59. package/dist/cs-CZ.module.js +9 -0
  60. package/dist/cs-CZ.module.js.map +1 -0
  61. package/dist/da-DK.main.js +7 -0
  62. package/dist/da-DK.main.js.map +1 -0
  63. package/dist/da-DK.mjs +9 -0
  64. package/dist/da-DK.module.js +9 -0
  65. package/dist/da-DK.module.js.map +1 -0
  66. package/dist/de-DE.main.js +7 -0
  67. package/dist/de-DE.main.js.map +1 -0
  68. package/dist/de-DE.mjs +9 -0
  69. package/dist/de-DE.module.js +9 -0
  70. package/dist/de-DE.module.js.map +1 -0
  71. package/dist/el-GR.main.js +7 -0
  72. package/dist/el-GR.main.js.map +1 -0
  73. package/dist/el-GR.mjs +9 -0
  74. package/dist/el-GR.module.js +9 -0
  75. package/dist/el-GR.module.js.map +1 -0
  76. package/dist/en-US.main.js +7 -0
  77. package/dist/en-US.main.js.map +1 -0
  78. package/dist/en-US.mjs +9 -0
  79. package/dist/en-US.module.js +9 -0
  80. package/dist/en-US.module.js.map +1 -0
  81. package/dist/es-ES.main.js +7 -0
  82. package/dist/es-ES.main.js.map +1 -0
  83. package/dist/es-ES.mjs +9 -0
  84. package/dist/es-ES.module.js +9 -0
  85. package/dist/es-ES.module.js.map +1 -0
  86. package/dist/et-EE.main.js +7 -0
  87. package/dist/et-EE.main.js.map +1 -0
  88. package/dist/et-EE.mjs +9 -0
  89. package/dist/et-EE.module.js +9 -0
  90. package/dist/et-EE.module.js.map +1 -0
  91. package/dist/fi-FI.main.js +7 -0
  92. package/dist/fi-FI.main.js.map +1 -0
  93. package/dist/fi-FI.mjs +9 -0
  94. package/dist/fi-FI.module.js +9 -0
  95. package/dist/fi-FI.module.js.map +1 -0
  96. package/dist/fr-FR.main.js +7 -0
  97. package/dist/fr-FR.main.js.map +1 -0
  98. package/dist/fr-FR.mjs +9 -0
  99. package/dist/fr-FR.module.js +9 -0
  100. package/dist/fr-FR.module.js.map +1 -0
  101. package/dist/he-IL.main.js +7 -0
  102. package/dist/he-IL.main.js.map +1 -0
  103. package/dist/he-IL.mjs +9 -0
  104. package/dist/he-IL.module.js +9 -0
  105. package/dist/he-IL.module.js.map +1 -0
  106. package/dist/hr-HR.main.js +7 -0
  107. package/dist/hr-HR.main.js.map +1 -0
  108. package/dist/hr-HR.mjs +9 -0
  109. package/dist/hr-HR.module.js +9 -0
  110. package/dist/hr-HR.module.js.map +1 -0
  111. package/dist/hu-HU.main.js +7 -0
  112. package/dist/hu-HU.main.js.map +1 -0
  113. package/dist/hu-HU.mjs +9 -0
  114. package/dist/hu-HU.module.js +9 -0
  115. package/dist/hu-HU.module.js.map +1 -0
  116. package/dist/import.mjs +26 -0
  117. package/dist/intlStrings.main.js +108 -0
  118. package/dist/intlStrings.main.js.map +1 -0
  119. package/dist/intlStrings.mjs +110 -0
  120. package/dist/intlStrings.module.js +110 -0
  121. package/dist/intlStrings.module.js.map +1 -0
  122. package/dist/it-IT.main.js +7 -0
  123. package/dist/it-IT.main.js.map +1 -0
  124. package/dist/it-IT.mjs +9 -0
  125. package/dist/it-IT.module.js +9 -0
  126. package/dist/it-IT.module.js.map +1 -0
  127. package/dist/ja-JP.main.js +7 -0
  128. package/dist/ja-JP.main.js.map +1 -0
  129. package/dist/ja-JP.mjs +9 -0
  130. package/dist/ja-JP.module.js +9 -0
  131. package/dist/ja-JP.module.js.map +1 -0
  132. package/dist/ko-KR.main.js +7 -0
  133. package/dist/ko-KR.main.js.map +1 -0
  134. package/dist/ko-KR.mjs +9 -0
  135. package/dist/ko-KR.module.js +9 -0
  136. package/dist/ko-KR.module.js.map +1 -0
  137. package/dist/lt-LT.main.js +7 -0
  138. package/dist/lt-LT.main.js.map +1 -0
  139. package/dist/lt-LT.mjs +9 -0
  140. package/dist/lt-LT.module.js +9 -0
  141. package/dist/lt-LT.module.js.map +1 -0
  142. package/dist/lv-LV.main.js +7 -0
  143. package/dist/lv-LV.main.js.map +1 -0
  144. package/dist/lv-LV.mjs +9 -0
  145. package/dist/lv-LV.module.js +9 -0
  146. package/dist/lv-LV.module.js.map +1 -0
  147. package/dist/main.js +21 -1447
  148. package/dist/main.js.map +1 -1
  149. package/dist/module.js +17 -1432
  150. package/dist/module.js.map +1 -1
  151. package/dist/nb-NO.main.js +7 -0
  152. package/dist/nb-NO.main.js.map +1 -0
  153. package/dist/nb-NO.mjs +9 -0
  154. package/dist/nb-NO.module.js +9 -0
  155. package/dist/nb-NO.module.js.map +1 -0
  156. package/dist/nl-NL.main.js +7 -0
  157. package/dist/nl-NL.main.js.map +1 -0
  158. package/dist/nl-NL.mjs +9 -0
  159. package/dist/nl-NL.module.js +9 -0
  160. package/dist/nl-NL.module.js.map +1 -0
  161. package/dist/pl-PL.main.js +7 -0
  162. package/dist/pl-PL.main.js.map +1 -0
  163. package/dist/pl-PL.mjs +9 -0
  164. package/dist/pl-PL.module.js +9 -0
  165. package/dist/pl-PL.module.js.map +1 -0
  166. package/dist/pt-BR.main.js +7 -0
  167. package/dist/pt-BR.main.js.map +1 -0
  168. package/dist/pt-BR.mjs +9 -0
  169. package/dist/pt-BR.module.js +9 -0
  170. package/dist/pt-BR.module.js.map +1 -0
  171. package/dist/pt-PT.main.js +7 -0
  172. package/dist/pt-PT.main.js.map +1 -0
  173. package/dist/pt-PT.mjs +9 -0
  174. package/dist/pt-PT.module.js +9 -0
  175. package/dist/pt-PT.module.js.map +1 -0
  176. package/dist/ro-RO.main.js +7 -0
  177. package/dist/ro-RO.main.js.map +1 -0
  178. package/dist/ro-RO.mjs +9 -0
  179. package/dist/ro-RO.module.js +9 -0
  180. package/dist/ro-RO.module.js.map +1 -0
  181. package/dist/ru-RU.main.js +7 -0
  182. package/dist/ru-RU.main.js.map +1 -0
  183. package/dist/ru-RU.mjs +9 -0
  184. package/dist/ru-RU.module.js +9 -0
  185. package/dist/ru-RU.module.js.map +1 -0
  186. package/dist/sk-SK.main.js +7 -0
  187. package/dist/sk-SK.main.js.map +1 -0
  188. package/dist/sk-SK.mjs +9 -0
  189. package/dist/sk-SK.module.js +9 -0
  190. package/dist/sk-SK.module.js.map +1 -0
  191. package/dist/sl-SI.main.js +7 -0
  192. package/dist/sl-SI.main.js.map +1 -0
  193. package/dist/sl-SI.mjs +9 -0
  194. package/dist/sl-SI.module.js +9 -0
  195. package/dist/sl-SI.module.js.map +1 -0
  196. package/dist/sr-SP.main.js +7 -0
  197. package/dist/sr-SP.main.js.map +1 -0
  198. package/dist/sr-SP.mjs +9 -0
  199. package/dist/sr-SP.module.js +9 -0
  200. package/dist/sr-SP.module.js.map +1 -0
  201. package/dist/sv-SE.main.js +7 -0
  202. package/dist/sv-SE.main.js.map +1 -0
  203. package/dist/sv-SE.mjs +9 -0
  204. package/dist/sv-SE.module.js +9 -0
  205. package/dist/sv-SE.module.js.map +1 -0
  206. package/dist/tr-TR.main.js +7 -0
  207. package/dist/tr-TR.main.js.map +1 -0
  208. package/dist/tr-TR.mjs +9 -0
  209. package/dist/tr-TR.module.js +9 -0
  210. package/dist/tr-TR.module.js.map +1 -0
  211. package/dist/types.d.ts +38 -36
  212. package/dist/types.d.ts.map +1 -1
  213. package/dist/uk-UA.main.js +7 -0
  214. package/dist/uk-UA.main.js.map +1 -0
  215. package/dist/uk-UA.mjs +9 -0
  216. package/dist/uk-UA.module.js +9 -0
  217. package/dist/uk-UA.module.js.map +1 -0
  218. package/dist/vars.02438011.css +1671 -0
  219. package/dist/vars.02438011.css.map +1 -0
  220. package/dist/zh-CN.main.js +7 -0
  221. package/dist/zh-CN.main.js.map +1 -0
  222. package/dist/zh-CN.mjs +9 -0
  223. package/dist/zh-CN.module.js +9 -0
  224. package/dist/zh-CN.module.js.map +1 -0
  225. package/dist/zh-TW.main.js +7 -0
  226. package/dist/zh-TW.main.js.map +1 -0
  227. package/dist/zh-TW.mjs +9 -0
  228. package/dist/zh-TW.module.js +9 -0
  229. package/dist/zh-TW.module.js.map +1 -0
  230. package/package.json +26 -23
  231. package/src/BaseLayout.tsx +36 -32
  232. package/src/Card.tsx +1 -0
  233. package/src/CardBase.tsx +9 -11
  234. package/src/CardView.tsx +71 -51
  235. package/src/CardViewContext.tsx +1 -0
  236. package/src/GalleryLayout.tsx +4 -2
  237. package/src/GridLayout.tsx +7 -39
  238. package/src/WaterfallLayout.tsx +8 -5
  239. package/src/index.ts +10 -5
  240. package/dist/main.css +0 -1
package/dist/module.js CHANGED
@@ -1,1441 +1,26 @@
1
- import "./main.css";
2
- import {useStyleProps as $8EWFi$useStyleProps, useDOMRef as $8EWFi$useDOMRef, classNames as $8EWFi$classNames, useUnwrapDOMRef as $8EWFi$useUnwrapDOMRef, useHasChild as $8EWFi$useHasChild, SlotProvider as $8EWFi$SlotProvider} from "@react-spectrum/utils";
3
- import {GridCollection as $8EWFi$GridCollection, useGridState as $8EWFi$useGridState} from "@react-stately/grid";
4
- import {ProgressCircle as $8EWFi$ProgressCircle} from "@react-spectrum/progress";
5
- import $8EWFi$react, {useMemo as $8EWFi$useMemo, useCallback as $8EWFi$useCallback, useRef as $8EWFi$useRef, useState as $8EWFi$useState, useContext as $8EWFi$useContext, forwardRef as $8EWFi$forwardRef} from "react";
6
- import {useCollator as $8EWFi$useCollator, useMessageFormatter as $8EWFi$useMessageFormatter, useLocale as $8EWFi$useLocale} from "@react-aria/i18n";
7
- import {useGrid as $8EWFi$useGrid, useGridRow as $8EWFi$useGridRow, useGridCell as $8EWFi$useGridCell} from "@react-aria/grid";
8
- import {useListState as $8EWFi$useListState} from "@react-stately/list";
9
- import {useProvider as $8EWFi$useProvider, useProviderProps as $8EWFi$useProviderProps} from "@react-spectrum/provider";
10
- import {VirtualizerItem as $8EWFi$VirtualizerItem, Virtualizer as $8EWFi$Virtualizer} from "@react-aria/virtualizer";
11
- import {Checkbox as $8EWFi$Checkbox} from "@react-spectrum/checkbox";
12
- import {useResizeObserver as $8EWFi$useResizeObserver, useLayoutEffect as $8EWFi$useLayoutEffect, mergeProps as $8EWFi$mergeProps, filterDOMProps as $8EWFi$filterDOMProps, useSlotId as $8EWFi$useSlotId} from "@react-aria/utils";
13
- import {getFocusableTreeWalker as $8EWFi$getFocusableTreeWalker, FocusRing as $8EWFi$FocusRing} from "@react-aria/focus";
14
- import {useHover as $8EWFi$useHover, useFocusWithin as $8EWFi$useFocusWithin} from "@react-aria/interactions";
15
- import {Size as $8EWFi$Size, Rect as $8EWFi$Rect, LayoutInfo as $8EWFi$LayoutInfo, Layout as $8EWFi$Layout} from "@react-stately/virtualizer";
1
+ import {CardView as $81a52da995c19652$export$7e52c821f7b6f422} from "./CardView.module.js";
2
+ import {GalleryLayout as $c0ba81539c443916$export$8e52095834484b61} from "./GalleryLayout.module.js";
3
+ import {GridLayout as $ed42fd44b9b9b664$export$7d2b12578154a735} from "./GridLayout.module.js";
4
+ import {WaterfallLayout as $03278f8d0f6860bb$export$e9f7cda058ba8df8} from "./WaterfallLayout.module.js";
5
+ import {Card as $d2d1c099b89e366a$export$60332b2344f7fe41} from "./Card.module.js";
6
+
7
+ /*
8
+ * Copyright 2021 Adobe. All rights reserved.
9
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License. You may obtain a copy
11
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software distributed under
14
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
+ * OF ANY KIND, either express or implied. See the License for the specific language
16
+ * governing permissions and limitations under the License.
17
+ */ /// <reference types="css-module-types" />
16
18
 
17
- function $parcel$interopDefault(a) {
18
- return a && a.__esModule ? a.default : a;
19
- }
20
- function $parcel$export(e, n, v, s) {
21
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
22
- }
23
- var $81a52da995c19652$exports = {};
24
19
 
25
- $parcel$export($81a52da995c19652$exports, "CardView", () => $81a52da995c19652$export$7e52c821f7b6f422);
26
20
 
27
21
 
28
22
 
29
23
 
30
24
 
31
-
32
- var $408a78e5068502c2$exports = {};
33
-
34
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card", () => $408a78e5068502c2$export$4e5e9f191b1edb8, (v) => $408a78e5068502c2$export$4e5e9f191b1edb8 = v);
35
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-heading", () => $408a78e5068502c2$export$92758a4a0e8d19e4, (v) => $408a78e5068502c2$export$92758a4a0e8d19e4 = v);
36
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-checkboxWrapper", () => $408a78e5068502c2$export$33977546b63e0df9, (v) => $408a78e5068502c2$export$33977546b63e0df9 = v);
37
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-checkbox", () => $408a78e5068502c2$export$842da5d48b8f6db2, (v) => $408a78e5068502c2$export$842da5d48b8f6db2 = v);
38
- $parcel$export($408a78e5068502c2$exports, "is-selected", () => $408a78e5068502c2$export$1e0fb04f31d3c22a, (v) => $408a78e5068502c2$export$1e0fb04f31d3c22a = v);
39
- $parcel$export($408a78e5068502c2$exports, "focus-ring", () => $408a78e5068502c2$export$f39a09f249340e2a, (v) => $408a78e5068502c2$export$f39a09f249340e2a = v);
40
- $parcel$export($408a78e5068502c2$exports, "is-hovered", () => $408a78e5068502c2$export$b8813cd5d7824ce7, (v) => $408a78e5068502c2$export$b8813cd5d7824ce7 = v);
41
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-grid", () => $408a78e5068502c2$export$b3dd760d2dfde29e, (v) => $408a78e5068502c2$export$b3dd760d2dfde29e = v);
42
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-decoration", () => $408a78e5068502c2$export$48252dc130b62514, (v) => $408a78e5068502c2$export$48252dc130b62514 = v);
43
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-image", () => $408a78e5068502c2$export$8d5fea71dc66db80, (v) => $408a78e5068502c2$export$8d5fea71dc66db80 = v);
44
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-illustration", () => $408a78e5068502c2$export$13dd3510ae7a8399, (v) => $408a78e5068502c2$export$13dd3510ae7a8399 = v);
45
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-avatar", () => $408a78e5068502c2$export$159930c59efb6273, (v) => $408a78e5068502c2$export$159930c59efb6273 = v);
46
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-detail", () => $408a78e5068502c2$export$16715af38fbd9819, (v) => $408a78e5068502c2$export$16715af38fbd9819 = v);
47
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card-content", () => $408a78e5068502c2$export$d946625b97e8aa17, (v) => $408a78e5068502c2$export$d946625b97e8aa17 = v);
48
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--waterfall", () => $408a78e5068502c2$export$d9c7209e0e4f7e4d, (v) => $408a78e5068502c2$export$d9c7209e0e4f7e4d = v);
49
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--default", () => $408a78e5068502c2$export$c7a022df9e10a238, (v) => $408a78e5068502c2$export$c7a022df9e10a238 = v);
50
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--noPreview", () => $408a78e5068502c2$export$b77922bc0320c9e4, (v) => $408a78e5068502c2$export$b77922bc0320c9e4 = v);
51
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--grid", () => $408a78e5068502c2$export$59739ab951d2dcc7, (v) => $408a78e5068502c2$export$59739ab951d2dcc7 = v);
52
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--noLayout", () => $408a78e5068502c2$export$a03d836e6ef3e749, (v) => $408a78e5068502c2$export$a03d836e6ef3e749 = v);
53
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--isQuiet", () => $408a78e5068502c2$export$92ad04b5ac9296ea, (v) => $408a78e5068502c2$export$92ad04b5ac9296ea = v);
54
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--gallery", () => $408a78e5068502c2$export$ccd8ffc36bd10cc, (v) => $408a78e5068502c2$export$ccd8ffc36bd10cc = v);
55
- $parcel$export($408a78e5068502c2$exports, "spectrum-Card--horizontal", () => $408a78e5068502c2$export$1c52334407225704, (v) => $408a78e5068502c2$export$1c52334407225704 = v);
56
- $parcel$export($408a78e5068502c2$exports, "is-focused", () => $408a78e5068502c2$export$e7dc768d35940237, (v) => $408a78e5068502c2$export$e7dc768d35940237 = v);
57
- $parcel$export($408a78e5068502c2$exports, "spectrum-CardView", () => $408a78e5068502c2$export$2f34e9e3e0b89d95, (v) => $408a78e5068502c2$export$2f34e9e3e0b89d95 = v);
58
- $parcel$export($408a78e5068502c2$exports, "spectrum-CardView-centeredWrapper", () => $408a78e5068502c2$export$7fc89689fcfab196, (v) => $408a78e5068502c2$export$7fc89689fcfab196 = v);
59
- $parcel$export($408a78e5068502c2$exports, "spectrum-CardView-row", () => $408a78e5068502c2$export$4746ac09daa215ae, (v) => $408a78e5068502c2$export$4746ac09daa215ae = v);
60
- $parcel$export($408a78e5068502c2$exports, "is-drop-target", () => $408a78e5068502c2$export$d8467f38d2d00bd0, (v) => $408a78e5068502c2$export$d8467f38d2d00bd0 = v);
61
- var $408a78e5068502c2$export$4e5e9f191b1edb8;
62
- var $408a78e5068502c2$export$92758a4a0e8d19e4;
63
- var $408a78e5068502c2$export$33977546b63e0df9;
64
- var $408a78e5068502c2$export$842da5d48b8f6db2;
65
- var $408a78e5068502c2$export$1e0fb04f31d3c22a;
66
- var $408a78e5068502c2$export$f39a09f249340e2a;
67
- var $408a78e5068502c2$export$b8813cd5d7824ce7;
68
- var $408a78e5068502c2$export$b3dd760d2dfde29e;
69
- var $408a78e5068502c2$export$48252dc130b62514;
70
- var $408a78e5068502c2$export$8d5fea71dc66db80;
71
- var $408a78e5068502c2$export$13dd3510ae7a8399;
72
- var $408a78e5068502c2$export$159930c59efb6273;
73
- var $408a78e5068502c2$export$16715af38fbd9819;
74
- var $408a78e5068502c2$export$d946625b97e8aa17;
75
- var $408a78e5068502c2$export$d9c7209e0e4f7e4d;
76
- var $408a78e5068502c2$export$c7a022df9e10a238;
77
- var $408a78e5068502c2$export$b77922bc0320c9e4;
78
- var $408a78e5068502c2$export$59739ab951d2dcc7;
79
- var $408a78e5068502c2$export$a03d836e6ef3e749;
80
- var $408a78e5068502c2$export$92ad04b5ac9296ea;
81
- var $408a78e5068502c2$export$ccd8ffc36bd10cc;
82
- var $408a78e5068502c2$export$1c52334407225704;
83
- var $408a78e5068502c2$export$e7dc768d35940237;
84
- var $408a78e5068502c2$export$2f34e9e3e0b89d95;
85
- var $408a78e5068502c2$export$7fc89689fcfab196;
86
- var $408a78e5068502c2$export$4746ac09daa215ae;
87
- var $408a78e5068502c2$export$d8467f38d2d00bd0;
88
- $408a78e5068502c2$export$4e5e9f191b1edb8 = "spectrum-Card_6fdf9f";
89
- $408a78e5068502c2$export$92758a4a0e8d19e4 = "spectrum-Card-heading_6fdf9f";
90
- $408a78e5068502c2$export$33977546b63e0df9 = "spectrum-Card-checkboxWrapper_6fdf9f";
91
- $408a78e5068502c2$export$842da5d48b8f6db2 = "spectrum-Card-checkbox_6fdf9f";
92
- $408a78e5068502c2$export$1e0fb04f31d3c22a = "is-selected_6fdf9f";
93
- $408a78e5068502c2$export$f39a09f249340e2a = "focus-ring_6fdf9f";
94
- $408a78e5068502c2$export$b8813cd5d7824ce7 = "is-hovered_6fdf9f";
95
- $408a78e5068502c2$export$b3dd760d2dfde29e = "spectrum-Card-grid_6fdf9f";
96
- $408a78e5068502c2$export$48252dc130b62514 = "spectrum-Card-decoration_6fdf9f";
97
- $408a78e5068502c2$export$8d5fea71dc66db80 = "spectrum-Card-image_6fdf9f";
98
- $408a78e5068502c2$export$13dd3510ae7a8399 = "spectrum-Card-illustration_6fdf9f";
99
- $408a78e5068502c2$export$159930c59efb6273 = "spectrum-Card-avatar_6fdf9f";
100
- $408a78e5068502c2$export$16715af38fbd9819 = "spectrum-Card-detail_6fdf9f";
101
- $408a78e5068502c2$export$d946625b97e8aa17 = "spectrum-Card-content_6fdf9f";
102
- $408a78e5068502c2$export$d9c7209e0e4f7e4d = "spectrum-Card--waterfall_6fdf9f";
103
- $408a78e5068502c2$export$c7a022df9e10a238 = "spectrum-Card--default_6fdf9f";
104
- $408a78e5068502c2$export$b77922bc0320c9e4 = "spectrum-Card--noPreview_6fdf9f";
105
- $408a78e5068502c2$export$59739ab951d2dcc7 = "spectrum-Card--grid_6fdf9f";
106
- $408a78e5068502c2$export$a03d836e6ef3e749 = "spectrum-Card--noLayout_6fdf9f";
107
- $408a78e5068502c2$export$92ad04b5ac9296ea = "spectrum-Card--isQuiet_6fdf9f";
108
- $408a78e5068502c2$export$ccd8ffc36bd10cc = "spectrum-Card--gallery_6fdf9f";
109
- $408a78e5068502c2$export$1c52334407225704 = "spectrum-Card--horizontal_6fdf9f";
110
- $408a78e5068502c2$export$e7dc768d35940237 = "is-focused_6fdf9f";
111
- $408a78e5068502c2$export$2f34e9e3e0b89d95 = "spectrum-CardView_6fdf9f";
112
- $408a78e5068502c2$export$7fc89689fcfab196 = "spectrum-CardView-centeredWrapper_6fdf9f";
113
- $408a78e5068502c2$export$4746ac09daa215ae = "spectrum-CardView-row_6fdf9f";
114
- $408a78e5068502c2$export$d8467f38d2d00bd0 = "is-drop-target_6fdf9f";
115
-
116
-
117
-
118
- const $8d180a244893de14$export$64992ac69f286e5c = /*#__PURE__*/ $8EWFi$react.createContext(null);
119
- function $8d180a244893de14$export$fea0b38586ec8f13() {
120
- return $8EWFi$useContext($8d180a244893de14$export$64992ac69f286e5c);
121
- }
122
-
123
-
124
-
125
-
126
- function $643dd8fa80926f94$var$CardBase(props, ref) {
127
- props = $8EWFi$useProviderProps(props);
128
- let context = $8d180a244893de14$export$fea0b38586ec8f13() || {
129
- }; // we can call again here, won't change from Card.tsx
130
- let { state: state } = context;
131
- let manager = state === null || state === void 0 ? void 0 : state.selectionManager;
132
- let { isQuiet: isQuiet , orientation: orientation = 'vertical' , articleProps: articleProps = {
133
- } , item: item , layout: layout , children: children } = props;
134
- let key = item === null || item === void 0 ? void 0 : item.key;
135
- let isSelected = manager === null || manager === void 0 ? void 0 : manager.isSelected(key);
136
- let isDisabled = state === null || state === void 0 ? void 0 : state.disabledKeys.has(key);
137
- let onChange = ()=>{
138
- return manager === null || manager === void 0 ? void 0 : manager.select(key);
139
- };
140
- let { styleProps: styleProps } = $8EWFi$useStyleProps(props);
141
- let { cardProps: cardProps , titleProps: titleProps , contentProps: contentProps } = $643dd8fa80926f94$var$useCard(props);
142
- let domRef = $8EWFi$useDOMRef(ref);
143
- let gridRef = $8EWFi$useRef();
144
- let checkboxRef = $8EWFi$useRef(null);
145
- // cards are only interactive if there is a selection manager and it allows selection
146
- let { hoverProps: hoverProps , isHovered: isHovered } = $8EWFi$useHover({
147
- isDisabled: manager === undefined || (manager === null || manager === void 0 ? void 0 : manager.selectionMode) === 'none' || isDisabled
148
- });
149
- let [isFocused, setIsFocused] = $8EWFi$useState(false);
150
- let { focusWithinProps: focusWithinProps } = $8EWFi$useFocusWithin({
151
- onFocusWithinChange: setIsFocused,
152
- isDisabled: isDisabled
153
- });
154
- // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default
155
- let hasPreviewImage = $8EWFi$useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports))['spectrum-Card-image']}`, gridRef);
156
- let hasPreviewIllustration = $8EWFi$useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports))['spectrum-Card-illustration']}`, gridRef);
157
- let hasPreview = hasPreviewImage || hasPreviewIllustration;
158
- // this is for horizontal cards
159
- let [height, setHeight] = $8EWFi$useState(NaN);
160
- let updateHeight = $8EWFi$useCallback(()=>{
161
- if (orientation !== 'horizontal') return;
162
- let cardHeight = gridRef.current.getBoundingClientRect().height;
163
- setHeight(cardHeight);
164
- }, [
165
- orientation,
166
- gridRef,
167
- setHeight
168
- ]);
169
- $8EWFi$useResizeObserver({
170
- ref: gridRef,
171
- onResize: updateHeight
172
- });
173
- let aspectRatioEnforce = undefined;
174
- if (orientation === 'horizontal' && !isNaN(height)) aspectRatioEnforce = {
175
- height: `${height}px`,
176
- width: `${height}px`
177
- };
178
- let slots = $8EWFi$useMemo(()=>({
179
- image: {
180
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-image'),
181
- objectFit: orientation === 'horizontal' ? 'cover' : 'contain',
182
- alt: '',
183
- ...aspectRatioEnforce
184
- },
185
- illustration: {
186
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-illustration'),
187
- ...aspectRatioEnforce
188
- },
189
- avatar: {
190
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-avatar'),
191
- size: 'avatar-size-400'
192
- },
193
- heading: {
194
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-heading'),
195
- ...titleProps
196
- },
197
- content: {
198
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-content'),
199
- ...contentProps
200
- },
201
- detail: {
202
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-detail')
203
- }
204
- })
205
- , [
206
- titleProps,
207
- contentProps,
208
- height,
209
- isQuiet,
210
- orientation
211
- ]);
212
- $8EWFi$useLayoutEffect(()=>{
213
- if (gridRef === null || gridRef === void 0 ? void 0 : gridRef.current) {
214
- let walker = $8EWFi$getFocusableTreeWalker(gridRef.current);
215
- let nextNode = walker.nextNode();
216
- while(nextNode != null){
217
- if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {
218
- console.warn('Card does not support focusable elements, please contact the team regarding your use case.');
219
- break;
220
- }
221
- nextNode = walker.nextNode();
222
- }
223
- }
224
- }, [
225
- children
226
- ]);
227
- return(/*#__PURE__*/ $8EWFi$react.createElement($8EWFi$FocusRing, {
228
- focusRingClass: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'focus-ring')
229
- }, /*#__PURE__*/ $8EWFi$react.createElement("article", {
230
- ...styleProps,
231
- ...$8EWFi$mergeProps(cardProps, focusWithinProps, hoverProps, $8EWFi$filterDOMProps(props), articleProps),
232
- ref: domRef,
233
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card', {
234
- 'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',
235
- 'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',
236
- 'spectrum-Card--horizontal': orientation === 'horizontal',
237
- 'spectrum-Card--noPreview': !hasPreview,
238
- 'is-hovered': isHovered,
239
- 'is-focused': isFocused,
240
- 'is-selected': isSelected,
241
- 'spectrum-Card--waterfall': layout === 'waterfall',
242
- 'spectrum-Card--gallery': layout === 'gallery',
243
- 'spectrum-Card--grid': layout === 'grid',
244
- 'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'
245
- }, styleProps.className)
246
- }, /*#__PURE__*/ $8EWFi$react.createElement("div", {
247
- ref: gridRef,
248
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-grid')
249
- }, manager && manager.selectionMode !== 'none' && /*#__PURE__*/ $8EWFi$react.createElement("div", {
250
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-checkboxWrapper')
251
- }, /*#__PURE__*/ $8EWFi$react.createElement($8EWFi$Checkbox, {
252
- ref: checkboxRef,
253
- isDisabled: isDisabled,
254
- excludeFromTabOrder: true,
255
- isSelected: isSelected,
256
- onChange: onChange,
257
- UNSAFE_className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-checkbox'),
258
- isEmphasized: true,
259
- "aria-label": "select"
260
- })), /*#__PURE__*/ $8EWFi$react.createElement($8EWFi$SlotProvider, {
261
- slots: slots
262
- }, children), /*#__PURE__*/ $8EWFi$react.createElement("div", {
263
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-Card-decoration')
264
- })))));
265
- }
266
- function $643dd8fa80926f94$var$useCard(props) {
267
- let titleId = $8EWFi$useSlotId();
268
- let descriptionId = $8EWFi$useSlotId();
269
- let titleProps = $8EWFi$useMemo(()=>({
270
- id: titleId
271
- })
272
- , [
273
- titleId
274
- ]);
275
- let contentProps = $8EWFi$useMemo(()=>({
276
- id: descriptionId
277
- })
278
- , [
279
- descriptionId
280
- ]);
281
- return {
282
- cardProps: {
283
- ...$8EWFi$filterDOMProps(props),
284
- 'aria-labelledby': titleId,
285
- 'aria-describedby': descriptionId,
286
- tabIndex: 0
287
- },
288
- titleProps: titleProps,
289
- contentProps: contentProps
290
- };
291
- }
292
- /**
293
- * TODO: Add description of component here.
294
- */ const $643dd8fa80926f94$export$7a6ccaf429ad93a8 = /*#__PURE__*/ $8EWFi$react.forwardRef($643dd8fa80926f94$var$CardBase);
295
-
296
-
297
-
298
-
299
-
300
- var $e24fb79fb8b63230$exports = {};
301
- var $6cb102354c06de53$exports = {};
302
- $6cb102354c06de53$exports = JSON.parse("{\"loading\":\"جارٍ التحميل...\",\"loadingMore\":\"جارٍ تحميل المزيد...\"}");
303
-
304
-
305
- var $17b8c838d83f13fc$exports = {};
306
- $17b8c838d83f13fc$exports = JSON.parse("{\"loading\":\"Зареждане...\",\"loadingMore\":\"Зареждане на още...\"}");
307
-
308
-
309
- var $1ddb4e1a3e8b15a5$exports = {};
310
- $1ddb4e1a3e8b15a5$exports = JSON.parse("{\"loading\":\"Načítání...\",\"loadingMore\":\"Načítání dalších...\"}");
311
-
312
-
313
- var $44b7f17cd1f1db7f$exports = {};
314
- $44b7f17cd1f1db7f$exports = JSON.parse("{\"loading\":\"Indlæser ...\",\"loadingMore\":\"Indlæser flere ...\"}");
315
-
316
-
317
- var $ffa85bef2c730318$exports = {};
318
- $ffa85bef2c730318$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Mehr laden ...\"}");
319
-
320
-
321
- var $1904be2ca25ad4ef$exports = {};
322
- $1904be2ca25ad4ef$exports = JSON.parse("{\"loading\":\"Φόρτωση...\",\"loadingMore\":\"Φόρτωση περισσότερων...\"}");
323
-
324
-
325
- var $d120e7d3833466fb$exports = {};
326
- $d120e7d3833466fb$exports = JSON.parse("{\"loading\":\"Loading…\",\"loadingMore\":\"Loading more…\"}");
327
-
328
-
329
- var $fe39ef3292597d11$exports = {};
330
- $fe39ef3292597d11$exports = JSON.parse("{\"loading\":\"Cargando…\",\"loadingMore\":\"Cargando más…\"}");
331
-
332
-
333
- var $3204c020860ca192$exports = {};
334
- $3204c020860ca192$exports = JSON.parse("{\"loading\":\"Laadimine...\",\"loadingMore\":\"Laadi rohkem...\"}");
335
-
336
-
337
- var $5ced2ee930f1d61a$exports = {};
338
- $5ced2ee930f1d61a$exports = JSON.parse("{\"loading\":\"Ladataan…\",\"loadingMore\":\"Ladataan lisää…\"}");
339
-
340
-
341
- var $bd751114db2e8872$exports = {};
342
- $bd751114db2e8872$exports = JSON.parse("{\"loading\":\"Chargement...\",\"loadingMore\":\"Chargement supplémentaire...\"}");
343
-
344
-
345
- var $6291b4a5eb5146c5$exports = {};
346
- $6291b4a5eb5146c5$exports = JSON.parse("{\"loading\":\"טוען...\",\"loadingMore\":\"טוען עוד...\"}");
347
-
348
-
349
- var $cdc3f7b2aa8b1879$exports = {};
350
- $cdc3f7b2aa8b1879$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
351
-
352
-
353
- var $1a69968dcbcabdff$exports = {};
354
- $1a69968dcbcabdff$exports = JSON.parse("{\"loading\":\"Betöltés folyamatban…\",\"loadingMore\":\"Továbbiak betöltése folyamatban…\"}");
355
-
356
-
357
- var $fe72420090e5e44f$exports = {};
358
- $fe72420090e5e44f$exports = JSON.parse("{\"loading\":\"Caricamento...\",\"loadingMore\":\"Caricamento altri...\"}");
359
-
360
-
361
- var $8643fac062a08b30$exports = {};
362
- $8643fac062a08b30$exports = JSON.parse("{\"loading\":\"読み込み中...\",\"loadingMore\":\"さらに読み込み中...\"}");
363
-
364
-
365
- var $41f4de1d2f63c8f4$exports = {};
366
- $41f4de1d2f63c8f4$exports = JSON.parse("{\"loading\":\"로드 중\",\"loadingMore\":\"추가 로드 중\"}");
367
-
368
-
369
- var $9819c3a9877418b0$exports = {};
370
- $9819c3a9877418b0$exports = JSON.parse("{\"loading\":\"Įkeliama...\",\"loadingMore\":\"Įkeliama daugiau...\"}");
371
-
372
-
373
- var $3e8ad6b78b8cc064$exports = {};
374
- $3e8ad6b78b8cc064$exports = JSON.parse("{\"loading\":\"Notiek ielāde...\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
375
-
376
-
377
- var $baa4fb210e65a6c5$exports = {};
378
- $baa4fb210e65a6c5$exports = JSON.parse("{\"loading\":\"Laster inn ...\",\"loadingMore\":\"Laster inn flere ...\"}");
379
-
380
-
381
- var $ee123eda5b089b7d$exports = {};
382
- $ee123eda5b089b7d$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Meer laden...\"}");
383
-
384
-
385
- var $36a325cd1c9e414f$exports = {};
386
- $36a325cd1c9e414f$exports = JSON.parse("{\"loading\":\"Ładowanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
387
-
388
-
389
- var $52d4fd0f211d7e51$exports = {};
390
- $52d4fd0f211d7e51$exports = JSON.parse("{\"loading\":\"Carregando...\",\"loadingMore\":\"Carregando mais...\"}");
391
-
392
-
393
- var $ad1f55e36e4e9241$exports = {};
394
- $ad1f55e36e4e9241$exports = JSON.parse("{\"loading\":\"A carregar...\",\"loadingMore\":\"A carregar mais...\"}");
395
-
396
-
397
- var $bfc201ee55c5f26f$exports = {};
398
- $bfc201ee55c5f26f$exports = JSON.parse("{\"loading\":\"Se încarcă...\",\"loadingMore\":\"Se încarcă mai multe...\"}");
399
-
400
-
401
- var $5773113377d944b4$exports = {};
402
- $5773113377d944b4$exports = JSON.parse("{\"loading\":\"Загрузка...\",\"loadingMore\":\"Дополнительная загрузка...\"}");
403
-
404
-
405
- var $75167f0b339049be$exports = {};
406
- $75167f0b339049be$exports = JSON.parse("{\"loading\":\"Načítava sa...\",\"loadingMore\":\"Načítava sa viac...\"}");
407
-
408
-
409
- var $83a887ec3d5f2028$exports = {};
410
- $83a887ec3d5f2028$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje več vsebine...\"}");
411
-
412
-
413
- var $8352707b2eadbfb4$exports = {};
414
- $8352707b2eadbfb4$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
415
-
416
-
417
- var $212352f469058747$exports = {};
418
- $212352f469058747$exports = JSON.parse("{\"loading\":\"Läser in...\",\"loadingMore\":\"Läser in mer...\"}");
419
-
420
-
421
- var $334510787f8a69f9$exports = {};
422
- $334510787f8a69f9$exports = JSON.parse("{\"loading\":\"Yükleniyor...\",\"loadingMore\":\"Daha fazla yükleniyor...\"}");
423
-
424
-
425
- var $1b8fd2890c177825$exports = {};
426
- $1b8fd2890c177825$exports = JSON.parse("{\"loading\":\"Завантаження…\",\"loadingMore\":\"Завантаження інших об’єктів...\"}");
427
-
428
-
429
- var $88c83d794a7a062b$exports = {};
430
- $88c83d794a7a062b$exports = JSON.parse("{\"loading\":\"正在加载...\",\"loadingMore\":\"正在加载更多...\"}");
431
-
432
-
433
- var $b7e2865acb74a940$exports = {};
434
- $b7e2865acb74a940$exports = JSON.parse("{\"loading\":\"正在載入\",\"loadingMore\":\"正在載入更多…\"}");
435
-
436
-
437
- $e24fb79fb8b63230$exports = {
438
- "ar-AE": $6cb102354c06de53$exports,
439
- "bg-BG": $17b8c838d83f13fc$exports,
440
- "cs-CZ": $1ddb4e1a3e8b15a5$exports,
441
- "da-DK": $44b7f17cd1f1db7f$exports,
442
- "de-DE": $ffa85bef2c730318$exports,
443
- "el-GR": $1904be2ca25ad4ef$exports,
444
- "en-US": $d120e7d3833466fb$exports,
445
- "es-ES": $fe39ef3292597d11$exports,
446
- "et-EE": $3204c020860ca192$exports,
447
- "fi-FI": $5ced2ee930f1d61a$exports,
448
- "fr-FR": $bd751114db2e8872$exports,
449
- "he-IL": $6291b4a5eb5146c5$exports,
450
- "hr-HR": $cdc3f7b2aa8b1879$exports,
451
- "hu-HU": $1a69968dcbcabdff$exports,
452
- "it-IT": $fe72420090e5e44f$exports,
453
- "ja-JP": $8643fac062a08b30$exports,
454
- "ko-KR": $41f4de1d2f63c8f4$exports,
455
- "lt-LT": $9819c3a9877418b0$exports,
456
- "lv-LV": $3e8ad6b78b8cc064$exports,
457
- "nb-NO": $baa4fb210e65a6c5$exports,
458
- "nl-NL": $ee123eda5b089b7d$exports,
459
- "pl-PL": $36a325cd1c9e414f$exports,
460
- "pt-BR": $52d4fd0f211d7e51$exports,
461
- "pt-PT": $ad1f55e36e4e9241$exports,
462
- "ro-RO": $bfc201ee55c5f26f$exports,
463
- "ru-RU": $5773113377d944b4$exports,
464
- "sk-SK": $75167f0b339049be$exports,
465
- "sl-SI": $83a887ec3d5f2028$exports,
466
- "sr-SP": $8352707b2eadbfb4$exports,
467
- "sv-SE": $212352f469058747$exports,
468
- "tr-TR": $334510787f8a69f9$exports,
469
- "uk-UA": $1b8fd2890c177825$exports,
470
- "zh-CN": $88c83d794a7a062b$exports,
471
- "zh-TW": $b7e2865acb74a940$exports
472
- };
473
-
474
-
475
-
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
- function $81a52da995c19652$var$CardView(props, ref) {
484
- let { scale: scale } = $8EWFi$useProvider();
485
- let { styleProps: styleProps } = $8EWFi$useStyleProps(props);
486
- let domRef = $8EWFi$useDOMRef(ref);
487
- let { isQuiet: isQuiet , renderEmptyState: renderEmptyState , layout: layout , loadingState: loadingState , onLoadMore: onLoadMore , cardOrientation: cardOrientation = 'vertical' } = props;
488
- let collator = $8EWFi$useCollator({
489
- usage: 'search',
490
- sensitivity: 'base'
491
- });
492
- let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
493
- let cardViewLayout = $8EWFi$useMemo(()=>typeof layout === 'function' ? new layout({
494
- collator: collator,
495
- cardOrientation: cardOrientation,
496
- scale: scale
497
- }) : layout
498
- , [
499
- layout,
500
- collator,
501
- cardOrientation,
502
- scale
503
- ]);
504
- let layoutType = cardViewLayout.layoutType;
505
- let formatMessage = $8EWFi$useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($e24fb79fb8b63230$exports)));
506
- let { direction: direction } = $8EWFi$useLocale();
507
- let { collection: collection } = $8EWFi$useListState(props);
508
- let gridCollection = $8EWFi$useMemo(()=>new $8EWFi$GridCollection({
509
- columnCount: 1,
510
- items: [
511
- ...collection
512
- ].map((item)=>({
513
- // Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys
514
- ...item,
515
- hasChildNodes: true,
516
- childNodes: [
517
- {
518
- key: `cell-${item.key}`,
519
- type: 'cell',
520
- value: null,
521
- level: 0,
522
- rendered: null,
523
- textValue: item.textValue,
524
- hasChildNodes: false,
525
- childNodes: []
526
- }
527
- ]
528
- })
529
- )
530
- })
531
- , [
532
- collection
533
- ]);
534
- let state = $8EWFi$useGridState({
535
- ...props,
536
- selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,
537
- collection: gridCollection,
538
- focusMode: 'cell'
539
- });
540
- cardViewLayout.collection = gridCollection;
541
- cardViewLayout.disabledKeys = state.disabledKeys;
542
- cardViewLayout.isLoading = isLoading;
543
- cardViewLayout.direction = direction;
544
- let { gridProps: gridProps } = $8EWFi$useGrid({
545
- ...props,
546
- isVirtualized: true,
547
- keyboardDelegate: cardViewLayout
548
- }, state, domRef);
549
- let renderWrapper = (parent, reusableView)=>/*#__PURE__*/ $8EWFi$react.createElement($8EWFi$VirtualizerItem, {
550
- key: reusableView.key,
551
- reusableView: reusableView,
552
- parent: parent
553
- })
554
- ;
555
- let focusedKey = state.selectionManager.focusedKey;
556
- let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
557
- if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
558
- let margin = cardViewLayout.margin || 0;
559
- let virtualizer = cardViewLayout.virtualizer;
560
- let scrollToItem = $8EWFi$useCallback((key)=>{
561
- virtualizer && virtualizer.scrollToItem(key, {
562
- duration: 0,
563
- offsetY: margin
564
- });
565
- }, [
566
- margin,
567
- virtualizer
568
- ]);
569
- // TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
570
- return(/*#__PURE__*/ $8EWFi$react.createElement($8d180a244893de14$export$64992ac69f286e5c.Provider, {
571
- value: {
572
- state: state,
573
- isQuiet: isQuiet,
574
- layout: cardViewLayout,
575
- cardOrientation: cardOrientation
576
- }
577
- }, /*#__PURE__*/ $8EWFi$react.createElement($8EWFi$Virtualizer, {
578
- ...gridProps,
579
- ...styleProps,
580
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-CardView'),
581
- ref: domRef,
582
- focusedKey: focusedKey,
583
- scrollDirection: "vertical",
584
- layout: cardViewLayout,
585
- collection: gridCollection,
586
- isLoading: isLoading,
587
- onLoadMore: onLoadMore,
588
- renderWrapper: renderWrapper,
589
- transitionDuration: isLoading ? 160 : 220,
590
- scrollToItem: scrollToItem
591
- }, (type, item)=>{
592
- if (type === 'item') return(/*#__PURE__*/ $8EWFi$react.createElement($81a52da995c19652$var$InternalCard, {
593
- item: item
594
- }));
595
- else if (type === 'loader') return(/*#__PURE__*/ $8EWFi$react.createElement($81a52da995c19652$var$CenteredWrapper, null, /*#__PURE__*/ $8EWFi$react.createElement($8EWFi$ProgressCircle, {
596
- isIndeterminate: true,
597
- "aria-label": state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')
598
- })));
599
- else if (type === 'placeholder') {
600
- let emptyState = renderEmptyState ? renderEmptyState() : null;
601
- if (emptyState == null) return null;
602
- return(/*#__PURE__*/ $8EWFi$react.createElement($81a52da995c19652$var$CenteredWrapper, null, emptyState));
603
- }
604
- })));
605
- }
606
- function $81a52da995c19652$var$CenteredWrapper({ children: children }) {
607
- let { state: state } = $8d180a244893de14$export$fea0b38586ec8f13();
608
- return(/*#__PURE__*/ $8EWFi$react.createElement("div", {
609
- role: "row",
610
- "aria-rowindex": state.collection.size + 1,
611
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-CardView-centeredWrapper')
612
- }, /*#__PURE__*/ $8EWFi$react.createElement("div", {
613
- role: "gridcell"
614
- }, children)));
615
- }
616
- function $81a52da995c19652$var$InternalCard(props) {
617
- let { item: item } = props;
618
- let cellNode = [
619
- ...item.childNodes
620
- ][0];
621
- let { state: state , cardOrientation: cardOrientation , isQuiet: isQuiet , layout: layout } = $8d180a244893de14$export$fea0b38586ec8f13();
622
- let layoutType = layout.layoutType;
623
- let rowRef = $8EWFi$useRef();
624
- let cellRef = $8EWFi$useRef();
625
- let unwrappedRef = $8EWFi$useUnwrapDOMRef(cellRef);
626
- let { rowProps: rowProps } = $8EWFi$useGridRow({
627
- node: item,
628
- isVirtualized: true
629
- }, state, rowRef);
630
- let { gridCellProps: gridCellProps } = $8EWFi$useGridCell({
631
- node: cellNode,
632
- focusMode: 'cell'
633
- }, state, unwrappedRef);
634
- if (layoutType === 'grid' || layoutType === 'gallery') isQuiet = true;
635
- if (layoutType !== 'grid') cardOrientation = 'vertical';
636
- // We don't want to focus the checkbox (or any other focusable elements) within the Card
637
- // when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between
638
- // the cards in the CardView is handled by useGrid => useSelectableCollection instead.
639
- delete gridCellProps.onKeyDownCapture;
640
- return(/*#__PURE__*/ $8EWFi$react.createElement("div", {
641
- ...rowProps,
642
- ref: rowRef,
643
- className: $8EWFi$classNames((/*@__PURE__*/$parcel$interopDefault($408a78e5068502c2$exports)), 'spectrum-CardView-row')
644
- }, /*#__PURE__*/ $8EWFi$react.createElement($643dd8fa80926f94$export$7a6ccaf429ad93a8, {
645
- ref: cellRef,
646
- articleProps: gridCellProps,
647
- isQuiet: isQuiet,
648
- orientation: cardOrientation,
649
- item: item,
650
- layout: layoutType
651
- }, item.rendered)));
652
- }
653
- /**
654
- * TODO: Add description of component here.
655
- */ const $81a52da995c19652$export$7e52c821f7b6f422 = /*#__PURE__*/ $8EWFi$react.forwardRef($81a52da995c19652$var$CardView);
656
-
657
-
658
- var $c0ba81539c443916$exports = {};
659
-
660
- $parcel$export($c0ba81539c443916$exports, "GalleryLayout", () => $c0ba81539c443916$export$8e52095834484b61);
661
-
662
- class $3d424c147206bac9$export$64943d2e59d72a29 extends $8EWFi$Layout {
663
- validate(invalidationContext) {
664
- this.collection = this.virtualizer.collection;
665
- this.buildCollection(invalidationContext);
666
- // Remove layout info that doesn't exist in new collection
667
- if (this.lastCollection) {
668
- for (let key of this.lastCollection.getKeys())if (!this.collection.getItem(key)) this.layoutInfos.delete(key);
669
- if (!this.isLoading) this.layoutInfos.delete('loader');
670
- if (this.collection.size > 0) this.layoutInfos.delete('placeholder');
671
- }
672
- this.lastCollection = this.collection;
673
- }
674
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
675
- buildCollection(invalidationContext) {
676
- }
677
- getContentSize() {
678
- return this.contentSize;
679
- }
680
- getLayoutInfo(key) {
681
- return this.layoutInfos.get(key);
682
- }
683
- getVisibleLayoutInfos(rect) {
684
- let res = [];
685
- for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
686
- return res;
687
- }
688
- isVisible(layoutInfo, rect) {
689
- return layoutInfo.rect.intersects(rect);
690
- }
691
- getInitialLayoutInfo(layoutInfo) {
692
- layoutInfo.opacity = 0;
693
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
694
- return layoutInfo;
695
- }
696
- getFinalLayoutInfo(layoutInfo) {
697
- layoutInfo.opacity = 0;
698
- layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
699
- return layoutInfo;
700
- }
701
- _findClosestLayoutInfo(target, rect) {
702
- let layoutInfos = this.getVisibleLayoutInfos(rect);
703
- let best = null;
704
- let bestDistance = Infinity;
705
- // Calculates distance as the distance between the center of 2 rects.
706
- for (let cur of layoutInfos)if (cur.type === 'item') {
707
- let curRect = cur.rect;
708
- let targetMidX = (target.x + target.maxX) / 2;
709
- let targetMidY = (target.y + target.maxY) / 2;
710
- let curMidX = (curRect.x + curRect.maxX) / 2;
711
- let curMidY = (curRect.y + curRect.maxY) / 2;
712
- let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);
713
- if (dist < bestDistance) {
714
- best = cur;
715
- bestDistance = dist;
716
- }
717
- }
718
- return best;
719
- }
720
- _findClosest(target, rect) {
721
- let best = this._findClosestLayoutInfo(target, rect);
722
- return best || null;
723
- }
724
- getKeyBelow(key) {
725
- var ref, ref1;
726
- // Expected key is the currently focused cell so we need the parent row key
727
- let parentRowKey = this.collection.getItem(key).parentKey;
728
- let layoutInfo = this.getLayoutInfo(parentRowKey);
729
- let rect = new $8EWFi$Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
730
- let closestRow = this.collection.getItem((ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key);
731
- return (ref1 = closestRow === null || closestRow === void 0 ? void 0 : closestRow.childNodes[0]) === null || ref1 === void 0 ? void 0 : ref1.key;
732
- }
733
- getKeyAbove(key) {
734
- var ref, ref2;
735
- // Expected key is the currently focused cell so we need the parent row key
736
- let parentRowKey = this.collection.getItem(key).parentKey;
737
- let layoutInfo = this.getLayoutInfo(parentRowKey);
738
- let rect = new $8EWFi$Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
739
- let closestRow = this.collection.getItem((ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key);
740
- return (ref2 = closestRow === null || closestRow === void 0 ? void 0 : closestRow.childNodes[0]) === null || ref2 === void 0 ? void 0 : ref2.key;
741
- }
742
- getKeyRightOf(key) {
743
- // Expected key is the currently focused cell so we need the parent row key
744
- let parentRowKey = this.collection.getItem(key).parentKey;
745
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);
746
- while(key != null){
747
- let item = this.collection.getItem(key);
748
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
749
- if (item.type === 'item') return item.childNodes[0].key;
750
- key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);
751
- }
752
- }
753
- getKeyLeftOf(key) {
754
- // Expected key is the currently focused cell so we need the parent row key
755
- let parentRowKey = this.collection.getItem(key).parentKey;
756
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(parentRowKey) : this.collection.getKeyBefore(parentRowKey);
757
- while(key != null){
758
- let item = this.collection.getItem(key);
759
- // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
760
- if (item.type === 'item') return item.childNodes[0].key;
761
- key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
762
- }
763
- }
764
- getFirstKey() {
765
- let firstRow = this.collection.getItem(this.collection.getFirstKey());
766
- return firstRow.childNodes[0].key;
767
- }
768
- getLastKey() {
769
- let lastRow = this.collection.getItem(this.collection.getLastKey());
770
- return lastRow.childNodes[0].key;
771
- }
772
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
773
- // Perhaps have layoutInfo store childKey as well so we don't need to do this? Or maybe make the layoutInfos be the cells instead of the rows?
774
- getKeyPageAbove(key) {
775
- // Expected key is the currently focused cell so we need the parent row key
776
- let parentRowKey = this.collection.getItem(key).parentKey;
777
- let layoutInfo = this.getLayoutInfo(parentRowKey);
778
- if (layoutInfo) {
779
- var ref;
780
- let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);
781
- // If the node is so large that it spans multiple page heights, return the key of the item immediately above
782
- // Otherwise keep going up until we exceed a single page height worth of nodes
783
- let keyAbove = (ref = this.collection.getItem(this.getKeyAbove(key))) === null || ref === void 0 ? void 0 : ref.parentKey;
784
- layoutInfo = this.getLayoutInfo(keyAbove);
785
- if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
786
- var ref3;
787
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
788
- let keyAbove = (ref3 = this.collection.getItem(this.getKeyAbove(childKey))) === null || ref3 === void 0 ? void 0 : ref3.parentKey;
789
- layoutInfo = this.getLayoutInfo(keyAbove);
790
- }
791
- if (layoutInfo) {
792
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
793
- return childKey;
794
- }
795
- }
796
- return this.getFirstKey();
797
- }
798
- // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
799
- // Perhaps have layoutInfo store childKey as well so we don't need to do this?
800
- getKeyPageBelow(key) {
801
- // Expected key is the currently focused cell so we need the parent row key
802
- let parentRowKey = this.collection.getItem(key).parentKey;
803
- let layoutInfo = this.getLayoutInfo(parentRowKey);
804
- if (layoutInfo) {
805
- var ref;
806
- let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);
807
- // If the node is so large that it spans multiple page heights, return the key of the item immediately below
808
- // Otherwise keep going up until we exceed a single page height worth of nodes
809
- let keyBelow = (ref = this.collection.getItem(this.getKeyBelow(key))) === null || ref === void 0 ? void 0 : ref.parentKey;
810
- layoutInfo = this.getLayoutInfo(keyBelow);
811
- if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
812
- var ref4;
813
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
814
- let keyBelow = (ref4 = this.collection.getItem(this.getKeyBelow(childKey))) === null || ref4 === void 0 ? void 0 : ref4.parentKey;
815
- layoutInfo = this.getLayoutInfo(keyBelow);
816
- }
817
- if (layoutInfo) {
818
- let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
819
- return childKey;
820
- }
821
- }
822
- return this.getLastKey();
823
- }
824
- getKeyForSearch(search, fromKey) {
825
- if (!this.collator) return null;
826
- let collection = this.collection;
827
- let key = fromKey !== null && fromKey !== void 0 ? fromKey : this.getFirstKey();
828
- let startItem = collection.getItem(key);
829
- key = startItem.parentKey;
830
- while(key != null){
831
- let item = collection.getItem(key);
832
- if (item.textValue) {
833
- let substring = item.textValue.slice(0, search.length);
834
- if (this.collator.compare(substring, search) === 0) return [
835
- ...item.childNodes
836
- ][0].key;
837
- }
838
- key = this.collection.getKeyAfter(key);
839
- }
840
- return null;
841
- }
842
- constructor(options = {
843
- }){
844
- super();
845
- this.disabledKeys = new Set();
846
- this.layoutInfos = new Map();
847
- this.collator = options.collator;
848
- this.lastCollection = null;
849
- this.scale = options.scale || 'medium';
850
- this.margin = options.margin || 24;
851
- }
852
- }
853
-
854
-
855
-
856
- const $c0ba81539c443916$var$DEFAULT_OPTIONS = {
857
- S: {
858
- idealRowHeight: 112,
859
- minItemSize: new $8EWFi$Size(96, 96),
860
- itemSpacing: new $8EWFi$Size(8, 16),
861
- itemPadding: 24,
862
- dropSpacing: 50,
863
- margin: 8
864
- },
865
- L: {
866
- idealRowHeight: 208,
867
- minItemSize: new $8EWFi$Size(136, 136),
868
- itemSpacing: new $8EWFi$Size(18, 18),
869
- itemPadding: {
870
- 'medium': 78,
871
- 'large': 99
872
- },
873
- dropSpacing: 100,
874
- margin: 24
875
- }
876
- };
877
- class $c0ba81539c443916$export$8e52095834484b61 extends $3d424c147206bac9$export$64943d2e59d72a29 {
878
- get layoutType() {
879
- return 'gallery';
880
- }
881
- /**
882
- * Takes a row of widths and if there are any widths smaller than the min-width, leech width starting from
883
- * the widest in the row until it can't give anymore, then move to the second widest and so forth.
884
- * Do this until all assets meet the min-width.
885
- * */ _distributeWidths(widths) {
886
- // create a copy of the widths array and sort it largest to smallest
887
- let sortedWidths = widths.concat().sort((a, b)=>a[1] > b[1] ? -1 : 1
888
- );
889
- for (let width of widths)// for each width, if it's smaller than the min width
890
- if (width[1] < this.minItemSize.width) {
891
- // then figure out how much smaller
892
- let delta = this.minItemSize.width - width[1];
893
- for (let item of sortedWidths)// go from the largest width in the row to the smallest
894
- // if the width is greater than the min width
895
- if (widths[item[0]][1] > this.minItemSize.width) {
896
- // subtract the delta from the width, if it's still greater than the min width
897
- // then we have finished, subtract the delta permanently from that width
898
- if (widths[item[0]][1] - delta > this.minItemSize.width) {
899
- widths[item[0]][1] -= delta;
900
- delta = 0;
901
- break;
902
- } else {
903
- // otherwise, we take as much as we can from the current width and then move on to
904
- // the next largest and take some width from it
905
- let maxChange = widths[item[0]][1] - this.minItemSize.width;
906
- delta -= maxChange;
907
- widths[item[0]][1] -= maxChange;
908
- }
909
- }
910
- if (delta > 0) return false;
911
- // force the width to be the min width that we just rebalanced for
912
- width[1] = this.minItemSize.width;
913
- }
914
- return true;
915
- }
916
- buildCollection() {
917
- let visibleWidth = this.virtualizer.visibleRect.width;
918
- let visibleHeight = this.virtualizer.visibleRect.height;
919
- let y = this.margin;
920
- let availableWidth = visibleWidth - this.margin * 2;
921
- // If avaliable width is not greater than 0, skip node layout calculations
922
- if (availableWidth > 0) {
923
- // Compute aspect ratios for all of the items, and the total width if all items were on in a single row.
924
- let ratios = [];
925
- let totalWidth = 0;
926
- let minRatio = this.minItemSize.width / this.minItemSize.height;
927
- let maxRatio = availableWidth / this.minItemSize.height;
928
- for (let node of this.collection){
929
- let ratio = node.props.width / node.props.height;
930
- if (ratio < minRatio) ratio = minRatio;
931
- else if (ratio > maxRatio && ratio !== minRatio) ratio = maxRatio;
932
- let itemWidth = ratio * this.minItemSize.height;
933
- ratios.push(ratio);
934
- totalWidth += itemWidth;
935
- }
936
- totalWidth += this.itemSpacing.width * (this.collection.size - 1);
937
- // Determine how many rows we'll need, and partition the items into rows
938
- // using the aspect ratios as weights.
939
- let rows = Math.max(1, Math.ceil(totalWidth / availableWidth));
940
- // if the available width can't hold two items, then every item will get its own row
941
- // this leads to a faster run through linear partition and more dependable output for small row widths
942
- if (availableWidth <= this.minItemSize.width * 2 + this.itemPadding * 2) rows = this.collection.size;
943
- let weightedRatios = ratios.map((ratio)=>ratio < this.threshold ? ratio + 0.5 * (1 / ratio) : ratio
944
- );
945
- let partition = $c0ba81539c443916$var$linearPartition(weightedRatios, rows);
946
- let index = 0;
947
- for (let row of partition){
948
- // Compute the total weight for this row
949
- let totalWeight = 0;
950
- for(let j = index; j < index + row.length; j++)totalWeight += ratios[j];
951
- // Determine the row height based on the total available width and weight of this row.
952
- let bestRowHeight = (availableWidth - (row.length - 1) * this.itemSpacing.width) / totalWeight;
953
- // if this is the last row and the row height is >2x the ideal row height, then cap to the ideal height
954
- // probably doing this because if the last row has one extremely tall image, then the row becomes huge
955
- // though that can happen anywhere if a row has lots of tall images... so i'm not sure why this one matters
956
- if (row === partition[partition.length - 1] && bestRowHeight > this.idealRowHeight * 2) bestRowHeight = this.idealRowHeight;
957
- let itemHeight = Math.round(bestRowHeight) + this.itemPadding;
958
- let x = this.margin;
959
- // if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
960
- let widths = [];
961
- for(let j1 = index; j1 < index + row.length; j1++){
962
- let width = Math.round(bestRowHeight * ratios[j1]);
963
- widths.push([
964
- j1 - index,
965
- width
966
- ]);
967
- }
968
- this._distributeWidths(widths);
969
- // Create items for this row.
970
- for(let j2 = index; j2 < index + row.length; j2++){
971
- let node = this.collection.rows[j2];
972
- let itemWidth = Math.max(widths[j2 - index][1], this.minItemSize.width);
973
- let rect = new $8EWFi$Rect(x, y, itemWidth, itemHeight);
974
- let layoutInfo = new $8EWFi$LayoutInfo(node.type, node.key, rect);
975
- layoutInfo.allowOverflow = true;
976
- this.layoutInfos.set(node.key, layoutInfo);
977
- x += itemWidth + this.itemSpacing.width;
978
- }
979
- y += itemHeight + this.itemSpacing.height;
980
- index += row.length;
981
- }
982
- if (this.isLoading) {
983
- let loaderY = y;
984
- let loaderHeight = 60;
985
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
986
- // so it doesn't scroll
987
- if (this.collection.size === 0) {
988
- loaderY = 0;
989
- loaderHeight = visibleHeight || 60;
990
- }
991
- let rect = new $8EWFi$Rect(0, loaderY, visibleWidth, loaderHeight);
992
- let loader = new $8EWFi$LayoutInfo('loader', 'loader', rect);
993
- this.layoutInfos.set('loader', loader);
994
- y = loader.rect.maxY;
995
- }
996
- if (this.collection.size === 0 && !this.isLoading) {
997
- let rect = new $8EWFi$Rect(0, 0, visibleWidth, visibleHeight);
998
- let placeholder = new $8EWFi$LayoutInfo('placeholder', 'placeholder', rect);
999
- this.layoutInfos.set('placeholder', placeholder);
1000
- y = placeholder.rect.maxY;
1001
- }
1002
- }
1003
- this.contentSize = new $8EWFi$Size(visibleWidth, y);
1004
- }
1005
- constructor(options = {
1006
- }){
1007
- super(options);
1008
- let cardSize = 'L';
1009
- this.idealRowHeight = options.idealRowHeight || $c0ba81539c443916$var$DEFAULT_OPTIONS[cardSize].idealRowHeight;
1010
- this.itemSpacing = options.itemSpacing || $c0ba81539c443916$var$DEFAULT_OPTIONS[cardSize].itemSpacing;
1011
- this.itemPadding = options.itemPadding != null ? options.itemPadding : $c0ba81539c443916$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.scale];
1012
- this.minItemSize = options.minItemSize || $c0ba81539c443916$var$DEFAULT_OPTIONS[cardSize].minItemSize;
1013
- this.threshold = options.threshold || 1;
1014
- this.margin = options.margin != null ? options.margin : $c0ba81539c443916$var$DEFAULT_OPTIONS[cardSize].margin;
1015
- }
1016
- }
1017
- // https://www8.cs.umu.se/kurser/TDBA77/VT06/algorithms/BOOK/BOOK2/NODE45.HTM
1018
- function $c0ba81539c443916$var$linearPartition(seq, k) {
1019
- let n = seq.length;
1020
- if (k <= 0) return [];
1021
- if (k >= n) return seq.map((x)=>[
1022
- x
1023
- ]
1024
- );
1025
- if (n === 1) return [
1026
- seq
1027
- ];
1028
- let table = Array(n).fill(0).map(()=>Array(k).fill(0)
1029
- );
1030
- let solution = Array(n - 1).fill(0).map(()=>Array(k - 1).fill(0)
1031
- );
1032
- for(let i = 0; i < n; i++)table[i][0] = seq[i] + (i > 0 ? table[i - 1][0] : 0);
1033
- for(let i1 = 0; i1 < k; i1++)table[0][i1] = seq[0];
1034
- for(let i2 = 1; i2 < n; i2++)for(let j = 1; j < k; j++){
1035
- let currentMin = 0;
1036
- let minX = Infinity;
1037
- for(let x = 0; x < i2; x++){
1038
- let c1 = table[x][j - 1];
1039
- let c2 = table[i2][0] - table[x][0];
1040
- let cost = Math.max(c1, c2);
1041
- if (!x || cost < currentMin) {
1042
- currentMin = cost;
1043
- minX = x;
1044
- }
1045
- }
1046
- table[i2][j] = currentMin;
1047
- solution[i2 - 1][j - 1] = minX;
1048
- }
1049
- n = n - 1;
1050
- k = k - 2;
1051
- let result = [];
1052
- while(k >= 0){
1053
- if (n >= 1) {
1054
- let row = [];
1055
- for(let i = solution[n - 1][k] + 1; i < n + 1; i++)row.push(seq[i]);
1056
- result.unshift(row);
1057
- n = solution[n - 1][k];
1058
- }
1059
- k--;
1060
- }
1061
- let row = [];
1062
- for(let i3 = 0; i3 < n + 1; i3++)row.push(seq[i3]);
1063
- result.unshift(row);
1064
- return result;
1065
- }
1066
-
1067
-
1068
- var $ed42fd44b9b9b664$exports = {};
1069
-
1070
- $parcel$export($ed42fd44b9b9b664$exports, "GridLayout", () => $ed42fd44b9b9b664$export$7d2b12578154a735);
1071
-
1072
-
1073
- const $ed42fd44b9b9b664$var$DEFAULT_OPTIONS = {
1074
- S: {
1075
- itemPadding: 20,
1076
- minItemSize: {
1077
- 'vertical': new $8EWFi$Size(96, 96)
1078
- },
1079
- maxItemSize: new $8EWFi$Size(Infinity, Infinity),
1080
- margin: 8,
1081
- minSpace: new $8EWFi$Size(6, 6),
1082
- maxColumns: Infinity,
1083
- dropSpacing: 50
1084
- },
1085
- L: {
1086
- itemPadding: {
1087
- 'vertical': {
1088
- 'medium': 78,
1089
- 'large': 98
1090
- },
1091
- 'horizontal': {
1092
- 'medium': 150,
1093
- 'large': 170
1094
- }
1095
- },
1096
- minItemSize: {
1097
- 'vertical': new $8EWFi$Size(208, 208),
1098
- 'horizontal': new $8EWFi$Size(102, 102)
1099
- },
1100
- maxItemSize: new $8EWFi$Size(Infinity, Infinity),
1101
- margin: 24,
1102
- minSpace: new $8EWFi$Size(18, 18),
1103
- maxColumns: Infinity,
1104
- dropSpacing: 100
1105
- }
1106
- };
1107
- class $ed42fd44b9b9b664$export$7d2b12578154a735 extends $3d424c147206bac9$export$64943d2e59d72a29 {
1108
- get layoutType() {
1109
- return 'grid';
1110
- }
1111
- getIndexAtPoint(x, y, allowInsertingAtEnd = false) {
1112
- let itemHeight = this.itemSize.height + this.minSpace.height;
1113
- let itemWidth = this.itemSize.width + this.horizontalSpacing;
1114
- return Math.max(0, Math.min(this.collection.size - (allowInsertingAtEnd ? 0 : 1), Math.floor(y / itemHeight) * this.numColumns + Math.floor((x - this.horizontalSpacing) / itemWidth)));
1115
- }
1116
- getVisibleLayoutInfos(rect) {
1117
- let res = [];
1118
- let numItems = this.collection.size;
1119
- if (numItems <= 0 || !this.itemSize) // If there aren't any items in the collection, we are in a loader/placeholder state. Return those layoutInfos as
1120
- // the currently visible items
1121
- {
1122
- if (this.layoutInfos.size > 0) {
1123
- for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
1124
- }
1125
- } else {
1126
- // The approach from v2 uses indexes where other v3 layouts iterate through every node/root node. This feels more efficient
1127
- let firstVisibleItem = this.getIndexAtPoint(rect.x, rect.y);
1128
- let lastVisibleItem = this.getIndexAtPoint(rect.maxX, rect.maxY);
1129
- for(let index = firstVisibleItem; index <= lastVisibleItem; index++){
1130
- let keyFromIndex = this.collection.rows[index].key;
1131
- let layoutInfo = this.layoutInfos.get(keyFromIndex);
1132
- if (layoutInfo && this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
1133
- }
1134
- // Check if loader is in view and add to res if so
1135
- let loader = this.layoutInfos.get('loader');
1136
- if (loader && this.isVisible(loader, rect)) res.push(loader);
1137
- }
1138
- return res;
1139
- }
1140
- buildCollection() {
1141
- let visibleWidth = this.virtualizer.visibleRect.width;
1142
- let visibleHeight = this.virtualizer.visibleRect.height;
1143
- let horizontalItemPadding = this.cardOrientation === 'horizontal' ? this.itemPadding : 0;
1144
- let verticalItemPadding = this.cardOrientation === 'vertical' ? this.itemPadding : 0;
1145
- let minCardWidth = this.minItemSize.width + horizontalItemPadding;
1146
- // Compute the number of rows and columns needed to display the content
1147
- let availableWidth = visibleWidth - this.margin * 2;
1148
- let columns = Math.floor((availableWidth + this.minSpace.width) / (minCardWidth + this.minSpace.width));
1149
- this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
1150
- this.numRows = Math.ceil(this.collection.size / this.numColumns);
1151
- // Compute the available width (minus the space between items)
1152
- let width = availableWidth - this.minSpace.width * Math.max(0, this.numColumns - 1);
1153
- // Compute the item width based on the space available
1154
- let itemWidth = Math.floor(width / this.numColumns);
1155
- itemWidth = Math.max(minCardWidth, Math.min(this.maxItemSize.width, itemWidth));
1156
- // Compute the item height, which is proportional to the item width
1157
- let t = (itemWidth - minCardWidth) / minCardWidth;
1158
- let itemHeight = Math.floor(this.minItemSize.height + this.minItemSize.height * t);
1159
- itemHeight = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, itemHeight)) + verticalItemPadding;
1160
- this.itemSize = new $8EWFi$Size(itemWidth, itemHeight);
1161
- // Compute the horizontal spacing and content height
1162
- this.horizontalSpacing = this.numColumns < 2 ? 0 : Math.floor((availableWidth - this.numColumns * this.itemSize.width) / (this.numColumns - 1));
1163
- let y = this.margin;
1164
- let index = 0;
1165
- for (let node of this.collection){
1166
- let layoutInfo = this.buildChild(node, y, index);
1167
- y = layoutInfo.rect.maxY;
1168
- index++;
1169
- }
1170
- if (this.isLoading) {
1171
- let loaderY = y;
1172
- let loaderHeight = 60;
1173
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
1174
- // so it doesn't scroll
1175
- if (this.collection.size === 0) {
1176
- loaderY = 0;
1177
- loaderHeight = visibleHeight || 60;
1178
- }
1179
- let rect = new $8EWFi$Rect(0, loaderY, visibleWidth, loaderHeight);
1180
- let loader = new $8EWFi$LayoutInfo('loader', 'loader', rect);
1181
- this.layoutInfos.set('loader', loader);
1182
- y = loader.rect.maxY;
1183
- }
1184
- if (this.collection.size === 0 && !this.isLoading) {
1185
- let rect = new $8EWFi$Rect(0, 0, visibleWidth, visibleHeight);
1186
- let placeholder = new $8EWFi$LayoutInfo('placeholder', 'placeholder', rect);
1187
- this.layoutInfos.set('placeholder', placeholder);
1188
- y = placeholder.rect.maxY;
1189
- }
1190
- this.contentSize = new $8EWFi$Size(visibleWidth, y);
1191
- }
1192
- buildChild(node, y, index) {
1193
- let row = Math.floor(index / this.numColumns);
1194
- let column = index % this.numColumns;
1195
- let x = this.margin + column * (this.itemSize.width + this.horizontalSpacing);
1196
- y = this.margin + row * (this.itemSize.height + this.minSpace.height);
1197
- let rect = new $8EWFi$Rect(x, y, this.itemSize.width, this.itemSize.height);
1198
- // TODO: Perhaps have it so that the child key for each row is stored with the layoutInfo?
1199
- let layoutInfo = new $8EWFi$LayoutInfo(node.type, node.key, rect);
1200
- layoutInfo.allowOverflow = true;
1201
- this.layoutInfos.set(node.key, layoutInfo);
1202
- return layoutInfo;
1203
- }
1204
- // Since the collection doesn't represent the visual layout, need to calculate what row and column the current key is in,
1205
- // then return the key that occupies the row + column below. This can be done by figuring out how many cards exist per column then dividing the
1206
- // collection contents by that number (which will give us the row distribution)
1207
- getKeyBelow(key) {
1208
- var ref;
1209
- // Expected key is the currently focused cell so we need the parent row key
1210
- let parentRowKey = this.collection.getItem(key).parentKey;
1211
- let indexRowBelow;
1212
- let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
1213
- );
1214
- if (index !== -1) indexRowBelow = index + this.numColumns;
1215
- else return null;
1216
- return ((ref = this.collection.rows[indexRowBelow]) === null || ref === void 0 ? void 0 : ref.childNodes[0].key) || null;
1217
- }
1218
- getKeyAbove(key) {
1219
- var ref;
1220
- // Expected key is the currently focused cell so we need the parent row key
1221
- let parentRowKey = this.collection.getItem(key).parentKey;
1222
- let indexRowAbove;
1223
- let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
1224
- );
1225
- if (index !== -1) indexRowAbove = index - this.numColumns;
1226
- else return null;
1227
- return ((ref = this.collection.rows[indexRowAbove]) === null || ref === void 0 ? void 0 : ref.childNodes[0].key) || null;
1228
- }
1229
- constructor(options = {
1230
- }){
1231
- super(options);
1232
- let cardSize = 'L';
1233
- this.cardOrientation = options.cardOrientation || 'vertical';
1234
- this.minItemSize = options.minItemSize || $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].minItemSize[this.cardOrientation];
1235
- this.maxItemSize = options.maxItemSize || $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].maxItemSize;
1236
- this.margin = options.margin != null ? options.margin : $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].margin;
1237
- this.minSpace = options.minSpace || $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].minSpace;
1238
- this.maxColumns = options.maxColumns || $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].maxColumns;
1239
- this.itemPadding = options.itemPadding != null ? options.itemPadding : $ed42fd44b9b9b664$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.cardOrientation][this.scale];
1240
- this.itemSize = null;
1241
- this.numColumns = 0;
1242
- this.numRows = 0;
1243
- this.horizontalSpacing = 0;
1244
- }
1245
- }
1246
-
1247
-
1248
- var $03278f8d0f6860bb$exports = {};
1249
-
1250
- $parcel$export($03278f8d0f6860bb$exports, "WaterfallLayout", () => $03278f8d0f6860bb$export$e9f7cda058ba8df8);
1251
-
1252
-
1253
- class $03278f8d0f6860bb$export$e9f7cda058ba8df8 extends $3d424c147206bac9$export$64943d2e59d72a29 {
1254
- get layoutType() {
1255
- return 'waterfall';
1256
- }
1257
- buildCollection(invalidationContext) {
1258
- // Compute the number of columns needed to display the content
1259
- let visibleWidth = this.virtualizer.visibleRect.width;
1260
- let availableWidth = visibleWidth - this.margin * 2;
1261
- let columns = Math.floor((availableWidth + this.minSpace.width) / (this.minItemSize.width + this.minSpace.width));
1262
- this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
1263
- // Compute the available width (minus the space between items)
1264
- let width = availableWidth - this.minSpace.width * (this.numColumns - 1);
1265
- // Compute the item width based on the space available
1266
- let itemWidth = Math.round(width / this.numColumns);
1267
- itemWidth = Math.max(this.minItemSize.width, Math.min(this.maxItemSize.width, itemWidth));
1268
- this.itemWidth = itemWidth;
1269
- // Compute the horizontal spacing
1270
- // if only one column, we cannot divide by zero, so set it to 1
1271
- let horizontalSpacing = Math.round((availableWidth - this.numColumns * itemWidth) / Math.max(1, this.numColumns - 1));
1272
- this.horizontalSpacing = horizontalSpacing;
1273
- // Setup an array of column heights
1274
- let columnHeights = Array(this.numColumns).fill(this.margin);
1275
- for (let node of this.collection){
1276
- let key = node.key;
1277
- // Compute the height of the item. Use the existing height if available,
1278
- // otherwise call the delegate to estimate the size.
1279
- let oldLayoutInfo = this.layoutInfos.get(key);
1280
- let height;
1281
- let estimatedSize = true;
1282
- if (oldLayoutInfo) {
1283
- height = oldLayoutInfo.rect.height;
1284
- estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize;
1285
- } else if (node.props.width && node.props.height) {
1286
- let nodeWidth = node.props.width;
1287
- let nodeHeight = node.props.height;
1288
- let scaledHeight = Math.round(nodeHeight * (itemWidth / nodeWidth));
1289
- height = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, scaledHeight));
1290
- } else height = itemWidth;
1291
- // Figure out which column to place the item in, and compute its position.
1292
- let column = this.getNextColumnIndex(columnHeights);
1293
- let x = this.margin + column * (itemWidth + horizontalSpacing);
1294
- let y = columnHeights[column];
1295
- let rect = new $8EWFi$Rect(x, y, itemWidth, height);
1296
- let layoutInfo = new $8EWFi$LayoutInfo(node.type, key, rect);
1297
- layoutInfo.estimatedSize = estimatedSize;
1298
- layoutInfo.allowOverflow = true;
1299
- this.layoutInfos.set(key, layoutInfo);
1300
- // TODO: From v2 figure out this bit, when does this get called and what to replace this.collectionView._transaction with?
1301
- // Removing it from v2 doesn't seem to do anything?
1302
- // if (layoutInfo.estimatedSize && !invalidationContext.contentChanged && !this.collectionView._transaction) {
1303
- // this.updateItemSize(new IndexPath(section, i));
1304
- // }
1305
- columnHeights[column] += layoutInfo.rect.height + this.minSpace.height;
1306
- }
1307
- // Reset all columns to the maximum for the next section
1308
- let maxHeight = Math.max.apply(Math, columnHeights) - this.minSpace.height + this.margin;
1309
- columnHeights.fill(maxHeight);
1310
- let y = columnHeights[0];
1311
- if (this.isLoading) {
1312
- let loaderY = y;
1313
- let loaderHeight = 60;
1314
- // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
1315
- // so it doesn't scroll
1316
- if (this.collection.size === 0) {
1317
- loaderY = 0;
1318
- loaderHeight = this.virtualizer.visibleRect.height || 60;
1319
- }
1320
- let rect = new $8EWFi$Rect(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
1321
- let loader = new $8EWFi$LayoutInfo('loader', 'loader', rect);
1322
- this.layoutInfos.set('loader', loader);
1323
- y = loader.rect.maxY;
1324
- }
1325
- if (this.collection.size === 0 && !this.isLoading) {
1326
- let rect = new $8EWFi$Rect(0, 0, this.virtualizer.visibleRect.width, this.virtualizer.visibleRect.height);
1327
- let placeholder = new $8EWFi$LayoutInfo('placeholder', 'placeholder', rect);
1328
- this.layoutInfos.set('placeholder', placeholder);
1329
- y = placeholder.rect.maxY;
1330
- }
1331
- this.contentSize = new $8EWFi$Size(this.virtualizer.visibleRect.width, y);
1332
- }
1333
- updateItemSize(key, size) {
1334
- let layoutInfo = this.layoutInfos.get(key);
1335
- if (!size || !layoutInfo) return false;
1336
- if (size.height !== layoutInfo.rect.height) {
1337
- // TODO: also not sure about copying layout info vs mutating it. Listlayout does the below
1338
- // but I feel that is because it actually maintained a layoutNode map cache which this doesn't have
1339
- let newLayoutInfo = layoutInfo.copy();
1340
- newLayoutInfo.rect.height = size.height < 600 ? size.height : 600;
1341
- newLayoutInfo.estimatedSize = false;
1342
- this.layoutInfos.set(key, newLayoutInfo);
1343
- return true;
1344
- }
1345
- return false;
1346
- }
1347
- getNextColumnIndex(columnHeights) {
1348
- let minIndex = 0;
1349
- for(let i = 0; i < columnHeights.length; i++)if (columnHeights[i] < columnHeights[minIndex]) minIndex = i;
1350
- return minIndex;
1351
- }
1352
- getClosestRight(key) {
1353
- var ref, ref1, ref2;
1354
- let layoutInfo = this.getLayoutInfo(key);
1355
- // Refactored from v2. Current strategy is to find the closest card in the adjacent column.
1356
- // This prevent the issue where it was possible that the closest layoutInfo would be two columns over due to the middle card being exceptionally tall
1357
- // and thus the top corner to top corner distance was massive.
1358
- // First look for a card to the immediate right of the current card. If we can't find any, look for the nearest card in the entire column to the right of the card
1359
- let rect = new $8EWFi$Rect(layoutInfo.rect.maxX + 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
1360
- key = (ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key;
1361
- if (!key) {
1362
- var ref3;
1363
- rect = new $8EWFi$Rect(layoutInfo.rect.maxX + 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
1364
- key = (ref3 = this._findClosest(layoutInfo.rect, rect)) === null || ref3 === void 0 ? void 0 : ref3.key;
1365
- }
1366
- return (ref2 = (ref1 = this.collection.getItem(key)) === null || ref1 === void 0 ? void 0 : ref1.childNodes[0]) === null || ref2 === void 0 ? void 0 : ref2.key;
1367
- }
1368
- getClosestLeft(key) {
1369
- var ref, ref4, ref5;
1370
- let layoutInfo = this.getLayoutInfo(key);
1371
- // First look for a card to the immediate left of the current card. If we can't find any, look for the nearest card in the entire column to the left of the card
1372
- let rect = new $8EWFi$Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
1373
- key = (ref = this._findClosest(layoutInfo.rect, rect)) === null || ref === void 0 ? void 0 : ref.key;
1374
- if (!key) {
1375
- var ref6;
1376
- rect = new $8EWFi$Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
1377
- key = (ref6 = this._findClosest(layoutInfo.rect, rect)) === null || ref6 === void 0 ? void 0 : ref6.key;
1378
- }
1379
- return (ref5 = (ref4 = this.collection.getItem(key)) === null || ref4 === void 0 ? void 0 : ref4.childNodes[0]) === null || ref5 === void 0 ? void 0 : ref5.key;
1380
- }
1381
- getKeyRightOf(key) {
1382
- // Expected key is the currently focused cell so we need the parent row key
1383
- let parentRowKey = this.collection.getItem(key).parentKey;
1384
- return this.direction === 'rtl' ? this.getClosestLeft(parentRowKey) : this.getClosestRight(parentRowKey);
1385
- }
1386
- getKeyLeftOf(key) {
1387
- // Expected key is the currently focused cell so we need the parent row key
1388
- let parentRowKey = this.collection.getItem(key).parentKey;
1389
- return this.direction === 'rtl' ? this.getClosestRight(parentRowKey) : this.getClosestLeft(parentRowKey);
1390
- }
1391
- constructor(options = {
1392
- }){
1393
- // TODO: WaterfallLayout doesn't use card size in v2, but perhaps it should support it? Perhaps it would modify
1394
- // minItemSize defaults or other things
1395
- super(options);
1396
- this.minItemSize = options.minItemSize || new $8EWFi$Size(240, 136);
1397
- this.maxItemSize = options.maxItemSize || new $8EWFi$Size(Infinity, Infinity);
1398
- this.margin = options.margin != null ? options.margin : 24;
1399
- this.minSpace = options.minSpace || new $8EWFi$Size(18, 18);
1400
- this.maxColumns = options.maxColumns || Infinity;
1401
- this.itemWidth = 0;
1402
- this.numColumns = 0;
1403
- this.lastCollection = null;
1404
- this.collator = options.collator;
1405
- }
1406
- }
1407
-
1408
-
1409
- var $d2d1c099b89e366a$exports = {};
1410
-
1411
- $parcel$export($d2d1c099b89e366a$exports, "Card", () => $d2d1c099b89e366a$export$60332b2344f7fe41);
1412
-
1413
-
1414
-
1415
- let $d2d1c099b89e366a$var$Card = /*#__PURE__*/ $8EWFi$forwardRef((props, ref)=>{
1416
- let context = $8d180a244893de14$export$fea0b38586ec8f13();
1417
- if (context !== null) return null;
1418
- else return(/*#__PURE__*/ $8EWFi$react.createElement($643dd8fa80926f94$export$7a6ccaf429ad93a8, {
1419
- ...props,
1420
- ref: ref
1421
- }));
1422
- });
1423
- // @ts-ignore
1424
- $d2d1c099b89e366a$var$Card.getCollectionNode = function* getCollectionNode(props) {
1425
- let { children: children , textValue: textValue } = props;
1426
- yield {
1427
- type: 'item',
1428
- props: props,
1429
- rendered: children,
1430
- 'aria-label': props['aria-label'],
1431
- hasChildNodes: false,
1432
- textValue: textValue
1433
- };
1434
- };
1435
- let $d2d1c099b89e366a$export$60332b2344f7fe41 = $d2d1c099b89e366a$var$Card;
1436
-
1437
-
1438
-
1439
-
1440
25
  export {$81a52da995c19652$export$7e52c821f7b6f422 as CardView, $c0ba81539c443916$export$8e52095834484b61 as GalleryLayout, $ed42fd44b9b9b664$export$7d2b12578154a735 as GridLayout, $03278f8d0f6860bb$export$e9f7cda058ba8df8 as WaterfallLayout, $d2d1c099b89e366a$export$60332b2344f7fe41 as Card};
1441
26
  //# sourceMappingURL=module.js.map