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