@react-stately/layout
Advanced tools
Comparing version 3.13.10-nightly.4695 to 3.13.10-nightly.4698
@@ -36,3 +36,3 @@ var $7Tzdl$reactstatelyvirtualizer = require("@react-stately/virtualizer"); | ||
// Compute the item height, which is proportional to the item width | ||
let t = (itemWidth - this.minItemSize.width) / (maxItemWidth - this.minItemSize.width); | ||
let t = (itemWidth - this.minItemSize.width) / Math.max(1, maxItemWidth - this.minItemSize.width); | ||
let itemHeight = this.minItemSize.height + Math.floor((maxItemHeight - this.minItemSize.height) * t); | ||
@@ -39,0 +39,0 @@ itemHeight = Math.max(this.minItemSize.height, Math.min(maxItemHeight, itemHeight)); |
@@ -30,3 +30,3 @@ import {Size as $ipgKF$Size, Rect as $ipgKF$Rect, LayoutInfo as $ipgKF$LayoutInfo, Layout as $ipgKF$Layout} from "@react-stately/virtualizer"; | ||
// Compute the item height, which is proportional to the item width | ||
let t = (itemWidth - this.minItemSize.width) / (maxItemWidth - this.minItemSize.width); | ||
let t = (itemWidth - this.minItemSize.width) / Math.max(1, maxItemWidth - this.minItemSize.width); | ||
let itemHeight = this.minItemSize.height + Math.floor((maxItemHeight - this.minItemSize.height) * t); | ||
@@ -33,0 +33,0 @@ itemHeight = Math.max(this.minItemSize.height, Math.min(maxItemHeight, itemHeight)); |
@@ -56,5 +56,6 @@ var $iId4j$reactstatelycollections = require("@react-stately/collections"); | ||
this.rootNodes = this.buildCollection(); | ||
} else // Ensure all of the persisted keys are available. | ||
} | ||
// Ensure all of the persisted keys are available. | ||
for (let key of this.virtualizer.persistedKeys){ | ||
if (this.ensureLayoutInfo(key)) break; | ||
if (this.ensureLayoutInfo(key)) return; | ||
} | ||
@@ -87,3 +88,6 @@ } | ||
this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext); | ||
if (this.invalidateEverything) this.requestedRect = this.virtualizer.visibleRect.copy(); | ||
if (this.invalidateEverything) { | ||
this.requestedRect = this.virtualizer.visibleRect.copy(); | ||
this.layoutNodes.clear(); | ||
} | ||
this.rootNodes = this.buildCollection(); | ||
@@ -90,0 +94,0 @@ // Remove deleted layout nodes |
@@ -50,5 +50,6 @@ import {getChildNodes as $img26$getChildNodes} from "@react-stately/collections"; | ||
this.rootNodes = this.buildCollection(); | ||
} else // Ensure all of the persisted keys are available. | ||
} | ||
// Ensure all of the persisted keys are available. | ||
for (let key of this.virtualizer.persistedKeys){ | ||
if (this.ensureLayoutInfo(key)) break; | ||
if (this.ensureLayoutInfo(key)) return; | ||
} | ||
@@ -81,3 +82,6 @@ } | ||
this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext); | ||
if (this.invalidateEverything) this.requestedRect = this.virtualizer.visibleRect.copy(); | ||
if (this.invalidateEverything) { | ||
this.requestedRect = this.virtualizer.visibleRect.copy(); | ||
this.layoutNodes.clear(); | ||
} | ||
this.rootNodes = this.buildCollection(); | ||
@@ -84,0 +88,0 @@ // Remove deleted layout nodes |
{ | ||
"name": "@react-stately/layout", | ||
"version": "3.13.10-nightly.4695+2964e9aaf", | ||
"version": "3.13.10-nightly.4698+b940126e4", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,8 +25,8 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly.2983+2964e9aaf", | ||
"@react-stately/table": "3.11.9-nightly.4695+2964e9aaf", | ||
"@react-stately/virtualizer": "3.7.2-nightly.4695+2964e9aaf", | ||
"@react-types/grid": "3.2.7-nightly.4695+2964e9aaf", | ||
"@react-types/shared": "3.0.0-nightly.2983+2964e9aaf", | ||
"@react-types/table": "3.9.6-nightly.4695+2964e9aaf", | ||
"@react-stately/collections": "3.0.0-nightly.2986+b940126e4", | ||
"@react-stately/table": "3.11.9-nightly.4698+b940126e4", | ||
"@react-stately/virtualizer": "3.7.2-nightly.4698+b940126e4", | ||
"@react-types/grid": "3.2.7-nightly.4698+b940126e4", | ||
"@react-types/shared": "3.0.0-nightly.2986+b940126e4", | ||
"@react-types/table": "3.9.6-nightly.4698+b940126e4", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -40,3 +40,3 @@ }, | ||
}, | ||
"gitHead": "2964e9aafc281888cd65da5bd77512e7f999bd84" | ||
"gitHead": "b940126e4d67a11d28b7c0b098eab23205598b6c" | ||
} |
@@ -86,3 +86,3 @@ /* | ||
// Compute the item height, which is proportional to the item width | ||
let t = ((itemWidth - this.minItemSize.width) / (maxItemWidth - this.minItemSize.width)); | ||
let t = ((itemWidth - this.minItemSize.width) / Math.max(1, maxItemWidth - this.minItemSize.width)); | ||
let itemHeight = this.minItemSize.height + Math.floor((maxItemHeight - this.minItemSize.height) * t); | ||
@@ -89,0 +89,0 @@ itemHeight = Math.max(this.minItemSize.height, Math.min(maxItemHeight, itemHeight)); |
@@ -131,8 +131,8 @@ /* | ||
this.rootNodes = this.buildCollection(); | ||
} else { | ||
// Ensure all of the persisted keys are available. | ||
for (let key of this.virtualizer.persistedKeys) { | ||
if (this.ensureLayoutInfo(key)) { | ||
break; | ||
} | ||
} | ||
// Ensure all of the persisted keys are available. | ||
for (let key of this.virtualizer.persistedKeys) { | ||
if (this.ensureLayoutInfo(key)) { | ||
return; | ||
} | ||
@@ -174,2 +174,3 @@ } | ||
this.requestedRect = this.virtualizer.visibleRect.copy(); | ||
this.layoutNodes.clear(); | ||
} | ||
@@ -176,0 +177,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
374531
4045