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