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