@react-spectrum/card 3.0.0-alpha.4 → 3.0.0-alpha.7

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/module.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import "./main.css";
2
2
  import {useStyleProps as $8EWFi$useStyleProps, useDOMRef as $8EWFi$useDOMRef, classNames as $8EWFi$classNames, useUnwrapDOMRef as $8EWFi$useUnwrapDOMRef, useHasChild as $8EWFi$useHasChild, SlotProvider as $8EWFi$SlotProvider} from "@react-spectrum/utils";
3
3
  import {GridCollection as $8EWFi$GridCollection, useGridState as $8EWFi$useGridState} from "@react-stately/grid";
4
+ import {mergeProps as $8EWFi$mergeProps, useResizeObserver as $8EWFi$useResizeObserver, useLayoutEffect as $8EWFi$useLayoutEffect, filterDOMProps as $8EWFi$filterDOMProps, useSlotId as $8EWFi$useSlotId} from "@react-aria/utils";
4
5
  import {ProgressCircle as $8EWFi$ProgressCircle} from "@react-spectrum/progress";
5
6
  import $8EWFi$react, {useMemo as $8EWFi$useMemo, useCallback as $8EWFi$useCallback, useRef as $8EWFi$useRef, useState as $8EWFi$useState, useContext as $8EWFi$useContext, forwardRef as $8EWFi$forwardRef} from "react";
6
7
  import {useCollator as $8EWFi$useCollator, useMessageFormatter as $8EWFi$useMessageFormatter, useLocale as $8EWFi$useLocale} from "@react-aria/i18n";
@@ -9,7 +10,6 @@ import {useListState as $8EWFi$useListState} from "@react-stately/list";
9
10
  import {useProvider as $8EWFi$useProvider, useProviderProps as $8EWFi$useProviderProps} from "@react-spectrum/provider";
10
11
  import {VirtualizerItem as $8EWFi$VirtualizerItem, Virtualizer as $8EWFi$Virtualizer} from "@react-aria/virtualizer";
11
12
  import {Checkbox as $8EWFi$Checkbox} from "@react-spectrum/checkbox";
12
- import {useResizeObserver as $8EWFi$useResizeObserver, useLayoutEffect as $8EWFi$useLayoutEffect, mergeProps as $8EWFi$mergeProps, filterDOMProps as $8EWFi$filterDOMProps, useSlotId as $8EWFi$useSlotId} from "@react-aria/utils";
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";
@@ -311,11 +311,11 @@ $1ddb4e1a3e8b15a5$exports = JSON.parse("{\"loading\":\"Načítání...\",\"loadi
311
311
 
312
312
 
313
313
  var $44b7f17cd1f1db7f$exports = {};
314
- $44b7f17cd1f1db7f$exports = JSON.parse("{\"loading\":\"Indlæser ...\",\"loadingMore\":\"Indlæser flere ...\"}");
314
+ $44b7f17cd1f1db7f$exports = JSON.parse("{\"loading\":\"Indlæser...\",\"loadingMore\":\"Indlæser flere...\"}");
315
315
 
316
316
 
317
317
  var $ffa85bef2c730318$exports = {};
318
- $ffa85bef2c730318$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\":\"Mehr laden ...\"}");
318
+ $ffa85bef2c730318$exports = JSON.parse("{\"loading\":\"Wird geladen...\",\"loadingMore\":\"Noch mehr wird geladen...\"}");
319
319
 
320
320
 
321
321
  var $1904be2ca25ad4ef$exports = {};
