@react-spectrum/card 3.0.0-alpha.31 → 3.0.0-alpha.32

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