@react-spectrum/table 3.10.1-nightly.4049 → 3.10.1-nightly.4053
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 +77 -45
- package/dist/main.js +76 -44
- package/dist/main.js.map +1 -1
- package/dist/module.js +77 -45
- package/dist/module.js.map +1 -1
- package/package.json +32 -32
- package/src/Resizer.tsx +6 -7
- package/src/TableViewBase.tsx +0 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/table",
|
|
3
|
-
"version": "3.10.1-nightly.
|
|
3
|
+
"version": "3.10.1-nightly.4053+caab22120",
|
|
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.
|
|
40
|
-
"@react-aria/focus": "3.0.0-nightly.
|
|
41
|
-
"@react-aria/grid": "3.8.1-nightly.
|
|
42
|
-
"@react-aria/i18n": "3.0.0-nightly.
|
|
43
|
-
"@react-aria/interactions": "3.0.0-nightly.
|
|
44
|
-
"@react-aria/table": "3.10.1-nightly.
|
|
45
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
46
|
-
"@react-aria/virtualizer": "3.9.1-nightly.
|
|
47
|
-
"@react-aria/visually-hidden": "3.0.0-nightly.
|
|
48
|
-
"@react-spectrum/button": "3.0.0-nightly.
|
|
49
|
-
"@react-spectrum/checkbox": "3.0.0-nightly.
|
|
50
|
-
"@react-spectrum/dnd": "3.3.1-nightly.
|
|
51
|
-
"@react-spectrum/layout": "3.5.4-nightly.
|
|
52
|
-
"@react-spectrum/menu": "3.12.1-nightly.
|
|
53
|
-
"@react-spectrum/progress": "3.0.0-nightly.
|
|
54
|
-
"@react-spectrum/tooltip": "3.0.0-nightly.
|
|
55
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
56
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
57
|
-
"@react-stately/flags": "3.0.0-nightly.
|
|
58
|
-
"@react-stately/grid": "3.7.1-nightly.
|
|
59
|
-
"@react-stately/layout": "3.12.3-nightly.
|
|
60
|
-
"@react-stately/table": "3.10.1-nightly.
|
|
61
|
-
"@react-stately/virtualizer": "3.6.1-nightly.
|
|
62
|
-
"@react-types/grid": "3.1.9-nightly.
|
|
63
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
64
|
-
"@react-types/table": "3.7.1-nightly.
|
|
65
|
-
"@spectrum-icons/ui": "3.0.0-nightly.
|
|
39
|
+
"@react-aria/button": "3.0.0-nightly.2348+caab22120",
|
|
40
|
+
"@react-aria/focus": "3.0.0-nightly.2348+caab22120",
|
|
41
|
+
"@react-aria/grid": "3.8.1-nightly.4053+caab22120",
|
|
42
|
+
"@react-aria/i18n": "3.0.0-nightly.2348+caab22120",
|
|
43
|
+
"@react-aria/interactions": "3.0.0-nightly.2348+caab22120",
|
|
44
|
+
"@react-aria/table": "3.10.1-nightly.4053+caab22120",
|
|
45
|
+
"@react-aria/utils": "3.0.0-nightly.2348+caab22120",
|
|
46
|
+
"@react-aria/virtualizer": "3.9.1-nightly.4053+caab22120",
|
|
47
|
+
"@react-aria/visually-hidden": "3.0.0-nightly.2348+caab22120",
|
|
48
|
+
"@react-spectrum/button": "3.0.0-nightly.2348+caab22120",
|
|
49
|
+
"@react-spectrum/checkbox": "3.0.0-nightly.2348+caab22120",
|
|
50
|
+
"@react-spectrum/dnd": "3.3.1-nightly.4053+caab22120",
|
|
51
|
+
"@react-spectrum/layout": "3.5.4-nightly.4053+caab22120",
|
|
52
|
+
"@react-spectrum/menu": "3.12.1-nightly.4053+caab22120",
|
|
53
|
+
"@react-spectrum/progress": "3.0.0-nightly.2348+caab22120",
|
|
54
|
+
"@react-spectrum/tooltip": "3.0.0-nightly.2348+caab22120",
|
|
55
|
+
"@react-spectrum/utils": "3.0.0-nightly.2348+caab22120",
|
|
56
|
+
"@react-stately/collections": "3.0.0-nightly.2348+caab22120",
|
|
57
|
+
"@react-stately/flags": "3.0.0-nightly.4053+caab22120",
|
|
58
|
+
"@react-stately/grid": "3.7.1-nightly.4053+caab22120",
|
|
59
|
+
"@react-stately/layout": "3.12.3-nightly.4053+caab22120",
|
|
60
|
+
"@react-stately/table": "3.10.1-nightly.4053+caab22120",
|
|
61
|
+
"@react-stately/virtualizer": "3.6.1-nightly.4053+caab22120",
|
|
62
|
+
"@react-types/grid": "3.1.9-nightly.4053+caab22120",
|
|
63
|
+
"@react-types/shared": "3.0.0-nightly.2348+caab22120",
|
|
64
|
+
"@react-types/table": "3.7.1-nightly.4053+caab22120",
|
|
65
|
+
"@spectrum-icons/ui": "3.0.0-nightly.2348+caab22120",
|
|
66
66
|
"@swc/helpers": "^0.5.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
70
|
-
"@react-aria/dnd": "3.3.1-nightly.
|
|
71
|
-
"@react-stately/dnd": "3.2.3-nightly.
|
|
69
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2348+caab22120",
|
|
70
|
+
"@react-aria/dnd": "3.3.1-nightly.4053+caab22120",
|
|
71
|
+
"@react-stately/dnd": "3.2.3-nightly.4053+caab22120"
|
|
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": "
|
|
81
|
+
"gitHead": "caab22120fff9386db18898a0c226aaa6ba862a8"
|
|
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. */}
|
package/src/TableViewBase.tsx
CHANGED
|
@@ -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';
|