@react-stately/virtualizer 3.7.1-nightly.4624 → 3.7.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/Rect.main.js +4 -4
- package/dist/Rect.mjs +4 -4
- package/dist/Rect.module.js +4 -4
- package/dist/Virtualizer.main.js +14 -14
- package/dist/Virtualizer.mjs +14 -14
- package/dist/Virtualizer.module.js +14 -14
- package/dist/tween.main.js +1 -1
- package/dist/tween.mjs +1 -1
- package/dist/tween.module.js +1 -1
- package/package.json +4 -4
package/dist/Rect.main.js
CHANGED
|
@@ -77,10 +77,10 @@ class $41b7691783731623$export$c79fc6492f3af13d {
|
|
|
77
77
|
* @param rect - The rectangle to check.
|
|
78
78
|
*/ getCornerInRect(rect) {
|
|
79
79
|
for (let key of [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
'topLeft',
|
|
81
|
+
'topRight',
|
|
82
|
+
'bottomLeft',
|
|
83
|
+
'bottomRight'
|
|
84
84
|
]){
|
|
85
85
|
if (rect.containsPoint(this[key])) return key;
|
|
86
86
|
}
|
package/dist/Rect.mjs
CHANGED
|
@@ -71,10 +71,10 @@ class $60423f92c7f9ad87$export$c79fc6492f3af13d {
|
|
|
71
71
|
* @param rect - The rectangle to check.
|
|
72
72
|
*/ getCornerInRect(rect) {
|
|
73
73
|
for (let key of [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
'topLeft',
|
|
75
|
+
'topRight',
|
|
76
|
+
'bottomLeft',
|
|
77
|
+
'bottomRight'
|
|
78
78
|
]){
|
|
79
79
|
if (rect.containsPoint(this[key])) return key;
|
|
80
80
|
}
|
package/dist/Rect.module.js
CHANGED
|
@@ -71,10 +71,10 @@ class $60423f92c7f9ad87$export$c79fc6492f3af13d {
|
|
|
71
71
|
* @param rect - The rectangle to check.
|
|
72
72
|
*/ getCornerInRect(rect) {
|
|
73
73
|
for (let key of [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
'topLeft',
|
|
75
|
+
'topRight',
|
|
76
|
+
'bottomLeft',
|
|
77
|
+
'bottomRight'
|
|
78
78
|
]){
|
|
79
79
|
if (rect.containsPoint(this[key])) return key;
|
|
80
80
|
}
|
package/dist/Virtualizer.main.js
CHANGED
|
@@ -155,9 +155,9 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
_getReuseType(layoutInfo, content) {
|
|
158
|
-
if (layoutInfo.type ===
|
|
159
|
-
let type = this.delegate.getType ? this.delegate.getType(content) :
|
|
160
|
-
let reuseType = type ===
|
|
158
|
+
if (layoutInfo.type === 'item' && content) {
|
|
159
|
+
let type = this.delegate.getType ? this.delegate.getType(content) : 'item';
|
|
160
|
+
let reuseType = type === 'item' ? 'item' : layoutInfo.type + '_' + type;
|
|
161
161
|
return {
|
|
162
162
|
type: type,
|
|
163
163
|
reuseType: reuseType
|
|
@@ -244,7 +244,7 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
244
244
|
* Triggers a layout invalidation, and updates the visible subviews.
|
|
245
245
|
*/ relayout(context = {}) {
|
|
246
246
|
// Ignore relayouts while animating the scroll position
|
|
247
|
-
if (this._scrollAnimation || typeof requestAnimationFrame ===
|
|
247
|
+
if (this._scrollAnimation || typeof requestAnimationFrame === 'undefined') return;
|
|
248
248
|
// If we already scheduled a relayout, extend the invalidation
|
|
249
249
|
// context so we coalesce multiple relayouts in the same frame.
|
|
250
250
|
if (this._invalidationContext) {
|
|
@@ -275,12 +275,12 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
275
275
|
if (!this.layout || !this._collection || this._scrollAnimation) return;
|
|
276
276
|
let scrollAnchor = this._getScrollAnchor();
|
|
277
277
|
// Trigger the beforeLayout hook, if provided
|
|
278
|
-
if (typeof context.beforeLayout ===
|
|
278
|
+
if (typeof context.beforeLayout === 'function') context.beforeLayout();
|
|
279
279
|
// Validate the layout
|
|
280
280
|
this.layout.validate(context);
|
|
281
281
|
this._setContentSize(this.layout.getContentSize());
|
|
282
282
|
// Trigger the afterLayout hook, if provided
|
|
283
|
-
if (typeof context.afterLayout ===
|
|
283
|
+
if (typeof context.afterLayout === 'function') context.afterLayout();
|
|
284
284
|
// Adjust scroll position based on scroll anchor, and constrain.
|
|
285
285
|
// If the content changed, scroll to the top.
|
|
286
286
|
let visibleRect = this.getVisibleRect();
|
|
@@ -316,12 +316,12 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
316
316
|
this._resetAnimatedContentOffset();
|
|
317
317
|
this._setContentOffset(new (0, $f89f15d7f52bce29$exports.Point)(x, y));
|
|
318
318
|
}
|
|
319
|
-
if (typeof context.afterAnimation ===
|
|
319
|
+
if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
320
320
|
};
|
|
321
321
|
// Sometimes the animation takes slightly longer than expected.
|
|
322
322
|
setTimeout(done, this.transitionDuration + 100);
|
|
323
323
|
return;
|
|
324
|
-
} else if (typeof context.afterAnimation ===
|
|
324
|
+
} else if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* Corrects DOM order of visible views to match item order of collection.
|
|
@@ -402,8 +402,8 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
402
402
|
}
|
|
403
403
|
getVisibleLayoutInfos() {
|
|
404
404
|
let isTestEnv = false;
|
|
405
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
406
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
405
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
406
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
407
407
|
let rect;
|
|
408
408
|
if (isTestEnv && !(isClientWidthMocked && isClientHeightMocked)) rect = this._getContentRect();
|
|
409
409
|
else rect = this.shouldOverscan ? this._overscanManager.getOverscannedRect() : this.getVisibleRect();
|
|
@@ -801,10 +801,10 @@ class $e1bc15d49d21df0e$export$89be5a243e59c4b2 {
|
|
|
801
801
|
this.anchorScrollPositionAtTop = options.anchorScrollPositionAtTop || false;
|
|
802
802
|
this.shouldOverscan = options.shouldOverscan !== false;
|
|
803
803
|
for (let key of [
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
'delegate',
|
|
805
|
+
'size',
|
|
806
|
+
'layout',
|
|
807
|
+
'collection'
|
|
808
808
|
])if (options[key]) this[key] = options[key];
|
|
809
809
|
}
|
|
810
810
|
}
|
package/dist/Virtualizer.mjs
CHANGED
|
@@ -149,9 +149,9 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
_getReuseType(layoutInfo, content) {
|
|
152
|
-
if (layoutInfo.type ===
|
|
153
|
-
let type = this.delegate.getType ? this.delegate.getType(content) :
|
|
154
|
-
let reuseType = type ===
|
|
152
|
+
if (layoutInfo.type === 'item' && content) {
|
|
153
|
+
let type = this.delegate.getType ? this.delegate.getType(content) : 'item';
|
|
154
|
+
let reuseType = type === 'item' ? 'item' : layoutInfo.type + '_' + type;
|
|
155
155
|
return {
|
|
156
156
|
type: type,
|
|
157
157
|
reuseType: reuseType
|
|
@@ -238,7 +238,7 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
238
238
|
* Triggers a layout invalidation, and updates the visible subviews.
|
|
239
239
|
*/ relayout(context = {}) {
|
|
240
240
|
// Ignore relayouts while animating the scroll position
|
|
241
|
-
if (this._scrollAnimation || typeof requestAnimationFrame ===
|
|
241
|
+
if (this._scrollAnimation || typeof requestAnimationFrame === 'undefined') return;
|
|
242
242
|
// If we already scheduled a relayout, extend the invalidation
|
|
243
243
|
// context so we coalesce multiple relayouts in the same frame.
|
|
244
244
|
if (this._invalidationContext) {
|
|
@@ -269,12 +269,12 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
269
269
|
if (!this.layout || !this._collection || this._scrollAnimation) return;
|
|
270
270
|
let scrollAnchor = this._getScrollAnchor();
|
|
271
271
|
// Trigger the beforeLayout hook, if provided
|
|
272
|
-
if (typeof context.beforeLayout ===
|
|
272
|
+
if (typeof context.beforeLayout === 'function') context.beforeLayout();
|
|
273
273
|
// Validate the layout
|
|
274
274
|
this.layout.validate(context);
|
|
275
275
|
this._setContentSize(this.layout.getContentSize());
|
|
276
276
|
// Trigger the afterLayout hook, if provided
|
|
277
|
-
if (typeof context.afterLayout ===
|
|
277
|
+
if (typeof context.afterLayout === 'function') context.afterLayout();
|
|
278
278
|
// Adjust scroll position based on scroll anchor, and constrain.
|
|
279
279
|
// If the content changed, scroll to the top.
|
|
280
280
|
let visibleRect = this.getVisibleRect();
|
|
@@ -310,12 +310,12 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
310
310
|
this._resetAnimatedContentOffset();
|
|
311
311
|
this._setContentOffset(new (0, $3041db3296945e6e$export$baf26146a414f24a)(x, y));
|
|
312
312
|
}
|
|
313
|
-
if (typeof context.afterAnimation ===
|
|
313
|
+
if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
314
314
|
};
|
|
315
315
|
// Sometimes the animation takes slightly longer than expected.
|
|
316
316
|
setTimeout(done, this.transitionDuration + 100);
|
|
317
317
|
return;
|
|
318
|
-
} else if (typeof context.afterAnimation ===
|
|
318
|
+
} else if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Corrects DOM order of visible views to match item order of collection.
|
|
@@ -396,8 +396,8 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
396
396
|
}
|
|
397
397
|
getVisibleLayoutInfos() {
|
|
398
398
|
let isTestEnv = false;
|
|
399
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
400
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
399
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
400
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
401
401
|
let rect;
|
|
402
402
|
if (isTestEnv && !(isClientWidthMocked && isClientHeightMocked)) rect = this._getContentRect();
|
|
403
403
|
else rect = this.shouldOverscan ? this._overscanManager.getOverscannedRect() : this.getVisibleRect();
|
|
@@ -795,10 +795,10 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
795
795
|
this.anchorScrollPositionAtTop = options.anchorScrollPositionAtTop || false;
|
|
796
796
|
this.shouldOverscan = options.shouldOverscan !== false;
|
|
797
797
|
for (let key of [
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
798
|
+
'delegate',
|
|
799
|
+
'size',
|
|
800
|
+
'layout',
|
|
801
|
+
'collection'
|
|
802
802
|
])if (options[key]) this[key] = options[key];
|
|
803
803
|
}
|
|
804
804
|
}
|
|
@@ -149,9 +149,9 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
_getReuseType(layoutInfo, content) {
|
|
152
|
-
if (layoutInfo.type ===
|
|
153
|
-
let type = this.delegate.getType ? this.delegate.getType(content) :
|
|
154
|
-
let reuseType = type ===
|
|
152
|
+
if (layoutInfo.type === 'item' && content) {
|
|
153
|
+
let type = this.delegate.getType ? this.delegate.getType(content) : 'item';
|
|
154
|
+
let reuseType = type === 'item' ? 'item' : layoutInfo.type + '_' + type;
|
|
155
155
|
return {
|
|
156
156
|
type: type,
|
|
157
157
|
reuseType: reuseType
|
|
@@ -238,7 +238,7 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
238
238
|
* Triggers a layout invalidation, and updates the visible subviews.
|
|
239
239
|
*/ relayout(context = {}) {
|
|
240
240
|
// Ignore relayouts while animating the scroll position
|
|
241
|
-
if (this._scrollAnimation || typeof requestAnimationFrame ===
|
|
241
|
+
if (this._scrollAnimation || typeof requestAnimationFrame === 'undefined') return;
|
|
242
242
|
// If we already scheduled a relayout, extend the invalidation
|
|
243
243
|
// context so we coalesce multiple relayouts in the same frame.
|
|
244
244
|
if (this._invalidationContext) {
|
|
@@ -269,12 +269,12 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
269
269
|
if (!this.layout || !this._collection || this._scrollAnimation) return;
|
|
270
270
|
let scrollAnchor = this._getScrollAnchor();
|
|
271
271
|
// Trigger the beforeLayout hook, if provided
|
|
272
|
-
if (typeof context.beforeLayout ===
|
|
272
|
+
if (typeof context.beforeLayout === 'function') context.beforeLayout();
|
|
273
273
|
// Validate the layout
|
|
274
274
|
this.layout.validate(context);
|
|
275
275
|
this._setContentSize(this.layout.getContentSize());
|
|
276
276
|
// Trigger the afterLayout hook, if provided
|
|
277
|
-
if (typeof context.afterLayout ===
|
|
277
|
+
if (typeof context.afterLayout === 'function') context.afterLayout();
|
|
278
278
|
// Adjust scroll position based on scroll anchor, and constrain.
|
|
279
279
|
// If the content changed, scroll to the top.
|
|
280
280
|
let visibleRect = this.getVisibleRect();
|
|
@@ -310,12 +310,12 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
310
310
|
this._resetAnimatedContentOffset();
|
|
311
311
|
this._setContentOffset(new (0, $3041db3296945e6e$export$baf26146a414f24a)(x, y));
|
|
312
312
|
}
|
|
313
|
-
if (typeof context.afterAnimation ===
|
|
313
|
+
if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
314
314
|
};
|
|
315
315
|
// Sometimes the animation takes slightly longer than expected.
|
|
316
316
|
setTimeout(done, this.transitionDuration + 100);
|
|
317
317
|
return;
|
|
318
|
-
} else if (typeof context.afterAnimation ===
|
|
318
|
+
} else if (typeof context.afterAnimation === 'function') context.afterAnimation();
|
|
319
319
|
}
|
|
320
320
|
/**
|
|
321
321
|
* Corrects DOM order of visible views to match item order of collection.
|
|
@@ -396,8 +396,8 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
396
396
|
}
|
|
397
397
|
getVisibleLayoutInfos() {
|
|
398
398
|
let isTestEnv = false;
|
|
399
|
-
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
400
|
-
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes(
|
|
399
|
+
let isClientWidthMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientWidth');
|
|
400
|
+
let isClientHeightMocked = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes('clientHeight');
|
|
401
401
|
let rect;
|
|
402
402
|
if (isTestEnv && !(isClientWidthMocked && isClientHeightMocked)) rect = this._getContentRect();
|
|
403
403
|
else rect = this.shouldOverscan ? this._overscanManager.getOverscannedRect() : this.getVisibleRect();
|
|
@@ -795,10 +795,10 @@ class $38b9490c1cca8fc4$export$89be5a243e59c4b2 {
|
|
|
795
795
|
this.anchorScrollPositionAtTop = options.anchorScrollPositionAtTop || false;
|
|
796
796
|
this.shouldOverscan = options.shouldOverscan !== false;
|
|
797
797
|
for (let key of [
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
798
|
+
'delegate',
|
|
799
|
+
'size',
|
|
800
|
+
'layout',
|
|
801
|
+
'collection'
|
|
802
802
|
])if (options[key]) this[key] = options[key];
|
|
803
803
|
}
|
|
804
804
|
}
|
package/dist/tween.main.js
CHANGED
|
@@ -19,7 +19,7 @@ $parcel$export(module.exports, "easeOut", () => $57c5d36217e1f286$export$57636bb
|
|
|
19
19
|
* governing permissions and limitations under the License.
|
|
20
20
|
*/
|
|
21
21
|
// use high res timer if available
|
|
22
|
-
let $57c5d36217e1f286$var$perf = typeof window !==
|
|
22
|
+
let $57c5d36217e1f286$var$perf = typeof window !== 'undefined' ? window.performance : null;
|
|
23
23
|
// @ts-ignore
|
|
24
24
|
let $57c5d36217e1f286$var$perfNow = $57c5d36217e1f286$var$perf && ($57c5d36217e1f286$var$perf.now || $57c5d36217e1f286$var$perf.webkitNow || $57c5d36217e1f286$var$perf.msNow || $57c5d36217e1f286$var$perf.mozNow);
|
|
25
25
|
let $57c5d36217e1f286$var$getTime = $57c5d36217e1f286$var$perfNow ? $57c5d36217e1f286$var$perfNow.bind($57c5d36217e1f286$var$perf) : function() {
|
package/dist/tween.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.mjs";
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
// use high res timer if available
|
|
15
|
-
let $3eb131dcf37ad5f8$var$perf = typeof window !==
|
|
15
|
+
let $3eb131dcf37ad5f8$var$perf = typeof window !== 'undefined' ? window.performance : null;
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
let $3eb131dcf37ad5f8$var$perfNow = $3eb131dcf37ad5f8$var$perf && ($3eb131dcf37ad5f8$var$perf.now || $3eb131dcf37ad5f8$var$perf.webkitNow || $3eb131dcf37ad5f8$var$perf.msNow || $3eb131dcf37ad5f8$var$perf.mozNow);
|
|
18
18
|
let $3eb131dcf37ad5f8$var$getTime = $3eb131dcf37ad5f8$var$perfNow ? $3eb131dcf37ad5f8$var$perfNow.bind($3eb131dcf37ad5f8$var$perf) : function() {
|
package/dist/tween.module.js
CHANGED
|
@@ -12,7 +12,7 @@ import {Point as $3041db3296945e6e$export$baf26146a414f24a} from "./Point.module
|
|
|
12
12
|
* governing permissions and limitations under the License.
|
|
13
13
|
*/
|
|
14
14
|
// use high res timer if available
|
|
15
|
-
let $3eb131dcf37ad5f8$var$perf = typeof window !==
|
|
15
|
+
let $3eb131dcf37ad5f8$var$perf = typeof window !== 'undefined' ? window.performance : null;
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
let $3eb131dcf37ad5f8$var$perfNow = $3eb131dcf37ad5f8$var$perf && ($3eb131dcf37ad5f8$var$perf.now || $3eb131dcf37ad5f8$var$perf.webkitNow || $3eb131dcf37ad5f8$var$perf.msNow || $3eb131dcf37ad5f8$var$perf.mozNow);
|
|
18
18
|
let $3eb131dcf37ad5f8$var$getTime = $3eb131dcf37ad5f8$var$perfNow ? $3eb131dcf37ad5f8$var$perfNow.bind($3eb131dcf37ad5f8$var$perf) : function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/virtualizer",
|
|
3
|
-
"version": "3.7.1
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/utils": "3.
|
|
26
|
-
"@react-types/shared": "3.
|
|
25
|
+
"@react-aria/utils": "^3.24.1",
|
|
26
|
+
"@react-types/shared": "^3.23.1",
|
|
27
27
|
"@swc/helpers": "^0.5.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
|
|
36
36
|
}
|