@@ -339,7 +339,7 @@ $5ced2ee930f1d61a$exports = JSON.parse("{\"loading\":\"Ladataan…\",\"loadingMo
339
339
 
340
340
 
341
341
  var $bd751114db2e8872$exports = {};
342
- $bd751114db2e8872$exports = JSON.parse("{\"loading\":\"Chargement...\",\"loadingMore\":\"Chargement supplémentaire...\"}");
342
+ $bd751114db2e8872$exports = JSON.parse("{\"loading\":\"Chargement en cours…\",\"loadingMore\":\"Chargement d’autres d’éléments…\"}");
343
343
 
344
344
 
345
345
  var $6291b4a5eb5146c5$exports = {};
@@ -363,19 +363,19 @@ $8643fac062a08b30$exports = JSON.parse("{\"loading\":\"読み込み中...\",\"lo
363
363
 
364
364
 
365
365
  var $41f4de1d2f63c8f4$exports = {};
366
- $41f4de1d2f63c8f4$exports = JSON.parse("{\"loading\":\"로드 중\",\"loadingMore\":\"추가 로드 중\"}");
366
+ $41f4de1d2f63c8f4$exports = JSON.parse("{\"loading\":\"로드 중…\",\"loadingMore\":\"추가 로드 중…\"}");
367
367
 
368
368
 
369
369
  var $9819c3a9877418b0$exports = {};
370
- $9819c3a9877418b0$exports = JSON.parse("{\"loading\":\"Įkeliama...\",\"loadingMore\":\"Įkeliama daugiau...\"}");
370
+ $9819c3a9877418b0$exports = JSON.parse("{\"loading\":\"Įkeliama…\",\"loadingMore\":\"Įkeliama daugiau…\"}");
371
371
 
372
372
 
373
373
  var $3e8ad6b78b8cc064$exports = {};
374
- $3e8ad6b78b8cc064$exports = JSON.parse("{\"loading\":\"Notiek ielāde...\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
374
+ $3e8ad6b78b8cc064$exports = JSON.parse("{\"loading\":\"Notiek ielāde…\",\"loadingMore\":\"Tiek ielādēts vēl...\"}");
375
375
 
376
376
 
377
377
  var $baa4fb210e65a6c5$exports = {};
378
- $baa4fb210e65a6c5$exports = JSON.parse("{\"loading\":\"Laster inn ...\",\"loadingMore\":\"Laster inn flere ...\"}");
378
+ $baa4fb210e65a6c5$exports = JSON.parse("{\"loading\":\"Laster inn...\",\"loadingMore\":\"Laster inn flere...\"}");
379
379
 
380
380
 
381
381
  var $ee123eda5b089b7d$exports = {};
@@ -383,7 +383,7 @@ $ee123eda5b089b7d$exports = JSON.parse("{\"loading\":\"Laden...\",\"loadingMore\
383
383
 
384
384
 
385
385
  var $36a325cd1c9e414f$exports = {};
386
- $36a325cd1c9e414f$exports = JSON.parse("{\"loading\":\"Ładowanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
386
+ $36a325cd1c9e414f$exports = JSON.parse("{\"loading\":\"Wczytywanie...\",\"loadingMore\":\"Wczytywanie większej liczby...\"}");
387
387
 
388
388
 
389
389
  var $52d4fd0f211d7e51$exports = {};
@@ -407,7 +407,7 @@ $75167f0b339049be$exports = JSON.parse("{\"loading\":\"Načítava sa...\",\"load
407
407
 
408
408
 
409
409
  var $83a887ec3d5f2028$exports = {};
410
- $83a887ec3d5f2028$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje več vsebine...\"}");
410
+ $83a887ec3d5f2028$exports = JSON.parse("{\"loading\":\"Nalaganje...\",\"loadingMore\":\"Nalaganje dodatne vsebine...\"}");
411
411
 
412
412
 
413
413
  var $8352707b2eadbfb4$exports = {};
@@ -431,7 +431,7 @@ $88c83d794a7a062b$exports = JSON.parse("{\"loading\":\"正在加载...\",\"loadi
431
431
 
432
432
 
433
433
  var $b7e2865acb74a940$exports = {};
434
- $b7e2865acb74a940$exports = JSON.parse("{\"loading\":\"正在載入\",\"loadingMore\":\"正在載入更多…\"}");
434
+ $b7e2865acb74a940$exports = JSON.parse("{\"loading\":\"正在載入…\",\"loadingMore\":\"正在載入更多…\"}");
435
435
 
436
436
 
437
437
  $e24fb79fb8b63230$exports = {
@@ -480,6 +480,7 @@ $e24fb79fb8b63230$exports = {
480
480
 
481
481
 
482
482
 
483
+
483
484
  function $81a52da995c19652$var$CardView(props, ref) {
484
485
  let { scale: scale } = $8EWFi$useProvider();
485
486
  let { styleProps: styleProps } = $8EWFi$useStyleProps(props);
@@ -623,7 +624,7 @@ function $81a52da995c19652$var$InternalCard(props) {
623
624
  let rowRef = $8EWFi$useRef();
624
625
  let cellRef = $8EWFi$useRef();
625
626
  let unwrappedRef = $8EWFi$useUnwrapDOMRef(cellRef);
626
- let { rowProps: rowProps } = $8EWFi$useGridRow({
627
+ let { rowProps: gridRowProps } = $8EWFi$useGridRow({
627
628
  node: item,
628
629
  isVirtualized: true
629
630
  }, state, rowRef);
@@ -631,6 +632,15 @@ function $81a52da995c19652$var$InternalCard(props) {
631
632
  node: cellNode,
632
633
  focusMode: 'cell'
633
634
  }, state, unwrappedRef);
635
+ // Prevent space key from scrolling the CardView if triggered on a disabled item or on a Card in a selectionMode="none" CardView.
636
+ let allowsInteraction = state.selectionManager.selectionMode !== 'none';
637
+ let isDisabled = !allowsInteraction || state.disabledKeys.has(item.key);
638
+ let onKeyDown = (e)=>{
639
+ if (e.key === ' ' && isDisabled) e.preventDefault();
640
+ };
641
+ let rowProps = $8EWFi$mergeProps(gridRowProps, {
642
+ onKeyDown: onKeyDown
643
+ });
634
644
  if (layoutType === 'grid' || layoutType === 'gallery') isQuiet = true;
635
645
  if (layoutType !== 'grid') cardOrientation = 'vertical';
636
646
  // We don't want to focus the checkbox (or any other focusable elements) within the Card