@react-spectrum/table 3.10.1-nightly.4049 → 3.10.1-nightly.4052

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/table",
3
- "version": "3.10.1-nightly.4049+3aa6dbe3b",
3
+ "version": "3.10.1-nightly.4052+77fbf106d",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,39 +36,39 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/button": "3.0.0-nightly.2344+3aa6dbe3b",
40
- "@react-aria/focus": "3.0.0-nightly.2344+3aa6dbe3b",
41
- "@react-aria/grid": "3.8.1-nightly.4049+3aa6dbe3b",
42
- "@react-aria/i18n": "3.0.0-nightly.2344+3aa6dbe3b",
43
- "@react-aria/interactions": "3.0.0-nightly.2344+3aa6dbe3b",
44
- "@react-aria/table": "3.10.1-nightly.4049+3aa6dbe3b",
45
- "@react-aria/utils": "3.0.0-nightly.2344+3aa6dbe3b",
46
- "@react-aria/virtualizer": "3.9.1-nightly.4049+3aa6dbe3b",
47
- "@react-aria/visually-hidden": "3.0.0-nightly.2344+3aa6dbe3b",
48
- "@react-spectrum/button": "3.0.0-nightly.2344+3aa6dbe3b",
49
- "@react-spectrum/checkbox": "3.0.0-nightly.2344+3aa6dbe3b",
50
- "@react-spectrum/dnd": "3.3.1-nightly.4049+3aa6dbe3b",
51
- "@react-spectrum/layout": "3.5.4-nightly.4049+3aa6dbe3b",
52
- "@react-spectrum/menu": "3.12.1-nightly.4049+3aa6dbe3b",
53
- "@react-spectrum/progress": "3.0.0-nightly.2344+3aa6dbe3b",
54
- "@react-spectrum/tooltip": "3.0.0-nightly.2344+3aa6dbe3b",
55
- "@react-spectrum/utils": "3.0.0-nightly.2344+3aa6dbe3b",
56
- "@react-stately/collections": "3.0.0-nightly.2344+3aa6dbe3b",
57
- "@react-stately/flags": "3.0.0-nightly.4049+3aa6dbe3b",
58
- "@react-stately/grid": "3.7.1-nightly.4049+3aa6dbe3b",
59
- "@react-stately/layout": "3.12.3-nightly.4049+3aa6dbe3b",
60
- "@react-stately/table": "3.10.1-nightly.4049+3aa6dbe3b",
61
- "@react-stately/virtualizer": "3.6.1-nightly.4049+3aa6dbe3b",
62
- "@react-types/grid": "3.1.9-nightly.4049+3aa6dbe3b",
63
- "@react-types/shared": "3.0.0-nightly.2344+3aa6dbe3b",
64
- "@react-types/table": "3.7.1-nightly.4049+3aa6dbe3b",
65
- "@spectrum-icons/ui": "3.0.0-nightly.2344+3aa6dbe3b",
39
+ "@react-aria/button": "3.0.0-nightly.2347+77fbf106d",
40
+ "@react-aria/focus": "3.0.0-nightly.2347+77fbf106d",
41
+ "@react-aria/grid": "3.8.1-nightly.4052+77fbf106d",
42
+ "@react-aria/i18n": "3.0.0-nightly.2347+77fbf106d",
43
+ "@react-aria/interactions": "3.0.0-nightly.2347+77fbf106d",
44
+ "@react-aria/table": "3.10.1-nightly.4052+77fbf106d",
45
+ "@react-aria/utils": "3.0.0-nightly.2347+77fbf106d",
46
+ "@react-aria/virtualizer": "3.9.1-nightly.4052+77fbf106d",
47
+ "@react-aria/visually-hidden": "3.0.0-nightly.2347+77fbf106d",
48
+ "@react-spectrum/button": "3.0.0-nightly.2347+77fbf106d",
49
+ "@react-spectrum/checkbox": "3.0.0-nightly.2347+77fbf106d",
50
+ "@react-spectrum/dnd": "3.3.1-nightly.4052+77fbf106d",
51
+ "@react-spectrum/layout": "3.5.4-nightly.4052+77fbf106d",
52
+ "@react-spectrum/menu": "3.12.1-nightly.4052+77fbf106d",
53
+ "@react-spectrum/progress": "3.0.0-nightly.2347+77fbf106d",
54
+ "@react-spectrum/tooltip": "3.0.0-nightly.2347+77fbf106d",
55
+ "@react-spectrum/utils": "3.0.0-nightly.2347+77fbf106d",
56
+ "@react-stately/collections": "3.0.0-nightly.2347+77fbf106d",
57
+ "@react-stately/flags": "3.0.0-nightly.4052+77fbf106d",
58
+ "@react-stately/grid": "3.7.1-nightly.4052+77fbf106d",
59
+ "@react-stately/layout": "3.12.3-nightly.4052+77fbf106d",
60
+ "@react-stately/table": "3.10.1-nightly.4052+77fbf106d",
61
+ "@react-stately/virtualizer": "3.6.1-nightly.4052+77fbf106d",
62
+ "@react-types/grid": "3.1.9-nightly.4052+77fbf106d",
63
+ "@react-types/shared": "3.0.0-nightly.2347+77fbf106d",
64
+ "@react-types/table": "3.7.1-nightly.4052+77fbf106d",
65
+ "@spectrum-icons/ui": "3.0.0-nightly.2347+77fbf106d",
66
66
  "@swc/helpers": "^0.5.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@adobe/spectrum-css-temp": "3.0.0-nightly.2344+3aa6dbe3b",
