@react-spectrum/card 3.0.0-alpha.1 → 3.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.css +1 -2
- package/dist/main.js +1296 -1598
- package/dist/main.js.map +1 -1
- package/dist/module.js +1277 -1510
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +8 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/Card.tsx +5 -8
- package/src/CardBase.tsx +17 -59
- package/src/CardView.tsx +4 -0
- package/src/GalleryLayout.tsx +90 -88
- package/src/WaterfallLayout.tsx +5 -14
- package/dist/main.css.map +0 -1
package/dist/main.js
CHANGED
|
@@ -1,1750 +1,1448 @@
|
|
|
1
|
-
var {
|
|
2
|
-
Layout,
|
|
3
|
-
Rect,
|
|
4
|
-
LayoutInfo,
|
|
5
|
-
Size
|
|
6
|
-
} = require("@react-stately/virtualizer");
|
|
7
|
-
|
|
8
|
-
var {
|
|
9
|
-
Virtualizer,
|
|
10
|
-
VirtualizerItem
|
|
11
|
-
} = require("@react-aria/virtualizer");
|
|
12
|
-
|
|
13
|
-
var {
|
|
14
|
-
useListState
|
|
15
|
-
} = require("@react-stately/list");
|
|
16
|
-
|
|
17
|
-
var {
|
|
18
|
-
useGrid,
|
|
19
|
-
useGridCell,
|
|
20
|
-
useGridRow
|
|
21
|
-
} = require("@react-aria/grid");
|
|
22
|
-
|
|
23
|
-
var {
|
|
24
|
-
useCollator,
|
|
25
|
-
useLocale,
|
|
26
|
-
useMessageFormatter
|
|
27
|
-
} = require("@react-aria/i18n");
|
|
28
|
-
|
|
29
|
-
var {
|
|
30
|
-
ProgressCircle
|
|
31
|
-
} = require("@react-spectrum/progress");
|
|
32
|
-
|
|
33
|
-
var {
|
|
34
|
-
GridCollection,
|
|
35
|
-
useGridState
|
|
36
|
-
} = require("@react-stately/grid");
|
|
37
|
-
|
|
38
|
-
var {
|
|
39
|
-
useProviderProps,
|
|
40
|
-
useProvider
|
|
41
|
-
} = require("@react-spectrum/provider");
|
|
42
|
-
|
|
43
|
-
var {
|
|
44
|
-
useFocusWithin,
|
|
45
|
-
useHover
|
|
46
|
-
} = require("@react-aria/interactions");
|
|
47
|
-
|
|
48
|
-
var _react2 = require("react");
|
|
49
|
-
|
|
50
|
-
var _react = $parcel$interopDefault(_react2);
|
|
51
|
-
|
|
52
|
-
var {
|
|
53
|
-
useCallback,
|
|
54
|
-
useMemo,
|
|
55
|
-
useRef,
|
|
56
|
-
useState,
|
|
57
|
-
useContext,
|
|
58
|
-
forwardRef
|
|
59
|
-
} = _react2;
|
|
60
|
-
|
|
61
|
-
var {
|
|
62
|
-
FocusRing
|
|
63
|
-
} = require("@react-aria/focus");
|
|
64
|
-
|
|
65
|
-
var {
|
|
66
|
-
filterDOMProps,
|
|
67
|
-
mergeProps,
|
|
68
|
-
useLayoutEffect,
|
|
69
|
-
useResizeObserver,
|
|
70
|
-
useSlotId
|
|
71
|
-
} = require("@react-aria/utils");
|
|
72
|
-
|
|
73
|
-
var {
|
|
74
|
-
Divider
|
|
75
|
-
} = require("@react-spectrum/divider");
|
|
76
|
-
|
|
77
|
-
var {
|
|
78
|
-
classNames,
|
|
79
|
-
SlotProvider,
|
|
80
|
-
useDOMRef,
|
|
81
|
-
useHasChild,
|
|
82
|
-
useStyleProps,
|
|
83
|
-
useUnwrapDOMRef
|
|
84
|
-
} = require("@react-spectrum/utils");
|
|
85
|
-
|
|
86
|
-
var {
|
|
87
|
-
Checkbox
|
|
88
|
-
} = require("@react-spectrum/checkbox");
|
|
89
|
-
|
|
90
|
-
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
|
|
91
|
-
|
|
92
|
-
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
|
93
|
-
|
|
94
1
|
require("./main.css");
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var $
|
|
102
|
-
$
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"spectrum-Card-image": "_spectrum-Card-image_dd040",
|
|
114
|
-
"spectrum-Card-illustration": "_spectrum-Card-illustration_dd040",
|
|
115
|
-
"spectrum-Card-avatar": "_spectrum-Card-avatar_dd040",
|
|
116
|
-
"spectrum-Card-detail": "_spectrum-Card-detail_dd040",
|
|
117
|
-
"spectrum-Card-actions": "_spectrum-Card-actions_dd040",
|
|
118
|
-
"spectrum-Card-content": "_spectrum-Card-content_dd040",
|
|
119
|
-
"spectrum-Card-divider": "_spectrum-Card-divider_dd040",
|
|
120
|
-
"spectrum-Card-footer": "_spectrum-Card-footer_dd040",
|
|
121
|
-
"spectrum-Card--waterfall": "_spectrum-Card--waterfall_dd040",
|
|
122
|
-
"spectrum-Card--default": "_spectrum-Card--default_dd040",
|
|
123
|
-
"spectrum-Card--noPreview": "_spectrum-Card--noPreview_dd040",
|
|
124
|
-
"spectrum-Card--grid": "_spectrum-Card--grid_dd040",
|
|
125
|
-
"spectrum-Card--noLayout": "_spectrum-Card--noLayout_dd040",
|
|
126
|
-
"spectrum-Card--isQuiet": "_spectrum-Card--isQuiet_dd040",
|
|
127
|
-
"spectrum-Card--gallery": "_spectrum-Card--gallery_dd040",
|
|
128
|
-
"spectrum-Card--closeToSquare": "_spectrum-Card--closeToSquare_dd040",
|
|
129
|
-
"spectrum-Card--horizontal": "_spectrum-Card--horizontal_dd040",
|
|
130
|
-
"spectrum-CardView": "_spectrum-CardView_dd040",
|
|
131
|
-
"spectrum-CardView-centeredWrapper": "_spectrum-CardView-centeredWrapper_dd040",
|
|
132
|
-
"spectrum-CardView-row": "_spectrum-CardView-row_dd040",
|
|
133
|
-
"is-drop-target": "_is-drop-target_dd040"
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const $d2268ebff01b30dc8701260db9de8b73$export$CardViewContext = /*#__PURE__*/_react.createContext(null);
|
|
137
|
-
|
|
138
|
-
function $d2268ebff01b30dc8701260db9de8b73$export$useCardViewContext() {
|
|
139
|
-
return useContext($d2268ebff01b30dc8701260db9de8b73$export$CardViewContext);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
var $e80f3e549a26f7869571c50d85a$$interop$default = $parcel$interopDefault($e80f3e549a26f7869571c50d85a$exports);
|
|
143
|
-
|
|
144
|
-
function $c05a01cf76428c47b3d1dc747d32$var$CardBase(props, ref) {
|
|
145
|
-
props = useProviderProps(props);
|
|
146
|
-
let context = $d2268ebff01b30dc8701260db9de8b73$export$useCardViewContext() || {}; // we can call again here, won't change from Card.tsx
|
|
147
|
-
|
|
148
|
-
let {
|
|
149
|
-
state
|
|
150
|
-
} = context;
|
|
151
|
-
let manager = state == null ? void 0 : state.selectionManager;
|
|
152
|
-
let {
|
|
153
|
-
isQuiet,
|
|
154
|
-
orientation = 'vertical',
|
|
155
|
-
articleProps = {},
|
|
156
|
-
item,
|
|
157
|
-
layout
|
|
158
|
-
} = props;
|
|
159
|
-
let key = item == null ? void 0 : item.key;
|
|
160
|
-
let isSelected = manager == null ? void 0 : manager.isSelected(key);
|
|
161
|
-
let isDisabled = state == null ? void 0 : state.disabledKeys.has(key);
|
|
162
|
-
|
|
163
|
-
let onChange = () => manager == null ? void 0 : manager.select(key);
|
|
164
|
-
|
|
165
|
-
let {
|
|
166
|
-
styleProps
|
|
167
|
-
} = useStyleProps(props);
|
|
168
|
-
let {
|
|
169
|
-
cardProps,
|
|
170
|
-
titleProps,
|
|
171
|
-
contentProps
|
|
172
|
-
} = $c05a01cf76428c47b3d1dc747d32$var$useCard(props);
|
|
173
|
-
let domRef = useDOMRef(ref);
|
|
174
|
-
let gridRef = useRef(); // cards are only interactive if there is a selection manager and it allows selection
|
|
175
|
-
|
|
176
|
-
let {
|
|
177
|
-
hoverProps,
|
|
178
|
-
isHovered
|
|
179
|
-
} = useHover({
|
|
180
|
-
isDisabled: manager === undefined || (manager == null ? void 0 : manager.selectionMode) === 'none' || isDisabled
|
|
181
|
-
});
|
|
182
|
-
let [isFocused, setIsFocused] = useState(false);
|
|
183
|
-
let {
|
|
184
|
-
focusWithinProps
|
|
185
|
-
} = useFocusWithin({
|
|
186
|
-
onFocusWithinChange: setIsFocused,
|
|
187
|
-
isDisabled
|
|
188
|
-
});
|
|
189
|
-
let hasFooter = useHasChild("." + $e80f3e549a26f7869571c50d85a$$interop$default['spectrum-Card-footer'], gridRef); // ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default
|
|
190
|
-
|
|
191
|
-
let hasPreviewImage = useHasChild("." + $e80f3e549a26f7869571c50d85a$$interop$default['spectrum-Card-image'], gridRef);
|
|
192
|
-
let hasPreviewIllustration = useHasChild("." + $e80f3e549a26f7869571c50d85a$$interop$default['spectrum-Card-illustration'], gridRef);
|
|
193
|
-
let hasPreview = hasPreviewImage || hasPreviewIllustration; // this is for horizontal cards
|
|
194
|
-
|
|
195
|
-
let [height, setHeight] = useState(NaN);
|
|
196
|
-
let updateHeight = useCallback(() => {
|
|
197
|
-
if (orientation !== 'horizontal') {
|
|
2
|
+
var $h48Fj$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
|
+
var $h48Fj$reactstatelygrid = require("@react-stately/grid");
|
|
4
|
+
var $h48Fj$reactspectrumprogress = require("@react-spectrum/progress");
|
|
5
|
+
var $h48Fj$react = require("react");
|
|
6
|
+
var $h48Fj$reactariai18n = require("@react-aria/i18n");
|
|
7
|
+
var $h48Fj$reactariagrid = require("@react-aria/grid");
|
|
8
|
+
var $h48Fj$reactstatelylist = require("@react-stately/list");
|
|
9
|
+
var $h48Fj$reactspectrumprovider = require("@react-spectrum/provider");
|
|
10
|
+
var $h48Fj$reactariavirtualizer = require("@react-aria/virtualizer");
|
|
11
|
+
var $h48Fj$reactspectrumcheckbox = require("@react-spectrum/checkbox");
|
|
12
|
+
var $h48Fj$reactariautils = require("@react-aria/utils");
|
|
13
|
+
var $h48Fj$reactariafocus = require("@react-aria/focus");
|
|
14
|
+
var $h48Fj$reactariainteractions = require("@react-aria/interactions");
|
|
15
|
+
var $h48Fj$reactstatelyvirtualizer = require("@react-stately/virtualizer");
|
|
16
|
+
|
|
17
|
+
function $parcel$exportWildcard(dest, source) {
|
|
18
|
+
Object.keys(source).forEach(function(key) {
|
|
19
|
+
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
198
20
|
return;
|
|
199
21
|
}
|
|
200
22
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
23
|
+
Object.defineProperty(dest, key, {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function get() {
|
|
26
|
+
return source[key];
|
|
27
|
+
}
|
|
28
|
+
});
|
|
207
29
|
});
|
|
208
|
-
let aspectRatioEnforce = undefined;
|
|
209
30
|
|
|
210
|
-
|
|
211
|
-
aspectRatioEnforce = {
|
|
212
|
-
height: height + "px",
|
|
213
|
-
width: height + "px"
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
let slots = useMemo(() => ({
|
|
218
|
-
image: _babelRuntimeHelpersExtends({
|
|
219
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-image'),
|
|
220
|
-
objectFit: orientation === 'horizontal' ? 'cover' : 'contain',
|
|
221
|
-
alt: ''
|
|
222
|
-
}, aspectRatioEnforce),
|
|
223
|
-
illustration: _babelRuntimeHelpersExtends({
|
|
224
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-illustration')
|
|
225
|
-
}, aspectRatioEnforce),
|
|
226
|
-
avatar: {
|
|
227
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-avatar'),
|
|
228
|
-
size: 'avatar-size-400'
|
|
229
|
-
},
|
|
230
|
-
heading: _babelRuntimeHelpersExtends({
|
|
231
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-heading')
|
|
232
|
-
}, titleProps),
|
|
233
|
-
content: _babelRuntimeHelpersExtends({
|
|
234
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-content')
|
|
235
|
-
}, contentProps),
|
|
236
|
-
detail: {
|
|
237
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-detail')
|
|
238
|
-
},
|
|
239
|
-
actionmenu: {
|
|
240
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-actions'),
|
|
241
|
-
align: 'end',
|
|
242
|
-
isQuiet: true
|
|
243
|
-
},
|
|
244
|
-
footer: {
|
|
245
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-footer'),
|
|
246
|
-
isHidden: isQuiet
|
|
247
|
-
},
|
|
248
|
-
divider: {
|
|
249
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-divider'),
|
|
250
|
-
size: 'S'
|
|
251
|
-
}
|
|
252
|
-
}), [titleProps, contentProps, height, isQuiet, orientation]); // This is only for quiet grid cards
|
|
253
|
-
|
|
254
|
-
let [isCloseToSquare, setIsCloseToSquare] = useState(false);
|
|
255
|
-
useLayoutEffect(() => {
|
|
256
|
-
if (!(layout === 'grid' && isQuiet)) {
|
|
257
|
-
return;
|
|
258
|
-
} // ToDo: how to handle illustrations? what if the illustration looks like an image? What about swatches/fonts https://spectrum-contributions.corp.adobe.com/page/asset-card-beta/#File-type
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
let image = gridRef.current.querySelector("." + $e80f3e549a26f7869571c50d85a$$interop$default['spectrum-Card-image'] + " img");
|
|
262
|
-
|
|
263
|
-
if (!image) {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
let measure = () => {
|
|
268
|
-
let height = image.naturalHeight;
|
|
269
|
-
let width = image.naturalWidth;
|
|
270
|
-
/*
|
|
271
|
-
* ToDo: Choose between min-padding and plain ratio
|
|
272
|
-
* Do we want to just do a ratio measurement when it's close to being a square?
|
|
273
|
-
* or do we want to actually figure out min-padding?
|
|
274
|
-
* Min Padding would require us to check that the padding is not less than the min in both Vertical and Horizontal
|
|
275
|
-
* Unfortunately img contain doesn't actually create padding, which is what this math below can figure out
|
|
276
|
-
* Vs the commented out straight ratio check
|
|
277
|
-
* */
|
|
278
|
-
|
|
279
|
-
let imgTagHeight = image.clientHeight;
|
|
280
|
-
let imgTagWidth = image.clientWidth;
|
|
281
|
-
let ratio = Math.min(imgTagWidth / width, imgTagHeight / height);
|
|
282
|
-
let trueHeight = ratio * height;
|
|
283
|
-
let trueWidth = ratio * width;
|
|
284
|
-
let paddingVertical = imgTagHeight - trueHeight;
|
|
285
|
-
let paddingHorizontal = imgTagWidth - trueWidth;
|
|
286
|
-
|
|
287
|
-
if (paddingVertical < 16 && paddingHorizontal < 16) {
|
|
288
|
-
// ToDo: does this need to be different per scale?
|
|
289
|
-
setIsCloseToSquare(true);
|
|
290
|
-
} else {
|
|
291
|
-
setIsCloseToSquare(false);
|
|
292
|
-
} // let ratio = height / width;
|
|
293
|
-
// if (ratio > 0.9 && ratio < 1.1) {
|
|
294
|
-
// setIsCloseToSquare(true);
|
|
295
|
-
// }
|
|
296
|
-
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
if (image.complete) {
|
|
300
|
-
measure();
|
|
301
|
-
} else {
|
|
302
|
-
image.addEventListener('load', measure);
|
|
303
|
-
return () => {
|
|
304
|
-
image.removeEventListener('load', measure);
|
|
305
|
-
};
|
|
306
|
-
} // ToDo: how to re-run if image src changes?
|
|
307
|
-
|
|
308
|
-
}, [props.children, setIsCloseToSquare, isQuiet, layout]);
|
|
309
|
-
return /*#__PURE__*/_react.createElement(FocusRing, {
|
|
310
|
-
focusRingClass: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'focus-ring')
|
|
311
|
-
}, /*#__PURE__*/_react.createElement("article", _babelRuntimeHelpersExtends({}, styleProps, mergeProps(cardProps, focusWithinProps, hoverProps, filterDOMProps(props), articleProps), {
|
|
312
|
-
ref: domRef,
|
|
313
|
-
className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card', {
|
|
314
|
-
'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',
|
|
315
|
-
'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',
|
|
316
|
-
'spectrum-Card--horizontal': orientation === 'horizontal',
|
|
317
|
-
'spectrum-Card--closeToSquare': isCloseToSquare,
|
|
318
|
-
'spectrum-Card--noPreview': !hasPreview,
|
|
319
|
-
'is-hovered': isHovered,
|
|
320
|
-
'is-focused': isFocused,
|
|
321
|
-
'is-selected': isSelected,
|
|
322
|
-
'spectrum-Card--waterfall': layout === 'waterfall',
|
|
323
|
-
'spectrum-Card--gallery': layout === 'gallery',
|
|
324
|
-
'spectrum-Card--grid': layout === 'grid',
|
|
325
|
-
'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'
|
|
326
|
-
}, styleProps.className)
|
|
327
|
-
}), /*#__PURE__*/_react.createElement("div", {
|
|
328
|
-
ref: gridRef,
|
|
329
|
-
className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-grid')
|
|
330
|
-
}, manager && manager.selectionMode !== 'none' && /*#__PURE__*/_react.createElement("div", {
|
|
331
|
-
className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-checkboxWrapper')
|
|
332
|
-
}, /*#__PURE__*/_react.createElement(Checkbox, {
|
|
333
|
-
isDisabled: isDisabled,
|
|
334
|
-
excludeFromTabOrder: true,
|
|
335
|
-
isSelected: isSelected,
|
|
336
|
-
onChange: onChange,
|
|
337
|
-
UNSAFE_className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-checkbox'),
|
|
338
|
-
isEmphasized: true,
|
|
339
|
-
"aria-label": "select"
|
|
340
|
-
})), /*#__PURE__*/_react.createElement(SlotProvider, {
|
|
341
|
-
slots: slots
|
|
342
|
-
}, props.children, hasFooter && /*#__PURE__*/_react.createElement(Divider, null)), /*#__PURE__*/_react.createElement("div", {
|
|
343
|
-
className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-Card-decoration')
|
|
344
|
-
}))));
|
|
31
|
+
return dest;
|
|
345
32
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
33
|
+
function $parcel$interopDefault(a) {
|
|
34
|
+
return a && a.__esModule ? a.default : a;
|
|
35
|
+
}
|
|
36
|
+
function $parcel$export(e, n, v, s) {
|
|
37
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
38
|
+
}
|
|
39
|
+
var $a17eb1b1228312f3$exports = {};
|
|
40
|
+
|
|
41
|
+
$parcel$export($a17eb1b1228312f3$exports, "CardView", () => $a17eb1b1228312f3$export$7e52c821f7b6f422);
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var $9dc4f51f9a4db17a$exports = {};
|
|
49
|
+
|
|
50
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card", () => $9dc4f51f9a4db17a$export$4e5e9f191b1edb8, (v) => $9dc4f51f9a4db17a$export$4e5e9f191b1edb8 = v);
|
|
51
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-heading", () => $9dc4f51f9a4db17a$export$92758a4a0e8d19e4, (v) => $9dc4f51f9a4db17a$export$92758a4a0e8d19e4 = v);
|
|
52
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-checkboxWrapper", () => $9dc4f51f9a4db17a$export$33977546b63e0df9, (v) => $9dc4f51f9a4db17a$export$33977546b63e0df9 = v);
|
|
53
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-checkbox", () => $9dc4f51f9a4db17a$export$842da5d48b8f6db2, (v) => $9dc4f51f9a4db17a$export$842da5d48b8f6db2 = v);
|
|
54
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "is-selected", () => $9dc4f51f9a4db17a$export$1e0fb04f31d3c22a, (v) => $9dc4f51f9a4db17a$export$1e0fb04f31d3c22a = v);
|
|
55
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "focus-ring", () => $9dc4f51f9a4db17a$export$f39a09f249340e2a, (v) => $9dc4f51f9a4db17a$export$f39a09f249340e2a = v);
|
|
56
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "is-hovered", () => $9dc4f51f9a4db17a$export$b8813cd5d7824ce7, (v) => $9dc4f51f9a4db17a$export$b8813cd5d7824ce7 = v);
|
|
57
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-grid", () => $9dc4f51f9a4db17a$export$b3dd760d2dfde29e, (v) => $9dc4f51f9a4db17a$export$b3dd760d2dfde29e = v);
|
|
58
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-decoration", () => $9dc4f51f9a4db17a$export$48252dc130b62514, (v) => $9dc4f51f9a4db17a$export$48252dc130b62514 = v);
|
|
59
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-image", () => $9dc4f51f9a4db17a$export$8d5fea71dc66db80, (v) => $9dc4f51f9a4db17a$export$8d5fea71dc66db80 = v);
|
|
60
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-illustration", () => $9dc4f51f9a4db17a$export$13dd3510ae7a8399, (v) => $9dc4f51f9a4db17a$export$13dd3510ae7a8399 = v);
|
|
61
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-avatar", () => $9dc4f51f9a4db17a$export$159930c59efb6273, (v) => $9dc4f51f9a4db17a$export$159930c59efb6273 = v);
|
|
62
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-detail", () => $9dc4f51f9a4db17a$export$16715af38fbd9819, (v) => $9dc4f51f9a4db17a$export$16715af38fbd9819 = v);
|
|
63
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card-content", () => $9dc4f51f9a4db17a$export$d946625b97e8aa17, (v) => $9dc4f51f9a4db17a$export$d946625b97e8aa17 = v);
|
|
64
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--waterfall", () => $9dc4f51f9a4db17a$export$d9c7209e0e4f7e4d, (v) => $9dc4f51f9a4db17a$export$d9c7209e0e4f7e4d = v);
|
|
65
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--default", () => $9dc4f51f9a4db17a$export$c7a022df9e10a238, (v) => $9dc4f51f9a4db17a$export$c7a022df9e10a238 = v);
|
|
66
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--noPreview", () => $9dc4f51f9a4db17a$export$b77922bc0320c9e4, (v) => $9dc4f51f9a4db17a$export$b77922bc0320c9e4 = v);
|
|
67
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--grid", () => $9dc4f51f9a4db17a$export$59739ab951d2dcc7, (v) => $9dc4f51f9a4db17a$export$59739ab951d2dcc7 = v);
|
|
68
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--noLayout", () => $9dc4f51f9a4db17a$export$a03d836e6ef3e749, (v) => $9dc4f51f9a4db17a$export$a03d836e6ef3e749 = v);
|
|
69
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--isQuiet", () => $9dc4f51f9a4db17a$export$92ad04b5ac9296ea, (v) => $9dc4f51f9a4db17a$export$92ad04b5ac9296ea = v);
|
|
70
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--gallery", () => $9dc4f51f9a4db17a$export$ccd8ffc36bd10cc, (v) => $9dc4f51f9a4db17a$export$ccd8ffc36bd10cc = v);
|
|
71
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-Card--horizontal", () => $9dc4f51f9a4db17a$export$1c52334407225704, (v) => $9dc4f51f9a4db17a$export$1c52334407225704 = v);
|
|
72
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "is-focused", () => $9dc4f51f9a4db17a$export$e7dc768d35940237, (v) => $9dc4f51f9a4db17a$export$e7dc768d35940237 = v);
|
|
73
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-CardView", () => $9dc4f51f9a4db17a$export$2f34e9e3e0b89d95, (v) => $9dc4f51f9a4db17a$export$2f34e9e3e0b89d95 = v);
|
|
74
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-CardView-centeredWrapper", () => $9dc4f51f9a4db17a$export$7fc89689fcfab196, (v) => $9dc4f51f9a4db17a$export$7fc89689fcfab196 = v);
|
|
75
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "spectrum-CardView-row", () => $9dc4f51f9a4db17a$export$4746ac09daa215ae, (v) => $9dc4f51f9a4db17a$export$4746ac09daa215ae = v);
|
|
76
|
+
$parcel$export($9dc4f51f9a4db17a$exports, "is-drop-target", () => $9dc4f51f9a4db17a$export$d8467f38d2d00bd0, (v) => $9dc4f51f9a4db17a$export$d8467f38d2d00bd0 = v);
|
|
77
|
+
var $9dc4f51f9a4db17a$export$4e5e9f191b1edb8;
|
|
78
|
+
var $9dc4f51f9a4db17a$export$92758a4a0e8d19e4;
|
|
79
|
+
var $9dc4f51f9a4db17a$export$33977546b63e0df9;
|
|
80
|
+
var $9dc4f51f9a4db17a$export$842da5d48b8f6db2;
|
|
81
|
+
var $9dc4f51f9a4db17a$export$1e0fb04f31d3c22a;
|
|
82
|
+
var $9dc4f51f9a4db17a$export$f39a09f249340e2a;
|
|
83
|
+
var $9dc4f51f9a4db17a$export$b8813cd5d7824ce7;
|
|
84
|
+
var $9dc4f51f9a4db17a$export$b3dd760d2dfde29e;
|
|
85
|
+
var $9dc4f51f9a4db17a$export$48252dc130b62514;
|
|
86
|
+
var $9dc4f51f9a4db17a$export$8d5fea71dc66db80;
|
|
87
|
+
var $9dc4f51f9a4db17a$export$13dd3510ae7a8399;
|
|
88
|
+
var $9dc4f51f9a4db17a$export$159930c59efb6273;
|
|
89
|
+
var $9dc4f51f9a4db17a$export$16715af38fbd9819;
|
|
90
|
+
var $9dc4f51f9a4db17a$export$d946625b97e8aa17;
|
|
91
|
+
var $9dc4f51f9a4db17a$export$d9c7209e0e4f7e4d;
|
|
92
|
+
var $9dc4f51f9a4db17a$export$c7a022df9e10a238;
|
|
93
|
+
var $9dc4f51f9a4db17a$export$b77922bc0320c9e4;
|
|
94
|
+
var $9dc4f51f9a4db17a$export$59739ab951d2dcc7;
|
|
95
|
+
var $9dc4f51f9a4db17a$export$a03d836e6ef3e749;
|
|
96
|
+
var $9dc4f51f9a4db17a$export$92ad04b5ac9296ea;
|
|
97
|
+
var $9dc4f51f9a4db17a$export$ccd8ffc36bd10cc;
|
|
98
|
+
var $9dc4f51f9a4db17a$export$1c52334407225704;
|
|
99
|
+
var $9dc4f51f9a4db17a$export$e7dc768d35940237;
|
|
100
|
+
var $9dc4f51f9a4db17a$export$2f34e9e3e0b89d95;
|
|
101
|
+
var $9dc4f51f9a4db17a$export$7fc89689fcfab196;
|
|
102
|
+
var $9dc4f51f9a4db17a$export$4746ac09daa215ae;
|
|
103
|
+
var $9dc4f51f9a4db17a$export$d8467f38d2d00bd0;
|
|
104
|
+
$9dc4f51f9a4db17a$export$4e5e9f191b1edb8 = "spectrum-Card_6fdf9f";
|
|
105
|
+
$9dc4f51f9a4db17a$export$92758a4a0e8d19e4 = "spectrum-Card-heading_6fdf9f";
|
|
106
|
+
$9dc4f51f9a4db17a$export$33977546b63e0df9 = "spectrum-Card-checkboxWrapper_6fdf9f";
|
|
107
|
+
$9dc4f51f9a4db17a$export$842da5d48b8f6db2 = "spectrum-Card-checkbox_6fdf9f";
|
|
108
|
+
$9dc4f51f9a4db17a$export$1e0fb04f31d3c22a = "is-selected_6fdf9f";
|
|
109
|
+
$9dc4f51f9a4db17a$export$f39a09f249340e2a = "focus-ring_6fdf9f";
|
|
110
|
+
$9dc4f51f9a4db17a$export$b8813cd5d7824ce7 = "is-hovered_6fdf9f";
|
|
111
|
+
$9dc4f51f9a4db17a$export$b3dd760d2dfde29e = "spectrum-Card-grid_6fdf9f";
|
|
112
|
+
$9dc4f51f9a4db17a$export$48252dc130b62514 = "spectrum-Card-decoration_6fdf9f";
|
|
113
|
+
$9dc4f51f9a4db17a$export$8d5fea71dc66db80 = "spectrum-Card-image_6fdf9f";
|
|
114
|
+
$9dc4f51f9a4db17a$export$13dd3510ae7a8399 = "spectrum-Card-illustration_6fdf9f";
|
|
115
|
+
$9dc4f51f9a4db17a$export$159930c59efb6273 = "spectrum-Card-avatar_6fdf9f";
|
|
116
|
+
$9dc4f51f9a4db17a$export$16715af38fbd9819 = "spectrum-Card-detail_6fdf9f";
|
|
117
|
+
$9dc4f51f9a4db17a$export$d946625b97e8aa17 = "spectrum-Card-content_6fdf9f";
|
|
118
|
+
$9dc4f51f9a4db17a$export$d9c7209e0e4f7e4d = "spectrum-Card--waterfall_6fdf9f";
|
|
119
|
+
$9dc4f51f9a4db17a$export$c7a022df9e10a238 = "spectrum-Card--default_6fdf9f";
|
|
120
|
+
$9dc4f51f9a4db17a$export$b77922bc0320c9e4 = "spectrum-Card--noPreview_6fdf9f";
|
|
121
|
+
$9dc4f51f9a4db17a$export$59739ab951d2dcc7 = "spectrum-Card--grid_6fdf9f";
|
|
122
|
+
$9dc4f51f9a4db17a$export$a03d836e6ef3e749 = "spectrum-Card--noLayout_6fdf9f";
|
|
123
|
+
$9dc4f51f9a4db17a$export$92ad04b5ac9296ea = "spectrum-Card--isQuiet_6fdf9f";
|
|
124
|
+
$9dc4f51f9a4db17a$export$ccd8ffc36bd10cc = "spectrum-Card--gallery_6fdf9f";
|
|
125
|
+
$9dc4f51f9a4db17a$export$1c52334407225704 = "spectrum-Card--horizontal_6fdf9f";
|
|
126
|
+
$9dc4f51f9a4db17a$export$e7dc768d35940237 = "is-focused_6fdf9f";
|
|
127
|
+
$9dc4f51f9a4db17a$export$2f34e9e3e0b89d95 = "spectrum-CardView_6fdf9f";
|
|
128
|
+
$9dc4f51f9a4db17a$export$7fc89689fcfab196 = "spectrum-CardView-centeredWrapper_6fdf9f";
|
|
129
|
+
$9dc4f51f9a4db17a$export$4746ac09daa215ae = "spectrum-CardView-row_6fdf9f";
|
|
130
|
+
$9dc4f51f9a4db17a$export$d8467f38d2d00bd0 = "is-drop-target_6fdf9f";
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
const $0498deb1284b0345$export$64992ac69f286e5c = /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createContext(null);
|
|
135
|
+
function $0498deb1284b0345$export$fea0b38586ec8f13() {
|
|
136
|
+
return $h48Fj$react.useContext($0498deb1284b0345$export$64992ac69f286e5c);
|
|
365
137
|
}
|
|
366
|
-
/**
|
|
367
|
-
* TODO: Add description of component here.
|
|
368
|
-
*/
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
const $c05a01cf76428c47b3d1dc747d32$export$CardBase = /*#__PURE__*/_react.forwardRef($c05a01cf76428c47b3d1dc747d32$var$CardBase);
|
|
372
|
-
|
|
373
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/ar-AE.json
|
|
374
|
-
var $a73c2251b3d85c65b5e95b28f93c8042$exports = {};
|
|
375
|
-
$a73c2251b3d85c65b5e95b28f93c8042$exports = JSON.parse("{\"loading\":\"جارٍ التحميل...\",\"loadingMore\":\"جارٍ تحميل المزيد...\"}");
|
|
376
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/bg-BG.json
|
|
377
|
-
var $cd530dcba5c06fcc85025230ea1fa$exports = {};
|
|
378
|
-
$cd530dcba5c06fcc85025230ea1fa$exports = JSON.parse("{\"loading\":\"Зареждане...\",\"loadingMore\":\"Зареждане на още...\"}");
|
|
379
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/cs-CZ.json
|
|
380
|
-
var $d4e7ef95b9eb2258a723c198e08ce1$exports = {};
|
|
381
|
-
$d4e7ef95b9eb2258a723c198e08ce1$exports = JSON.parse("{\"loading\":\"Načítání...\",\"loadingMore\":\"Načítání dalších...\"}");
|
|
382
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/da-DK.json
|
|
383
|
-
var $e591e0ea92da820daf4525e271cb1091$exports = {};
|
|
384
|
-
$e591e0ea92da820daf4525e271cb1091$exports = JSON.parse("{\"loading\":\"Indlæser ...\",\"loadingMore\":\"Indlæser flere ...\"}");
|
|
385
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/de-DE.json
|
|
386
|
-
var $a79235d0b2a717d6e877d4196d9a700$exports = {};
|
|
387
|
-
$a79235d0b2a717d6e877d4196d9a700$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Mehr laden ...\"}");
|
|
388
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/el-GR.json
|
|
389
|
-
var $b031a841d1713b81f37be7a3e54f62bc$exports = {};
|
|
390
|
-
$b031a841d1713b81f37be7a3e54f62bc$exports = JSON.parse("{\"loading\":\"Φόρτωση...\",\"loadingMore\":\"Φόρτωση περισσότερων...\"}");
|
|
391
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/en-US.json
|
|
392
|
-
var $fe3b01a31811de4315f58934cfe01d9f$exports = {};
|
|
393
|
-
$fe3b01a31811de4315f58934cfe01d9f$exports = JSON.parse("{\"loading\":\"Loading…\",\"loadingMore\":\"Loading more…\"}");
|
|
394
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/es-ES.json
|
|
395
|
-
var $dfccb4b840ac9a4f6372f30756231413$exports = {};
|
|
396
|
-
$dfccb4b840ac9a4f6372f30756231413$exports = JSON.parse("{\"loading\":\"Cargando…\",\"loadingMore\":\"Cargando más…\"}");
|
|
397
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/et-EE.json
|
|
398
|
-
var $c0afdcf18fcf36fd0acae74dbc5bddfb$exports = {};
|
|
399
|
-
$c0afdcf18fcf36fd0acae74dbc5bddfb$exports = JSON.parse("{\"loading\":\"Laadimine...\",\"loadingMore\":\"Laadi rohkem...\"}");
|
|
400
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/fi-FI.json
|
|
401
|
-
var $bda8be2b1a9fa47093f290fdcbc590$exports = {};
|
|
402
|
-
$bda8be2b1a9fa47093f290fdcbc590$exports = JSON.parse("{\"loading\":\"Ladataan…\",\"loadingMore\":\"Ladataan lisää…\"}");
|
|
403
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/fr-FR.json
|
|
404
|
-
var $b400752af39f40d53ff83e9d6ae1716f$exports = {};
|
|
405
|
-
$b400752af39f40d53ff83e9d6ae1716f$exports = JSON.parse("{\"loading\":\"Chargement...\",\"loadingMore\":\"Chargement supplémentaire...\"}");
|
|
406
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/he-IL.json
|
|
407
|
-
var $f52b9c77027a45c50447d15f211aee3c$exports = {};
|
|
408
|
-
$f52b9c77027a45c50447d15f211aee3c$exports = JSON.parse("{\"loading\":\"טוען...\",\"loadingMore\":\"טוען עוד...\"}");
|
|
409
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/hr-HR.json
|
|
410
|
-
var $c51bbbe61ab7dda3d07ff8b63a6656e$exports = {};
|
|
411
|
-
$c51bbbe61ab7dda3d07ff8b63a6656e$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
|
|
412
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/hu-HU.json
|
|
413
|
-
var $f835d20fb8524bab4bfa3011b2fe2$exports = {};
|
|
414
|
-
$f835d20fb8524bab4bfa3011b2fe2$exports = JSON.parse("{\"loading\":\"Betöltés folyamatban…\",\"loadingMore\":\"Továbbiak betöltése folyamatban…\"}");
|
|
415
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/it-IT.json
|
|
416
|
-
var $a049c9a68793a22cc3d3121b0b4a10$exports = {};
|
|
417
|
-
$a049c9a68793a22cc3d3121b0b4a10$exports = JSON.parse("{\"loading\":\"Caricamento...\",\"loadingMore\":\"Caricamento altri...\"}");
|
|
418
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/ja-JP.json
|
|
419
|
-
var $c90338eb448423751c80d6cf2fb8c8a1$exports = {};
|
|
420
|
-
$c90338eb448423751c80d6cf2fb8c8a1$exports = JSON.parse("{\"loading\":\"読み込み中...\",\"loadingMore\":\"さらに読み込み中...\"}");
|
|
421
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/ko-KR.json
|
|
422
|
-
var $b635e415ea191230d720f8a57bcfac4$exports = {};
|
|
423
|
-
$b635e415ea191230d720f8a57bcfac4$exports = JSON.parse("{\"loading\":\"로드 중\",\"loadingMore\":\"추가 로드 중\"}");
|
|
424
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/lt-LT.json
|
|
425
|
-
var $bf40374472802f152aae7e860cbfba$exports = {};
|
|
426
|
-
$bf40374472802f152aae7e860cbfba$exports = JSON.parse("{\"loading\":\"Įkeliama...\",\"loadingMore\":\"Įkeliama daugiau...\"}");
|
|
427
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/lv-LV.json
|
|
428
|
-
var $a5f0a1480f91d7acc8710521295c83e$exports = {};
|
|
429
|
-
$a5f0a1480f91d7acc8710521295c83e$exports = JSON.parse("{\"loading\":\"Notiek ielāde...\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
|
|
430
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/nb-NO.json
|
|
431
|
-
var $dc580345c46a3bd686da9e80ef533a94$exports = {};
|
|
432
|
-
$dc580345c46a3bd686da9e80ef533a94$exports = JSON.parse("{\"loading\":\"Laster inn ...\",\"loadingMore\":\"Laster inn flere ...\"}");
|
|
433
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/nl-NL.json
|
|
434
|
-
var $cf7646cd46b2513084100884bbfb5$exports = {};
|
|
435
|
-
$cf7646cd46b2513084100884bbfb5$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Meer laden...\"}");
|
|
436
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/pl-PL.json
|
|
437
|
-
var $d45f9d44e7bb340675d3f3$exports = {};
|
|
438
|
-
$d45f9d44e7bb340675d3f3$exports = JSON.parse("{\"loading\":\"Ładowanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
|
|
439
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/pt-BR.json
|
|
440
|
-
var $d7fc96a2256f525f33439570c5176b6$exports = {};
|
|
441
|
-
$d7fc96a2256f525f33439570c5176b6$exports = JSON.parse("{\"loading\":\"Carregando...\",\"loadingMore\":\"Carregando mais...\"}");
|
|
442
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/pt-PT.json
|
|
443
|
-
var $bce54762c8026412a8cc0b3c0e17$exports = {};
|
|
444
|
-
$bce54762c8026412a8cc0b3c0e17$exports = JSON.parse("{\"loading\":\"A carregar...\",\"loadingMore\":\"A carregar mais...\"}");
|
|
445
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/ro-RO.json
|
|
446
|
-
var $b1a5d948f23fd42b37cf4a62bc20fbc9$exports = {};
|
|
447
|
-
$b1a5d948f23fd42b37cf4a62bc20fbc9$exports = JSON.parse("{\"loading\":\"Se încarcă...\",\"loadingMore\":\"Se încarcă mai multe...\"}");
|
|
448
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/ru-RU.json
|
|
449
|
-
var $fd34d0ae6d3c2b124aa82bec518fdebc$exports = {};
|
|
450
|
-
$fd34d0ae6d3c2b124aa82bec518fdebc$exports = JSON.parse("{\"loading\":\"Загрузка...\",\"loadingMore\":\"Дополнительная загрузка...\"}");
|
|
451
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/sk-SK.json
|
|
452
|
-
var $f0d899f938fc0b4d2e0a803e77f73b6$exports = {};
|
|
453
|
-
$f0d899f938fc0b4d2e0a803e77f73b6$exports = JSON.parse("{\"loading\":\"Načítava sa...\",\"loadingMore\":\"Načítava sa viac...\"}");
|
|
454
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/sl-SI.json
|
|
455
|
-
var $fc6db5102b55f61b25dc1512b9307$exports = {};
|
|
456
|
-
$fc6db5102b55f61b25dc1512b9307$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje več vsebine...\"}");
|
|
457
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/sr-SP.json
|
|
458
|
-
var $b5867f72618ad3ebdf24df3b2c0c64ad$exports = {};
|
|
459
|
-
$b5867f72618ad3ebdf24df3b2c0c64ad$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
|
|
460
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/sv-SE.json
|
|
461
|
-
var $e75d48658029b318f5477dc4b15713$exports = {};
|
|
462
|
-
$e75d48658029b318f5477dc4b15713$exports = JSON.parse("{\"loading\":\"Läser in...\",\"loadingMore\":\"Läser in mer...\"}");
|
|
463
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/tr-TR.json
|
|
464
|
-
var $a386b5db27abfbe3745c59576f$exports = {};
|
|
465
|
-
$a386b5db27abfbe3745c59576f$exports = JSON.parse("{\"loading\":\"Yükleniyor...\",\"loadingMore\":\"Daha fazla yükleniyor...\"}");
|
|
466
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/uk-UA.json
|
|
467
|
-
var $d04a11b64459844c9f6c167e5538da$exports = {};
|
|
468
|
-
$d04a11b64459844c9f6c167e5538da$exports = JSON.parse("{\"loading\":\"Завантаження…\",\"loadingMore\":\"Завантаження інших об’єктів...\"}");
|
|
469
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/zh-CN.json
|
|
470
|
-
var $b9216cdc8ad21d0c1b8e94822b8d13a3$exports = {};
|
|
471
|
-
$b9216cdc8ad21d0c1b8e94822b8d13a3$exports = JSON.parse("{\"loading\":\"正在加载...\",\"loadingMore\":\"正在加载更多...\"}");
|
|
472
|
-
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-spectrum/card/intl/zh-TW.json
|
|
473
|
-
var $f9135827d71b7bceae5eb74e24cd6$exports = {};
|
|
474
|
-
$f9135827d71b7bceae5eb74e24cd6$exports = JSON.parse("{\"loading\":\"正在載入\",\"loadingMore\":\"正在載入更多…\"}");
|
|
475
|
-
// @ts-ignore
|
|
476
|
-
const $e13c04c0c86a4119edea9d2f83b$var$intlMessages = {
|
|
477
|
-
"ar-AE": _babelRuntimeHelpersInteropRequireDefault($a73c2251b3d85c65b5e95b28f93c8042$exports).default,
|
|
478
|
-
"bg-BG": _babelRuntimeHelpersInteropRequireDefault($cd530dcba5c06fcc85025230ea1fa$exports).default,
|
|
479
|
-
"cs-CZ": _babelRuntimeHelpersInteropRequireDefault($d4e7ef95b9eb2258a723c198e08ce1$exports).default,
|
|
480
|
-
"da-DK": _babelRuntimeHelpersInteropRequireDefault($e591e0ea92da820daf4525e271cb1091$exports).default,
|
|
481
|
-
"de-DE": _babelRuntimeHelpersInteropRequireDefault($a79235d0b2a717d6e877d4196d9a700$exports).default,
|
|
482
|
-
"el-GR": _babelRuntimeHelpersInteropRequireDefault($b031a841d1713b81f37be7a3e54f62bc$exports).default,
|
|
483
|
-
"en-US": _babelRuntimeHelpersInteropRequireDefault($fe3b01a31811de4315f58934cfe01d9f$exports).default,
|
|
484
|
-
"es-ES": _babelRuntimeHelpersInteropRequireDefault($dfccb4b840ac9a4f6372f30756231413$exports).default,
|
|
485
|
-
"et-EE": _babelRuntimeHelpersInteropRequireDefault($c0afdcf18fcf36fd0acae74dbc5bddfb$exports).default,
|
|
486
|
-
"fi-FI": _babelRuntimeHelpersInteropRequireDefault($bda8be2b1a9fa47093f290fdcbc590$exports).default,
|
|
487
|
-
"fr-FR": _babelRuntimeHelpersInteropRequireDefault($b400752af39f40d53ff83e9d6ae1716f$exports).default,
|
|
488
|
-
"he-IL": _babelRuntimeHelpersInteropRequireDefault($f52b9c77027a45c50447d15f211aee3c$exports).default,
|
|
489
|
-
"hr-HR": _babelRuntimeHelpersInteropRequireDefault($c51bbbe61ab7dda3d07ff8b63a6656e$exports).default,
|
|
490
|
-
"hu-HU": _babelRuntimeHelpersInteropRequireDefault($f835d20fb8524bab4bfa3011b2fe2$exports).default,
|
|
491
|
-
"it-IT": _babelRuntimeHelpersInteropRequireDefault($a049c9a68793a22cc3d3121b0b4a10$exports).default,
|
|
492
|
-
"ja-JP": _babelRuntimeHelpersInteropRequireDefault($c90338eb448423751c80d6cf2fb8c8a1$exports).default,
|
|
493
|
-
"ko-KR": _babelRuntimeHelpersInteropRequireDefault($b635e415ea191230d720f8a57bcfac4$exports).default,
|
|
494
|
-
"lt-LT": _babelRuntimeHelpersInteropRequireDefault($bf40374472802f152aae7e860cbfba$exports).default,
|
|
495
|
-
"lv-LV": _babelRuntimeHelpersInteropRequireDefault($a5f0a1480f91d7acc8710521295c83e$exports).default,
|
|
496
|
-
"nb-NO": _babelRuntimeHelpersInteropRequireDefault($dc580345c46a3bd686da9e80ef533a94$exports).default,
|
|
497
|
-
"nl-NL": _babelRuntimeHelpersInteropRequireDefault($cf7646cd46b2513084100884bbfb5$exports).default,
|
|
498
|
-
"pl-PL": _babelRuntimeHelpersInteropRequireDefault($d45f9d44e7bb340675d3f3$exports).default,
|
|
499
|
-
"pt-BR": _babelRuntimeHelpersInteropRequireDefault($d7fc96a2256f525f33439570c5176b6$exports).default,
|
|
500
|
-
"pt-PT": _babelRuntimeHelpersInteropRequireDefault($bce54762c8026412a8cc0b3c0e17$exports).default,
|
|
501
|
-
"ro-RO": _babelRuntimeHelpersInteropRequireDefault($b1a5d948f23fd42b37cf4a62bc20fbc9$exports).default,
|
|
502
|
-
"ru-RU": _babelRuntimeHelpersInteropRequireDefault($fd34d0ae6d3c2b124aa82bec518fdebc$exports).default,
|
|
503
|
-
"sk-SK": _babelRuntimeHelpersInteropRequireDefault($f0d899f938fc0b4d2e0a803e77f73b6$exports).default,
|
|
504
|
-
"sl-SI": _babelRuntimeHelpersInteropRequireDefault($fc6db5102b55f61b25dc1512b9307$exports).default,
|
|
505
|
-
"sr-SP": _babelRuntimeHelpersInteropRequireDefault($b5867f72618ad3ebdf24df3b2c0c64ad$exports).default,
|
|
506
|
-
"sv-SE": _babelRuntimeHelpersInteropRequireDefault($e75d48658029b318f5477dc4b15713$exports).default,
|
|
507
|
-
"tr-TR": _babelRuntimeHelpersInteropRequireDefault($a386b5db27abfbe3745c59576f$exports).default,
|
|
508
|
-
"uk-UA": _babelRuntimeHelpersInteropRequireDefault($d04a11b64459844c9f6c167e5538da$exports).default,
|
|
509
|
-
"zh-CN": _babelRuntimeHelpersInteropRequireDefault($b9216cdc8ad21d0c1b8e94822b8d13a3$exports).default,
|
|
510
|
-
"zh-TW": _babelRuntimeHelpersInteropRequireDefault($f9135827d71b7bceae5eb74e24cd6$exports).default
|
|
511
|
-
};
|
|
512
138
|
|
|
513
|
-
function $e13c04c0c86a4119edea9d2f83b$var$CardView(props, ref) {
|
|
514
|
-
let {
|
|
515
|
-
scale
|
|
516
|
-
} = useProvider();
|
|
517
|
-
let {
|
|
518
|
-
styleProps
|
|
519
|
-
} = useStyleProps(props);
|
|
520
|
-
let domRef = useDOMRef(ref);
|
|
521
|
-
let {
|
|
522
|
-
isQuiet,
|
|
523
|
-
renderEmptyState,
|
|
524
|
-
layout,
|
|
525
|
-
loadingState,
|
|
526
|
-
onLoadMore,
|
|
527
|
-
cardOrientation = 'vertical'
|
|
528
|
-
} = props;
|
|
529
|
-
let collator = useCollator({
|
|
530
|
-
usage: 'search',
|
|
531
|
-
sensitivity: 'base'
|
|
532
|
-
});
|
|
533
|
-
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
534
|
-
let cardViewLayout = useMemo(() => typeof layout === 'function' ? new layout({
|
|
535
|
-
collator,
|
|
536
|
-
cardOrientation,
|
|
537
|
-
scale
|
|
538
|
-
}) : layout, [layout, collator, cardOrientation, scale]);
|
|
539
|
-
let layoutType = cardViewLayout.layoutType;
|
|
540
|
-
let formatMessage = useMessageFormatter($e13c04c0c86a4119edea9d2f83b$var$intlMessages);
|
|
541
|
-
let {
|
|
542
|
-
direction
|
|
543
|
-
} = useLocale();
|
|
544
|
-
let {
|
|
545
|
-
collection
|
|
546
|
-
} = useListState(props);
|
|
547
|
-
let gridCollection = useMemo(() => new GridCollection({
|
|
548
|
-
columnCount: 1,
|
|
549
|
-
items: [...collection].map(item => _babelRuntimeHelpersExtends({}, item, {
|
|
550
|
-
hasChildNodes: true,
|
|
551
|
-
childNodes: [{
|
|
552
|
-
key: "cell-" + item.key,
|
|
553
|
-
type: 'cell',
|
|
554
|
-
value: null,
|
|
555
|
-
level: 0,
|
|
556
|
-
rendered: null,
|
|
557
|
-
textValue: item.textValue,
|
|
558
|
-
hasChildNodes: false,
|
|
559
|
-
childNodes: []
|
|
560
|
-
}]
|
|
561
|
-
}))
|
|
562
|
-
}), [collection]);
|
|
563
|
-
let state = useGridState(_babelRuntimeHelpersExtends({}, props, {
|
|
564
|
-
selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,
|
|
565
|
-
collection: gridCollection,
|
|
566
|
-
focusMode: 'cell'
|
|
567
|
-
}));
|
|
568
|
-
cardViewLayout.collection = gridCollection;
|
|
569
|
-
cardViewLayout.disabledKeys = state.disabledKeys;
|
|
570
|
-
cardViewLayout.isLoading = isLoading;
|
|
571
|
-
cardViewLayout.direction = direction;
|
|
572
|
-
let {
|
|
573
|
-
gridProps
|
|
574
|
-
} = useGrid(_babelRuntimeHelpersExtends({}, props, {
|
|
575
|
-
isVirtualized: true,
|
|
576
|
-
keyboardDelegate: cardViewLayout
|
|
577
|
-
}), state, domRef);
|
|
578
|
-
|
|
579
|
-
let renderWrapper = (parent, reusableView) => /*#__PURE__*/_react.createElement(VirtualizerItem, {
|
|
580
|
-
key: reusableView.key,
|
|
581
|
-
reusableView: reusableView,
|
|
582
|
-
parent: parent
|
|
583
|
-
});
|
|
584
139
|
|
|
585
|
-
let focusedKey = state.selectionManager.focusedKey;
|
|
586
|
-
let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
|
|
587
140
|
|
|
588
|
-
if ((focusedItem == null ? void 0 : focusedItem.parentKey) != null) {
|
|
589
|
-
focusedKey = focusedItem.parentKey;
|
|
590
|
-
}
|
|
591
141
|
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
142
|
+
function $aa5f628de93d2fc1$var$CardBase(props, ref) {
|
|
143
|
+
props = $h48Fj$reactspectrumprovider.useProviderProps(props);
|
|
144
|
+
let context = $0498deb1284b0345$export$fea0b38586ec8f13() || {
|
|
145
|
+
}; // we can call again here, won't change from Card.tsx
|
|
146
|
+
let { state: state } = context;
|
|
147
|
+
let manager = state?.selectionManager;
|
|
148
|
+
let { isQuiet: isQuiet , orientation: orientation = 'vertical' , articleProps: articleProps = {
|
|
149
|
+
} , item: item , layout: layout , children: children } = props;
|
|
150
|
+
let key = item?.key;
|
|
151
|
+
let isSelected = manager?.isSelected(key);
|
|
152
|
+
let isDisabled = state?.disabledKeys.has(key);
|
|
153
|
+
let onChange = ()=>manager?.select(key)
|
|
154
|
+
;
|
|
155
|
+
let { styleProps: styleProps } = $h48Fj$reactspectrumutils.useStyleProps(props);
|
|
156
|
+
let { cardProps: cardProps , titleProps: titleProps , contentProps: contentProps } = $aa5f628de93d2fc1$var$useCard(props);
|
|
157
|
+
let domRef = $h48Fj$reactspectrumutils.useDOMRef(ref);
|
|
158
|
+
let gridRef = $h48Fj$react.useRef();
|
|
159
|
+
let checkboxRef = $h48Fj$react.useRef(null);
|
|
160
|
+
// cards are only interactive if there is a selection manager and it allows selection
|
|
161
|
+
let { hoverProps: hoverProps , isHovered: isHovered } = $h48Fj$reactariainteractions.useHover({
|
|
162
|
+
isDisabled: manager === undefined || manager?.selectionMode === 'none' || isDisabled
|
|
598
163
|
});
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
164
|
+
let [isFocused, setIsFocused] = $h48Fj$react.useState(false);
|
|
165
|
+
let { focusWithinProps: focusWithinProps } = $h48Fj$reactariainteractions.useFocusWithin({
|
|
166
|
+
onFocusWithinChange: setIsFocused,
|
|
167
|
+
isDisabled: isDisabled
|
|
168
|
+
});
|
|
169
|
+
// ToDo: see css for comment about avatar under selector .spectrum-Card--noLayout.spectrum-Card--default
|
|
170
|
+
let hasPreviewImage = $h48Fj$reactspectrumutils.useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports))['spectrum-Card-image']}`, gridRef);
|
|
171
|
+
let hasPreviewIllustration = $h48Fj$reactspectrumutils.useHasChild(`.${(/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports))['spectrum-Card-illustration']}`, gridRef);
|
|
172
|
+
let hasPreview = hasPreviewImage || hasPreviewIllustration;
|
|
173
|
+
// this is for horizontal cards
|
|
174
|
+
let [height, setHeight] = $h48Fj$react.useState(NaN);
|
|
175
|
+
let updateHeight = $h48Fj$react.useCallback(()=>{
|
|
176
|
+
if (orientation !== 'horizontal') return;
|
|
177
|
+
let cardHeight = gridRef.current.getBoundingClientRect().height;
|
|
178
|
+
setHeight(cardHeight);
|
|
179
|
+
}, [
|
|
180
|
+
orientation,
|
|
181
|
+
gridRef,
|
|
182
|
+
setHeight
|
|
183
|
+
]);
|
|
184
|
+
$h48Fj$reactariautils.useResizeObserver({
|
|
185
|
+
ref: gridRef,
|
|
186
|
+
onResize: updateHeight
|
|
187
|
+
});
|
|
188
|
+
let aspectRatioEnforce = undefined;
|
|
189
|
+
if (orientation === 'horizontal' && !isNaN(height)) aspectRatioEnforce = {
|
|
190
|
+
height: `${height}px`,
|
|
191
|
+
width: `${height}px`
|
|
192
|
+
};
|
|
193
|
+
let slots = $h48Fj$react.useMemo(()=>({
|
|
194
|
+
image: {
|
|
195
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-image'),
|
|
196
|
+
objectFit: orientation === 'horizontal' ? 'cover' : 'contain',
|
|
197
|
+
alt: '',
|
|
198
|
+
...aspectRatioEnforce
|
|
199
|
+
},
|
|
200
|
+
illustration: {
|
|
201
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-illustration'),
|
|
202
|
+
...aspectRatioEnforce
|
|
203
|
+
},
|
|
204
|
+
avatar: {
|
|
205
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-avatar'),
|
|
206
|
+
size: 'avatar-size-400'
|
|
207
|
+
},
|
|
208
|
+
heading: {
|
|
209
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-heading'),
|
|
210
|
+
...titleProps
|
|
211
|
+
},
|
|
212
|
+
content: {
|
|
213
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-content'),
|
|
214
|
+
...contentProps
|
|
215
|
+
},
|
|
216
|
+
detail: {
|
|
217
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-detail')
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
, [
|
|
221
|
+
titleProps,
|
|
222
|
+
contentProps,
|
|
223
|
+
height,
|
|
224
|
+
isQuiet,
|
|
225
|
+
orientation
|
|
226
|
+
]);
|
|
227
|
+
$h48Fj$reactariautils.useLayoutEffect(()=>{
|
|
228
|
+
if (gridRef?.current) {
|
|
229
|
+
let walker = $h48Fj$reactariafocus.getFocusableTreeWalker(gridRef.current);
|
|
230
|
+
let nextNode = walker.nextNode();
|
|
231
|
+
while(nextNode != null){
|
|
232
|
+
if (checkboxRef.current && !checkboxRef.current.UNSAFE_getDOMNode().contains(nextNode)) {
|
|
233
|
+
console.warn('Card does not support focusable elements, please contact the team regarding your use case.');
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
nextNode = walker.nextNode();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}, [
|
|
240
|
+
children
|
|
241
|
+
]);
|
|
242
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactariafocus.FocusRing, {
|
|
243
|
+
focusRingClass: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'focus-ring')
|
|
244
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("article", {
|
|
245
|
+
...styleProps,
|
|
246
|
+
...$h48Fj$reactariautils.mergeProps(cardProps, focusWithinProps, hoverProps, $h48Fj$reactariautils.filterDOMProps(props), articleProps),
|
|
247
|
+
ref: domRef,
|
|
248
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card', {
|
|
249
|
+
'spectrum-Card--default': !isQuiet && orientation !== 'horizontal',
|
|
250
|
+
'spectrum-Card--isQuiet': isQuiet && orientation !== 'horizontal',
|
|
251
|
+
'spectrum-Card--horizontal': orientation === 'horizontal',
|
|
252
|
+
'spectrum-Card--noPreview': !hasPreview,
|
|
253
|
+
'is-hovered': isHovered,
|
|
254
|
+
'is-focused': isFocused,
|
|
255
|
+
'is-selected': isSelected,
|
|
256
|
+
'spectrum-Card--waterfall': layout === 'waterfall',
|
|
257
|
+
'spectrum-Card--gallery': layout === 'gallery',
|
|
258
|
+
'spectrum-Card--grid': layout === 'grid',
|
|
259
|
+
'spectrum-Card--noLayout': layout !== 'waterfall' && layout !== 'gallery' && layout !== 'grid'
|
|
260
|
+
}, styleProps.className)
|
|
261
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
262
|
+
ref: gridRef,
|
|
263
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-grid')
|
|
264
|
+
}, manager && manager.selectionMode !== 'none' && /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
265
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-checkboxWrapper')
|
|
266
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactspectrumcheckbox.Checkbox, {
|
|
267
|
+
ref: checkboxRef,
|
|
268
|
+
isDisabled: isDisabled,
|
|
269
|
+
excludeFromTabOrder: true,
|
|
270
|
+
isSelected: isSelected,
|
|
271
|
+
onChange: onChange,
|
|
272
|
+
UNSAFE_className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-checkbox'),
|
|
273
|
+
isEmphasized: true,
|
|
274
|
+
"aria-label": "select"
|
|
275
|
+
})), /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactspectrumutils.SlotProvider, {
|
|
276
|
+
slots: slots
|
|
277
|
+
}, children), /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
278
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-Card-decoration')
|
|
279
|
+
})))));
|
|
656
280
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
node: cellNode,
|
|
683
|
-
focusMode: 'cell'
|
|
684
|
-
}, state, unwrappedRef);
|
|
685
|
-
|
|
686
|
-
if (layoutType === 'grid' || layoutType === 'gallery') {
|
|
687
|
-
isQuiet = true;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
if (layoutType !== 'grid') {
|
|
691
|
-
cardOrientation = 'vertical';
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
return /*#__PURE__*/_react.createElement("div", _babelRuntimeHelpersExtends({}, rowProps, {
|
|
695
|
-
ref: rowRef,
|
|
696
|
-
className: classNames($e80f3e549a26f7869571c50d85a$$interop$default, 'spectrum-CardView-row')
|
|
697
|
-
}), /*#__PURE__*/_react.createElement($c05a01cf76428c47b3d1dc747d32$export$CardBase, {
|
|
698
|
-
ref: cellRef,
|
|
699
|
-
articleProps: gridCellProps,
|
|
700
|
-
isQuiet: isQuiet,
|
|
701
|
-
orientation: cardOrientation,
|
|
702
|
-
item: item,
|
|
703
|
-
layout: layoutType
|
|
704
|
-
}, item.rendered));
|
|
281
|
+
function $aa5f628de93d2fc1$var$useCard(props) {
|
|
282
|
+
let titleId = $h48Fj$reactariautils.useSlotId();
|
|
283
|
+
let descriptionId = $h48Fj$reactariautils.useSlotId();
|
|
284
|
+
let titleProps = $h48Fj$react.useMemo(()=>({
|
|
285
|
+
id: titleId
|
|
286
|
+
})
|
|
287
|
+
, [
|
|
288
|
+
titleId
|
|
289
|
+
]);
|
|
290
|
+
let contentProps = $h48Fj$react.useMemo(()=>({
|
|
291
|
+
id: descriptionId
|
|
292
|
+
})
|
|
293
|
+
, [
|
|
294
|
+
descriptionId
|
|
295
|
+
]);
|
|
296
|
+
return {
|
|
297
|
+
cardProps: {
|
|
298
|
+
...$h48Fj$reactariautils.filterDOMProps(props),
|
|
299
|
+
'aria-labelledby': titleId,
|
|
300
|
+
'aria-describedby': descriptionId,
|
|
301
|
+
tabIndex: 0
|
|
302
|
+
},
|
|
303
|
+
titleProps: titleProps,
|
|
304
|
+
contentProps: contentProps
|
|
305
|
+
};
|
|
705
306
|
}
|
|
706
307
|
/**
|
|
707
308
|
* TODO: Add description of component here.
|
|
708
|
-
*/
|
|
309
|
+
*/ const $aa5f628de93d2fc1$export$7a6ccaf429ad93a8 = /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).forwardRef($aa5f628de93d2fc1$var$CardBase);
|
|
709
310
|
|
|
710
311
|
|
|
711
|
-
const CardView = /*#__PURE__*/_react.forwardRef($e13c04c0c86a4119edea9d2f83b$var$CardView);
|
|
712
312
|
|
|
713
|
-
exports.CardView = CardView;
|
|
714
313
|
|
|
715
|
-
class $ae626509048548c15655cbbeb258411$export$BaseLayout extends Layout {
|
|
716
|
-
constructor(options) {
|
|
717
|
-
if (options === void 0) {
|
|
718
|
-
options = {};
|
|
719
|
-
}
|
|
720
314
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
this.collator = void 0;
|
|
725
|
-
this.lastCollection = void 0;
|
|
726
|
-
this.collection = void 0;
|
|
727
|
-
this.isLoading = void 0;
|
|
728
|
-
this.disabledKeys = new Set();
|
|
729
|
-
this.direction = void 0;
|
|
730
|
-
this.scale = void 0;
|
|
731
|
-
this.margin = void 0;
|
|
732
|
-
this.layoutInfos = new Map();
|
|
733
|
-
this.collator = options.collator;
|
|
734
|
-
this.lastCollection = null;
|
|
735
|
-
this.scale = options.scale || 'medium';
|
|
736
|
-
this.margin = options.margin || 24;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
validate(invalidationContext) {
|
|
740
|
-
this.collection = this.virtualizer.collection;
|
|
741
|
-
this.buildCollection(invalidationContext); // Remove layout info that doesn't exist in new collection
|
|
742
|
-
|
|
743
|
-
if (this.lastCollection) {
|
|
744
|
-
for (let key of this.lastCollection.getKeys()) {
|
|
745
|
-
if (!this.collection.getItem(key)) {
|
|
746
|
-
this.layoutInfos.delete(key);
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
if (!this.isLoading) {
|
|
751
|
-
this.layoutInfos.delete('loader');
|
|
752
|
-
}
|
|
315
|
+
var $c499a0c50a86931f$exports = {};
|
|
316
|
+
var $05e11d44de60bb49$exports = {};
|
|
317
|
+
$05e11d44de60bb49$exports = JSON.parse("{\"loading\":\"جارٍ التحميل...\",\"loadingMore\":\"جارٍ تحميل المزيد...\"}");
|
|
753
318
|
|
|
754
|
-
if (this.collection.size > 0) {
|
|
755
|
-
this.layoutInfos.delete('placeholder');
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
319
|
|
|
759
|
-
|
|
760
|
-
|
|
320
|
+
var $b89ff112e7ae8788$exports = {};
|
|
321
|
+
$b89ff112e7ae8788$exports = JSON.parse("{\"loading\":\"Зареждане...\",\"loadingMore\":\"Зареждане на още...\"}");
|
|
761
322
|
|
|
762
323
|
|
|
763
|
-
|
|
324
|
+
var $f673382e27d382c0$exports = {};
|
|
325
|
+
$f673382e27d382c0$exports = JSON.parse("{\"loading\":\"Načítání...\",\"loadingMore\":\"Načítání dalších...\"}");
|
|
764
326
|
|
|
765
|
-
getContentSize() {
|
|
766
|
-
return this.contentSize;
|
|
767
|
-
}
|
|
768
327
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
328
|
+
var $30e4d3afeab4b7ab$exports = {};
|
|
329
|
+
$30e4d3afeab4b7ab$exports = JSON.parse("{\"loading\":\"Indlæser ...\",\"loadingMore\":\"Indlæser flere ...\"}");
|
|
772
330
|
|
|
773
|
-
getVisibleLayoutInfos(rect) {
|
|
774
|
-
let res = [];
|
|
775
|
-
|
|
776
|
-
for (let layoutInfo of this.layoutInfos.values()) {
|
|
777
|
-
if (this.isVisible(layoutInfo, rect)) {
|
|
778
|
-
res.push(layoutInfo);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
331
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
isVisible(layoutInfo, rect) {
|
|
786
|
-
return layoutInfo.rect.intersects(rect);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
getInitialLayoutInfo(layoutInfo) {
|
|
790
|
-
layoutInfo.opacity = 0;
|
|
791
|
-
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
792
|
-
return layoutInfo;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
getFinalLayoutInfo(layoutInfo) {
|
|
796
|
-
layoutInfo.opacity = 0;
|
|
797
|
-
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
798
|
-
return layoutInfo;
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
_findClosestLayoutInfo(target, rect) {
|
|
802
|
-
let layoutInfos = this.getVisibleLayoutInfos(rect);
|
|
803
|
-
let best = null;
|
|
804
|
-
let bestDistance = Infinity; // Calculates distance as the distance between the center of 2 rects.
|
|
805
|
-
|
|
806
|
-
for (let cur of layoutInfos) {
|
|
807
|
-
if (cur.type === 'item') {
|
|
808
|
-
let curRect = cur.rect;
|
|
809
|
-
let targetMidX = (target.x + target.maxX) / 2;
|
|
810
|
-
let targetMidY = (target.y + target.maxY) / 2;
|
|
811
|
-
let curMidX = (curRect.x + curRect.maxX) / 2;
|
|
812
|
-
let curMidY = (curRect.y + curRect.maxY) / 2;
|
|
813
|
-
let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);
|
|
814
|
-
|
|
815
|
-
if (dist < bestDistance) {
|
|
816
|
-
best = cur;
|
|
817
|
-
bestDistance = dist;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
}
|
|
332
|
+
var $b7c6ec2c6e0bca3f$exports = {};
|
|
333
|
+
$b7c6ec2c6e0bca3f$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Mehr laden ...\"}");
|
|
821
334
|
|
|
822
|
-
return best;
|
|
823
|
-
}
|
|
824
335
|
|
|
825
|
-
|
|
826
|
-
|
|
336
|
+
var $7d4af83e4b75a459$exports = {};
|
|
337
|
+
$7d4af83e4b75a459$exports = JSON.parse("{\"loading\":\"Φόρτωση...\",\"loadingMore\":\"Φόρτωση περισσότερων...\"}");
|
|
827
338
|
|
|
828
|
-
return best || null;
|
|
829
|
-
}
|
|
830
339
|
|
|
831
|
-
|
|
832
|
-
|
|
340
|
+
var $75890aa9c3731f17$exports = {};
|
|
341
|
+
$75890aa9c3731f17$exports = JSON.parse("{\"loading\":\"Loading…\",\"loadingMore\":\"Loading more…\"}");
|
|
833
342
|
|
|
834
|
-
// Expected key is the currently focused cell so we need the parent row key
|
|
835
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
836
|
-
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
837
|
-
let rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
|
|
838
|
-
let closestRow = this.collection.getItem((_this$_findClosest = this._findClosest(layoutInfo.rect, rect)) == null ? void 0 : _this$_findClosest.key);
|
|
839
|
-
return closestRow == null ? void 0 : (_closestRow$childNode = closestRow.childNodes[0]) == null ? void 0 : _closestRow$childNode.key;
|
|
840
|
-
}
|
|
841
343
|
|
|
842
|
-
|
|
843
|
-
|
|
344
|
+
var $1073084a3d4380a7$exports = {};
|
|
345
|
+
$1073084a3d4380a7$exports = JSON.parse("{\"loading\":\"Cargando…\",\"loadingMore\":\"Cargando más…\"}");
|
|
844
346
|
|
|
845
|
-
// Expected key is the currently focused cell so we need the parent row key
|
|
846
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
847
|
-
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
848
|
-
let rect = new Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
|
|
849
|
-
let closestRow = this.collection.getItem((_this$_findClosest2 = this._findClosest(layoutInfo.rect, rect)) == null ? void 0 : _this$_findClosest2.key);
|
|
850
|
-
return closestRow == null ? void 0 : (_closestRow$childNode2 = closestRow.childNodes[0]) == null ? void 0 : _closestRow$childNode2.key;
|
|
851
|
-
}
|
|
852
347
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
856
|
-
key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);
|
|
348
|
+
var $e7e5017384501812$exports = {};
|
|
349
|
+
$e7e5017384501812$exports = JSON.parse("{\"loading\":\"Laadimine...\",\"loadingMore\":\"Laadi rohkem...\"}");
|
|
857
350
|
|
|
858
|
-
while (key != null) {
|
|
859
|
-
let item = this.collection.getItem(key); // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
|
|
860
351
|
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}
|
|
352
|
+
var $e27bd262dfe8a5f9$exports = {};
|
|
353
|
+
$e27bd262dfe8a5f9$exports = JSON.parse("{\"loading\":\"Ladataan…\",\"loadingMore\":\"Ladataan lisää…\"}");
|
|
864
354
|
|
|
865
|
-
key = this.direction === 'rtl' ? this.collection.getKeyBefore(key) : this.collection.getKeyAfter(key);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
355
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
872
|
-
key = this.direction === 'rtl' ? this.collection.getKeyAfter(parentRowKey) : this.collection.getKeyBefore(parentRowKey);
|
|
356
|
+
var $8e635e8e68bfcd28$exports = {};
|
|
357
|
+
$8e635e8e68bfcd28$exports = JSON.parse("{\"loading\":\"Chargement...\",\"loadingMore\":\"Chargement supplémentaire...\"}");
|
|
873
358
|
|
|
874
|
-
while (key != null) {
|
|
875
|
-
let item = this.collection.getItem(key); // Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
|
|
876
359
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
}
|
|
360
|
+
var $e57298bc648f02f5$exports = {};
|
|
361
|
+
$e57298bc648f02f5$exports = JSON.parse("{\"loading\":\"טוען...\",\"loadingMore\":\"טוען עוד...\"}");
|
|
880
362
|
|
|
881
|
-
key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
363
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
return firstRow.childNodes[0].key;
|
|
888
|
-
}
|
|
364
|
+
var $348fe8c4d1345caa$exports = {};
|
|
365
|
+
$348fe8c4d1345caa$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
|
|
889
366
|
|
|
890
|
-
getLastKey() {
|
|
891
|
-
let lastRow = this.collection.getItem(this.collection.getLastKey());
|
|
892
|
-
return lastRow.childNodes[0].key;
|
|
893
|
-
} // TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
|
|
894
|
-
// 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?
|
|
895
367
|
|
|
368
|
+
var $5432af5e9e029165$exports = {};
|
|
369
|
+
$5432af5e9e029165$exports = JSON.parse("{\"loading\":\"Betöltés folyamatban…\",\"loadingMore\":\"Továbbiak betöltése folyamatban…\"}");
|
|
896
370
|
|
|
897
|
-
getKeyPageAbove(key) {
|
|
898
|
-
// Expected key is the currently focused cell so we need the parent row key
|
|
899
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
900
|
-
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
901
371
|
|
|
902
|
-
|
|
903
|
-
|
|
372
|
+
var $5373de5381e81c93$exports = {};
|
|
373
|
+
$5373de5381e81c93$exports = JSON.parse("{\"loading\":\"Caricamento...\",\"loadingMore\":\"Caricamento altri...\"}");
|
|
904
374
|
|
|
905
|
-
let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height); // If the node is so large that it spans multiple page heights, return the key of the item immediately above
|
|
906
|
-
// Otherwise keep going up until we exceed a single page height worth of nodes
|
|
907
375
|
|
|
908
|
-
|
|
909
|
-
|
|
376
|
+
var $c0f02cf68cc6e29c$exports = {};
|
|
377
|
+
$c0f02cf68cc6e29c$exports = JSON.parse("{\"loading\":\"読み込み中...\",\"loadingMore\":\"さらに読み込み中...\"}");
|
|
910
378
|
|
|
911
|
-
if (layoutInfo && layoutInfo.rect.y > pageY) {
|
|
912
|
-
while (layoutInfo && layoutInfo.rect.y > pageY) {
|
|
913
|
-
var _this$collection$getI2;
|
|
914
379
|
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
layoutInfo = this.getLayoutInfo(keyAbove);
|
|
918
|
-
}
|
|
919
|
-
}
|
|
380
|
+
var $9d64e186eae28c9e$exports = {};
|
|
381
|
+
$9d64e186eae28c9e$exports = JSON.parse("{\"loading\":\"로드 중\",\"loadingMore\":\"추가 로드 중\"}");
|
|
920
382
|
|
|
921
|
-
if (layoutInfo) {
|
|
922
|
-
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
923
|
-
return childKey;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
383
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
// Perhaps have layoutInfo store childKey as well so we don't need to do this?
|
|
384
|
+
var $c242b9c8eccb24dd$exports = {};
|
|
385
|
+
$c242b9c8eccb24dd$exports = JSON.parse("{\"loading\":\"Įkeliama...\",\"loadingMore\":\"Įkeliama daugiau...\"}");
|
|
930
386
|
|
|
931
387
|
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
935
|
-
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
388
|
+
var $850489cfc731f34d$exports = {};
|
|
389
|
+
$850489cfc731f34d$exports = JSON.parse("{\"loading\":\"Notiek ielāde...\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
|
|
936
390
|
|
|
937
|
-
if (layoutInfo) {
|
|
938
|
-
var _this$collection$getI3;
|
|
939
391
|
|
|
940
|
-
|
|
941
|
-
|
|
392
|
+
var $03302a3965b0cb25$exports = {};
|
|
393
|
+
$03302a3965b0cb25$exports = JSON.parse("{\"loading\":\"Laster inn ...\",\"loadingMore\":\"Laster inn flere ...\"}");
|
|
942
394
|
|
|
943
|
-
let keyBelow = (_this$collection$getI3 = this.collection.getItem(this.getKeyBelow(key))) == null ? void 0 : _this$collection$getI3.parentKey;
|
|
944
|
-
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
945
395
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
var _this$collection$getI4;
|
|
396
|
+
var $f0b491507d9648cc$exports = {};
|
|
397
|
+
$f0b491507d9648cc$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Meer laden...\"}");
|
|
949
398
|
|
|
950
|
-
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
951
|
-
let keyBelow = (_this$collection$getI4 = this.collection.getItem(this.getKeyBelow(childKey))) == null ? void 0 : _this$collection$getI4.parentKey;
|
|
952
|
-
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
399
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
return childKey;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
400
|
+
var $98a4bd7d4032ff5e$exports = {};
|
|
401
|
+
$98a4bd7d4032ff5e$exports = JSON.parse("{\"loading\":\"Ładowanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
|
|
961
402
|
|
|
962
|
-
return this.getLastKey();
|
|
963
|
-
}
|
|
964
403
|
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
return null;
|
|
968
|
-
}
|
|
404
|
+
var $8bc868b0f7096384$exports = {};
|
|
405
|
+
$8bc868b0f7096384$exports = JSON.parse("{\"loading\":\"Carregando...\",\"loadingMore\":\"Carregando mais...\"}");
|
|
969
406
|
|
|
970
|
-
let collection = this.collection;
|
|
971
|
-
let key = fromKey != null ? fromKey : this.getFirstKey();
|
|
972
|
-
let startItem = collection.getItem(key);
|
|
973
|
-
key = startItem.parentKey;
|
|
974
407
|
|
|
975
|
-
|
|
976
|
-
|
|
408
|
+
var $b70799b89c361523$exports = {};
|
|
409
|
+
$b70799b89c361523$exports = JSON.parse("{\"loading\":\"A carregar...\",\"loadingMore\":\"A carregar mais...\"}");
|
|
977
410
|
|
|
978
|
-
if (item.textValue) {
|
|
979
|
-
let substring = item.textValue.slice(0, search.length);
|
|
980
411
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}
|
|
984
|
-
}
|
|
412
|
+
var $0dbfb5ab353c8d62$exports = {};
|
|
413
|
+
$0dbfb5ab353c8d62$exports = JSON.parse("{\"loading\":\"Se încarcă...\",\"loadingMore\":\"Se încarcă mai multe...\"}");
|
|
985
414
|
|
|
986
|
-
key = this.collection.getKeyAfter(key);
|
|
987
|
-
}
|
|
988
415
|
|
|
989
|
-
|
|
990
|
-
|
|
416
|
+
var $02d64b00e5364785$exports = {};
|
|
417
|
+
$02d64b00e5364785$exports = JSON.parse("{\"loading\":\"Загрузка...\",\"loadingMore\":\"Дополнительная загрузка...\"}");
|
|
991
418
|
|
|
992
|
-
}
|
|
993
419
|
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
idealRowHeight: 112,
|
|
997
|
-
minItemSize: new Size(96, 96),
|
|
998
|
-
itemSpacing: new Size(8, 16),
|
|
999
|
-
itemPadding: 24,
|
|
1000
|
-
dropSpacing: 50,
|
|
1001
|
-
margin: 8
|
|
1002
|
-
},
|
|
1003
|
-
L: {
|
|
1004
|
-
idealRowHeight: 208,
|
|
1005
|
-
minItemSize: new Size(136, 136),
|
|
1006
|
-
itemSpacing: new Size(18, 18),
|
|
1007
|
-
itemPadding: {
|
|
1008
|
-
'medium': 114,
|
|
1009
|
-
'large': 143
|
|
1010
|
-
},
|
|
1011
|
-
dropSpacing: 100,
|
|
1012
|
-
margin: 24
|
|
1013
|
-
}
|
|
1014
|
-
};
|
|
420
|
+
var $91c537037a78c021$exports = {};
|
|
421
|
+
$91c537037a78c021$exports = JSON.parse("{\"loading\":\"Načítava sa...\",\"loadingMore\":\"Načítava sa viac...\"}");
|
|
1015
422
|
|
|
1016
|
-
class GalleryLayout extends $ae626509048548c15655cbbeb258411$export$BaseLayout {
|
|
1017
|
-
constructor(options) {
|
|
1018
|
-
if (options === void 0) {
|
|
1019
|
-
options = {};
|
|
1020
|
-
}
|
|
1021
423
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
this.itemSpacing = void 0;
|
|
1025
|
-
this.itemPadding = void 0;
|
|
1026
|
-
this.minItemSize = void 0;
|
|
1027
|
-
this.threshold = void 0;
|
|
1028
|
-
let cardSize = 'L';
|
|
1029
|
-
this.idealRowHeight = options.idealRowHeight || $a23e32931be921d018d1ae1efeda8$var$DEFAULT_OPTIONS[cardSize].idealRowHeight;
|
|
1030
|
-
this.itemSpacing = options.itemSpacing || $a23e32931be921d018d1ae1efeda8$var$DEFAULT_OPTIONS[cardSize].itemSpacing;
|
|
1031
|
-
this.itemPadding = options.itemPadding != null ? options.itemPadding : $a23e32931be921d018d1ae1efeda8$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.scale];
|
|
1032
|
-
this.minItemSize = options.minItemSize || $a23e32931be921d018d1ae1efeda8$var$DEFAULT_OPTIONS[cardSize].minItemSize;
|
|
1033
|
-
this.threshold = options.threshold || 1;
|
|
1034
|
-
this.margin = options.margin != null ? options.margin : $a23e32931be921d018d1ae1efeda8$var$DEFAULT_OPTIONS[cardSize].margin;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
get layoutType() {
|
|
1038
|
-
return 'gallery';
|
|
1039
|
-
}
|
|
1040
|
-
/**
|
|
1041
|
-
* Takes a row of widths and if there are any widths smaller than the min-width, leech width starting from
|
|
1042
|
-
* the widest in the row until it can't give anymore, then move to the second widest and so forth.
|
|
1043
|
-
* Do this until all assets meet the min-width.
|
|
1044
|
-
* */
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
_distributeWidths(widths) {
|
|
1048
|
-
// create a copy of the widths array and sort it largest to smallest
|
|
1049
|
-
let sortedWidths = widths.concat().sort((a, b) => a[1] > b[1] ? -1 : 1);
|
|
1050
|
-
|
|
1051
|
-
for (let width of widths) {
|
|
1052
|
-
// for each width, if it's smaller than the min width
|
|
1053
|
-
if (width[1] < this.minItemSize.width) {
|
|
1054
|
-
// then figure out how much smaller
|
|
1055
|
-
let delta = this.minItemSize.width - width[1];
|
|
1056
|
-
|
|
1057
|
-
for (let item of sortedWidths) {
|
|
1058
|
-
// go from the largest width in the row to the smallest
|
|
1059
|
-
// if the width is greater than the min width
|
|
1060
|
-
if (widths[item[0]][1] > this.minItemSize.width) {
|
|
1061
|
-
// subtract the delta from the width, if it's still greater than the min width
|
|
1062
|
-
// then we have finished, subtract the delta permanently from that width
|
|
1063
|
-
if (widths[item[0]][1] - delta > this.minItemSize.width) {
|
|
1064
|
-
widths[item[0]][1] -= delta;
|
|
1065
|
-
delta = 0;
|
|
1066
|
-
break;
|
|
1067
|
-
} else {
|
|
1068
|
-
// otherwise, we take as much as we can from the current width and then move on to
|
|
1069
|
-
// the next largest and take some width from it
|
|
1070
|
-
let maxChange = widths[item[0]][1] - this.minItemSize.width;
|
|
1071
|
-
delta -= maxChange;
|
|
1072
|
-
widths[item[0]][1] -= maxChange;
|
|
1073
|
-
}
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
424
|
+
var $96433c112ab164da$exports = {};
|
|
425
|
+
$96433c112ab164da$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje več vsebine...\"}");
|
|
1076
426
|
|
|
1077
|
-
if (delta > 0) {
|
|
1078
|
-
return false;
|
|
1079
|
-
} // force the width to be the min width that we just rebalanced for
|
|
1080
427
|
|
|
428
|
+
var $5e38aa6fe07a208a$exports = {};
|
|
429
|
+
$5e38aa6fe07a208a$exports = JSON.parse("{\"loading\":\"Učitavam...\",\"loadingMore\":\"Učitavam još...\"}");
|
|
1081
430
|
|
|
1082
|
-
width[1] = this.minItemSize.width;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
431
|
|
|
1086
|
-
|
|
1087
|
-
|
|
432
|
+
var $1603e110d1b708a2$exports = {};
|
|
433
|
+
$1603e110d1b708a2$exports = JSON.parse("{\"loading\":\"Läser in...\",\"loadingMore\":\"Läser in mer...\"}");
|
|
1088
434
|
|
|
1089
|
-
buildCollection() {
|
|
1090
|
-
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
1091
|
-
let visibleHeight = this.virtualizer.visibleRect.height;
|
|
1092
|
-
let y = this.margin;
|
|
1093
|
-
let availableWidth = visibleWidth - this.margin * 2; // Compute aspect ratios for all of the items, and the total width if all items were on in a single row.
|
|
1094
435
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
let minRatio = this.minItemSize.width / this.minItemSize.height;
|
|
1098
|
-
let maxRatio = availableWidth / this.minItemSize.height;
|
|
436
|
+
var $d1e6a4344fa7e24c$exports = {};
|
|
437
|
+
$d1e6a4344fa7e24c$exports = JSON.parse("{\"loading\":\"Yükleniyor...\",\"loadingMore\":\"Daha fazla yükleniyor...\"}");
|
|
1099
438
|
|
|
1100
|
-
for (let node of this.collection) {
|
|
1101
|
-
let ratio = node.props.width / node.props.height;
|
|
1102
439
|
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
} else if (ratio > maxRatio && ratio !== minRatio) {
|
|
1106
|
-
ratio = maxRatio;
|
|
1107
|
-
}
|
|
440
|
+
var $eb17c3bd09bd0a84$exports = {};
|
|
441
|
+
$eb17c3bd09bd0a84$exports = JSON.parse("{\"loading\":\"Завантаження…\",\"loadingMore\":\"Завантаження інших об’єктів...\"}");
|
|
1108
442
|
|
|
1109
|
-
let itemWidth = ratio * this.minItemSize.height;
|
|
1110
|
-
ratios.push(ratio);
|
|
1111
|
-
totalWidth += itemWidth;
|
|
1112
|
-
}
|
|
1113
443
|
|
|
1114
|
-
|
|
1115
|
-
|
|
444
|
+
var $2021a7dfbfb3ee24$exports = {};
|
|
445
|
+
$2021a7dfbfb3ee24$exports = JSON.parse("{\"loading\":\"正在加载...\",\"loadingMore\":\"正在加载更多...\"}");
|
|
1116
446
|
|
|
1117
|
-
let rows = Math.max(1, Math.ceil(totalWidth / availableWidth)); // if the available width can't hold two items, then every item will get its own row
|
|
1118
|
-
// this leads to a faster run through linear partition and more dependable output for small row widths
|
|
1119
447
|
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
}
|
|
448
|
+
var $cc6ddaf27cd77eec$exports = {};
|
|
449
|
+
$cc6ddaf27cd77eec$exports = JSON.parse("{\"loading\":\"正在載入\",\"loadingMore\":\"正在載入更多…\"}");
|
|
1123
450
|
|
|
1124
|
-
let weightedRatios = ratios.map(ratio => ratio < this.threshold ? ratio + 0.5 * (1 / ratio) : ratio);
|
|
1125
|
-
let partition = $a23e32931be921d018d1ae1efeda8$var$linearPartition(weightedRatios, rows);
|
|
1126
|
-
let index = 0;
|
|
1127
451
|
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
452
|
+
$c499a0c50a86931f$exports = {
|
|
453
|
+
"ar-AE": $05e11d44de60bb49$exports,
|
|
454
|
+
"bg-BG": $b89ff112e7ae8788$exports,
|
|
455
|
+
"cs-CZ": $f673382e27d382c0$exports,
|
|
456
|
+
"da-DK": $30e4d3afeab4b7ab$exports,
|
|
457
|
+
"de-DE": $b7c6ec2c6e0bca3f$exports,
|
|
458
|
+
"el-GR": $7d4af83e4b75a459$exports,
|
|
459
|
+
"en-US": $75890aa9c3731f17$exports,
|
|
460
|
+
"es-ES": $1073084a3d4380a7$exports,
|
|
461
|
+
"et-EE": $e7e5017384501812$exports,
|
|
462
|
+
"fi-FI": $e27bd262dfe8a5f9$exports,
|
|
463
|
+
"fr-FR": $8e635e8e68bfcd28$exports,
|
|
464
|
+
"he-IL": $e57298bc648f02f5$exports,
|
|
465
|
+
"hr-HR": $348fe8c4d1345caa$exports,
|
|
466
|
+
"hu-HU": $5432af5e9e029165$exports,
|
|
467
|
+
"it-IT": $5373de5381e81c93$exports,
|
|
468
|
+
"ja-JP": $c0f02cf68cc6e29c$exports,
|
|
469
|
+
"ko-KR": $9d64e186eae28c9e$exports,
|
|
470
|
+
"lt-LT": $c242b9c8eccb24dd$exports,
|
|
471
|
+
"lv-LV": $850489cfc731f34d$exports,
|
|
472
|
+
"nb-NO": $03302a3965b0cb25$exports,
|
|
473
|
+
"nl-NL": $f0b491507d9648cc$exports,
|
|
474
|
+
"pl-PL": $98a4bd7d4032ff5e$exports,
|
|
475
|
+
"pt-BR": $8bc868b0f7096384$exports,
|
|
476
|
+
"pt-PT": $b70799b89c361523$exports,
|
|
477
|
+
"ro-RO": $0dbfb5ab353c8d62$exports,
|
|
478
|
+
"ru-RU": $02d64b00e5364785$exports,
|
|
479
|
+
"sk-SK": $91c537037a78c021$exports,
|
|
480
|
+
"sl-SI": $96433c112ab164da$exports,
|
|
481
|
+
"sr-SP": $5e38aa6fe07a208a$exports,
|
|
482
|
+
"sv-SE": $1603e110d1b708a2$exports,
|
|
483
|
+
"tr-TR": $d1e6a4344fa7e24c$exports,
|
|
484
|
+
"uk-UA": $eb17c3bd09bd0a84$exports,
|
|
485
|
+
"zh-CN": $2021a7dfbfb3ee24$exports,
|
|
486
|
+
"zh-TW": $cc6ddaf27cd77eec$exports
|
|
487
|
+
};
|
|
1131
488
|
|
|
1132
|
-
for (let j = index; j < index + row.length; j++) {
|
|
1133
|
-
totalWeight += ratios[j];
|
|
1134
|
-
} // Determine the row height based on the total available width and weight of this row.
|
|
1135
489
|
|
|
1136
490
|
|
|
1137
|
-
let bestRowHeight = (availableWidth - (row.length - 1) * this.itemSpacing.width) / totalWeight; // if this is the last row and the row height is >2x the ideal row height, then cap to the ideal height
|
|
1138
|
-
// probably doing this because if the last row has one extremely tall image, then the row becomes huge
|
|
1139
|
-
// though that can happen anywhere if a row has lots of tall images... so i'm not sure why this one matters
|
|
1140
491
|
|
|
1141
|
-
if (row === partition[partition.length - 1] && bestRowHeight > this.idealRowHeight * 2) {
|
|
1142
|
-
bestRowHeight = this.idealRowHeight;
|
|
1143
|
-
}
|
|
1144
492
|
|
|
1145
|
-
let itemHeight = Math.round(bestRowHeight) + this.itemPadding;
|
|
1146
|
-
let x = this.margin; // if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
|
|
1147
493
|
|
|
1148
|
-
let widths = [];
|
|
1149
494
|
|
|
1150
|
-
for (let j = index; j < index + row.length; j++) {
|
|
1151
|
-
let width = Math.round(bestRowHeight * ratios[j]);
|
|
1152
|
-
widths.push([j - index, width]);
|
|
1153
|
-
}
|
|
1154
495
|
|
|
1155
|
-
this._distributeWidths(widths); // Create items for this row.
|
|
1156
496
|
|
|
1157
497
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
498
|
+
function $a17eb1b1228312f3$var$CardView(props, ref) {
|
|
499
|
+
let { scale: scale } = $h48Fj$reactspectrumprovider.useProvider();
|
|
500
|
+
let { styleProps: styleProps } = $h48Fj$reactspectrumutils.useStyleProps(props);
|
|
501
|
+
let domRef = $h48Fj$reactspectrumutils.useDOMRef(ref);
|
|
502
|
+
let { isQuiet: isQuiet , renderEmptyState: renderEmptyState , layout: layout , loadingState: loadingState , onLoadMore: onLoadMore , cardOrientation: cardOrientation = 'vertical' } = props;
|
|
503
|
+
let collator = $h48Fj$reactariai18n.useCollator({
|
|
504
|
+
usage: 'search',
|
|
505
|
+
sensitivity: 'base'
|
|
506
|
+
});
|
|
507
|
+
let isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
|
|
508
|
+
let cardViewLayout = $h48Fj$react.useMemo(()=>typeof layout === 'function' ? new layout({
|
|
509
|
+
collator: collator,
|
|
510
|
+
cardOrientation: cardOrientation,
|
|
511
|
+
scale: scale
|
|
512
|
+
}) : layout
|
|
513
|
+
, [
|
|
514
|
+
layout,
|
|
515
|
+
collator,
|
|
516
|
+
cardOrientation,
|
|
517
|
+
scale
|
|
518
|
+
]);
|
|
519
|
+
let layoutType = cardViewLayout.layoutType;
|
|
520
|
+
let formatMessage = $h48Fj$reactariai18n.useMessageFormatter((/*@__PURE__*/$parcel$interopDefault($c499a0c50a86931f$exports)));
|
|
521
|
+
let { direction: direction } = $h48Fj$reactariai18n.useLocale();
|
|
522
|
+
let { collection: collection } = $h48Fj$reactstatelylist.useListState(props);
|
|
523
|
+
let gridCollection = $h48Fj$react.useMemo(()=>new $h48Fj$reactstatelygrid.GridCollection({
|
|
524
|
+
columnCount: 1,
|
|
525
|
+
items: [
|
|
526
|
+
...collection
|
|
527
|
+
].map((item)=>({
|
|
528
|
+
// Makes the Grid row use the keys the user provides to the cards so that selection change via interactions returns the card keys
|
|
529
|
+
...item,
|
|
530
|
+
hasChildNodes: true,
|
|
531
|
+
childNodes: [
|
|
532
|
+
{
|
|
533
|
+
key: `cell-${item.key}`,
|
|
534
|
+
type: 'cell',
|
|
535
|
+
value: null,
|
|
536
|
+
level: 0,
|
|
537
|
+
rendered: null,
|
|
538
|
+
textValue: item.textValue,
|
|
539
|
+
hasChildNodes: false,
|
|
540
|
+
childNodes: []
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
})
|
|
544
|
+
)
|
|
545
|
+
})
|
|
546
|
+
, [
|
|
547
|
+
collection
|
|
548
|
+
]);
|
|
549
|
+
let state = $h48Fj$reactstatelygrid.useGridState({
|
|
550
|
+
...props,
|
|
551
|
+
selectionMode: cardOrientation === 'horizontal' && layoutType === 'grid' ? 'none' : props.selectionMode,
|
|
552
|
+
collection: gridCollection,
|
|
553
|
+
focusMode: 'cell'
|
|
554
|
+
});
|
|
555
|
+
cardViewLayout.collection = gridCollection;
|
|
556
|
+
cardViewLayout.disabledKeys = state.disabledKeys;
|
|
557
|
+
cardViewLayout.isLoading = isLoading;
|
|
558
|
+
cardViewLayout.direction = direction;
|
|
559
|
+
let { gridProps: gridProps } = $h48Fj$reactariagrid.useGrid({
|
|
560
|
+
...props,
|
|
561
|
+
isVirtualized: true,
|
|
562
|
+
keyboardDelegate: cardViewLayout
|
|
563
|
+
}, state, domRef);
|
|
564
|
+
let renderWrapper = (parent, reusableView)=>/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactariavirtualizer.VirtualizerItem, {
|
|
565
|
+
key: reusableView.key,
|
|
566
|
+
reusableView: reusableView,
|
|
567
|
+
parent: parent
|
|
568
|
+
})
|
|
569
|
+
;
|
|
570
|
+
let focusedKey = state.selectionManager.focusedKey;
|
|
571
|
+
let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
|
|
572
|
+
if (focusedItem?.parentKey != null) focusedKey = focusedItem.parentKey;
|
|
573
|
+
let margin = cardViewLayout.margin || 0;
|
|
574
|
+
let virtualizer = cardViewLayout.virtualizer;
|
|
575
|
+
let scrollToItem = $h48Fj$react.useCallback((key)=>{
|
|
576
|
+
virtualizer && virtualizer.scrollToItem(key, {
|
|
577
|
+
duration: 0,
|
|
578
|
+
offsetY: margin
|
|
579
|
+
});
|
|
580
|
+
}, [
|
|
581
|
+
margin,
|
|
582
|
+
virtualizer
|
|
583
|
+
]);
|
|
584
|
+
// TODO: does aria-row count and aria-col count need to be modified? Perhaps aria-col count needs to be omitted
|
|
585
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($0498deb1284b0345$export$64992ac69f286e5c.Provider, {
|
|
586
|
+
value: {
|
|
587
|
+
state: state,
|
|
588
|
+
isQuiet: isQuiet,
|
|
589
|
+
layout: cardViewLayout,
|
|
590
|
+
cardOrientation: cardOrientation
|
|
591
|
+
}
|
|
592
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactariavirtualizer.Virtualizer, {
|
|
593
|
+
...gridProps,
|
|
594
|
+
...styleProps,
|
|
595
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-CardView'),
|
|
596
|
+
ref: domRef,
|
|
597
|
+
focusedKey: focusedKey,
|
|
598
|
+
scrollDirection: "vertical",
|
|
599
|
+
layout: cardViewLayout,
|
|
600
|
+
collection: gridCollection,
|
|
601
|
+
isLoading: isLoading,
|
|
602
|
+
onLoadMore: onLoadMore,
|
|
603
|
+
renderWrapper: renderWrapper,
|
|
604
|
+
transitionDuration: isLoading ? 160 : 220,
|
|
605
|
+
scrollToItem: scrollToItem
|
|
606
|
+
}, (type, item)=>{
|
|
607
|
+
if (type === 'item') return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($a17eb1b1228312f3$var$InternalCard, {
|
|
608
|
+
item: item
|
|
609
|
+
}));
|
|
610
|
+
else if (type === 'loader') return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($a17eb1b1228312f3$var$CenteredWrapper, null, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($h48Fj$reactspectrumprogress.ProgressCircle, {
|
|
611
|
+
isIndeterminate: true,
|
|
612
|
+
"aria-label": state.collection.size > 0 ? formatMessage('loadingMore') : formatMessage('loading')
|
|
613
|
+
})));
|
|
614
|
+
else if (type === 'placeholder') {
|
|
615
|
+
let emptyState = renderEmptyState ? renderEmptyState() : null;
|
|
616
|
+
if (emptyState == null) return null;
|
|
617
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($a17eb1b1228312f3$var$CenteredWrapper, null, emptyState));
|
|
618
|
+
}
|
|
619
|
+
})));
|
|
620
|
+
}
|
|
621
|
+
function $a17eb1b1228312f3$var$CenteredWrapper({ children: children }) {
|
|
622
|
+
let { state: state } = $0498deb1284b0345$export$fea0b38586ec8f13();
|
|
623
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
624
|
+
role: "row",
|
|
625
|
+
"aria-rowindex": state.collection.size + 1,
|
|
626
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-CardView-centeredWrapper')
|
|
627
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
628
|
+
role: "gridcell"
|
|
629
|
+
}, children)));
|
|
630
|
+
}
|
|
631
|
+
function $a17eb1b1228312f3$var$InternalCard(props) {
|
|
632
|
+
let { item: item } = props;
|
|
633
|
+
let cellNode = [
|
|
634
|
+
...item.childNodes
|
|
635
|
+
][0];
|
|
636
|
+
let { state: state , cardOrientation: cardOrientation , isQuiet: isQuiet , layout: layout } = $0498deb1284b0345$export$fea0b38586ec8f13();
|
|
637
|
+
let layoutType = layout.layoutType;
|
|
638
|
+
let rowRef = $h48Fj$react.useRef();
|
|
639
|
+
let cellRef = $h48Fj$react.useRef();
|
|
640
|
+
let unwrappedRef = $h48Fj$reactspectrumutils.useUnwrapDOMRef(cellRef);
|
|
641
|
+
let { rowProps: rowProps } = $h48Fj$reactariagrid.useGridRow({
|
|
642
|
+
node: item,
|
|
643
|
+
isVirtualized: true
|
|
644
|
+
}, state, rowRef);
|
|
645
|
+
let { gridCellProps: gridCellProps } = $h48Fj$reactariagrid.useGridCell({
|
|
646
|
+
node: cellNode,
|
|
647
|
+
focusMode: 'cell'
|
|
648
|
+
}, state, unwrappedRef);
|
|
649
|
+
if (layoutType === 'grid' || layoutType === 'gallery') isQuiet = true;
|
|
650
|
+
if (layoutType !== 'grid') cardOrientation = 'vertical';
|
|
651
|
+
// We don't want to focus the checkbox (or any other focusable elements) within the Card
|
|
652
|
+
// when pressing the arrow keys so we delete the key down handler here. Arrow key navigation between
|
|
653
|
+
// the cards in the CardView is handled by useGrid => useSelectableCollection instead.
|
|
654
|
+
delete gridCellProps.onKeyDownCapture;
|
|
655
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement("div", {
|
|
656
|
+
...rowProps,
|
|
657
|
+
ref: rowRef,
|
|
658
|
+
className: $h48Fj$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9dc4f51f9a4db17a$exports)), 'spectrum-CardView-row')
|
|
659
|
+
}, /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($aa5f628de93d2fc1$export$7a6ccaf429ad93a8, {
|
|
660
|
+
ref: cellRef,
|
|
661
|
+
articleProps: gridCellProps,
|
|
662
|
+
isQuiet: isQuiet,
|
|
663
|
+
orientation: cardOrientation,
|
|
664
|
+
item: item,
|
|
665
|
+
layout: layoutType
|
|
666
|
+
}, item.rendered)));
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* TODO: Add description of component here.
|
|
670
|
+
*/ const $a17eb1b1228312f3$export$7e52c821f7b6f422 = /*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).forwardRef($a17eb1b1228312f3$var$CardView);
|
|
1167
671
|
|
|
1168
|
-
y += itemHeight + this.itemSpacing.height;
|
|
1169
|
-
index += row.length;
|
|
1170
|
-
}
|
|
1171
672
|
|
|
1172
|
-
|
|
1173
|
-
let loaderY = y;
|
|
1174
|
-
let loaderHeight = 60; // If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1175
|
-
// so it doesn't scroll
|
|
673
|
+
var $f2d8d97b844f7f17$exports = {};
|
|
1176
674
|
|
|
1177
|
-
|
|
1178
|
-
loaderY = 0;
|
|
1179
|
-
loaderHeight = visibleHeight || 60;
|
|
1180
|
-
}
|
|
675
|
+
$parcel$export($f2d8d97b844f7f17$exports, "GalleryLayout", () => $f2d8d97b844f7f17$export$8e52095834484b61);
|
|
1181
676
|
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
677
|
+
class $b5fabe37852ab8f7$export$64943d2e59d72a29 extends $h48Fj$reactstatelyvirtualizer.Layout {
|
|
678
|
+
constructor(options = {
|
|
679
|
+
}){
|
|
680
|
+
super();
|
|
681
|
+
this.disabledKeys = new Set();
|
|
682
|
+
this.layoutInfos = new Map();
|
|
683
|
+
this.collator = options.collator;
|
|
684
|
+
this.lastCollection = null;
|
|
685
|
+
this.scale = options.scale || 'medium';
|
|
686
|
+
this.margin = options.margin || 24;
|
|
1186
687
|
}
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
688
|
+
validate(invalidationContext) {
|
|
689
|
+
this.collection = this.virtualizer.collection;
|
|
690
|
+
this.buildCollection(invalidationContext);
|
|
691
|
+
// Remove layout info that doesn't exist in new collection
|
|
692
|
+
if (this.lastCollection) {
|
|
693
|
+
for (let key of this.lastCollection.getKeys())if (!this.collection.getItem(key)) this.layoutInfos.delete(key);
|
|
694
|
+
if (!this.isLoading) this.layoutInfos.delete('loader');
|
|
695
|
+
if (this.collection.size > 0) this.layoutInfos.delete('placeholder');
|
|
696
|
+
}
|
|
697
|
+
this.lastCollection = this.collection;
|
|
1193
698
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
let cost = Math.max(c1, c2);
|
|
1238
|
-
|
|
1239
|
-
if (!x || cost < currentMin) {
|
|
1240
|
-
currentMin = cost;
|
|
1241
|
-
minX = x;
|
|
699
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
700
|
+
buildCollection(invalidationContext) {
|
|
701
|
+
}
|
|
702
|
+
getContentSize() {
|
|
703
|
+
return this.contentSize;
|
|
704
|
+
}
|
|
705
|
+
getLayoutInfo(key) {
|
|
706
|
+
return this.layoutInfos.get(key);
|
|
707
|
+
}
|
|
708
|
+
getVisibleLayoutInfos(rect) {
|
|
709
|
+
let res = [];
|
|
710
|
+
for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
|
|
711
|
+
return res;
|
|
712
|
+
}
|
|
713
|
+
isVisible(layoutInfo, rect) {
|
|
714
|
+
return layoutInfo.rect.intersects(rect);
|
|
715
|
+
}
|
|
716
|
+
getInitialLayoutInfo(layoutInfo) {
|
|
717
|
+
layoutInfo.opacity = 0;
|
|
718
|
+
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
719
|
+
return layoutInfo;
|
|
720
|
+
}
|
|
721
|
+
getFinalLayoutInfo(layoutInfo) {
|
|
722
|
+
layoutInfo.opacity = 0;
|
|
723
|
+
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
724
|
+
return layoutInfo;
|
|
725
|
+
}
|
|
726
|
+
_findClosestLayoutInfo(target, rect) {
|
|
727
|
+
let layoutInfos = this.getVisibleLayoutInfos(rect);
|
|
728
|
+
let best = null;
|
|
729
|
+
let bestDistance = Infinity;
|
|
730
|
+
// Calculates distance as the distance between the center of 2 rects.
|
|
731
|
+
for (let cur of layoutInfos)if (cur.type === 'item') {
|
|
732
|
+
let curRect = cur.rect;
|
|
733
|
+
let targetMidX = (target.x + target.maxX) / 2;
|
|
734
|
+
let targetMidY = (target.y + target.maxY) / 2;
|
|
735
|
+
let curMidX = (curRect.x + curRect.maxX) / 2;
|
|
736
|
+
let curMidY = (curRect.y + curRect.maxY) / 2;
|
|
737
|
+
let dist = Math.pow(targetMidX - curMidX, 2) + Math.pow(targetMidY - curMidY, 2);
|
|
738
|
+
if (dist < bestDistance) {
|
|
739
|
+
best = cur;
|
|
740
|
+
bestDistance = dist;
|
|
741
|
+
}
|
|
1242
742
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
table[i][j] = currentMin;
|
|
1246
|
-
solution[i - 1][j - 1] = minX;
|
|
743
|
+
return best;
|
|
1247
744
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
k = k - 2;
|
|
1252
|
-
let result = [];
|
|
1253
|
-
|
|
1254
|
-
while (k >= 0) {
|
|
1255
|
-
if (n >= 1) {
|
|
1256
|
-
let row = [];
|
|
1257
|
-
|
|
1258
|
-
for (let i = solution[n - 1][k] + 1; i < n + 1; i++) {
|
|
1259
|
-
row.push(seq[i]);
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
result.unshift(row);
|
|
1263
|
-
n = solution[n - 1][k];
|
|
745
|
+
_findClosest(target, rect) {
|
|
746
|
+
let best = this._findClosestLayoutInfo(target, rect);
|
|
747
|
+
return best || null;
|
|
1264
748
|
}
|
|
749
|
+
getKeyBelow(key) {
|
|
750
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
751
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
752
|
+
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
753
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.x, layoutInfo.rect.maxY + 1, layoutInfo.rect.width, this.virtualizer.visibleRect.height);
|
|
754
|
+
let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);
|
|
755
|
+
return closestRow?.childNodes[0]?.key;
|
|
756
|
+
}
|
|
757
|
+
getKeyAbove(key) {
|
|
758
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
759
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
760
|
+
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
761
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.x, 0, layoutInfo.rect.width, layoutInfo.rect.y - 1);
|
|
762
|
+
let closestRow = this.collection.getItem(this._findClosest(layoutInfo.rect, rect)?.key);
|
|
763
|
+
return closestRow?.childNodes[0]?.key;
|
|
764
|
+
}
|
|
765
|
+
getKeyRightOf(key) {
|
|
766
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
767
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
768
|
+
key = this.direction === 'rtl' ? this.collection.getKeyBefore(parentRowKey) : this.collection.getKeyAfter(parentRowKey);
|
|
769
|
+
while(key != null){
|
|
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 item.childNodes[0].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
|
+
let item = this.collection.getItem(key);
|
|
782
|
+
// Don't check if item is disabled because we want to be able to focus disabled items in a grid (double check this)
|
|
783
|
+
if (item.type === 'item') return item.childNodes[0].key;
|
|
784
|
+
key = this.direction === 'rtl' ? this.collection.getKeyAfter(key) : this.collection.getKeyBefore(key);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
getFirstKey() {
|
|
788
|
+
let firstRow = this.collection.getItem(this.collection.getFirstKey());
|
|
789
|
+
return firstRow.childNodes[0].key;
|
|
790
|
+
}
|
|
791
|
+
getLastKey() {
|
|
792
|
+
let lastRow = this.collection.getItem(this.collection.getLastKey());
|
|
793
|
+
return lastRow.childNodes[0].key;
|
|
794
|
+
}
|
|
795
|
+
// TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
|
|
796
|
+
// 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?
|
|
797
|
+
getKeyPageAbove(key) {
|
|
798
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
799
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
800
|
+
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
801
|
+
if (layoutInfo) {
|
|
802
|
+
let pageY = Math.max(0, layoutInfo.rect.y + layoutInfo.rect.height - this.virtualizer.visibleRect.height);
|
|
803
|
+
// If the node is so large that it spans multiple page heights, return the key of the item immediately above
|
|
804
|
+
// Otherwise keep going up until we exceed a single page height worth of nodes
|
|
805
|
+
let keyAbove = this.collection.getItem(this.getKeyAbove(key))?.parentKey;
|
|
806
|
+
layoutInfo = this.getLayoutInfo(keyAbove);
|
|
807
|
+
if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
|
|
808
|
+
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
809
|
+
let keyAbove = this.collection.getItem(this.getKeyAbove(childKey))?.parentKey;
|
|
810
|
+
layoutInfo = this.getLayoutInfo(keyAbove);
|
|
811
|
+
}
|
|
812
|
+
if (layoutInfo) {
|
|
813
|
+
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
814
|
+
return childKey;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
return this.getFirstKey();
|
|
818
|
+
}
|
|
819
|
+
// TODO: pretty unwieldy because it needs to bounce back and forth between the parent key and the child key
|
|
820
|
+
// Perhaps have layoutInfo store childKey as well so we don't need to do this?
|
|
821
|
+
getKeyPageBelow(key) {
|
|
822
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
823
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
824
|
+
let layoutInfo = this.getLayoutInfo(parentRowKey);
|
|
825
|
+
if (layoutInfo) {
|
|
826
|
+
let pageY = Math.min(this.virtualizer.contentSize.height, layoutInfo.rect.y - layoutInfo.rect.height + this.virtualizer.visibleRect.height);
|
|
827
|
+
// If the node is so large that it spans multiple page heights, return the key of the item immediately below
|
|
828
|
+
// Otherwise keep going up until we exceed a single page height worth of nodes
|
|
829
|
+
let keyBelow = this.collection.getItem(this.getKeyBelow(key))?.parentKey;
|
|
830
|
+
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
831
|
+
if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
|
|
832
|
+
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
833
|
+
let keyBelow = this.collection.getItem(this.getKeyBelow(childKey))?.parentKey;
|
|
834
|
+
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
835
|
+
}
|
|
836
|
+
if (layoutInfo) {
|
|
837
|
+
let childKey = this.collection.getItem(layoutInfo.key).childNodes[0].key;
|
|
838
|
+
return childKey;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return this.getLastKey();
|
|
842
|
+
}
|
|
843
|
+
getKeyForSearch(search, fromKey) {
|
|
844
|
+
if (!this.collator) return null;
|
|
845
|
+
let collection = this.collection;
|
|
846
|
+
let key = fromKey ?? this.getFirstKey();
|
|
847
|
+
let startItem = collection.getItem(key);
|
|
848
|
+
key = startItem.parentKey;
|
|
849
|
+
while(key != null){
|
|
850
|
+
let item = collection.getItem(key);
|
|
851
|
+
if (item.textValue) {
|
|
852
|
+
let substring = item.textValue.slice(0, search.length);
|
|
853
|
+
if (this.collator.compare(substring, search) === 0) return [
|
|
854
|
+
...item.childNodes
|
|
855
|
+
][0].key;
|
|
856
|
+
}
|
|
857
|
+
key = this.collection.getKeyAfter(key);
|
|
858
|
+
}
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
1265
862
|
|
|
1266
|
-
k--;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
let row = [];
|
|
1270
|
-
|
|
1271
|
-
for (let i = 0; i < n + 1; i++) {
|
|
1272
|
-
row.push(seq[i]);
|
|
1273
|
-
}
|
|
1274
863
|
|
|
1275
|
-
result.unshift(row);
|
|
1276
|
-
return result;
|
|
1277
|
-
}
|
|
1278
864
|
|
|
1279
|
-
const $
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
minSpace: new Size(6, 6),
|
|
1288
|
-
maxColumns: Infinity,
|
|
1289
|
-
dropSpacing: 50
|
|
1290
|
-
},
|
|
1291
|
-
L: {
|
|
1292
|
-
itemPadding: {
|
|
1293
|
-
'vertical': {
|
|
1294
|
-
'medium': 78,
|
|
1295
|
-
'large': 98
|
|
1296
|
-
},
|
|
1297
|
-
'horizontal': {
|
|
1298
|
-
'medium': 150,
|
|
1299
|
-
'large': 170
|
|
1300
|
-
}
|
|
865
|
+
const $f2d8d97b844f7f17$var$DEFAULT_OPTIONS = {
|
|
866
|
+
S: {
|
|
867
|
+
idealRowHeight: 112,
|
|
868
|
+
minItemSize: new $h48Fj$reactstatelyvirtualizer.Size(96, 96),
|
|
869
|
+
itemSpacing: new $h48Fj$reactstatelyvirtualizer.Size(8, 16),
|
|
870
|
+
itemPadding: 24,
|
|
871
|
+
dropSpacing: 50,
|
|
872
|
+
margin: 8
|
|
1301
873
|
},
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
874
|
+
L: {
|
|
875
|
+
idealRowHeight: 208,
|
|
876
|
+
minItemSize: new $h48Fj$reactstatelyvirtualizer.Size(136, 136),
|
|
877
|
+
itemSpacing: new $h48Fj$reactstatelyvirtualizer.Size(18, 18),
|
|
878
|
+
itemPadding: {
|
|
879
|
+
'medium': 78,
|
|
880
|
+
'large': 99
|
|
881
|
+
},
|
|
882
|
+
dropSpacing: 100,
|
|
883
|
+
margin: 24
|
|
884
|
+
}
|
|
1312
885
|
};
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
886
|
+
class $f2d8d97b844f7f17$export$8e52095834484b61 extends $b5fabe37852ab8f7$export$64943d2e59d72a29 {
|
|
887
|
+
constructor(options = {
|
|
888
|
+
}){
|
|
889
|
+
super(options);
|
|
890
|
+
let cardSize = 'L';
|
|
891
|
+
this.idealRowHeight = options.idealRowHeight || $f2d8d97b844f7f17$var$DEFAULT_OPTIONS[cardSize].idealRowHeight;
|
|
892
|
+
this.itemSpacing = options.itemSpacing || $f2d8d97b844f7f17$var$DEFAULT_OPTIONS[cardSize].itemSpacing;
|
|
893
|
+
this.itemPadding = options.itemPadding != null ? options.itemPadding : $f2d8d97b844f7f17$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.scale];
|
|
894
|
+
this.minItemSize = options.minItemSize || $f2d8d97b844f7f17$var$DEFAULT_OPTIONS[cardSize].minItemSize;
|
|
895
|
+
this.threshold = options.threshold || 1;
|
|
896
|
+
this.margin = options.margin != null ? options.margin : $f2d8d97b844f7f17$var$DEFAULT_OPTIONS[cardSize].margin;
|
|
1318
897
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
this.minItemSize = void 0;
|
|
1322
|
-
this.maxItemSize = void 0;
|
|
1323
|
-
this.minSpace = void 0;
|
|
1324
|
-
this.maxColumns = void 0;
|
|
1325
|
-
this.itemPadding = void 0;
|
|
1326
|
-
this.cardOrientation = void 0;
|
|
1327
|
-
this.itemSize = void 0;
|
|
1328
|
-
this.numColumns = void 0;
|
|
1329
|
-
this.numRows = void 0;
|
|
1330
|
-
this.horizontalSpacing = void 0;
|
|
1331
|
-
let cardSize = 'L';
|
|
1332
|
-
this.cardOrientation = options.cardOrientation || 'vertical';
|
|
1333
|
-
this.minItemSize = options.minItemSize || $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].minItemSize[this.cardOrientation];
|
|
1334
|
-
this.maxItemSize = options.maxItemSize || $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].maxItemSize;
|
|
1335
|
-
this.margin = options.margin != null ? options.margin : $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].margin;
|
|
1336
|
-
this.minSpace = options.minSpace || $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].minSpace;
|
|
1337
|
-
this.maxColumns = options.maxColumns || $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].maxColumns;
|
|
1338
|
-
this.itemPadding = options.itemPadding != null ? options.itemPadding : $e0c00724bec6201efad9430accf8c3b1$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.cardOrientation][this.scale];
|
|
1339
|
-
this.itemSize = null;
|
|
1340
|
-
this.numColumns = 0;
|
|
1341
|
-
this.numRows = 0;
|
|
1342
|
-
this.horizontalSpacing = 0;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
get layoutType() {
|
|
1346
|
-
return 'grid';
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
getIndexAtPoint(x, y, allowInsertingAtEnd) {
|
|
1350
|
-
if (allowInsertingAtEnd === void 0) {
|
|
1351
|
-
allowInsertingAtEnd = false;
|
|
898
|
+
get layoutType() {
|
|
899
|
+
return 'gallery';
|
|
1352
900
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
901
|
+
/**
|
|
902
|
+
* Takes a row of widths and if there are any widths smaller than the min-width, leech width starting from
|
|
903
|
+
* the widest in the row until it can't give anymore, then move to the second widest and so forth.
|
|
904
|
+
* Do this until all assets meet the min-width.
|
|
905
|
+
* */ _distributeWidths(widths) {
|
|
906
|
+
// create a copy of the widths array and sort it largest to smallest
|
|
907
|
+
let sortedWidths = widths.concat().sort((a, b)=>a[1] > b[1] ? -1 : 1
|
|
908
|
+
);
|
|
909
|
+
for (let width of widths)// for each width, if it's smaller than the min width
|
|
910
|
+
if (width[1] < this.minItemSize.width) {
|
|
911
|
+
// then figure out how much smaller
|
|
912
|
+
let delta = this.minItemSize.width - width[1];
|
|
913
|
+
for (let item of sortedWidths)// go from the largest width in the row to the smallest
|
|
914
|
+
// if the width is greater than the min width
|
|
915
|
+
if (widths[item[0]][1] > this.minItemSize.width) {
|
|
916
|
+
// subtract the delta from the width, if it's still greater than the min width
|
|
917
|
+
// then we have finished, subtract the delta permanently from that width
|
|
918
|
+
if (widths[item[0]][1] - delta > this.minItemSize.width) {
|
|
919
|
+
widths[item[0]][1] -= delta;
|
|
920
|
+
delta = 0;
|
|
921
|
+
break;
|
|
922
|
+
} else {
|
|
923
|
+
// otherwise, we take as much as we can from the current width and then move on to
|
|
924
|
+
// the next largest and take some width from it
|
|
925
|
+
let maxChange = widths[item[0]][1] - this.minItemSize.width;
|
|
926
|
+
delta -= maxChange;
|
|
927
|
+
widths[item[0]][1] -= maxChange;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
if (delta > 0) return false;
|
|
931
|
+
// force the width to be the min width that we just rebalanced for
|
|
932
|
+
width[1] = this.minItemSize.width;
|
|
1371
933
|
}
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
934
|
+
return true;
|
|
935
|
+
}
|
|
936
|
+
buildCollection() {
|
|
937
|
+
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
938
|
+
let visibleHeight = this.virtualizer.visibleRect.height;
|
|
939
|
+
let y = this.margin;
|
|
940
|
+
let availableWidth = visibleWidth - this.margin * 2;
|
|
941
|
+
// If avaliable width is not greater than 0, skip node layout calculations
|
|
942
|
+
if (availableWidth > 0) {
|
|
943
|
+
// Compute aspect ratios for all of the items, and the total width if all items were on in a single row.
|
|
944
|
+
let ratios = [];
|
|
945
|
+
let totalWidth = 0;
|
|
946
|
+
let minRatio = this.minItemSize.width / this.minItemSize.height;
|
|
947
|
+
let maxRatio = availableWidth / this.minItemSize.height;
|
|
948
|
+
for (let node of this.collection){
|
|
949
|
+
let ratio = node.props.width / node.props.height;
|
|
950
|
+
if (ratio < minRatio) ratio = minRatio;
|
|
951
|
+
else if (ratio > maxRatio && ratio !== minRatio) ratio = maxRatio;
|
|
952
|
+
let itemWidth = ratio * this.minItemSize.height;
|
|
953
|
+
ratios.push(ratio);
|
|
954
|
+
totalWidth += itemWidth;
|
|
955
|
+
}
|
|
956
|
+
totalWidth += this.itemSpacing.width * (this.collection.size - 1);
|
|
957
|
+
// Determine how many rows we'll need, and partition the items into rows
|
|
958
|
+
// using the aspect ratios as weights.
|
|
959
|
+
let rows = Math.max(1, Math.ceil(totalWidth / availableWidth));
|
|
960
|
+
// if the available width can't hold two items, then every item will get its own row
|
|
961
|
+
// this leads to a faster run through linear partition and more dependable output for small row widths
|
|
962
|
+
if (availableWidth <= this.minItemSize.width * 2 + this.itemPadding * 2) rows = this.collection.size;
|
|
963
|
+
let weightedRatios = ratios.map((ratio)=>ratio < this.threshold ? ratio + 0.5 * (1 / ratio) : ratio
|
|
964
|
+
);
|
|
965
|
+
let partition = $f2d8d97b844f7f17$var$linearPartition(weightedRatios, rows);
|
|
966
|
+
let index = 0;
|
|
967
|
+
for (let row of partition){
|
|
968
|
+
// Compute the total weight for this row
|
|
969
|
+
let totalWeight = 0;
|
|
970
|
+
for(let j = index; j < index + row.length; j++)totalWeight += ratios[j];
|
|
971
|
+
// Determine the row height based on the total available width and weight of this row.
|
|
972
|
+
let bestRowHeight = (availableWidth - (row.length - 1) * this.itemSpacing.width) / totalWeight;
|
|
973
|
+
// if this is the last row and the row height is >2x the ideal row height, then cap to the ideal height
|
|
974
|
+
// probably doing this because if the last row has one extremely tall image, then the row becomes huge
|
|
975
|
+
// though that can happen anywhere if a row has lots of tall images... so i'm not sure why this one matters
|
|
976
|
+
if (row === partition[partition.length - 1] && bestRowHeight > this.idealRowHeight * 2) bestRowHeight = this.idealRowHeight;
|
|
977
|
+
let itemHeight = Math.round(bestRowHeight) + this.itemPadding;
|
|
978
|
+
let x = this.margin;
|
|
979
|
+
// if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
|
|
980
|
+
let widths = [];
|
|
981
|
+
for(let j1 = index; j1 < index + row.length; j1++){
|
|
982
|
+
let width = Math.round(bestRowHeight * ratios[j1]);
|
|
983
|
+
widths.push([
|
|
984
|
+
j1 - index,
|
|
985
|
+
width
|
|
986
|
+
]);
|
|
987
|
+
}
|
|
988
|
+
this._distributeWidths(widths);
|
|
989
|
+
// Create items for this row.
|
|
990
|
+
for(let j2 = index; j2 < index + row.length; j2++){
|
|
991
|
+
let node = this.collection.rows[j2];
|
|
992
|
+
let itemWidth = Math.max(widths[j2 - index][1], this.minItemSize.width);
|
|
993
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(x, y, itemWidth, itemHeight);
|
|
994
|
+
let layoutInfo = new $h48Fj$reactstatelyvirtualizer.LayoutInfo(node.type, node.key, rect);
|
|
995
|
+
layoutInfo.allowOverflow = true;
|
|
996
|
+
this.layoutInfos.set(node.key, layoutInfo);
|
|
997
|
+
x += itemWidth + this.itemSpacing.width;
|
|
998
|
+
}
|
|
999
|
+
y += itemHeight + this.itemSpacing.height;
|
|
1000
|
+
index += row.length;
|
|
1001
|
+
}
|
|
1002
|
+
if (this.isLoading) {
|
|
1003
|
+
let loaderY = y;
|
|
1004
|
+
let loaderHeight = 60;
|
|
1005
|
+
// If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1006
|
+
// so it doesn't scroll
|
|
1007
|
+
if (this.collection.size === 0) {
|
|
1008
|
+
loaderY = 0;
|
|
1009
|
+
loaderHeight = visibleHeight || 60;
|
|
1010
|
+
}
|
|
1011
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, loaderY, visibleWidth, loaderHeight);
|
|
1012
|
+
let loader = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
|
|
1013
|
+
this.layoutInfos.set('loader', loader);
|
|
1014
|
+
y = loader.rect.maxY;
|
|
1015
|
+
}
|
|
1016
|
+
if (this.collection.size === 0 && !this.isLoading) {
|
|
1017
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, 0, visibleWidth, visibleHeight);
|
|
1018
|
+
let placeholder = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
|
|
1019
|
+
this.layoutInfos.set('placeholder', placeholder);
|
|
1020
|
+
y = placeholder.rect.maxY;
|
|
1021
|
+
}
|
|
1384
1022
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
let loader = this.layoutInfos.get('loader');
|
|
1389
|
-
|
|
1390
|
-
if (loader && this.isVisible(loader, rect)) {
|
|
1391
|
-
res.push(loader);
|
|
1392
|
-
}
|
|
1023
|
+
this.contentSize = new $h48Fj$reactstatelyvirtualizer.Size(visibleWidth, y);
|
|
1393
1024
|
}
|
|
1025
|
+
}
|
|
1026
|
+
// https://www8.cs.umu.se/kurser/TDBA77/VT06/algorithms/BOOK/BOOK2/NODE45.HTM
|
|
1027
|
+
function $f2d8d97b844f7f17$var$linearPartition(seq, k) {
|
|
1028
|
+
let n = seq.length;
|
|
1029
|
+
if (k <= 0) return [];
|
|
1030
|
+
if (k >= n) return seq.map((x)=>[
|
|
1031
|
+
x
|
|
1032
|
+
]
|
|
1033
|
+
);
|
|
1034
|
+
if (n === 1) return [
|
|
1035
|
+
seq
|
|
1036
|
+
];
|
|
1037
|
+
let table = Array(n).fill(0).map(()=>Array(k).fill(0)
|
|
1038
|
+
);
|
|
1039
|
+
let solution = Array(n - 1).fill(0).map(()=>Array(k - 1).fill(0)
|
|
1040
|
+
);
|
|
1041
|
+
for(let i = 0; i < n; i++)table[i][0] = seq[i] + (i > 0 ? table[i - 1][0] : 0);
|
|
1042
|
+
for(let i1 = 0; i1 < k; i1++)table[0][i1] = seq[0];
|
|
1043
|
+
for(let i2 = 1; i2 < n; i2++)for(let j = 1; j < k; j++){
|
|
1044
|
+
let currentMin = 0;
|
|
1045
|
+
let minX = Infinity;
|
|
1046
|
+
for(let x = 0; x < i2; x++){
|
|
1047
|
+
let c1 = table[x][j - 1];
|
|
1048
|
+
let c2 = table[i2][0] - table[x][0];
|
|
1049
|
+
let cost = Math.max(c1, c2);
|
|
1050
|
+
if (!x || cost < currentMin) {
|
|
1051
|
+
currentMin = cost;
|
|
1052
|
+
minX = x;
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
table[i2][j] = currentMin;
|
|
1056
|
+
solution[i2 - 1][j - 1] = minX;
|
|
1057
|
+
}
|
|
1058
|
+
n = n - 1;
|
|
1059
|
+
k = k - 2;
|
|
1060
|
+
let result = [];
|
|
1061
|
+
while(k >= 0){
|
|
1062
|
+
if (n >= 1) {
|
|
1063
|
+
let row = [];
|
|
1064
|
+
for(let i = solution[n - 1][k] + 1; i < n + 1; i++)row.push(seq[i]);
|
|
1065
|
+
result.unshift(row);
|
|
1066
|
+
n = solution[n - 1][k];
|
|
1067
|
+
}
|
|
1068
|
+
k--;
|
|
1069
|
+
}
|
|
1070
|
+
let row = [];
|
|
1071
|
+
for(let i3 = 0; i3 < n + 1; i3++)row.push(seq[i3]);
|
|
1072
|
+
result.unshift(row);
|
|
1073
|
+
return result;
|
|
1074
|
+
}
|
|
1394
1075
|
|
|
1395
|
-
return res;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
buildCollection() {
|
|
1399
|
-
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
1400
|
-
let visibleHeight = this.virtualizer.visibleRect.height;
|
|
1401
|
-
let horizontalItemPadding = this.cardOrientation === 'horizontal' ? this.itemPadding : 0;
|
|
1402
|
-
let verticalItemPadding = this.cardOrientation === 'vertical' ? this.itemPadding : 0;
|
|
1403
|
-
let minCardWidth = this.minItemSize.width + horizontalItemPadding; // Compute the number of rows and columns needed to display the content
|
|
1404
|
-
|
|
1405
|
-
let availableWidth = visibleWidth - this.margin * 2;
|
|
1406
|
-
let columns = Math.floor((availableWidth + this.minSpace.width) / (minCardWidth + this.minSpace.width));
|
|
1407
|
-
this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
|
|
1408
|
-
this.numRows = Math.ceil(this.collection.size / this.numColumns); // Compute the available width (minus the space between items)
|
|
1409
|
-
|
|
1410
|
-
let width = availableWidth - this.minSpace.width * Math.max(0, this.numColumns - 1); // Compute the item width based on the space available
|
|
1411
1076
|
|
|
1412
|
-
|
|
1413
|
-
itemWidth = Math.max(minCardWidth, Math.min(this.maxItemSize.width, itemWidth)); // Compute the item height, which is proportional to the item width
|
|
1077
|
+
var $c6ddca8a4b54c716$exports = {};
|
|
1414
1078
|
|
|
1415
|
-
|
|
1416
|
-
let itemHeight = Math.floor(this.minItemSize.height + this.minItemSize.height * t);
|
|
1417
|
-
itemHeight = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, itemHeight)) + verticalItemPadding;
|
|
1418
|
-
this.itemSize = new Size(itemWidth, itemHeight); // Compute the horizontal spacing and content height
|
|
1079
|
+
$parcel$export($c6ddca8a4b54c716$exports, "GridLayout", () => $c6ddca8a4b54c716$export$7d2b12578154a735);
|
|
1419
1080
|
|
|
1420
|
-
this.horizontalSpacing = this.numColumns < 2 ? 0 : Math.floor((availableWidth - this.numColumns * this.itemSize.width) / (this.numColumns - 1));
|
|
1421
|
-
let y = this.margin;
|
|
1422
|
-
let index = 0;
|
|
1423
1081
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1082
|
+
const $c6ddca8a4b54c716$var$DEFAULT_OPTIONS = {
|
|
1083
|
+
S: {
|
|
1084
|
+
itemPadding: 20,
|
|
1085
|
+
minItemSize: {
|
|
1086
|
+
'vertical': new $h48Fj$reactstatelyvirtualizer.Size(96, 96)
|
|
1087
|
+
},
|
|
1088
|
+
maxItemSize: new $h48Fj$reactstatelyvirtualizer.Size(Infinity, Infinity),
|
|
1089
|
+
margin: 8,
|
|
1090
|
+
minSpace: new $h48Fj$reactstatelyvirtualizer.Size(6, 6),
|
|
1091
|
+
maxColumns: Infinity,
|
|
1092
|
+
dropSpacing: 50
|
|
1093
|
+
},
|
|
1094
|
+
L: {
|
|
1095
|
+
itemPadding: {
|
|
1096
|
+
'vertical': {
|
|
1097
|
+
'medium': 78,
|
|
1098
|
+
'large': 98
|
|
1099
|
+
},
|
|
1100
|
+
'horizontal': {
|
|
1101
|
+
'medium': 150,
|
|
1102
|
+
'large': 170
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
minItemSize: {
|
|
1106
|
+
'vertical': new $h48Fj$reactstatelyvirtualizer.Size(208, 208),
|
|
1107
|
+
'horizontal': new $h48Fj$reactstatelyvirtualizer.Size(102, 102)
|
|
1108
|
+
},
|
|
1109
|
+
maxItemSize: new $h48Fj$reactstatelyvirtualizer.Size(Infinity, Infinity),
|
|
1110
|
+
margin: 24,
|
|
1111
|
+
minSpace: new $h48Fj$reactstatelyvirtualizer.Size(18, 18),
|
|
1112
|
+
maxColumns: Infinity,
|
|
1113
|
+
dropSpacing: 100
|
|
1428
1114
|
}
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1115
|
+
};
|
|
1116
|
+
class $c6ddca8a4b54c716$export$7d2b12578154a735 extends $b5fabe37852ab8f7$export$64943d2e59d72a29 {
|
|
1117
|
+
constructor(options = {
|
|
1118
|
+
}){
|
|
1119
|
+
super(options);
|
|
1120
|
+
let cardSize = 'L';
|
|
1121
|
+
this.cardOrientation = options.cardOrientation || 'vertical';
|
|
1122
|
+
this.minItemSize = options.minItemSize || $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].minItemSize[this.cardOrientation];
|
|
1123
|
+
this.maxItemSize = options.maxItemSize || $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].maxItemSize;
|
|
1124
|
+
this.margin = options.margin != null ? options.margin : $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].margin;
|
|
1125
|
+
this.minSpace = options.minSpace || $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].minSpace;
|
|
1126
|
+
this.maxColumns = options.maxColumns || $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].maxColumns;
|
|
1127
|
+
this.itemPadding = options.itemPadding != null ? options.itemPadding : $c6ddca8a4b54c716$var$DEFAULT_OPTIONS[cardSize].itemPadding[this.cardOrientation][this.scale];
|
|
1128
|
+
this.itemSize = null;
|
|
1129
|
+
this.numColumns = 0;
|
|
1130
|
+
this.numRows = 0;
|
|
1131
|
+
this.horizontalSpacing = 0;
|
|
1444
1132
|
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
let rect = new Rect(0, 0, visibleWidth, visibleHeight);
|
|
1448
|
-
let placeholder = new LayoutInfo('placeholder', 'placeholder', rect);
|
|
1449
|
-
this.layoutInfos.set('placeholder', placeholder);
|
|
1450
|
-
y = placeholder.rect.maxY;
|
|
1133
|
+
get layoutType() {
|
|
1134
|
+
return 'grid';
|
|
1451
1135
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
buildChild(node, y, index) {
|
|
1457
|
-
let row = Math.floor(index / this.numColumns);
|
|
1458
|
-
let column = index % this.numColumns;
|
|
1459
|
-
let x = this.margin + column * (this.itemSize.width + this.horizontalSpacing);
|
|
1460
|
-
y = this.margin + row * (this.itemSize.height + this.minSpace.height);
|
|
1461
|
-
let rect = new Rect(x, y, this.itemSize.width, this.itemSize.height); // TODO: Perhaps have it so that the child key for each row is stored with the layoutInfo?
|
|
1462
|
-
|
|
1463
|
-
let layoutInfo = new LayoutInfo(node.type, node.key, rect);
|
|
1464
|
-
layoutInfo.allowOverflow = true;
|
|
1465
|
-
this.layoutInfos.set(node.key, layoutInfo);
|
|
1466
|
-
return layoutInfo;
|
|
1467
|
-
} // Since the collection doesn't represent the visual layout, need to calculate what row and column the current key is in,
|
|
1468
|
-
// 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
|
|
1469
|
-
// collection contents by that number (which will give us the row distribution)
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
getKeyBelow(key) {
|
|
1473
|
-
var _this$collection$rows;
|
|
1474
|
-
|
|
1475
|
-
// Expected key is the currently focused cell so we need the parent row key
|
|
1476
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1477
|
-
let indexRowBelow;
|
|
1478
|
-
let index = this.collection.rows.findIndex(card => card.key === parentRowKey);
|
|
1479
|
-
|
|
1480
|
-
if (index !== -1) {
|
|
1481
|
-
indexRowBelow = index + this.numColumns;
|
|
1482
|
-
} else {
|
|
1483
|
-
return null;
|
|
1136
|
+
getIndexAtPoint(x, y, allowInsertingAtEnd = false) {
|
|
1137
|
+
let itemHeight = this.itemSize.height + this.minSpace.height;
|
|
1138
|
+
let itemWidth = this.itemSize.width + this.horizontalSpacing;
|
|
1139
|
+
return Math.max(0, Math.min(this.collection.size - (allowInsertingAtEnd ? 0 : 1), Math.floor(y / itemHeight) * this.numColumns + Math.floor((x - this.horizontalSpacing) / itemWidth)));
|
|
1484
1140
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1141
|
+
getVisibleLayoutInfos(rect) {
|
|
1142
|
+
let res = [];
|
|
1143
|
+
let numItems = this.collection.size;
|
|
1144
|
+
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
|
|
1145
|
+
// the currently visible items
|
|
1146
|
+
{
|
|
1147
|
+
if (this.layoutInfos.size > 0) {
|
|
1148
|
+
for (let layoutInfo of this.layoutInfos.values())if (this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
|
|
1149
|
+
}
|
|
1150
|
+
} else {
|
|
1151
|
+
// The approach from v2 uses indexes where other v3 layouts iterate through every node/root node. This feels more efficient
|
|
1152
|
+
let firstVisibleItem = this.getIndexAtPoint(rect.x, rect.y);
|
|
1153
|
+
let lastVisibleItem = this.getIndexAtPoint(rect.maxX, rect.maxY);
|
|
1154
|
+
for(let index = firstVisibleItem; index <= lastVisibleItem; index++){
|
|
1155
|
+
let keyFromIndex = this.collection.rows[index].key;
|
|
1156
|
+
let layoutInfo = this.layoutInfos.get(keyFromIndex);
|
|
1157
|
+
if (layoutInfo && this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
|
|
1158
|
+
}
|
|
1159
|
+
// Check if loader is in view and add to res if so
|
|
1160
|
+
let loader = this.layoutInfos.get('loader');
|
|
1161
|
+
if (loader && this.isVisible(loader, rect)) res.push(loader);
|
|
1162
|
+
}
|
|
1163
|
+
return res;
|
|
1501
1164
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1165
|
+
buildCollection() {
|
|
1166
|
+
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
1167
|
+
let visibleHeight = this.virtualizer.visibleRect.height;
|
|
1168
|
+
let horizontalItemPadding = this.cardOrientation === 'horizontal' ? this.itemPadding : 0;
|
|
1169
|
+
let verticalItemPadding = this.cardOrientation === 'vertical' ? this.itemPadding : 0;
|
|
1170
|
+
let minCardWidth = this.minItemSize.width + horizontalItemPadding;
|
|
1171
|
+
// Compute the number of rows and columns needed to display the content
|
|
1172
|
+
let availableWidth = visibleWidth - this.margin * 2;
|
|
1173
|
+
let columns = Math.floor((availableWidth + this.minSpace.width) / (minCardWidth + this.minSpace.width));
|
|
1174
|
+
this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
|
|
1175
|
+
this.numRows = Math.ceil(this.collection.size / this.numColumns);
|
|
1176
|
+
// Compute the available width (minus the space between items)
|
|
1177
|
+
let width = availableWidth - this.minSpace.width * Math.max(0, this.numColumns - 1);
|
|
1178
|
+
// Compute the item width based on the space available
|
|
1179
|
+
let itemWidth = Math.floor(width / this.numColumns);
|
|
1180
|
+
itemWidth = Math.max(minCardWidth, Math.min(this.maxItemSize.width, itemWidth));
|
|
1181
|
+
// Compute the item height, which is proportional to the item width
|
|
1182
|
+
let t = (itemWidth - minCardWidth) / minCardWidth;
|
|
1183
|
+
let itemHeight = Math.floor(this.minItemSize.height + this.minItemSize.height * t);
|
|
1184
|
+
itemHeight = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, itemHeight)) + verticalItemPadding;
|
|
1185
|
+
this.itemSize = new $h48Fj$reactstatelyvirtualizer.Size(itemWidth, itemHeight);
|
|
1186
|
+
// Compute the horizontal spacing and content height
|
|
1187
|
+
this.horizontalSpacing = this.numColumns < 2 ? 0 : Math.floor((availableWidth - this.numColumns * this.itemSize.width) / (this.numColumns - 1));
|
|
1188
|
+
let y = this.margin;
|
|
1189
|
+
let index = 0;
|
|
1190
|
+
for (let node of this.collection){
|
|
1191
|
+
let layoutInfo = this.buildChild(node, y, index);
|
|
1192
|
+
y = layoutInfo.rect.maxY;
|
|
1193
|
+
index++;
|
|
1194
|
+
}
|
|
1195
|
+
if (this.isLoading) {
|
|
1196
|
+
let loaderY = y;
|
|
1197
|
+
let loaderHeight = 60;
|
|
1198
|
+
// If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1199
|
+
// so it doesn't scroll
|
|
1200
|
+
if (this.collection.size === 0) {
|
|
1201
|
+
loaderY = 0;
|
|
1202
|
+
loaderHeight = visibleHeight || 60;
|
|
1203
|
+
}
|
|
1204
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, loaderY, visibleWidth, loaderHeight);
|
|
1205
|
+
let loader = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
|
|
1206
|
+
this.layoutInfos.set('loader', loader);
|
|
1207
|
+
y = loader.rect.maxY;
|
|
1208
|
+
}
|
|
1209
|
+
if (this.collection.size === 0 && !this.isLoading) {
|
|
1210
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, 0, visibleWidth, visibleHeight);
|
|
1211
|
+
let placeholder = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
|
|
1212
|
+
this.layoutInfos.set('placeholder', placeholder);
|
|
1213
|
+
y = placeholder.rect.maxY;
|
|
1214
|
+
}
|
|
1215
|
+
this.contentSize = new $h48Fj$reactstatelyvirtualizer.Size(visibleWidth, y);
|
|
1515
1216
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
this.horizontalSpacing = void 0;
|
|
1528
|
-
this.minItemSize = options.minItemSize || new Size(240, 136);
|
|
1529
|
-
this.maxItemSize = options.maxItemSize || new Size(Infinity, Infinity);
|
|
1530
|
-
this.margin = options.margin != null ? options.margin : 24;
|
|
1531
|
-
this.minSpace = options.minSpace || new Size(18, 18);
|
|
1532
|
-
this.maxColumns = options.maxColumns || Infinity; // TODO: not entirely sure what this is for since the layout will automatically shift itself to the correct vertical space for the card
|
|
1533
|
-
|
|
1534
|
-
this.itemPadding = options.itemPadding != null ? options.itemPadding : 56;
|
|
1535
|
-
this.itemWidth = 0;
|
|
1536
|
-
this.numColumns = 0;
|
|
1537
|
-
this.lastCollection = null;
|
|
1538
|
-
this.collator = options.collator;
|
|
1539
|
-
}
|
|
1540
|
-
|
|
1541
|
-
get layoutType() {
|
|
1542
|
-
return 'waterfall';
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
buildCollection(invalidationContext) {
|
|
1546
|
-
// Compute the number of columns needed to display the content
|
|
1547
|
-
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
1548
|
-
let availableWidth = visibleWidth - this.margin * 2;
|
|
1549
|
-
let columns = Math.floor((availableWidth + this.minSpace.width) / (this.minItemSize.width + this.minSpace.width));
|
|
1550
|
-
this.numColumns = Math.max(1, Math.min(this.maxColumns, columns)); // Compute the available width (minus the space between items)
|
|
1551
|
-
|
|
1552
|
-
let width = availableWidth - this.minSpace.width * (this.numColumns - 1); // Compute the item width based on the space available
|
|
1553
|
-
|
|
1554
|
-
let itemWidth = Math.round(width / this.numColumns);
|
|
1555
|
-
itemWidth = Math.max(this.minItemSize.width, Math.min(this.maxItemSize.width, itemWidth));
|
|
1556
|
-
this.itemWidth = itemWidth; // Compute the horizontal spacing
|
|
1557
|
-
// if only one column, we cannot divide by zero, so set it to 1
|
|
1558
|
-
|
|
1559
|
-
let horizontalSpacing = Math.round((availableWidth - this.numColumns * itemWidth) / Math.max(1, this.numColumns - 1));
|
|
1560
|
-
this.horizontalSpacing = horizontalSpacing; // Setup an array of column heights
|
|
1561
|
-
|
|
1562
|
-
let columnHeights = Array(this.numColumns).fill(this.margin);
|
|
1563
|
-
|
|
1564
|
-
for (let node of this.collection) {
|
|
1565
|
-
let key = node.key; // Compute the height of the item. Use the existing height if available,
|
|
1566
|
-
// otherwise call the delegate to estimate the size.
|
|
1567
|
-
|
|
1568
|
-
let oldLayoutInfo = this.layoutInfos.get(key);
|
|
1569
|
-
let height;
|
|
1570
|
-
let estimatedSize = true;
|
|
1571
|
-
|
|
1572
|
-
if (oldLayoutInfo) {
|
|
1573
|
-
height = oldLayoutInfo.rect.height;
|
|
1574
|
-
estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize;
|
|
1575
|
-
} else if (node.props.width && node.props.height) {
|
|
1576
|
-
let nodeWidth = node.props.width;
|
|
1577
|
-
let nodeHeight = node.props.height;
|
|
1578
|
-
let scaledHeight = Math.round(nodeWidth * (itemWidth / nodeHeight));
|
|
1579
|
-
height = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, scaledHeight)) + this.itemPadding;
|
|
1580
|
-
} else {
|
|
1581
|
-
height = itemWidth;
|
|
1582
|
-
} // Figure out which column to place the item in, and compute its position.
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
let column = this.getNextColumnIndex(columnHeights);
|
|
1586
|
-
let x = this.margin + column * (itemWidth + horizontalSpacing);
|
|
1587
|
-
let y = columnHeights[column];
|
|
1588
|
-
let rect = new Rect(x, y, itemWidth, height);
|
|
1589
|
-
let layoutInfo = new LayoutInfo(node.type, key, rect);
|
|
1590
|
-
layoutInfo.estimatedSize = estimatedSize;
|
|
1591
|
-
layoutInfo.allowOverflow = true;
|
|
1592
|
-
this.layoutInfos.set(key, layoutInfo); // TODO: From v2 figure out this bit, when does this get called and what to replace this.collectionView._transaction with?
|
|
1593
|
-
// Removing it from v2 doesn't seem to do anything?
|
|
1594
|
-
// if (layoutInfo.estimatedSize && !invalidationContext.contentChanged && !this.collectionView._transaction) {
|
|
1595
|
-
// this.updateItemSize(new IndexPath(section, i));
|
|
1596
|
-
// }
|
|
1597
|
-
|
|
1598
|
-
columnHeights[column] += layoutInfo.rect.height + this.minSpace.height;
|
|
1217
|
+
buildChild(node, y, index) {
|
|
1218
|
+
let row = Math.floor(index / this.numColumns);
|
|
1219
|
+
let column = index % this.numColumns;
|
|
1220
|
+
let x = this.margin + column * (this.itemSize.width + this.horizontalSpacing);
|
|
1221
|
+
y = this.margin + row * (this.itemSize.height + this.minSpace.height);
|
|
1222
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(x, y, this.itemSize.width, this.itemSize.height);
|
|
1223
|
+
// TODO: Perhaps have it so that the child key for each row is stored with the layoutInfo?
|
|
1224
|
+
let layoutInfo = new $h48Fj$reactstatelyvirtualizer.LayoutInfo(node.type, node.key, rect);
|
|
1225
|
+
layoutInfo.allowOverflow = true;
|
|
1226
|
+
this.layoutInfos.set(node.key, layoutInfo);
|
|
1227
|
+
return layoutInfo;
|
|
1599
1228
|
}
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
loaderHeight = this.virtualizer.visibleRect.height || 60;
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
let rect = new Rect(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
|
|
1616
|
-
let loader = new LayoutInfo('loader', 'loader', rect);
|
|
1617
|
-
this.layoutInfos.set('loader', loader);
|
|
1618
|
-
y = loader.rect.maxY;
|
|
1229
|
+
// Since the collection doesn't represent the visual layout, need to calculate what row and column the current key is in,
|
|
1230
|
+
// 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
|
|
1231
|
+
// collection contents by that number (which will give us the row distribution)
|
|
1232
|
+
getKeyBelow(key) {
|
|
1233
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
1234
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1235
|
+
let indexRowBelow;
|
|
1236
|
+
let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
|
|
1237
|
+
);
|
|
1238
|
+
if (index !== -1) indexRowBelow = index + this.numColumns;
|
|
1239
|
+
else return null;
|
|
1240
|
+
return this.collection.rows[indexRowBelow]?.childNodes[0].key || null;
|
|
1619
1241
|
}
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1242
|
+
getKeyAbove(key) {
|
|
1243
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
1244
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1245
|
+
let indexRowAbove;
|
|
1246
|
+
let index = this.collection.rows.findIndex((card)=>card.key === parentRowKey
|
|
1247
|
+
);
|
|
1248
|
+
if (index !== -1) indexRowAbove = index - this.numColumns;
|
|
1249
|
+
else return null;
|
|
1250
|
+
return this.collection.rows[indexRowAbove]?.childNodes[0].key || null;
|
|
1626
1251
|
}
|
|
1252
|
+
}
|
|
1627
1253
|
|
|
1628
|
-
this.contentSize = new Size(this.virtualizer.visibleRect.width, y);
|
|
1629
|
-
}
|
|
1630
1254
|
|
|
1631
|
-
|
|
1632
|
-
let layoutInfo = this.layoutInfos.get(key);
|
|
1255
|
+
var $2e17f74d7257c32a$exports = {};
|
|
1633
1256
|
|
|
1634
|
-
|
|
1635
|
-
return false;
|
|
1636
|
-
}
|
|
1257
|
+
$parcel$export($2e17f74d7257c32a$exports, "WaterfallLayout", () => $2e17f74d7257c32a$export$e9f7cda058ba8df8);
|
|
1637
1258
|
|
|
1638
|
-
if (size.height !== layoutInfo.rect.height) {
|
|
1639
|
-
// TODO: also not sure about copying layout info vs mutating it. Listlayout does the below
|
|
1640
|
-
// but I feel that is because it actually maintained a layoutNode map cache which this doesn't have
|
|
1641
|
-
let newLayoutInfo = layoutInfo.copy();
|
|
1642
|
-
newLayoutInfo.rect.height = size.height;
|
|
1643
|
-
this.layoutInfos.set(key, newLayoutInfo); // TODO: v2 had layoutInfo.estimatedSize = view.estimatedSize || false; but we can't do the same here?
|
|
1644
1259
|
|
|
1645
|
-
|
|
1646
|
-
|
|
1260
|
+
class $2e17f74d7257c32a$export$e9f7cda058ba8df8 extends $b5fabe37852ab8f7$export$64943d2e59d72a29 {
|
|
1261
|
+
constructor(options = {
|
|
1262
|
+
}){
|
|
1263
|
+
// TODO: WaterfallLayout doesn't use card size in v2, but perhaps it should support it? Perhaps it would modify
|
|
1264
|
+
// minItemSize defaults or other things
|
|
1265
|
+
super(options);
|
|
1266
|
+
this.minItemSize = options.minItemSize || new $h48Fj$reactstatelyvirtualizer.Size(240, 136);
|
|
1267
|
+
this.maxItemSize = options.maxItemSize || new $h48Fj$reactstatelyvirtualizer.Size(Infinity, Infinity);
|
|
1268
|
+
this.margin = options.margin != null ? options.margin : 24;
|
|
1269
|
+
this.minSpace = options.minSpace || new $h48Fj$reactstatelyvirtualizer.Size(18, 18);
|
|
1270
|
+
this.maxColumns = options.maxColumns || Infinity;
|
|
1271
|
+
this.itemWidth = 0;
|
|
1272
|
+
this.numColumns = 0;
|
|
1273
|
+
this.lastCollection = null;
|
|
1274
|
+
this.collator = options.collator;
|
|
1647
1275
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
getNextColumnIndex(columnHeights) {
|
|
1653
|
-
let minIndex = 0;
|
|
1654
|
-
|
|
1655
|
-
for (let i = 0; i < columnHeights.length; i++) {
|
|
1656
|
-
if (columnHeights[i] < columnHeights[minIndex]) {
|
|
1657
|
-
minIndex = i;
|
|
1658
|
-
}
|
|
1276
|
+
get layoutType() {
|
|
1277
|
+
return 'waterfall';
|
|
1659
1278
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1279
|
+
buildCollection(invalidationContext) {
|
|
1280
|
+
// Compute the number of columns needed to display the content
|
|
1281
|
+
let visibleWidth = this.virtualizer.visibleRect.width;
|
|
1282
|
+
let availableWidth = visibleWidth - this.margin * 2;
|
|
1283
|
+
let columns = Math.floor((availableWidth + this.minSpace.width) / (this.minItemSize.width + this.minSpace.width));
|
|
1284
|
+
this.numColumns = Math.max(1, Math.min(this.maxColumns, columns));
|
|
1285
|
+
// Compute the available width (minus the space between items)
|
|
1286
|
+
let width = availableWidth - this.minSpace.width * (this.numColumns - 1);
|
|
1287
|
+
// Compute the item width based on the space available
|
|
1288
|
+
let itemWidth = Math.round(width / this.numColumns);
|
|
1289
|
+
itemWidth = Math.max(this.minItemSize.width, Math.min(this.maxItemSize.width, itemWidth));
|
|
1290
|
+
this.itemWidth = itemWidth;
|
|
1291
|
+
// Compute the horizontal spacing
|
|
1292
|
+
// if only one column, we cannot divide by zero, so set it to 1
|
|
1293
|
+
let horizontalSpacing = Math.round((availableWidth - this.numColumns * itemWidth) / Math.max(1, this.numColumns - 1));
|
|
1294
|
+
this.horizontalSpacing = horizontalSpacing;
|
|
1295
|
+
// Setup an array of column heights
|
|
1296
|
+
let columnHeights = Array(this.numColumns).fill(this.margin);
|
|
1297
|
+
for (let node of this.collection){
|
|
1298
|
+
let key = node.key;
|
|
1299
|
+
// Compute the height of the item. Use the existing height if available,
|
|
1300
|
+
// otherwise call the delegate to estimate the size.
|
|
1301
|
+
let oldLayoutInfo = this.layoutInfos.get(key);
|
|
1302
|
+
let height;
|
|
1303
|
+
let estimatedSize = true;
|
|
1304
|
+
if (oldLayoutInfo) {
|
|
1305
|
+
height = oldLayoutInfo.rect.height;
|
|
1306
|
+
estimatedSize = invalidationContext.sizeChanged || oldLayoutInfo.estimatedSize;
|
|
1307
|
+
} else if (node.props.width && node.props.height) {
|
|
1308
|
+
let nodeWidth = node.props.width;
|
|
1309
|
+
let nodeHeight = node.props.height;
|
|
1310
|
+
let scaledHeight = Math.round(nodeHeight * (itemWidth / nodeWidth));
|
|
1311
|
+
height = Math.max(this.minItemSize.height, Math.min(this.maxItemSize.height, scaledHeight));
|
|
1312
|
+
} else height = itemWidth;
|
|
1313
|
+
// Figure out which column to place the item in, and compute its position.
|
|
1314
|
+
let column = this.getNextColumnIndex(columnHeights);
|
|
1315
|
+
let x = this.margin + column * (itemWidth + horizontalSpacing);
|
|
1316
|
+
let y = columnHeights[column];
|
|
1317
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(x, y, itemWidth, height);
|
|
1318
|
+
let layoutInfo = new $h48Fj$reactstatelyvirtualizer.LayoutInfo(node.type, key, rect);
|
|
1319
|
+
layoutInfo.estimatedSize = estimatedSize;
|
|
1320
|
+
layoutInfo.allowOverflow = true;
|
|
1321
|
+
this.layoutInfos.set(key, layoutInfo);
|
|
1322
|
+
// TODO: From v2 figure out this bit, when does this get called and what to replace this.collectionView._transaction with?
|
|
1323
|
+
// Removing it from v2 doesn't seem to do anything?
|
|
1324
|
+
// if (layoutInfo.estimatedSize && !invalidationContext.contentChanged && !this.collectionView._transaction) {
|
|
1325
|
+
// this.updateItemSize(new IndexPath(section, i));
|
|
1326
|
+
// }
|
|
1327
|
+
columnHeights[column] += layoutInfo.rect.height + this.minSpace.height;
|
|
1328
|
+
}
|
|
1329
|
+
// Reset all columns to the maximum for the next section
|
|
1330
|
+
let maxHeight = Math.max.apply(Math, columnHeights) - this.minSpace.height + this.margin;
|
|
1331
|
+
columnHeights.fill(maxHeight);
|
|
1332
|
+
let y = columnHeights[0];
|
|
1333
|
+
if (this.isLoading) {
|
|
1334
|
+
let loaderY = y;
|
|
1335
|
+
let loaderHeight = 60;
|
|
1336
|
+
// If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1337
|
+
// so it doesn't scroll
|
|
1338
|
+
if (this.collection.size === 0) {
|
|
1339
|
+
loaderY = 0;
|
|
1340
|
+
loaderHeight = this.virtualizer.visibleRect.height || 60;
|
|
1341
|
+
}
|
|
1342
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
|
|
1343
|
+
let loader = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('loader', 'loader', rect);
|
|
1344
|
+
this.layoutInfos.set('loader', loader);
|
|
1345
|
+
y = loader.rect.maxY;
|
|
1346
|
+
}
|
|
1347
|
+
if (this.collection.size === 0 && !this.isLoading) {
|
|
1348
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(0, 0, this.virtualizer.visibleRect.width, this.virtualizer.visibleRect.height);
|
|
1349
|
+
let placeholder = new $h48Fj$reactstatelyvirtualizer.LayoutInfo('placeholder', 'placeholder', rect);
|
|
1350
|
+
this.layoutInfos.set('placeholder', placeholder);
|
|
1351
|
+
y = placeholder.rect.maxY;
|
|
1352
|
+
}
|
|
1353
|
+
this.contentSize = new $h48Fj$reactstatelyvirtualizer.Size(this.virtualizer.visibleRect.width, y);
|
|
1680
1354
|
}
|
|
1355
|
+
updateItemSize(key, size) {
|
|
1356
|
+
let layoutInfo = this.layoutInfos.get(key);
|
|
1357
|
+
if (!size || !layoutInfo) return false;
|
|
1358
|
+
if (size.height !== layoutInfo.rect.height) {
|
|
1359
|
+
// TODO: also not sure about copying layout info vs mutating it. Listlayout does the below
|
|
1360
|
+
// but I feel that is because it actually maintained a layoutNode map cache which this doesn't have
|
|
1361
|
+
let newLayoutInfo = layoutInfo.copy();
|
|
1362
|
+
newLayoutInfo.rect.height = size.height < 600 ? size.height : 600;
|
|
1363
|
+
newLayoutInfo.estimatedSize = false;
|
|
1364
|
+
this.layoutInfos.set(key, newLayoutInfo);
|
|
1365
|
+
return true;
|
|
1366
|
+
}
|
|
1367
|
+
return false;
|
|
1368
|
+
}
|
|
1369
|
+
getNextColumnIndex(columnHeights) {
|
|
1370
|
+
let minIndex = 0;
|
|
1371
|
+
for(let i = 0; i < columnHeights.length; i++)if (columnHeights[i] < columnHeights[minIndex]) minIndex = i;
|
|
1372
|
+
return minIndex;
|
|
1373
|
+
}
|
|
1374
|
+
getClosestRight(key) {
|
|
1375
|
+
let layoutInfo = this.getLayoutInfo(key);
|
|
1376
|
+
// Refactored from v2. Current strategy is to find the closest card in the adjacent column.
|
|
1377
|
+
// 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
|
|
1378
|
+
// and thus the top corner to top corner distance was massive.
|
|
1379
|
+
// 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
|
|
1380
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.maxX + 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
|
|
1381
|
+
key = this._findClosest(layoutInfo.rect, rect)?.key;
|
|
1382
|
+
if (!key) {
|
|
1383
|
+
rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.maxX + 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
|
|
1384
|
+
key = this._findClosest(layoutInfo.rect, rect)?.key;
|
|
1385
|
+
}
|
|
1386
|
+
return this.collection.getItem(key)?.childNodes[0]?.key;
|
|
1387
|
+
}
|
|
1388
|
+
getClosestLeft(key) {
|
|
1389
|
+
let layoutInfo = this.getLayoutInfo(key);
|
|
1390
|
+
// 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
|
|
1391
|
+
let rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, layoutInfo.rect.y, layoutInfo.rect.width + this.horizontalSpacing, layoutInfo.rect.height);
|
|
1392
|
+
key = this._findClosest(layoutInfo.rect, rect)?.key;
|
|
1393
|
+
if (!key) {
|
|
1394
|
+
rect = new $h48Fj$reactstatelyvirtualizer.Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
|
|
1395
|
+
key = this._findClosest(layoutInfo.rect, rect)?.key;
|
|
1396
|
+
}
|
|
1397
|
+
return this.collection.getItem(key)?.childNodes[0]?.key;
|
|
1398
|
+
}
|
|
1399
|
+
getKeyRightOf(key) {
|
|
1400
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
1401
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1402
|
+
return this.direction === 'rtl' ? this.getClosestLeft(parentRowKey) : this.getClosestRight(parentRowKey);
|
|
1403
|
+
}
|
|
1404
|
+
getKeyLeftOf(key) {
|
|
1405
|
+
// Expected key is the currently focused cell so we need the parent row key
|
|
1406
|
+
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1407
|
+
return this.direction === 'rtl' ? this.getClosestRight(parentRowKey) : this.getClosestLeft(parentRowKey);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1681
1410
|
|
|
1682
|
-
return (_this$collection$getI = this.collection.getItem(key)) == null ? void 0 : (_this$collection$getI2 = _this$collection$getI.childNodes[0]) == null ? void 0 : _this$collection$getI2.key;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
getClosestLeft(key) {
|
|
1686
|
-
var _this$_findClosest3, _this$collection$getI3, _this$collection$getI4;
|
|
1687
|
-
|
|
1688
|
-
let layoutInfo = this.getLayoutInfo(key); // 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
|
|
1689
1411
|
|
|
1690
|
-
|
|
1691
|
-
key = (_this$_findClosest3 = this._findClosest(layoutInfo.rect, rect)) == null ? void 0 : _this$_findClosest3.key;
|
|
1412
|
+
var $48cb4aae5203b049$exports = {};
|
|
1692
1413
|
|
|
1693
|
-
|
|
1694
|
-
var _this$_findClosest4;
|
|
1414
|
+
$parcel$export($48cb4aae5203b049$exports, "Card", () => $48cb4aae5203b049$export$60332b2344f7fe41);
|
|
1695
1415
|
|
|
1696
|
-
rect = new Rect(layoutInfo.rect.x - layoutInfo.rect.width - this.horizontalSpacing - 1, 0, layoutInfo.rect.width + this.horizontalSpacing, this.virtualizer.contentSize.height);
|
|
1697
|
-
key = (_this$_findClosest4 = this._findClosest(layoutInfo.rect, rect)) == null ? void 0 : _this$_findClosest4.key;
|
|
1698
|
-
}
|
|
1699
1416
|
|
|
1700
|
-
return (_this$collection$getI3 = this.collection.getItem(key)) == null ? void 0 : (_this$collection$getI4 = _this$collection$getI3.childNodes[0]) == null ? void 0 : _this$collection$getI4.key;
|
|
1701
|
-
}
|
|
1702
1417
|
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
return
|
|
1707
|
-
|
|
1418
|
+
let $48cb4aae5203b049$var$Card = /*#__PURE__*/ $h48Fj$react.forwardRef((props, ref)=>{
|
|
1419
|
+
let context = $0498deb1284b0345$export$fea0b38586ec8f13();
|
|
1420
|
+
if (context !== null) return null;
|
|
1421
|
+
else return(/*#__PURE__*/ ($parcel$interopDefault($h48Fj$react)).createElement($aa5f628de93d2fc1$export$7a6ccaf429ad93a8, {
|
|
1422
|
+
...props,
|
|
1423
|
+
ref: ref
|
|
1424
|
+
}));
|
|
1425
|
+
});
|
|
1426
|
+
// @ts-ignore
|
|
1427
|
+
$48cb4aae5203b049$var$Card.getCollectionNode = function* getCollectionNode(props) {
|
|
1428
|
+
let { children: children , textValue: textValue } = props;
|
|
1429
|
+
yield {
|
|
1430
|
+
type: 'item',
|
|
1431
|
+
props: props,
|
|
1432
|
+
rendered: children,
|
|
1433
|
+
'aria-label': props['aria-label'],
|
|
1434
|
+
hasChildNodes: false,
|
|
1435
|
+
textValue: textValue
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
let $48cb4aae5203b049$export$60332b2344f7fe41 = $48cb4aae5203b049$var$Card;
|
|
1708
1439
|
|
|
1709
|
-
getKeyLeftOf(key) {
|
|
1710
|
-
// Expected key is the currently focused cell so we need the parent row key
|
|
1711
|
-
let parentRowKey = this.collection.getItem(key).parentKey;
|
|
1712
|
-
return this.direction === 'rtl' ? this.getClosestRight(parentRowKey) : this.getClosestLeft(parentRowKey);
|
|
1713
|
-
}
|
|
1714
1440
|
|
|
1715
|
-
|
|
1441
|
+
$parcel$exportWildcard(module.exports, $a17eb1b1228312f3$exports);
|
|
1442
|
+
$parcel$exportWildcard(module.exports, $f2d8d97b844f7f17$exports);
|
|
1443
|
+
$parcel$exportWildcard(module.exports, $c6ddca8a4b54c716$exports);
|
|
1444
|
+
$parcel$exportWildcard(module.exports, $2e17f74d7257c32a$exports);
|
|
1445
|
+
$parcel$exportWildcard(module.exports, $48cb4aae5203b049$exports);
|
|
1716
1446
|
|
|
1717
|
-
exports.WaterfallLayout = WaterfallLayout;
|
|
1718
|
-
let $bc2440b48de2b2afa97227cbf612729$var$Card = /*#__PURE__*/forwardRef((props, ref) => {
|
|
1719
|
-
let context = $d2268ebff01b30dc8701260db9de8b73$export$useCardViewContext();
|
|
1720
1447
|
|
|
1721
|
-
if (context !== null) {
|
|
1722
|
-
return null;
|
|
1723
|
-
} else {
|
|
1724
|
-
return /*#__PURE__*/_react.createElement($c05a01cf76428c47b3d1dc747d32$export$CardBase, _babelRuntimeHelpersExtends({}, props, {
|
|
1725
|
-
ref: ref
|
|
1726
|
-
}));
|
|
1727
|
-
}
|
|
1728
|
-
}); // TODO: Update the typescript for the below and the export
|
|
1729
|
-
// @ts-ignore
|
|
1730
|
-
// eslint-disable-next-line
|
|
1731
|
-
|
|
1732
|
-
$bc2440b48de2b2afa97227cbf612729$var$Card.getCollectionNode = function* getCollectionNode(props, context) {
|
|
1733
|
-
let {
|
|
1734
|
-
children,
|
|
1735
|
-
textValue
|
|
1736
|
-
} = props;
|
|
1737
|
-
yield {
|
|
1738
|
-
type: 'item',
|
|
1739
|
-
props: props,
|
|
1740
|
-
rendered: children,
|
|
1741
|
-
'aria-label': props['aria-label'],
|
|
1742
|
-
hasChildNodes: false,
|
|
1743
|
-
textValue
|
|
1744
|
-
};
|
|
1745
|
-
}; // eslint-disable-next-line
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
let Card = $bc2440b48de2b2afa97227cbf612729$var$Card;
|
|
1749
|
-
exports.Card = Card;
|
|
1750
1448
|
//# sourceMappingURL=main.js.map
|