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