70
- "@react-aria/dnd": "3.3.1-nightly.4049+3aa6dbe3b",
71
- "@react-stately/dnd": "3.2.3-nightly.4049+3aa6dbe3b"
69
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2347+77fbf106d",
70
+ "@react-aria/dnd": "3.3.1-nightly.4052+77fbf106d",
71
+ "@react-stately/dnd": "3.2.3-nightly.4052+77fbf106d"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "@react-spectrum/provider": "^3.0.0",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "3aa6dbe3bdf1f5de94111a6e3153ace69540effa"
81
+ "gitHead": "77fbf106d412426d829fffce39c7abe45e0ccc64"
82
82
  }
package/src/Resizer.tsx CHANGED
@@ -47,7 +47,7 @@ const CURSORS = {
47
47
 
48
48
  function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
49
49
  let {column, showResizer} = props;
50
- let {isEmpty, layout} = useTableContext();
50
+ let {isEmpty, layout, onFocusedResizer} = useTableContext();
51
51
  // Virtualizer re-renders, but these components are all cached
52
52
  // in order to get around that and cause a rerender here, we use context
53
53
  // but we don't actually need any value, they are available on the layout object
@@ -78,8 +78,7 @@ function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
78
78
  let {inputProps, resizerProps} = useTableColumnResize<unknown>(
79
79
  mergeProps(props, {
80
80
  'aria-label': stringFormatter.format('columnResizer'),
81
- isDisabled: isEmpty,
82
- shouldResizeOnFocus: true
81
+ isDisabled: isEmpty
83
82
  }), layout, ref);
84
83
 
85
84
  let isEResizable = layout.getColumnMinWidth(column.key) >= layout.getColumnWidth(column.key);
@@ -95,9 +94,9 @@ function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
95
94
  }
96
95
 
97
96
  let style = {
97
+ ...resizerProps.style,
98
98
  height: '100%',
99
99
  display: showResizer ? undefined : 'none',
100
- touchAction: 'none',
101
100
  cursor
102
101
  };
103
102
 
@@ -105,13 +104,13 @@ function Resizer<T>(props: ResizerProps<T>, ref: RefObject<HTMLInputElement>) {
105
104
  <>
106
105
  <FocusRing within focusRingClass={classNames(styles, 'focus-ring')}>
107
106
  <div
107
+ {...resizerProps}
108
108
  role="presentation"
109
109
  style={style}
110
- className={classNames(styles, 'spectrum-Table-columnResizer')}
111
- {...resizerProps}>
110
+ className={classNames(styles, 'spectrum-Table-columnResizer')}>
112
111
  <input
113
112
  ref={ref}
114
- {...inputProps} />
113
+ {...mergeProps(inputProps, {onFocus: onFocusedResizer})} />
115
114
  </div>
116
115
  </FocusRing>
117
116
  {/* Placeholder so that the title doesn't intersect with space reserved by the resizer when it appears. */}
@@ -20,7 +20,6 @@ import {
20
20
  classNames,
21
21
  useDOMRef,
22
22
  useFocusableRef,
23
- useIsMobileDevice,
24
23
  useStyleProps,
25
24
  useUnwrapDOMRef
26
25
  } from '@react-spectrum/utils';
@@ -823,7 +822,6 @@ function ResizableTableColumnHeader(props) {
823
822
  headerRowHovered,
824
823
  setIsInResizeMode,
825
824
  isEmpty,
826
- onFocusedResizer,
827
825
  isInResizeMode,
828
826
  headerMenuOpen,
829
827
  setHeaderMenuOpen
@@ -877,39 +875,8 @@ function ResizableTableColumnHeader(props) {
877
875
  return options;
878
876
  // eslint-disable-next-line react-hooks/exhaustive-deps
879
877
  }, [allowsSorting]);
880
- let isMobile = useIsMobileDevice();
881
878
 
882
879
  let resizingColumn = layout.resizingColumn;
883
- let prevResizingColumn = useRef(null);
884
- let timeout = useRef(null);
885
- useEffect(() => {
886
- if (prevResizingColumn.current !== resizingColumn &&
887
- resizingColumn != null &&
888
- resizingColumn === column.key) {
889
- if (timeout.current) {
890
- clearTimeout(timeout.current);
891
- }
892
- // focusSafely won't actually focus because the focus moves from the menuitem to the body during the after transition wait
893
- // without the immediate timeout, Android Chrome doesn't move focus to the resizer
894
- let focusResizer = () => {
895
- resizingRef.current.focus();
896
- onFocusedResizer();
897
- timeout.current = null;
898
- };
899
- if (isMobile) {
900
- timeout.current = setTimeout(focusResizer, 400);
901
- return;
902
- }
903
- timeout.current = setTimeout(focusResizer, 0);
904
- }
905
- prevResizingColumn.current = resizingColumn;
906
- }, [resizingColumn, column.key, isMobile, onFocusedResizer, resizingRef, prevResizingColumn, timeout]);
907
-
908
- // eslint-disable-next-line arrow-body-style
909
- useEffect(() => {
910
- return () => clearTimeout(timeout.current);
911
- }, []);
912
-
913
880
  let showResizer = !isEmpty && ((headerRowHovered && getInteractionModality() !== 'keyboard') || resizingColumn != null);
914
881
  let alignment = 'start';
915
882
  let menuAlign = 'start' as 'start' | 'end';