@react-aria/virtualizer 3.10.1-nightly.4624 → 3.10.1
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/ScrollView.main.js +15 -15
- package/dist/ScrollView.mjs +15 -15
- package/dist/ScrollView.module.js +15 -15
- package/dist/Virtualizer.main.js +2 -2
- package/dist/Virtualizer.mjs +2 -2
- package/dist/Virtualizer.module.js +2 -2
- package/dist/VirtualizerItem.main.js +9 -9
- package/dist/VirtualizerItem.mjs +9 -9
- package/dist/VirtualizerItem.module.js +9 -9
- package/dist/useVirtualizerItem.main.js +1 -1
- package/dist/useVirtualizerItem.mjs +1 -1
- package/dist/useVirtualizerItem.module.js +1 -1
- package/dist/utils.main.js +17 -17
- package/dist/utils.mjs +17 -17
- package/dist/utils.module.js +17 -17
- package/package.json +7 -7
package/dist/ScrollView.main.js
CHANGED
|
@@ -32,9 +32,9 @@ $parcel$export(module.exports, "ScrollView", () => $00ca8c0b29e3e07c$export$5665
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
let $00ca8c0b29e3e07c$var$isOldReact = (0, ($parcel$interopDefault($kvIfm$react))).version.startsWith(
|
|
35
|
+
let $00ca8c0b29e3e07c$var$isOldReact = (0, ($parcel$interopDefault($kvIfm$react))).version.startsWith('16.') || (0, ($parcel$interopDefault($kvIfm$react))).version.startsWith('17.');
|
|
36
36
|
function $00ca8c0b29e3e07c$var$ScrollView(props, ref) {
|
|
37
|
-
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection =
|
|
37
|
+
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection = 'both', ...otherProps } = props;
|
|
38
38
|
let defaultRef = (0, $kvIfm$react.useRef)();
|
|
39
39
|
ref = ref || defaultRef;
|
|
40
40
|
let state = (0, $kvIfm$react.useRef)({
|
|
@@ -98,13 +98,13 @@ function $00ca8c0b29e3e07c$var$ScrollView(props, ref) {
|
|
|
98
98
|
let dom = ref.current;
|
|
99
99
|
if (!dom) return;
|
|
100
100
|
let isTestEnv = false;
|
|
101
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
102
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
101
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
102
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
103
103
|
let w = isTestEnv && !isClientWidthMocked ? Infinity : dom.clientWidth;
|
|
104
104
|
let h = isTestEnv && !isClientHeightMocked ? Infinity : dom.clientHeight;
|
|
105
105
|
if (sizeToFit && contentSize.width > 0 && contentSize.height > 0) {
|
|
106
|
-
if (sizeToFit ===
|
|
107
|
-
else if (sizeToFit ===
|
|
106
|
+
if (sizeToFit === 'width') w = Math.min(w, contentSize.width);
|
|
107
|
+
else if (sizeToFit === 'height') h = Math.min(h, contentSize.height);
|
|
108
108
|
}
|
|
109
109
|
if (state.width !== w || state.height !== h) {
|
|
110
110
|
state.width = w;
|
|
@@ -147,21 +147,21 @@ function $00ca8c0b29e3e07c$var$ScrollView(props, ref) {
|
|
|
147
147
|
padding: 0,
|
|
148
148
|
...otherProps.style
|
|
149
149
|
};
|
|
150
|
-
if (scrollDirection ===
|
|
151
|
-
style.overflowX =
|
|
152
|
-
style.overflowY =
|
|
153
|
-
} else if (scrollDirection ===
|
|
150
|
+
if (scrollDirection === 'horizontal') {
|
|
151
|
+
style.overflowX = 'auto';
|
|
152
|
+
style.overflowY = 'hidden';
|
|
153
|
+
} else if (scrollDirection === 'vertical' || contentSize.width === state.width) {
|
|
154
154
|
// Set overflow-x: hidden if content size is equal to the width of the scroll view.
|
|
155
155
|
// This prevents horizontal scrollbars from flickering during resizing due to resize observer
|
|
156
156
|
// firing slower than the frame rate, which may cause an infinite re-render loop.
|
|
157
|
-
style.overflowY =
|
|
158
|
-
style.overflowX =
|
|
159
|
-
} else style.overflow =
|
|
157
|
+
style.overflowY = 'auto';
|
|
158
|
+
style.overflowX = 'hidden';
|
|
159
|
+
} else style.overflow = 'auto';
|
|
160
160
|
innerStyle = {
|
|
161
161
|
width: Number.isFinite(contentSize.width) ? contentSize.width : undefined,
|
|
162
162
|
height: Number.isFinite(contentSize.height) ? contentSize.height : undefined,
|
|
163
|
-
pointerEvents: isScrolling ?
|
|
164
|
-
position:
|
|
163
|
+
pointerEvents: isScrolling ? 'none' : 'auto',
|
|
164
|
+
position: 'relative',
|
|
165
165
|
...innerStyle
|
|
166
166
|
};
|
|
167
167
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($kvIfm$react))).createElement("div", {
|
package/dist/ScrollView.mjs
CHANGED
|
@@ -22,9 +22,9 @@ import {useLocale as $f9kpT$useLocale} from "@react-aria/i18n";
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
let $44a6ee657928b002$var$isOldReact = (0, $f9kpT$react).version.startsWith(
|
|
25
|
+
let $44a6ee657928b002$var$isOldReact = (0, $f9kpT$react).version.startsWith('16.') || (0, $f9kpT$react).version.startsWith('17.');
|
|
26
26
|
function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
27
|
-
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection =
|
|
27
|
+
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection = 'both', ...otherProps } = props;
|
|
28
28
|
let defaultRef = (0, $f9kpT$useRef)();
|
|
29
29
|
ref = ref || defaultRef;
|
|
30
30
|
let state = (0, $f9kpT$useRef)({
|
|
@@ -88,13 +88,13 @@ function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
|
88
88
|
let dom = ref.current;
|
|
89
89
|
if (!dom) return;
|
|
90
90
|
let isTestEnv = false;
|
|
91
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
92
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
91
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
92
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
93
93
|
let w = isTestEnv && !isClientWidthMocked ? Infinity : dom.clientWidth;
|
|
94
94
|
let h = isTestEnv && !isClientHeightMocked ? Infinity : dom.clientHeight;
|
|
95
95
|
if (sizeToFit && contentSize.width > 0 && contentSize.height > 0) {
|
|
96
|
-
if (sizeToFit ===
|
|
97
|
-
else if (sizeToFit ===
|
|
96
|
+
if (sizeToFit === 'width') w = Math.min(w, contentSize.width);
|
|
97
|
+
else if (sizeToFit === 'height') h = Math.min(h, contentSize.height);
|
|
98
98
|
}
|
|
99
99
|
if (state.width !== w || state.height !== h) {
|
|
100
100
|
state.width = w;
|
|
@@ -137,21 +137,21 @@ function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
|
137
137
|
padding: 0,
|
|
138
138
|
...otherProps.style
|
|
139
139
|
};
|
|
140
|
-
if (scrollDirection ===
|
|
141
|
-
style.overflowX =
|
|
142
|
-
style.overflowY =
|
|
143
|
-
} else if (scrollDirection ===
|
|
140
|
+
if (scrollDirection === 'horizontal') {
|
|
141
|
+
style.overflowX = 'auto';
|
|
142
|
+
style.overflowY = 'hidden';
|
|
143
|
+
} else if (scrollDirection === 'vertical' || contentSize.width === state.width) {
|
|
144
144
|
// Set overflow-x: hidden if content size is equal to the width of the scroll view.
|
|
145
145
|
// This prevents horizontal scrollbars from flickering during resizing due to resize observer
|
|
146
146
|
// firing slower than the frame rate, which may cause an infinite re-render loop.
|
|
147
|
-
style.overflowY =
|
|
148
|
-
style.overflowX =
|
|
149
|
-
} else style.overflow =
|
|
147
|
+
style.overflowY = 'auto';
|
|
148
|
+
style.overflowX = 'hidden';
|
|
149
|
+
} else style.overflow = 'auto';
|
|
150
150
|
innerStyle = {
|
|
151
151
|
width: Number.isFinite(contentSize.width) ? contentSize.width : undefined,
|
|
152
152
|
height: Number.isFinite(contentSize.height) ? contentSize.height : undefined,
|
|
153
|
-
pointerEvents: isScrolling ?
|
|
154
|
-
position:
|
|
153
|
+
pointerEvents: isScrolling ? 'none' : 'auto',
|
|
154
|
+
position: 'relative',
|
|
155
155
|
...innerStyle
|
|
156
156
|
};
|
|
157
157
|
return /*#__PURE__*/ (0, $f9kpT$react).createElement("div", {
|
|
@@ -22,9 +22,9 @@ import {useLocale as $f9kpT$useLocale} from "@react-aria/i18n";
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
let $44a6ee657928b002$var$isOldReact = (0, $f9kpT$react).version.startsWith(
|
|
25
|
+
let $44a6ee657928b002$var$isOldReact = (0, $f9kpT$react).version.startsWith('16.') || (0, $f9kpT$react).version.startsWith('17.');
|
|
26
26
|
function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
27
|
-
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection =
|
|
27
|
+
let { contentSize: contentSize, onVisibleRectChange: onVisibleRectChange, children: children, innerStyle: innerStyle, sizeToFit: sizeToFit, onScrollStart: onScrollStart, onScrollEnd: onScrollEnd, scrollDirection: scrollDirection = 'both', ...otherProps } = props;
|
|
28
28
|
let defaultRef = (0, $f9kpT$useRef)();
|
|
29
29
|
ref = ref || defaultRef;
|
|
30
30
|
let state = (0, $f9kpT$useRef)({
|
|
@@ -88,13 +88,13 @@ function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
|
88
88
|
let dom = ref.current;
|
|
89
89
|
if (!dom) return;
|
|
90
90
|
let isTestEnv = false;
|
|
91
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
92
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
91
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
92
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
93
93
|
let w = isTestEnv && !isClientWidthMocked ? Infinity : dom.clientWidth;
|
|
94
94
|
let h = isTestEnv && !isClientHeightMocked ? Infinity : dom.clientHeight;
|
|
95
95
|
if (sizeToFit && contentSize.width > 0 && contentSize.height > 0) {
|
|
96
|
-
if (sizeToFit ===
|
|
97
|
-
else if (sizeToFit ===
|
|
96
|
+
if (sizeToFit === 'width') w = Math.min(w, contentSize.width);
|
|
97
|
+
else if (sizeToFit === 'height') h = Math.min(h, contentSize.height);
|
|
98
98
|
}
|
|
99
99
|
if (state.width !== w || state.height !== h) {
|
|
100
100
|
state.width = w;
|
|
@@ -137,21 +137,21 @@ function $44a6ee657928b002$var$ScrollView(props, ref) {
|
|
|
137
137
|
padding: 0,
|
|
138
138
|
...otherProps.style
|
|
139
139
|
};
|
|
140
|
-
if (scrollDirection ===
|
|
141
|
-
style.overflowX =
|
|
142
|
-
style.overflowY =
|
|
143
|
-
} else if (scrollDirection ===
|
|
140
|
+
if (scrollDirection === 'horizontal') {
|
|
141
|
+
style.overflowX = 'auto';
|
|
142
|
+
style.overflowY = 'hidden';
|
|
143
|
+
} else if (scrollDirection === 'vertical' || contentSize.width === state.width) {
|
|
144
144
|
// Set overflow-x: hidden if content size is equal to the width of the scroll view.
|
|
145
145
|
// This prevents horizontal scrollbars from flickering during resizing due to resize observer
|
|
146
146
|
// firing slower than the frame rate, which may cause an infinite re-render loop.
|
|
147
|
-
style.overflowY =
|
|
148
|
-
style.overflowX =
|
|
149
|
-
} else style.overflow =
|
|
147
|
+
style.overflowY = 'auto';
|
|
148
|
+
style.overflowX = 'hidden';
|
|
149
|
+
} else style.overflow = 'auto';
|
|
150
150
|
innerStyle = {
|
|
151
151
|
width: Number.isFinite(contentSize.width) ? contentSize.width : undefined,
|
|
152
152
|
height: Number.isFinite(contentSize.height) ? contentSize.height : undefined,
|
|
153
|
-
pointerEvents: isScrolling ?
|
|
154
|
-
position:
|
|
153
|
+
pointerEvents: isScrolling ? 'none' : 'auto',
|
|
154
|
+
position: 'relative',
|
|
155
155
|
...innerStyle
|
|
156
156
|
};
|
|
157
157
|
return /*#__PURE__*/ (0, $f9kpT$react).createElement("div", {
|
package/dist/Virtualizer.main.js
CHANGED
|
@@ -80,7 +80,7 @@ function $e1fb6f3669e1c329$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
80
80
|
if (virtualizer.visibleRect.height === 0) return;
|
|
81
81
|
// Only scroll the focusedKey into view if the modality is not pointer to avoid jumps in position when clicking/pressing tall items.
|
|
82
82
|
let modality = (0, $knrtk$reactariainteractions.getInteractionModality)();
|
|
83
|
-
if (focusedKey !== lastFocusedKey.current && (modality !==
|
|
83
|
+
if (focusedKey !== lastFocusedKey.current && (modality !== 'pointer' || autoFocus.current)) {
|
|
84
84
|
autoFocus.current = false;
|
|
85
85
|
if (scrollToItem) // If user provides scrolltoitem, then it is their responsibility to call scrollIntoViewport if desired
|
|
86
86
|
// since we don't know if their scrollToItem may take some time to actually bring the active element into the virtualizer's visible rect.
|
|
@@ -110,7 +110,7 @@ function $e1fb6f3669e1c329$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
110
110
|
// Ignore focus events that bubble through portals (e.g. focus that happens on a menu popover child of the virtualizer)
|
|
111
111
|
// Don't scroll focused key into view if modality is pointer to prevent sudden jump in position (e.g. CardView).
|
|
112
112
|
let modality = (0, $knrtk$reactariainteractions.getInteractionModality)();
|
|
113
|
-
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !==
|
|
113
|
+
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !== 'pointer') {
|
|
114
114
|
if (scrollToItem) scrollToItem(focusedKey);
|
|
115
115
|
else virtualizer.scrollToItem(focusedKey, {
|
|
116
116
|
duration: 0
|
package/dist/Virtualizer.mjs
CHANGED
|
@@ -69,7 +69,7 @@ function $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
69
69
|
if (virtualizer.visibleRect.height === 0) return;
|
|
70
70
|
// Only scroll the focusedKey into view if the modality is not pointer to avoid jumps in position when clicking/pressing tall items.
|
|
71
71
|
let modality = (0, $9WwqA$getInteractionModality)();
|
|
72
|
-
if (focusedKey !== lastFocusedKey.current && (modality !==
|
|
72
|
+
if (focusedKey !== lastFocusedKey.current && (modality !== 'pointer' || autoFocus.current)) {
|
|
73
73
|
autoFocus.current = false;
|
|
74
74
|
if (scrollToItem) // If user provides scrolltoitem, then it is their responsibility to call scrollIntoViewport if desired
|
|
75
75
|
// since we don't know if their scrollToItem may take some time to actually bring the active element into the virtualizer's visible rect.
|
|
@@ -99,7 +99,7 @@ function $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
99
99
|
// Ignore focus events that bubble through portals (e.g. focus that happens on a menu popover child of the virtualizer)
|
|
100
100
|
// Don't scroll focused key into view if modality is pointer to prevent sudden jump in position (e.g. CardView).
|
|
101
101
|
let modality = (0, $9WwqA$getInteractionModality)();
|
|
102
|
-
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !==
|
|
102
|
+
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !== 'pointer') {
|
|
103
103
|
if (scrollToItem) scrollToItem(focusedKey);
|
|
104
104
|
else virtualizer.scrollToItem(focusedKey, {
|
|
105
105
|
duration: 0
|
|
@@ -69,7 +69,7 @@ function $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
69
69
|
if (virtualizer.visibleRect.height === 0) return;
|
|
70
70
|
// Only scroll the focusedKey into view if the modality is not pointer to avoid jumps in position when clicking/pressing tall items.
|
|
71
71
|
let modality = (0, $9WwqA$getInteractionModality)();
|
|
72
|
-
if (focusedKey !== lastFocusedKey.current && (modality !==
|
|
72
|
+
if (focusedKey !== lastFocusedKey.current && (modality !== 'pointer' || autoFocus.current)) {
|
|
73
73
|
autoFocus.current = false;
|
|
74
74
|
if (scrollToItem) // If user provides scrolltoitem, then it is their responsibility to call scrollIntoViewport if desired
|
|
75
75
|
// since we don't know if their scrollToItem may take some time to actually bring the active element into the virtualizer's visible rect.
|
|
@@ -99,7 +99,7 @@ function $6d0a5c394373ae64$export$dd6d526d88b5a137(props, state, ref) {
|
|
|
99
99
|
// Ignore focus events that bubble through portals (e.g. focus that happens on a menu popover child of the virtualizer)
|
|
100
100
|
// Don't scroll focused key into view if modality is pointer to prevent sudden jump in position (e.g. CardView).
|
|
101
101
|
let modality = (0, $9WwqA$getInteractionModality)();
|
|
102
|
-
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !==
|
|
102
|
+
if (!isFocusWithin.current && ref.current.contains(e.target) && modality !== 'pointer') {
|
|
103
103
|
if (scrollToItem) scrollToItem(focusedKey);
|
|
104
104
|
else virtualizer.scrollToItem(focusedKey, {
|
|
105
105
|
duration: 0
|
|
@@ -44,7 +44,7 @@ function $d6a26279cc31826b$export$6796df8ba7398521(props) {
|
|
|
44
44
|
}
|
|
45
45
|
let $d6a26279cc31826b$var$cache = new WeakMap();
|
|
46
46
|
function $d6a26279cc31826b$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
47
|
-
let xProperty = dir ===
|
|
47
|
+
let xProperty = dir === 'rtl' ? 'right' : 'left';
|
|
48
48
|
let cached = $d6a26279cc31826b$var$cache.get(layoutInfo);
|
|
49
49
|
if (cached && cached[xProperty] != null) {
|
|
50
50
|
if (!parent) return cached;
|
|
@@ -64,18 +64,18 @@ function $d6a26279cc31826b$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
|
64
64
|
if (!Number.isFinite(value)) rectStyles[key] = undefined;
|
|
65
65
|
});
|
|
66
66
|
let style = {
|
|
67
|
-
position: layoutInfo.isSticky ?
|
|
67
|
+
position: layoutInfo.isSticky ? 'sticky' : 'absolute',
|
|
68
68
|
// Sticky elements are positioned in normal document flow. Display inline-block so that they don't push other sticky columns onto the following rows.
|
|
69
|
-
display: layoutInfo.isSticky ?
|
|
70
|
-
overflow: layoutInfo.allowOverflow ?
|
|
71
|
-
transition:
|
|
72
|
-
WebkitTransition:
|
|
73
|
-
WebkitTransitionDuration:
|
|
74
|
-
transitionDuration:
|
|
69
|
+
display: layoutInfo.isSticky ? 'inline-block' : undefined,
|
|
70
|
+
overflow: layoutInfo.allowOverflow ? 'visible' : 'hidden',
|
|
71
|
+
transition: 'all',
|
|
72
|
+
WebkitTransition: 'all',
|
|
73
|
+
WebkitTransitionDuration: 'inherit',
|
|
74
|
+
transitionDuration: 'inherit',
|
|
75
75
|
opacity: layoutInfo.opacity,
|
|
76
76
|
zIndex: layoutInfo.zIndex,
|
|
77
77
|
transform: layoutInfo.transform,
|
|
78
|
-
contain:
|
|
78
|
+
contain: 'size layout style',
|
|
79
79
|
...rectStyles
|
|
80
80
|
};
|
|
81
81
|
$d6a26279cc31826b$var$cache.set(layoutInfo, style);
|
package/dist/VirtualizerItem.mjs
CHANGED
|
@@ -33,7 +33,7 @@ function $ccf8a0a04e4175ae$export$6796df8ba7398521(props) {
|
|
|
33
33
|
}
|
|
34
34
|
let $ccf8a0a04e4175ae$var$cache = new WeakMap();
|
|
35
35
|
function $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
36
|
-
let xProperty = dir ===
|
|
36
|
+
let xProperty = dir === 'rtl' ? 'right' : 'left';
|
|
37
37
|
let cached = $ccf8a0a04e4175ae$var$cache.get(layoutInfo);
|
|
38
38
|
if (cached && cached[xProperty] != null) {
|
|
39
39
|
if (!parent) return cached;
|
|
@@ -53,18 +53,18 @@ function $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
|
53
53
|
if (!Number.isFinite(value)) rectStyles[key] = undefined;
|
|
54
54
|
});
|
|
55
55
|
let style = {
|
|
56
|
-
position: layoutInfo.isSticky ?
|
|
56
|
+
position: layoutInfo.isSticky ? 'sticky' : 'absolute',
|
|
57
57
|
// Sticky elements are positioned in normal document flow. Display inline-block so that they don't push other sticky columns onto the following rows.
|
|
58
|
-
display: layoutInfo.isSticky ?
|
|
59
|
-
overflow: layoutInfo.allowOverflow ?
|
|
60
|
-
transition:
|
|
61
|
-
WebkitTransition:
|
|
62
|
-
WebkitTransitionDuration:
|
|
63
|
-
transitionDuration:
|
|
58
|
+
display: layoutInfo.isSticky ? 'inline-block' : undefined,
|
|
59
|
+
overflow: layoutInfo.allowOverflow ? 'visible' : 'hidden',
|
|
60
|
+
transition: 'all',
|
|
61
|
+
WebkitTransition: 'all',
|
|
62
|
+
WebkitTransitionDuration: 'inherit',
|
|
63
|
+
transitionDuration: 'inherit',
|
|
64
64
|
opacity: layoutInfo.opacity,
|
|
65
65
|
zIndex: layoutInfo.zIndex,
|
|
66
66
|
transform: layoutInfo.transform,
|
|
67
|
-
contain:
|
|
67
|
+
contain: 'size layout style',
|
|
68
68
|
...rectStyles
|
|
69
69
|
};
|
|
70
70
|
$ccf8a0a04e4175ae$var$cache.set(layoutInfo, style);
|
|
@@ -33,7 +33,7 @@ function $ccf8a0a04e4175ae$export$6796df8ba7398521(props) {
|
|
|
33
33
|
}
|
|
34
34
|
let $ccf8a0a04e4175ae$var$cache = new WeakMap();
|
|
35
35
|
function $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
36
|
-
let xProperty = dir ===
|
|
36
|
+
let xProperty = dir === 'rtl' ? 'right' : 'left';
|
|
37
37
|
let cached = $ccf8a0a04e4175ae$var$cache.get(layoutInfo);
|
|
38
38
|
if (cached && cached[xProperty] != null) {
|
|
39
39
|
if (!parent) return cached;
|
|
@@ -53,18 +53,18 @@ function $ccf8a0a04e4175ae$export$1481e64fbe01b8b3(layoutInfo, dir, parent) {
|
|
|
53
53
|
if (!Number.isFinite(value)) rectStyles[key] = undefined;
|
|
54
54
|
});
|
|
55
55
|
let style = {
|
|
56
|
-
position: layoutInfo.isSticky ?
|
|
56
|
+
position: layoutInfo.isSticky ? 'sticky' : 'absolute',
|
|
57
57
|
// Sticky elements are positioned in normal document flow. Display inline-block so that they don't push other sticky columns onto the following rows.
|
|
58
|
-
display: layoutInfo.isSticky ?
|
|
59
|
-
overflow: layoutInfo.allowOverflow ?
|
|
60
|
-
transition:
|
|
61
|
-
WebkitTransition:
|
|
62
|
-
WebkitTransitionDuration:
|
|
63
|
-
transitionDuration:
|
|
58
|
+
display: layoutInfo.isSticky ? 'inline-block' : undefined,
|
|
59
|
+
overflow: layoutInfo.allowOverflow ? 'visible' : 'hidden',
|
|
60
|
+
transition: 'all',
|
|
61
|
+
WebkitTransition: 'all',
|
|
62
|
+
WebkitTransitionDuration: 'inherit',
|
|
63
|
+
transitionDuration: 'inherit',
|
|
64
64
|
opacity: layoutInfo.opacity,
|
|
65
65
|
zIndex: layoutInfo.zIndex,
|
|
66
66
|
transform: layoutInfo.transform,
|
|
67
|
-
contain:
|
|
67
|
+
contain: 'size layout style',
|
|
68
68
|
...rectStyles
|
|
69
69
|
};
|
|
70
70
|
$ccf8a0a04e4175ae$var$cache.set(layoutInfo, style);
|
|
@@ -41,7 +41,7 @@ function $7d70e069fceb2deb$export$1da781778207e0a2(options) {
|
|
|
41
41
|
function $7d70e069fceb2deb$var$getSize(node) {
|
|
42
42
|
// Reset height before measuring so we get the intrinsic size
|
|
43
43
|
let height = node.style.height;
|
|
44
|
-
node.style.height =
|
|
44
|
+
node.style.height = '';
|
|
45
45
|
let size = new (0, $64doO$reactstatelyvirtualizer.Size)(node.scrollWidth, node.scrollHeight);
|
|
46
46
|
node.style.height = height;
|
|
47
47
|
return size;
|
|
@@ -35,7 +35,7 @@ function $47736c1e63ba1c6d$export$1da781778207e0a2(options) {
|
|
|
35
35
|
function $47736c1e63ba1c6d$var$getSize(node) {
|
|
36
36
|
// Reset height before measuring so we get the intrinsic size
|
|
37
37
|
let height = node.style.height;
|
|
38
|
-
node.style.height =
|
|
38
|
+
node.style.height = '';
|
|
39
39
|
let size = new (0, $uBoVA$Size)(node.scrollWidth, node.scrollHeight);
|
|
40
40
|
node.style.height = height;
|
|
41
41
|
return size;
|
|
@@ -35,7 +35,7 @@ function $47736c1e63ba1c6d$export$1da781778207e0a2(options) {
|
|
|
35
35
|
function $47736c1e63ba1c6d$var$getSize(node) {
|
|
36
36
|
// Reset height before measuring so we get the intrinsic size
|
|
37
37
|
let height = node.style.height;
|
|
38
|
-
node.style.height =
|
|
38
|
+
node.style.height = '';
|
|
39
39
|
let size = new (0, $uBoVA$Size)(node.scrollWidth, node.scrollHeight);
|
|
40
40
|
node.style.height = height;
|
|
41
41
|
return size;
|
package/dist/utils.main.js
CHANGED
|
@@ -19,23 +19,23 @@ $parcel$export(module.exports, "setScrollLeft", () => $efdd61e59e023a1d$export$e
|
|
|
19
19
|
*/ let $efdd61e59e023a1d$var$cachedRTLResult = null;
|
|
20
20
|
function $efdd61e59e023a1d$export$faf7630257ad4304(recalculate = false) {
|
|
21
21
|
if ($efdd61e59e023a1d$var$cachedRTLResult === null || recalculate) {
|
|
22
|
-
const outerDiv = document.createElement(
|
|
22
|
+
const outerDiv = document.createElement('div');
|
|
23
23
|
const outerStyle = outerDiv.style;
|
|
24
|
-
outerStyle.width =
|
|
25
|
-
outerStyle.height =
|
|
26
|
-
outerStyle.overflow =
|
|
27
|
-
outerStyle.direction =
|
|
28
|
-
const innerDiv = document.createElement(
|
|
24
|
+
outerStyle.width = '50px';
|
|
25
|
+
outerStyle.height = '50px';
|
|
26
|
+
outerStyle.overflow = 'scroll';
|
|
27
|
+
outerStyle.direction = 'rtl';
|
|
28
|
+
const innerDiv = document.createElement('div');
|
|
29
29
|
const innerStyle = innerDiv.style;
|
|
30
|
-
innerStyle.width =
|
|
31
|
-
innerStyle.height =
|
|
30
|
+
innerStyle.width = '100px';
|
|
31
|
+
innerStyle.height = '100px';
|
|
32
32
|
outerDiv.appendChild(innerDiv);
|
|
33
33
|
document.body.appendChild(outerDiv);
|
|
34
|
-
if (outerDiv.scrollLeft > 0) $efdd61e59e023a1d$var$cachedRTLResult =
|
|
34
|
+
if (outerDiv.scrollLeft > 0) $efdd61e59e023a1d$var$cachedRTLResult = 'positive-descending';
|
|
35
35
|
else {
|
|
36
36
|
outerDiv.scrollLeft = 1;
|
|
37
|
-
if (outerDiv.scrollLeft === 0) $efdd61e59e023a1d$var$cachedRTLResult =
|
|
38
|
-
else $efdd61e59e023a1d$var$cachedRTLResult =
|
|
37
|
+
if (outerDiv.scrollLeft === 0) $efdd61e59e023a1d$var$cachedRTLResult = 'negative';
|
|
38
|
+
else $efdd61e59e023a1d$var$cachedRTLResult = 'positive-ascending';
|
|
39
39
|
}
|
|
40
40
|
document.body.removeChild(outerDiv);
|
|
41
41
|
return $efdd61e59e023a1d$var$cachedRTLResult;
|
|
@@ -46,13 +46,13 @@ function $efdd61e59e023a1d$export$1389d168952b34b5(node, direction) {
|
|
|
46
46
|
let { scrollLeft: scrollLeft } = node;
|
|
47
47
|
// scrollLeft in rtl locales differs across browsers, so normalize.
|
|
48
48
|
// See comment by getRTLOffsetType below for details.
|
|
49
|
-
if (direction ===
|
|
49
|
+
if (direction === 'rtl') {
|
|
50
50
|
let { scrollWidth: scrollWidth, clientWidth: clientWidth } = node;
|
|
51
51
|
switch($efdd61e59e023a1d$export$faf7630257ad4304()){
|
|
52
|
-
case
|
|
52
|
+
case 'negative':
|
|
53
53
|
scrollLeft = -scrollLeft;
|
|
54
54
|
break;
|
|
55
|
-
case
|
|
55
|
+
case 'positive-descending':
|
|
56
56
|
scrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
@@ -60,11 +60,11 @@ function $efdd61e59e023a1d$export$1389d168952b34b5(node, direction) {
|
|
|
60
60
|
return scrollLeft;
|
|
61
61
|
}
|
|
62
62
|
function $efdd61e59e023a1d$export$ed5fd5ffe5ab0ac(node, direction, scrollLeft) {
|
|
63
|
-
if (direction ===
|
|
64
|
-
case
|
|
63
|
+
if (direction === 'rtl') switch($efdd61e59e023a1d$export$faf7630257ad4304()){
|
|
64
|
+
case 'negative':
|
|
65
65
|
scrollLeft = -scrollLeft;
|
|
66
66
|
break;
|
|
67
|
-
case
|
|
67
|
+
case 'positive-ascending':
|
|
68
68
|
break;
|
|
69
69
|
default:
|
|
70
70
|
{
|
package/dist/utils.mjs
CHANGED
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
*/ let $ce415dc67314b753$var$cachedRTLResult = null;
|
|
12
12
|
function $ce415dc67314b753$export$faf7630257ad4304(recalculate = false) {
|
|
13
13
|
if ($ce415dc67314b753$var$cachedRTLResult === null || recalculate) {
|
|
14
|
-
const outerDiv = document.createElement(
|
|
14
|
+
const outerDiv = document.createElement('div');
|
|
15
15
|
const outerStyle = outerDiv.style;
|
|
16
|
-
outerStyle.width =
|
|
17
|
-
outerStyle.height =
|
|
18
|
-
outerStyle.overflow =
|
|
19
|
-
outerStyle.direction =
|
|
20
|
-
const innerDiv = document.createElement(
|
|
16
|
+
outerStyle.width = '50px';
|
|
17
|
+
outerStyle.height = '50px';
|
|
18
|
+
outerStyle.overflow = 'scroll';
|
|
19
|
+
outerStyle.direction = 'rtl';
|
|
20
|
+
const innerDiv = document.createElement('div');
|
|
21
21
|
const innerStyle = innerDiv.style;
|
|
22
|
-
innerStyle.width =
|
|
23
|
-
innerStyle.height =
|
|
22
|
+
innerStyle.width = '100px';
|
|
23
|
+
innerStyle.height = '100px';
|
|
24
24
|
outerDiv.appendChild(innerDiv);
|
|
25
25
|
document.body.appendChild(outerDiv);
|
|
26
|
-
if (outerDiv.scrollLeft > 0) $ce415dc67314b753$var$cachedRTLResult =
|
|
26
|
+
if (outerDiv.scrollLeft > 0) $ce415dc67314b753$var$cachedRTLResult = 'positive-descending';
|
|
27
27
|
else {
|
|
28
28
|
outerDiv.scrollLeft = 1;
|
|
29
|
-
if (outerDiv.scrollLeft === 0) $ce415dc67314b753$var$cachedRTLResult =
|
|
30
|
-
else $ce415dc67314b753$var$cachedRTLResult =
|
|
29
|
+
if (outerDiv.scrollLeft === 0) $ce415dc67314b753$var$cachedRTLResult = 'negative';
|
|
30
|
+
else $ce415dc67314b753$var$cachedRTLResult = 'positive-ascending';
|
|
31
31
|
}
|
|
32
32
|
document.body.removeChild(outerDiv);
|
|
33
33
|
return $ce415dc67314b753$var$cachedRTLResult;
|
|
@@ -38,13 +38,13 @@ function $ce415dc67314b753$export$1389d168952b34b5(node, direction) {
|
|
|
38
38
|
let { scrollLeft: scrollLeft } = node;
|
|
39
39
|
// scrollLeft in rtl locales differs across browsers, so normalize.
|
|
40
40
|
// See comment by getRTLOffsetType below for details.
|
|
41
|
-
if (direction ===
|
|
41
|
+
if (direction === 'rtl') {
|
|
42
42
|
let { scrollWidth: scrollWidth, clientWidth: clientWidth } = node;
|
|
43
43
|
switch($ce415dc67314b753$export$faf7630257ad4304()){
|
|
44
|
-
case
|
|
44
|
+
case 'negative':
|
|
45
45
|
scrollLeft = -scrollLeft;
|
|
46
46
|
break;
|
|
47
|
-
case
|
|
47
|
+
case 'positive-descending':
|
|
48
48
|
scrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
@@ -52,11 +52,11 @@ function $ce415dc67314b753$export$1389d168952b34b5(node, direction) {
|
|
|
52
52
|
return scrollLeft;
|
|
53
53
|
}
|
|
54
54
|
function $ce415dc67314b753$export$ed5fd5ffe5ab0ac(node, direction, scrollLeft) {
|
|
55
|
-
if (direction ===
|
|
56
|
-
case
|
|
55
|
+
if (direction === 'rtl') switch($ce415dc67314b753$export$faf7630257ad4304()){
|
|
56
|
+
case 'negative':
|
|
57
57
|
scrollLeft = -scrollLeft;
|
|
58
58
|
break;
|
|
59
|
-
case
|
|
59
|
+
case 'positive-ascending':
|
|
60
60
|
break;
|
|
61
61
|
default:
|
|
62
62
|
{
|
package/dist/utils.module.js
CHANGED
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
*/ let $ce415dc67314b753$var$cachedRTLResult = null;
|
|
12
12
|
function $ce415dc67314b753$export$faf7630257ad4304(recalculate = false) {
|
|
13
13
|
if ($ce415dc67314b753$var$cachedRTLResult === null || recalculate) {
|
|
14
|
-
const outerDiv = document.createElement(
|
|
14
|
+
const outerDiv = document.createElement('div');
|
|
15
15
|
const outerStyle = outerDiv.style;
|
|
16
|
-
outerStyle.width =
|
|
17
|
-
outerStyle.height =
|
|
18
|
-
outerStyle.overflow =
|
|
19
|
-
outerStyle.direction =
|
|
20
|
-
const innerDiv = document.createElement(
|
|
16
|
+
outerStyle.width = '50px';
|
|
17
|
+
outerStyle.height = '50px';
|
|
18
|
+
outerStyle.overflow = 'scroll';
|
|
19
|
+
outerStyle.direction = 'rtl';
|
|
20
|
+
const innerDiv = document.createElement('div');
|
|
21
21
|
const innerStyle = innerDiv.style;
|
|
22
|
-
innerStyle.width =
|
|
23
|
-
innerStyle.height =
|
|
22
|
+
innerStyle.width = '100px';
|
|
23
|
+
innerStyle.height = '100px';
|
|
24
24
|
outerDiv.appendChild(innerDiv);
|
|
25
25
|
document.body.appendChild(outerDiv);
|
|
26
|
-
if (outerDiv.scrollLeft > 0) $ce415dc67314b753$var$cachedRTLResult =
|
|
26
|
+
if (outerDiv.scrollLeft > 0) $ce415dc67314b753$var$cachedRTLResult = 'positive-descending';
|
|
27
27
|
else {
|
|
28
28
|
outerDiv.scrollLeft = 1;
|
|
29
|
-
if (outerDiv.scrollLeft === 0) $ce415dc67314b753$var$cachedRTLResult =
|
|
30
|
-
else $ce415dc67314b753$var$cachedRTLResult =
|
|
29
|
+
if (outerDiv.scrollLeft === 0) $ce415dc67314b753$var$cachedRTLResult = 'negative';
|
|
30
|
+
else $ce415dc67314b753$var$cachedRTLResult = 'positive-ascending';
|
|
31
31
|
}
|
|
32
32
|
document.body.removeChild(outerDiv);
|
|
33
33
|
return $ce415dc67314b753$var$cachedRTLResult;
|
|
@@ -38,13 +38,13 @@ function $ce415dc67314b753$export$1389d168952b34b5(node, direction) {
|
|
|
38
38
|
let { scrollLeft: scrollLeft } = node;
|
|
39
39
|
// scrollLeft in rtl locales differs across browsers, so normalize.
|
|
40
40
|
// See comment by getRTLOffsetType below for details.
|
|
41
|
-
if (direction ===
|
|
41
|
+
if (direction === 'rtl') {
|
|
42
42
|
let { scrollWidth: scrollWidth, clientWidth: clientWidth } = node;
|
|
43
43
|
switch($ce415dc67314b753$export$faf7630257ad4304()){
|
|
44
|
-
case
|
|
44
|
+
case 'negative':
|
|
45
45
|
scrollLeft = -scrollLeft;
|
|
46
46
|
break;
|
|
47
|
-
case
|
|
47
|
+
case 'positive-descending':
|
|
48
48
|
scrollLeft = scrollWidth - clientWidth - scrollLeft;
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
@@ -52,11 +52,11 @@ function $ce415dc67314b753$export$1389d168952b34b5(node, direction) {
|
|
|
52
52
|
return scrollLeft;
|
|
53
53
|
}
|
|
54
54
|
function $ce415dc67314b753$export$ed5fd5ffe5ab0ac(node, direction, scrollLeft) {
|
|
55
|
-
if (direction ===
|
|
56
|
-
case
|
|
55
|
+
if (direction === 'rtl') switch($ce415dc67314b753$export$faf7630257ad4304()){
|
|
56
|
+
case 'negative':
|
|
57
57
|
scrollLeft = -scrollLeft;
|
|
58
58
|
break;
|
|
59
|
-
case
|
|
59
|
+
case 'positive-ascending':
|
|
60
60
|
break;
|
|
61
61
|
default:
|
|
62
62
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/virtualizer",
|
|
3
|
-
"version": "3.10.1
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/i18n": "3.
|
|
26
|
-
"@react-aria/interactions": "3.
|
|
27
|
-
"@react-aria/utils": "3.
|
|
28
|
-
"@react-stately/virtualizer": "3.7.1
|
|
29
|
-
"@react-types/shared": "3.
|
|
25
|
+
"@react-aria/i18n": "^3.11.1",
|
|
26
|
+
"@react-aria/interactions": "^3.21.3",
|
|
27
|
+
"@react-aria/utils": "^3.24.1",
|
|
28
|
+
"@react-stately/virtualizer": "^3.7.1",
|
|
29
|
+
"@react-types/shared": "^3.23.1",
|
|
30
30
|
"@swc/helpers": "^0.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
40
40
|
}
|