@react-stately/layout
Advanced tools
Comparing version 3.13.10-nightly.4704 to 3.13.10-nightly.4709
@@ -147,4 +147,16 @@ var $iId4j$reactstatelycollections = require("@react-stately/collections"); | ||
return this.buildSectionHeader(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
} | ||
} | ||
buildLoader(node, x, y) { | ||
let rect = new (0, $iId4j$reactstatelyvirtualizer.Rect)(x, y, 0, 0); | ||
let layoutInfo = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)('loader', node.key, rect); | ||
rect.width = this.virtualizer.contentSize.width; | ||
rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight; | ||
return { | ||
layoutInfo: layoutInfo, | ||
validRect: rect.intersection(this.requestedRect) | ||
}; | ||
} | ||
buildSection(node, x, y) { | ||
@@ -334,2 +346,3 @@ let width = this.virtualizer.visibleRect.width; | ||
this.estimatedHeadingHeight = options.estimatedHeadingHeight; | ||
this.loaderHeight = options.loaderHeight; | ||
this.dropIndicatorThickness = options.dropIndicatorThickness || 2; | ||
@@ -336,0 +349,0 @@ this.layoutNodes = new Map(); |
@@ -141,4 +141,16 @@ import {getChildNodes as $img26$getChildNodes} from "@react-stately/collections"; | ||
return this.buildSectionHeader(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
} | ||
} | ||
buildLoader(node, x, y) { | ||
let rect = new (0, $img26$Rect)(x, y, 0, 0); | ||
let layoutInfo = new (0, $img26$LayoutInfo)('loader', node.key, rect); | ||
rect.width = this.virtualizer.contentSize.width; | ||
rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight; | ||
return { | ||
layoutInfo: layoutInfo, | ||
validRect: rect.intersection(this.requestedRect) | ||
}; | ||
} | ||
buildSection(node, x, y) { | ||
@@ -328,2 +340,3 @@ let width = this.virtualizer.visibleRect.width; | ||
this.estimatedHeadingHeight = options.estimatedHeadingHeight; | ||
this.loaderHeight = options.loaderHeight; | ||
this.dropIndicatorThickness = options.dropIndicatorThickness || 2; | ||
@@ -330,0 +343,0 @@ this.layoutNodes = new Map(); |
@@ -222,2 +222,4 @@ var $fe69e47e38ed0ac4$exports = require("./ListLayout.main.js"); | ||
return this.buildCell(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
default: | ||
@@ -224,0 +226,0 @@ throw new Error('Unknown node type ' + node.type); |
@@ -216,2 +216,4 @@ import {ListLayout as $61ef60fc9b1041f4$export$cacbb3924155d68e} from "./ListLayout.module.js"; | ||
return this.buildCell(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
default: | ||
@@ -218,0 +220,0 @@ throw new Error('Unknown node type ' + node.type); |
@@ -61,2 +61,6 @@ import { DropTarget, DropTargetDelegate, ItemDropTarget, Key, Node, Collection } from "@react-types/shared"; | ||
estimatedHeadingHeight?: number; | ||
/** The fixed height of a loader element in px. This loader is specifically for | ||
* "load more" elements rendered when loading more rows at the root level or inside nested row/sections. | ||
*/ | ||
loaderHeight?: number; | ||
/** The thickness of the drop indicator. */ | ||
@@ -85,2 +89,3 @@ dropIndicatorThickness?: number; | ||
protected estimatedHeadingHeight: number; | ||
protected loaderHeight: number; | ||
protected dropIndicatorThickness: number; | ||
@@ -110,2 +115,3 @@ protected layoutNodes: Map<Key, LayoutNode>; | ||
protected buildNode(node: Node<T>, x: number, y: number): LayoutNode; | ||
protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode; | ||
protected buildSection(node: Node<T>, x: number, y: number): LayoutNode; | ||
@@ -112,0 +118,0 @@ protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode; |
{ | ||
"name": "@react-stately/layout", | ||
"version": "3.13.10-nightly.4704+546ffa41f", | ||
"version": "3.13.10-nightly.4709+4fc70174a", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,8 +25,8 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly.2992+546ffa41f", | ||
"@react-stately/table": "3.11.9-nightly.4704+546ffa41f", | ||
"@react-stately/virtualizer": "3.7.2-nightly.4704+546ffa41f", | ||
"@react-types/grid": "3.2.7-nightly.4704+546ffa41f", | ||
"@react-types/shared": "3.0.0-nightly.2992+546ffa41f", | ||
"@react-types/table": "3.9.6-nightly.4704+546ffa41f", | ||
"@react-stately/collections": "3.0.0-nightly.2997+4fc70174a", | ||
"@react-stately/table": "3.11.9-nightly.4709+4fc70174a", | ||
"@react-stately/virtualizer": "3.7.2-nightly.4709+4fc70174a", | ||
"@react-types/grid": "3.2.7-nightly.4709+4fc70174a", | ||
"@react-types/shared": "3.0.0-nightly.2997+4fc70174a", | ||
"@react-types/table": "3.9.6-nightly.4709+4fc70174a", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -40,3 +40,3 @@ }, | ||
}, | ||
"gitHead": "546ffa41f7d1d3a566950a14d8f46cf726891220" | ||
"gitHead": "4fc70174ac35a5ebf06379f5cafaf943519a1eac" | ||
} |
@@ -26,2 +26,6 @@ /* | ||
estimatedHeadingHeight?: number, | ||
/** The fixed height of a loader element in px. This loader is specifically for | ||
* "load more" elements rendered when loading more rows at the root level or inside nested row/sections. | ||
*/ | ||
loaderHeight?: number, | ||
/** The thickness of the drop indicator. */ | ||
@@ -55,2 +59,3 @@ dropIndicatorThickness?: number | ||
protected estimatedHeadingHeight: number; | ||
protected loaderHeight: number; | ||
protected dropIndicatorThickness: number; | ||
@@ -79,2 +84,3 @@ protected layoutNodes: Map<Key, LayoutNode>; | ||
this.estimatedHeadingHeight = options.estimatedHeadingHeight; | ||
this.loaderHeight = options.loaderHeight; | ||
this.dropIndicatorThickness = options.dropIndicatorThickness || 2; | ||
@@ -259,5 +265,19 @@ this.layoutNodes = new Map(); | ||
return this.buildSectionHeader(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
} | ||
} | ||
protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode { | ||
let rect = new Rect(x, y, 0, 0); | ||
let layoutInfo = new LayoutInfo('loader', node.key, rect); | ||
rect.width = this.virtualizer.contentSize.width; | ||
rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight; | ||
return { | ||
layoutInfo, | ||
validRect: rect.intersection(this.requestedRect) | ||
}; | ||
} | ||
protected buildSection(node: Node<T>, x: number, y: number): LayoutNode { | ||
@@ -264,0 +284,0 @@ let width = this.virtualizer.visibleRect.width; |
@@ -38,3 +38,3 @@ /* | ||
private columnsChanged(newCollection: TableCollection<T>, oldCollection: TableCollection<T> | null) { | ||
return !oldCollection || | ||
return !oldCollection || | ||
newCollection.columns !== oldCollection.columns && | ||
@@ -278,2 +278,4 @@ newCollection.columns.length !== oldCollection.columns.length || | ||
return this.buildCell(node, x, y); | ||
case 'loader': | ||
return this.buildLoader(node, x, y); | ||
default: | ||
@@ -280,0 +282,0 @@ throw new Error('Unknown node type ' + node.type); |
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
380242
4104
4