@react-spectrum/card 3.0.0-alpha.19 → 3.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +56 -56
- package/dist/main.js +56 -56
- package/dist/main.js.map +1 -1
- package/dist/module.js +56 -56
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/CardBase.tsx +1 -2
- package/src/CardView.tsx +7 -4
package/dist/import.mjs
CHANGED
|
@@ -13,7 +13,6 @@ import {Checkbox as $8EWFi$Checkbox} from "@react-spectrum/checkbox";
|
|
|
13
13
|
import {getFocusableTreeWalker as $8EWFi$getFocusableTreeWalker, FocusRing as $8EWFi$FocusRing} from "@react-aria/focus";
|
|
14
14
|
import {useHover as $8EWFi$useHover, useFocusWithin as $8EWFi$useFocusWithin} from "@react-aria/interactions";
|
|
15
15
|
import {Size as $8EWFi$Size, Rect as $8EWFi$Rect, LayoutInfo as $8EWFi$LayoutInfo, Layout as $8EWFi$Layout} from "@react-stately/virtualizer";
|
|
16
|
-
import $8EWFi$swchelperssrc_define_propertymjs from "@swc/helpers/src/_define_property.mjs";
|
|
17
16
|
import {getFirstItem as $8EWFi$getFirstItem, getChildNodes as $8EWFi$getChildNodes} from "@react-stately/collections";
|
|
18
17
|
|
|
19
18
|
function $parcel$interopDefault(a) {
|
|
@@ -58,7 +57,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
|
|
61
|
-
|
|
62
60
|
var $408a78e5068502c2$exports = {};
|
|
63
61
|
|
|
64
62
|
$parcel$export($408a78e5068502c2$exports, "spectrum-Card", () => $408a78e5068502c2$export$4e5e9f191b1edb8, (v) => $408a78e5068502c2$export$4e5e9f191b1edb8 = v);
|
|
@@ -332,7 +330,7 @@ function $643dd8fa80926f94$var$useCard(props) {
|
|
|
332
330
|
|
|
333
331
|
|
|
334
332
|
|
|
335
|
-
var $
|
|
333
|
+
var $49aba923a95704ba$exports = {};
|
|
336
334
|
var $6cb102354c06de53$exports = {};
|
|
337
335
|
$6cb102354c06de53$exports = {
|
|
338
336
|
"loading": `جارٍ التحميل...`,
|
|
@@ -571,7 +569,7 @@ $b7e2865acb74a940$exports = {
|
|
|
571
569
|
};
|
|
572
570
|
|
|
573
571
|
|
|
574
|
-
$
|
|
572
|
+
$49aba923a95704ba$exports = {
|
|
575
573
|
"ar-AE": $6cb102354c06de53$exports,
|
|
576
574
|
"bg-BG": $17b8c838d83f13fc$exports,
|
|
577
575
|
"cs-CZ": $1ddb4e1a3e8b15a5$exports,
|
|
@@ -639,7 +637,7 @@ function $81a52da995c19652$var$CardView(props, ref) {
|
|
|
639
637
|
scale
|
|
640
638
|
]);
|
|
641
639
|
let layoutType = cardViewLayout.layoutType;
|
|
642
|
-
let stringFormatter = (0, $8EWFi$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
640
|
+
let stringFormatter = (0, $8EWFi$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($49aba923a95704ba$exports))));
|
|
643
641
|
let { direction: direction } = (0, $8EWFi$useLocale)();
|
|
644
642
|
let { collection: collection } = (0, $8EWFi$useListState)(props);
|
|
645
643
|
let gridCollection = (0, $8EWFi$useMemo)(()=>new (0, $8EWFi$GridCollection)({
|
|
@@ -681,11 +679,14 @@ function $81a52da995c19652$var$CardView(props, ref) {
|
|
|
681
679
|
isVirtualized: true,
|
|
682
680
|
keyboardDelegate: cardViewLayout
|
|
683
681
|
}, state, domRef);
|
|
684
|
-
let renderWrapper = (parent, reusableView)
|
|
682
|
+
let renderWrapper = (parent, reusableView)=>{
|
|
683
|
+
/*#__PURE__*/ return (0, $8EWFi$react).createElement((0, $8EWFi$VirtualizerItem), {
|
|
685
684
|
key: reusableView.key,
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
685
|
+
layoutInfo: reusableView.layoutInfo,
|
|
686
|
+
virtualizer: reusableView.virtualizer,
|
|
687
|
+
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
688
|
+
}, reusableView.rendered);
|
|
689
|
+
};
|
|
689
690
|
let focusedKey = state.selectionManager.focusedKey;
|
|
690
691
|
let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
|
|
691
692
|
if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
|
|
@@ -820,7 +821,6 @@ function $81a52da995c19652$var$InternalCard(props) {
|
|
|
820
821
|
* governing permissions and limitations under the License.
|
|
821
822
|
*/
|
|
822
823
|
|
|
823
|
-
|
|
824
824
|
class $3d424c147206bac9$export$64943d2e59d72a29 extends (0, $8EWFi$Layout) {
|
|
825
825
|
validate(invalidationContext) {
|
|
826
826
|
this.collection = this.virtualizer.collection;
|
|
@@ -950,13 +950,13 @@ class $3d424c147206bac9$export$64943d2e59d72a29 extends (0, $8EWFi$Layout) {
|
|
|
950
950
|
if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
|
|
951
951
|
var _getFirstItem, _this_collection_getItem1;
|
|
952
952
|
let childKey = (_getFirstItem = (0, $8EWFi$getFirstItem)((0, $8EWFi$getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
|
|
953
|
-
let
|
|
954
|
-
layoutInfo = this.getLayoutInfo(
|
|
953
|
+
let keyAbove = (_this_collection_getItem1 = this.collection.getItem(this.getKeyAbove(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
|
|
954
|
+
layoutInfo = this.getLayoutInfo(keyAbove);
|
|
955
955
|
}
|
|
956
956
|
if (layoutInfo) {
|
|
957
957
|
var _getFirstItem1;
|
|
958
|
-
let
|
|
959
|
-
return
|
|
958
|
+
let childKey = (_getFirstItem1 = (0, $8EWFi$getFirstItem)((0, $8EWFi$getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
|
|
959
|
+
return childKey;
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
return this.getFirstKey();
|
|
@@ -977,13 +977,13 @@ class $3d424c147206bac9$export$64943d2e59d72a29 extends (0, $8EWFi$Layout) {
|
|
|
977
977
|
if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
|
|
978
978
|
var _getFirstItem, _this_collection_getItem1;
|
|
979
979
|
let childKey = (_getFirstItem = (0, $8EWFi$getFirstItem)((0, $8EWFi$getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
|
|
980
|
-
let
|
|
981
|
-
layoutInfo = this.getLayoutInfo(
|
|
980
|
+
let keyBelow = (_this_collection_getItem1 = this.collection.getItem(this.getKeyBelow(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
|
|
981
|
+
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
982
982
|
}
|
|
983
983
|
if (layoutInfo) {
|
|
984
984
|
var _getFirstItem1;
|
|
985
|
-
let
|
|
986
|
-
return
|
|
985
|
+
let childKey = (_getFirstItem1 = (0, $8EWFi$getFirstItem)((0, $8EWFi$getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
|
|
986
|
+
return childKey;
|
|
987
987
|
}
|
|
988
988
|
}
|
|
989
989
|
return this.getLastKey();
|
|
@@ -1007,7 +1007,7 @@ class $3d424c147206bac9$export$64943d2e59d72a29 extends (0, $8EWFi$Layout) {
|
|
|
1007
1007
|
}
|
|
1008
1008
|
constructor(options = {}){
|
|
1009
1009
|
super();
|
|
1010
|
-
|
|
1010
|
+
this.disabledKeys = new Set();
|
|
1011
1011
|
this.layoutInfos = new Map();
|
|
1012
1012
|
this.collator = options.collator;
|
|
1013
1013
|
this.lastCollection = null;
|
|
@@ -1122,23 +1122,23 @@ class $c0ba81539c443916$export$8e52095834484b61 extends (0, $3d424c147206bac9$ex
|
|
|
1122
1122
|
let x = this.margin;
|
|
1123
1123
|
// if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
|
|
1124
1124
|
let widths = [];
|
|
1125
|
-
for(let
|
|
1126
|
-
let width = Math.round(bestRowHeight * ratios[
|
|
1125
|
+
for(let j = index; j < index + row.length; j++){
|
|
1126
|
+
let width = Math.round(bestRowHeight * ratios[j]);
|
|
1127
1127
|
widths.push([
|
|
1128
|
-
|
|
1128
|
+
j - index,
|
|
1129
1129
|
width
|
|
1130
1130
|
]);
|
|
1131
1131
|
}
|
|
1132
1132
|
this._distributeWidths(widths);
|
|
1133
1133
|
// Create items for this row.
|
|
1134
|
-
for(let
|
|
1135
|
-
let
|
|
1136
|
-
let
|
|
1137
|
-
let rect = new (0, $8EWFi$Rect)(x, y,
|
|
1138
|
-
let layoutInfo = new (0, $8EWFi$LayoutInfo)(
|
|
1134
|
+
for(let j = index; j < index + row.length; j++){
|
|
1135
|
+
let node = this.collection.rows[j];
|
|
1136
|
+
let itemWidth = Math.max(widths[j - index][1], this.minItemSize.width);
|
|
1137
|
+
let rect = new (0, $8EWFi$Rect)(x, y, itemWidth, itemHeight);
|
|
1138
|
+
let layoutInfo = new (0, $8EWFi$LayoutInfo)(node.type, node.key, rect);
|
|
1139
1139
|
layoutInfo.allowOverflow = true;
|
|
1140
|
-
this.layoutInfos.set(
|
|
1141
|
-
x +=
|
|
1140
|
+
this.layoutInfos.set(node.key, layoutInfo);
|
|
1141
|
+
x += itemWidth + this.itemSpacing.width;
|
|
1142
1142
|
}
|
|
1143
1143
|
y += itemHeight + this.itemSpacing.height;
|
|
1144
1144
|
index += row.length;
|
|
@@ -1152,14 +1152,14 @@ class $c0ba81539c443916$export$8e52095834484b61 extends (0, $3d424c147206bac9$ex
|
|
|
1152
1152
|
loaderY = 0;
|
|
1153
1153
|
loaderHeight = visibleHeight || 60;
|
|
1154
1154
|
}
|
|
1155
|
-
let
|
|
1156
|
-
let loader = new (0, $8EWFi$LayoutInfo)("loader", "loader",
|
|
1155
|
+
let rect = new (0, $8EWFi$Rect)(0, loaderY, visibleWidth, loaderHeight);
|
|
1156
|
+
let loader = new (0, $8EWFi$LayoutInfo)("loader", "loader", rect);
|
|
1157
1157
|
this.layoutInfos.set("loader", loader);
|
|
1158
1158
|
y = loader.rect.maxY;
|
|
1159
1159
|
}
|
|
1160
1160
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1161
|
-
let
|
|
1162
|
-
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder",
|
|
1161
|
+
let rect = new (0, $8EWFi$Rect)(0, 0, visibleWidth, visibleHeight);
|
|
1162
|
+
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder", rect);
|
|
1163
1163
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1164
1164
|
y = placeholder.rect.maxY;
|
|
1165
1165
|
}
|
|
@@ -1190,21 +1190,21 @@ function $c0ba81539c443916$var$linearPartition(seq, k) {
|
|
|
1190
1190
|
let table = Array(n).fill(0).map(()=>Array(k).fill(0));
|
|
1191
1191
|
let solution = Array(n - 1).fill(0).map(()=>Array(k - 1).fill(0));
|
|
1192
1192
|
for(let i = 0; i < n; i++)table[i][0] = seq[i] + (i > 0 ? table[i - 1][0] : 0);
|
|
1193
|
-
for(let
|
|
1194
|
-
for(let
|
|
1193
|
+
for(let i = 0; i < k; i++)table[0][i] = seq[0];
|
|
1194
|
+
for(let i = 1; i < n; i++)for(let j = 1; j < k; j++){
|
|
1195
1195
|
let currentMin = 0;
|
|
1196
1196
|
let minX = Infinity;
|
|
1197
|
-
for(let x = 0; x <
|
|
1197
|
+
for(let x = 0; x < i; x++){
|
|
1198
1198
|
let c1 = table[x][j - 1];
|
|
1199
|
-
let c2 = table[
|
|
1199
|
+
let c2 = table[i][0] - table[x][0];
|
|
1200
1200
|
let cost = Math.max(c1, c2);
|
|
1201
1201
|
if (!x || cost < currentMin) {
|
|
1202
1202
|
currentMin = cost;
|
|
1203
1203
|
minX = x;
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
table[
|
|
1207
|
-
solution[
|
|
1206
|
+
table[i][j] = currentMin;
|
|
1207
|
+
solution[i - 1][j - 1] = minX;
|
|
1208
1208
|
}
|
|
1209
1209
|
n = n - 1;
|
|
1210
1210
|
k = k - 2;
|
|
@@ -1212,15 +1212,15 @@ function $c0ba81539c443916$var$linearPartition(seq, k) {
|
|
|
1212
1212
|
while(k >= 0){
|
|
1213
1213
|
if (n >= 1) {
|
|
1214
1214
|
let row = [];
|
|
1215
|
-
for(let
|
|
1215
|
+
for(let i = solution[n - 1][k] + 1; i < n + 1; i++)row.push(seq[i]);
|
|
1216
1216
|
result.unshift(row);
|
|
1217
1217
|
n = solution[n - 1][k];
|
|
1218
1218
|
}
|
|
1219
1219
|
k--;
|
|
1220
1220
|
}
|
|
1221
|
-
let
|
|
1222
|
-
for(let
|
|
1223
|
-
result.unshift(
|
|
1221
|
+
let row = [];
|
|
1222
|
+
for(let i = 0; i < n + 1; i++)row.push(seq[i]);
|
|
1223
|
+
result.unshift(row);
|
|
1224
1224
|
return result;
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
@@ -1296,8 +1296,8 @@ class $ed42fd44b9b9b664$export$7d2b12578154a735 extends (0, $3d424c147206bac9$ex
|
|
|
1296
1296
|
let lastVisibleItem = this.getIndexAtPoint(rect.maxX, rect.maxY);
|
|
1297
1297
|
for(let index = firstVisibleItem; index <= lastVisibleItem; index++){
|
|
1298
1298
|
let keyFromIndex = this.collection.rows[index].key;
|
|
1299
|
-
let
|
|
1300
|
-
if (
|
|
1299
|
+
let layoutInfo = this.layoutInfos.get(keyFromIndex);
|
|
1300
|
+
if (layoutInfo && this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
|
|
1301
1301
|
}
|
|
1302
1302
|
// Check if loader is in view and add to res if so
|
|
1303
1303
|
let loader = this.layoutInfos.get("loader");
|
|
@@ -1350,8 +1350,8 @@ class $ed42fd44b9b9b664$export$7d2b12578154a735 extends (0, $3d424c147206bac9$ex
|
|
|
1350
1350
|
y = loader.rect.maxY;
|
|
1351
1351
|
}
|
|
1352
1352
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1353
|
-
let
|
|
1354
|
-
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder",
|
|
1353
|
+
let rect = new (0, $8EWFi$Rect)(0, 0, visibleWidth, visibleHeight);
|
|
1354
|
+
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder", rect);
|
|
1355
1355
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1356
1356
|
y = placeholder.rect.maxY;
|
|
1357
1357
|
}
|
|
@@ -1482,9 +1482,9 @@ class $03278f8d0f6860bb$export$e9f7cda058ba8df8 extends (0, $3d424c147206bac9$ex
|
|
|
1482
1482
|
// Reset all columns to the maximum for the next section
|
|
1483
1483
|
let maxHeight = Math.max.apply(Math, columnHeights) - this.minSpace.height + this.margin;
|
|
1484
1484
|
columnHeights.fill(maxHeight);
|
|
1485
|
-
let
|
|
1485
|
+
let y = columnHeights[0];
|
|
1486
1486
|
if (this.isLoading) {
|
|
1487
|
-
let loaderY =
|
|
1487
|
+
let loaderY = y;
|
|
1488
1488
|
let loaderHeight = 60;
|
|
1489
1489
|
// If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1490
1490
|
// so it doesn't scroll
|
|
@@ -1492,18 +1492,18 @@ class $03278f8d0f6860bb$export$e9f7cda058ba8df8 extends (0, $3d424c147206bac9$ex
|
|
|
1492
1492
|
loaderY = 0;
|
|
1493
1493
|
loaderHeight = this.virtualizer.visibleRect.height || 60;
|
|
1494
1494
|
}
|
|
1495
|
-
let
|
|
1496
|
-
let loader = new (0, $8EWFi$LayoutInfo)("loader", "loader",
|
|
1495
|
+
let rect = new (0, $8EWFi$Rect)(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
|
|
1496
|
+
let loader = new (0, $8EWFi$LayoutInfo)("loader", "loader", rect);
|
|
1497
1497
|
this.layoutInfos.set("loader", loader);
|
|
1498
|
-
|
|
1498
|
+
y = loader.rect.maxY;
|
|
1499
1499
|
}
|
|
1500
1500
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1501
|
-
let
|
|
1502
|
-
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder",
|
|
1501
|
+
let rect = new (0, $8EWFi$Rect)(0, 0, this.virtualizer.visibleRect.width, this.virtualizer.visibleRect.height);
|
|
1502
|
+
let placeholder = new (0, $8EWFi$LayoutInfo)("placeholder", "placeholder", rect);
|
|
1503
1503
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1504
|
-
|
|
1504
|
+
y = placeholder.rect.maxY;
|
|
1505
1505
|
}
|
|
1506
|
-
this.contentSize = new (0, $8EWFi$Size)(this.virtualizer.visibleRect.width,
|
|
1506
|
+
this.contentSize = new (0, $8EWFi$Size)(this.virtualizer.visibleRect.width, y);
|
|
1507
1507
|
}
|
|
1508
1508
|
updateItemSize(key, size) {
|
|
1509
1509
|
let layoutInfo = this.layoutInfos.get(key);
|
package/dist/main.js
CHANGED
|
@@ -13,7 +13,6 @@ var $jpY3B$reactspectrumcheckbox = require("@react-spectrum/checkbox");
|
|
|
13
13
|
var $jpY3B$reactariafocus = require("@react-aria/focus");
|
|
14
14
|
var $jpY3B$reactariainteractions = require("@react-aria/interactions");
|
|
15
15
|
var $jpY3B$reactstatelyvirtualizer = require("@react-stately/virtualizer");
|
|
16
|
-
var $jpY3B$swchelperslib_define_propertyjs = require("@swc/helpers/lib/_define_property.js");
|
|
17
16
|
var $jpY3B$reactstatelycollections = require("@react-stately/collections");
|
|
18
17
|
|
|
19
18
|
function $parcel$export(e, n, v, s) {
|
|
@@ -64,7 +63,6 @@ $parcel$export(module.exports, "Card", () => $6b630ac4b78ba7f3$export$60332b2344
|
|
|
64
63
|
|
|
65
64
|
|
|
66
65
|
|
|
67
|
-
|
|
68
66
|
var $71570f0038472fa2$exports = {};
|
|
69
67
|
|
|
70
68
|
$parcel$export($71570f0038472fa2$exports, "spectrum-Card", () => $71570f0038472fa2$export$4e5e9f191b1edb8, (v) => $71570f0038472fa2$export$4e5e9f191b1edb8 = v);
|
|
@@ -338,7 +336,7 @@ function $7888205ff7de382f$var$useCard(props) {
|
|
|
338
336
|
|
|
339
337
|
|
|
340
338
|
|
|
341
|
-
var $
|
|
339
|
+
var $85c597beff94758b$exports = {};
|
|
342
340
|
var $b0d49dbc72f937a2$exports = {};
|
|
343
341
|
$b0d49dbc72f937a2$exports = {
|
|
344
342
|
"loading": `جارٍ التحميل...`,
|
|
@@ -577,7 +575,7 @@ $d20ec5c21f83badd$exports = {
|
|
|
577
575
|
};
|
|
578
576
|
|
|
579
577
|
|
|
580
|
-
$
|
|
578
|
+
$85c597beff94758b$exports = {
|
|
581
579
|
"ar-AE": $b0d49dbc72f937a2$exports,
|
|
582
580
|
"bg-BG": $ce0dd82398fba411$exports,
|
|
583
581
|
"cs-CZ": $1086444b40892e5d$exports,
|
|
@@ -645,7 +643,7 @@ function $514a55f6d91f25ef$var$CardView(props, ref) {
|
|
|
645
643
|
scale
|
|
646
644
|
]);
|
|
647
645
|
let layoutType = cardViewLayout.layoutType;
|
|
648
|
-
let stringFormatter = (0, $jpY3B$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($
|
|
646
|
+
let stringFormatter = (0, $jpY3B$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($85c597beff94758b$exports))));
|
|
649
647
|
let { direction: direction } = (0, $jpY3B$reactariai18n.useLocale)();
|
|
650
648
|
let { collection: collection } = (0, $jpY3B$reactstatelylist.useListState)(props);
|
|
651
649
|
let gridCollection = (0, $jpY3B$react.useMemo)(()=>new (0, $jpY3B$reactstatelygrid.GridCollection)({
|
|
@@ -687,11 +685,14 @@ function $514a55f6d91f25ef$var$CardView(props, ref) {
|
|
|
687
685
|
isVirtualized: true,
|
|
688
686
|
keyboardDelegate: cardViewLayout
|
|
689
687
|
}, state, domRef);
|
|
690
|
-
let renderWrapper = (parent, reusableView)
|
|
688
|
+
let renderWrapper = (parent, reusableView)=>{
|
|
689
|
+
/*#__PURE__*/ return (0, ($parcel$interopDefault($jpY3B$react))).createElement((0, $jpY3B$reactariavirtualizer.VirtualizerItem), {
|
|
691
690
|
key: reusableView.key,
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
691
|
+
layoutInfo: reusableView.layoutInfo,
|
|
692
|
+
virtualizer: reusableView.virtualizer,
|
|
693
|
+
parent: parent === null || parent === void 0 ? void 0 : parent.layoutInfo
|
|
694
|
+
}, reusableView.rendered);
|
|
695
|
+
};
|
|
695
696
|
let focusedKey = state.selectionManager.focusedKey;
|
|
696
697
|
let focusedItem = gridCollection.getItem(state.selectionManager.focusedKey);
|
|
697
698
|
if ((focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) != null) focusedKey = focusedItem.parentKey;
|
|
@@ -826,7 +827,6 @@ function $514a55f6d91f25ef$var$InternalCard(props) {
|
|
|
826
827
|
* governing permissions and limitations under the License.
|
|
827
828
|
*/
|
|
828
829
|
|
|
829
|
-
|
|
830
830
|
class $5ee605f09afaa4de$export$64943d2e59d72a29 extends (0, $jpY3B$reactstatelyvirtualizer.Layout) {
|
|
831
831
|
validate(invalidationContext) {
|
|
832
832
|
this.collection = this.virtualizer.collection;
|
|
@@ -956,13 +956,13 @@ class $5ee605f09afaa4de$export$64943d2e59d72a29 extends (0, $jpY3B$reactstatelyv
|
|
|
956
956
|
if (layoutInfo && layoutInfo.rect.y > pageY) while(layoutInfo && layoutInfo.rect.y > pageY){
|
|
957
957
|
var _getFirstItem, _this_collection_getItem1;
|
|
958
958
|
let childKey = (_getFirstItem = (0, $jpY3B$reactstatelycollections.getFirstItem)((0, $jpY3B$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
|
|
959
|
-
let
|
|
960
|
-
layoutInfo = this.getLayoutInfo(
|
|
959
|
+
let keyAbove = (_this_collection_getItem1 = this.collection.getItem(this.getKeyAbove(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
|
|
960
|
+
layoutInfo = this.getLayoutInfo(keyAbove);
|
|
961
961
|
}
|
|
962
962
|
if (layoutInfo) {
|
|
963
963
|
var _getFirstItem1;
|
|
964
|
-
let
|
|
965
|
-
return
|
|
964
|
+
let childKey = (_getFirstItem1 = (0, $jpY3B$reactstatelycollections.getFirstItem)((0, $jpY3B$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
|
|
965
|
+
return childKey;
|
|
966
966
|
}
|
|
967
967
|
}
|
|
968
968
|
return this.getFirstKey();
|
|
@@ -983,13 +983,13 @@ class $5ee605f09afaa4de$export$64943d2e59d72a29 extends (0, $jpY3B$reactstatelyv
|
|
|
983
983
|
if (layoutInfo && layoutInfo.rect.y < pageY) while(layoutInfo && layoutInfo.rect.y < pageY){
|
|
984
984
|
var _getFirstItem, _this_collection_getItem1;
|
|
985
985
|
let childKey = (_getFirstItem = (0, $jpY3B$reactstatelycollections.getFirstItem)((0, $jpY3B$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key;
|
|
986
|
-
let
|
|
987
|
-
layoutInfo = this.getLayoutInfo(
|
|
986
|
+
let keyBelow = (_this_collection_getItem1 = this.collection.getItem(this.getKeyBelow(childKey))) === null || _this_collection_getItem1 === void 0 ? void 0 : _this_collection_getItem1.parentKey;
|
|
987
|
+
layoutInfo = this.getLayoutInfo(keyBelow);
|
|
988
988
|
}
|
|
989
989
|
if (layoutInfo) {
|
|
990
990
|
var _getFirstItem1;
|
|
991
|
-
let
|
|
992
|
-
return
|
|
991
|
+
let childKey = (_getFirstItem1 = (0, $jpY3B$reactstatelycollections.getFirstItem)((0, $jpY3B$reactstatelycollections.getChildNodes)(this.collection.getItem(layoutInfo.key), this.collection))) === null || _getFirstItem1 === void 0 ? void 0 : _getFirstItem1.key;
|
|
992
|
+
return childKey;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
return this.getLastKey();
|
|
@@ -1013,7 +1013,7 @@ class $5ee605f09afaa4de$export$64943d2e59d72a29 extends (0, $jpY3B$reactstatelyv
|
|
|
1013
1013
|
}
|
|
1014
1014
|
constructor(options = {}){
|
|
1015
1015
|
super();
|
|
1016
|
-
|
|
1016
|
+
this.disabledKeys = new Set();
|
|
1017
1017
|
this.layoutInfos = new Map();
|
|
1018
1018
|
this.collator = options.collator;
|
|
1019
1019
|
this.lastCollection = null;
|
|
@@ -1128,23 +1128,23 @@ class $8019a3d2c7d098ea$export$8e52095834484b61 extends (0, $5ee605f09afaa4de$ex
|
|
|
1128
1128
|
let x = this.margin;
|
|
1129
1129
|
// if any items are going to end up too small, add a bit of width to them and subtract it from wider objects
|
|
1130
1130
|
let widths = [];
|
|
1131
|
-
for(let
|
|
1132
|
-
let width = Math.round(bestRowHeight * ratios[
|
|
1131
|
+
for(let j = index; j < index + row.length; j++){
|
|
1132
|
+
let width = Math.round(bestRowHeight * ratios[j]);
|
|
1133
1133
|
widths.push([
|
|
1134
|
-
|
|
1134
|
+
j - index,
|
|
1135
1135
|
width
|
|
1136
1136
|
]);
|
|
1137
1137
|
}
|
|
1138
1138
|
this._distributeWidths(widths);
|
|
1139
1139
|
// Create items for this row.
|
|
1140
|
-
for(let
|
|
1141
|
-
let
|
|
1142
|
-
let
|
|
1143
|
-
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(x, y,
|
|
1144
|
-
let layoutInfo = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)(
|
|
1140
|
+
for(let j = index; j < index + row.length; j++){
|
|
1141
|
+
let node = this.collection.rows[j];
|
|
1142
|
+
let itemWidth = Math.max(widths[j - index][1], this.minItemSize.width);
|
|
1143
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(x, y, itemWidth, itemHeight);
|
|
1144
|
+
let layoutInfo = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)(node.type, node.key, rect);
|
|
1145
1145
|
layoutInfo.allowOverflow = true;
|
|
1146
|
-
this.layoutInfos.set(
|
|
1147
|
-
x +=
|
|
1146
|
+
this.layoutInfos.set(node.key, layoutInfo);
|
|
1147
|
+
x += itemWidth + this.itemSpacing.width;
|
|
1148
1148
|
}
|
|
1149
1149
|
y += itemHeight + this.itemSpacing.height;
|
|
1150
1150
|
index += row.length;
|
|
@@ -1158,14 +1158,14 @@ class $8019a3d2c7d098ea$export$8e52095834484b61 extends (0, $5ee605f09afaa4de$ex
|
|
|
1158
1158
|
loaderY = 0;
|
|
1159
1159
|
loaderHeight = visibleHeight || 60;
|
|
1160
1160
|
}
|
|
1161
|
-
let
|
|
1162
|
-
let loader = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("loader", "loader",
|
|
1161
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(0, loaderY, visibleWidth, loaderHeight);
|
|
1162
|
+
let loader = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("loader", "loader", rect);
|
|
1163
1163
|
this.layoutInfos.set("loader", loader);
|
|
1164
1164
|
y = loader.rect.maxY;
|
|
1165
1165
|
}
|
|
1166
1166
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1167
|
-
let
|
|
1168
|
-
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder",
|
|
1167
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(0, 0, visibleWidth, visibleHeight);
|
|
1168
|
+
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder", rect);
|
|
1169
1169
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1170
1170
|
y = placeholder.rect.maxY;
|
|
1171
1171
|
}
|
|
@@ -1196,21 +1196,21 @@ function $8019a3d2c7d098ea$var$linearPartition(seq, k) {
|
|
|
1196
1196
|
let table = Array(n).fill(0).map(()=>Array(k).fill(0));
|
|
1197
1197
|
let solution = Array(n - 1).fill(0).map(()=>Array(k - 1).fill(0));
|
|
1198
1198
|
for(let i = 0; i < n; i++)table[i][0] = seq[i] + (i > 0 ? table[i - 1][0] : 0);
|
|
1199
|
-
for(let
|
|
1200
|
-
for(let
|
|
1199
|
+
for(let i = 0; i < k; i++)table[0][i] = seq[0];
|
|
1200
|
+
for(let i = 1; i < n; i++)for(let j = 1; j < k; j++){
|
|
1201
1201
|
let currentMin = 0;
|
|
1202
1202
|
let minX = Infinity;
|
|
1203
|
-
for(let x = 0; x <
|
|
1203
|
+
for(let x = 0; x < i; x++){
|
|
1204
1204
|
let c1 = table[x][j - 1];
|
|
1205
|
-
let c2 = table[
|
|
1205
|
+
let c2 = table[i][0] - table[x][0];
|
|
1206
1206
|
let cost = Math.max(c1, c2);
|
|
1207
1207
|
if (!x || cost < currentMin) {
|
|
1208
1208
|
currentMin = cost;
|
|
1209
1209
|
minX = x;
|
|
1210
1210
|
}
|
|
1211
1211
|
}
|
|
1212
|
-
table[
|
|
1213
|
-
solution[
|
|
1212
|
+
table[i][j] = currentMin;
|
|
1213
|
+
solution[i - 1][j - 1] = minX;
|
|
1214
1214
|
}
|
|
1215
1215
|
n = n - 1;
|
|
1216
1216
|
k = k - 2;
|
|
@@ -1218,15 +1218,15 @@ function $8019a3d2c7d098ea$var$linearPartition(seq, k) {
|
|
|
1218
1218
|
while(k >= 0){
|
|
1219
1219
|
if (n >= 1) {
|
|
1220
1220
|
let row = [];
|
|
1221
|
-
for(let
|
|
1221
|
+
for(let i = solution[n - 1][k] + 1; i < n + 1; i++)row.push(seq[i]);
|
|
1222
1222
|
result.unshift(row);
|
|
1223
1223
|
n = solution[n - 1][k];
|
|
1224
1224
|
}
|
|
1225
1225
|
k--;
|
|
1226
1226
|
}
|
|
1227
|
-
let
|
|
1228
|
-
for(let
|
|
1229
|
-
result.unshift(
|
|
1227
|
+
let row = [];
|
|
1228
|
+
for(let i = 0; i < n + 1; i++)row.push(seq[i]);
|
|
1229
|
+
result.unshift(row);
|
|
1230
1230
|
return result;
|
|
1231
1231
|
}
|
|
1232
1232
|
|
|
@@ -1302,8 +1302,8 @@ class $71b727f94b595b1a$export$7d2b12578154a735 extends (0, $5ee605f09afaa4de$ex
|
|
|
1302
1302
|
let lastVisibleItem = this.getIndexAtPoint(rect.maxX, rect.maxY);
|
|
1303
1303
|
for(let index = firstVisibleItem; index <= lastVisibleItem; index++){
|
|
1304
1304
|
let keyFromIndex = this.collection.rows[index].key;
|
|
1305
|
-
let
|
|
1306
|
-
if (
|
|
1305
|
+
let layoutInfo = this.layoutInfos.get(keyFromIndex);
|
|
1306
|
+
if (layoutInfo && this.isVisible(layoutInfo, rect)) res.push(layoutInfo);
|
|
1307
1307
|
}
|
|
1308
1308
|
// Check if loader is in view and add to res if so
|
|
1309
1309
|
let loader = this.layoutInfos.get("loader");
|
|
@@ -1356,8 +1356,8 @@ class $71b727f94b595b1a$export$7d2b12578154a735 extends (0, $5ee605f09afaa4de$ex
|
|
|
1356
1356
|
y = loader.rect.maxY;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1359
|
-
let
|
|
1360
|
-
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder",
|
|
1359
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(0, 0, visibleWidth, visibleHeight);
|
|
1360
|
+
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder", rect);
|
|
1361
1361
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1362
1362
|
y = placeholder.rect.maxY;
|
|
1363
1363
|
}
|
|
@@ -1488,9 +1488,9 @@ class $632abf8fbf0ad57b$export$e9f7cda058ba8df8 extends (0, $5ee605f09afaa4de$ex
|
|
|
1488
1488
|
// Reset all columns to the maximum for the next section
|
|
1489
1489
|
let maxHeight = Math.max.apply(Math, columnHeights) - this.minSpace.height + this.margin;
|
|
1490
1490
|
columnHeights.fill(maxHeight);
|
|
1491
|
-
let
|
|
1491
|
+
let y = columnHeights[0];
|
|
1492
1492
|
if (this.isLoading) {
|
|
1493
|
-
let loaderY =
|
|
1493
|
+
let loaderY = y;
|
|
1494
1494
|
let loaderHeight = 60;
|
|
1495
1495
|
// If there aren't any items, make loader take all avaliable room and remove margin from y calculation
|
|
1496
1496
|
// so it doesn't scroll
|
|
@@ -1498,18 +1498,18 @@ class $632abf8fbf0ad57b$export$e9f7cda058ba8df8 extends (0, $5ee605f09afaa4de$ex
|
|
|
1498
1498
|
loaderY = 0;
|
|
1499
1499
|
loaderHeight = this.virtualizer.visibleRect.height || 60;
|
|
1500
1500
|
}
|
|
1501
|
-
let
|
|
1502
|
-
let loader = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("loader", "loader",
|
|
1501
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(0, loaderY, this.virtualizer.visibleRect.width, loaderHeight);
|
|
1502
|
+
let loader = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("loader", "loader", rect);
|
|
1503
1503
|
this.layoutInfos.set("loader", loader);
|
|
1504
|
-
|
|
1504
|
+
y = loader.rect.maxY;
|
|
1505
1505
|
}
|
|
1506
1506
|
if (this.collection.size === 0 && !this.isLoading) {
|
|
1507
|
-
let
|
|
1508
|
-
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder",
|
|
1507
|
+
let rect = new (0, $jpY3B$reactstatelyvirtualizer.Rect)(0, 0, this.virtualizer.visibleRect.width, this.virtualizer.visibleRect.height);
|
|
1508
|
+
let placeholder = new (0, $jpY3B$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder", rect);
|
|
1509
1509
|
this.layoutInfos.set("placeholder", placeholder);
|
|
1510
|
-
|
|
1510
|
+
y = placeholder.rect.maxY;
|
|
1511
1511
|
}
|
|
1512
|
-
this.contentSize = new (0, $jpY3B$reactstatelyvirtualizer.Size)(this.virtualizer.visibleRect.width,
|
|
1512
|
+
this.contentSize = new (0, $jpY3B$reactstatelyvirtualizer.Size)(this.virtualizer.visibleRect.width, y);
|
|
1513
1513
|
}
|
|
1514
1514
|
updateItemSize(key, size) {
|
|
1515
1515
|
let layoutInfo = this.layoutInfos.get(key);
|