@react-stately/layout
Advanced tools
Comparing version 3.13.9-nightly.4624 to 3.13.9
@@ -99,3 +99,3 @@ var $iId4j$reactstatelycollections = require("@react-stately/collections"); | ||
// Skip rows before the valid rectangle unless they are already cached. | ||
if (node.type === "item" && y + rowHeight < this.validRect.y && !this.isValid(node, y)) { | ||
if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) { | ||
y += rowHeight; | ||
@@ -108,3 +108,3 @@ skipped++; | ||
nodes.push(layoutNode); | ||
if (node.type === "item" && y > this.validRect.maxY) { | ||
if (node.type === 'item' && y > this.validRect.maxY) { | ||
y += (this.collection.size - (nodes.length + skipped)) * rowHeight; | ||
@@ -117,4 +117,4 @@ break; | ||
let rect = new (0, $iId4j$reactstatelyvirtualizer.Rect)(0, y, this.virtualizer.visibleRect.width, (_this_loaderHeight = this.loaderHeight) !== null && _this_loaderHeight !== void 0 ? _this_loaderHeight : this.virtualizer.visibleRect.height); | ||
let loader = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)("loader", "loader", rect); | ||
this.layoutInfos.set("loader", loader); | ||
let loader = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)('loader', 'loader', rect); | ||
this.layoutInfos.set('loader', loader); | ||
nodes.push({ | ||
@@ -128,4 +128,4 @@ layoutInfo: loader | ||
let rect = new (0, $iId4j$reactstatelyvirtualizer.Rect)(0, y, this.virtualizer.visibleRect.width, (_this_placeholderHeight = this.placeholderHeight) !== null && _this_placeholderHeight !== void 0 ? _this_placeholderHeight : this.virtualizer.visibleRect.height); | ||
let placeholder = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)("placeholder", "placeholder", rect); | ||
this.layoutInfos.set("placeholder", placeholder); | ||
let placeholder = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)('placeholder', 'placeholder', rect); | ||
this.layoutInfos.set('placeholder', placeholder); | ||
nodes.push({ | ||
@@ -156,5 +156,5 @@ layoutInfo: placeholder | ||
switch(node.type){ | ||
case "section": | ||
case 'section': | ||
return this.buildSection(node, x, y); | ||
case "item": | ||
case 'item': | ||
return this.buildItem(node, x, y); | ||
@@ -185,3 +185,3 @@ } | ||
let headerRect = new (0, $iId4j$reactstatelyvirtualizer.Rect)(0, y, width, rectHeight); | ||
let header = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)("header", node.key + ":header", headerRect); | ||
let header = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)('header', node.key + ':header', headerRect); | ||
header.estimatedSize = isEstimated; | ||
@@ -242,3 +242,3 @@ header.parentKey = node.key; | ||
if (rectHeight == null) rectHeight = $fe69e47e38ed0ac4$var$DEFAULT_HEIGHT; | ||
if (typeof this.indentationForItem === "function") x += this.indentationForItem(this.collection, node.key) || 0; | ||
if (typeof this.indentationForItem === 'function') x += this.indentationForItem(this.collection, node.key) || 0; | ||
let rect = new (0, $iId4j$reactstatelyvirtualizer.Rect)(x, y, width - x, rectHeight); | ||
@@ -293,3 +293,3 @@ let layoutInfo = new (0, $iId4j$reactstatelyvirtualizer.LayoutInfo)(node.type, node.key, rect); | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyBefore(key); | ||
@@ -303,3 +303,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyAfter(key); | ||
@@ -337,3 +337,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyAfter(key); | ||
@@ -347,3 +347,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyBefore(key); | ||
@@ -366,3 +366,3 @@ } | ||
layoutInfo.opacity = 0; | ||
layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)"; | ||
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)'; | ||
return layoutInfo; | ||
@@ -372,3 +372,3 @@ } | ||
layoutInfo.opacity = 0; | ||
layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)"; | ||
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)'; | ||
return layoutInfo; | ||
@@ -381,3 +381,3 @@ } | ||
if (key == null || this.collection.size === 0) return { | ||
type: "root" | ||
type: 'root' | ||
}; | ||
@@ -387,5 +387,5 @@ let layoutInfo = this.getLayoutInfo(key); | ||
let target = { | ||
type: "item", | ||
type: 'item', | ||
key: layoutInfo.key, | ||
dropPosition: "on" | ||
dropPosition: 'on' | ||
}; | ||
@@ -398,16 +398,16 @@ // If dropping on the item isn't accepted, try the target before or after depending on the y position. | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
} else if (y <= rect.y + 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (y >= rect.maxY - 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
return target; | ||
@@ -414,0 +414,0 @@ } |
@@ -93,3 +93,3 @@ import {getChildNodes as $img26$getChildNodes} from "@react-stately/collections"; | ||
// Skip rows before the valid rectangle unless they are already cached. | ||
if (node.type === "item" && y + rowHeight < this.validRect.y && !this.isValid(node, y)) { | ||
if (node.type === 'item' && y + rowHeight < this.validRect.y && !this.isValid(node, y)) { | ||
y += rowHeight; | ||
@@ -102,3 +102,3 @@ skipped++; | ||
nodes.push(layoutNode); | ||
if (node.type === "item" && y > this.validRect.maxY) { | ||
if (node.type === 'item' && y > this.validRect.maxY) { | ||
y += (this.collection.size - (nodes.length + skipped)) * rowHeight; | ||
@@ -111,4 +111,4 @@ break; | ||
let rect = new (0, $img26$Rect)(0, y, this.virtualizer.visibleRect.width, (_this_loaderHeight = this.loaderHeight) !== null && _this_loaderHeight !== void 0 ? _this_loaderHeight : this.virtualizer.visibleRect.height); | ||
let loader = new (0, $img26$LayoutInfo)("loader", "loader", rect); | ||
this.layoutInfos.set("loader", loader); | ||
let loader = new (0, $img26$LayoutInfo)('loader', 'loader', rect); | ||
this.layoutInfos.set('loader', loader); | ||
nodes.push({ | ||
@@ -122,4 +122,4 @@ layoutInfo: loader | ||
let rect = new (0, $img26$Rect)(0, y, this.virtualizer.visibleRect.width, (_this_placeholderHeight = this.placeholderHeight) !== null && _this_placeholderHeight !== void 0 ? _this_placeholderHeight : this.virtualizer.visibleRect.height); | ||
let placeholder = new (0, $img26$LayoutInfo)("placeholder", "placeholder", rect); | ||
this.layoutInfos.set("placeholder", placeholder); | ||
let placeholder = new (0, $img26$LayoutInfo)('placeholder', 'placeholder', rect); | ||
this.layoutInfos.set('placeholder', placeholder); | ||
nodes.push({ | ||
@@ -150,5 +150,5 @@ layoutInfo: placeholder | ||
switch(node.type){ | ||
case "section": | ||
case 'section': | ||
return this.buildSection(node, x, y); | ||
case "item": | ||
case 'item': | ||
return this.buildItem(node, x, y); | ||
@@ -179,3 +179,3 @@ } | ||
let headerRect = new (0, $img26$Rect)(0, y, width, rectHeight); | ||
let header = new (0, $img26$LayoutInfo)("header", node.key + ":header", headerRect); | ||
let header = new (0, $img26$LayoutInfo)('header', node.key + ':header', headerRect); | ||
header.estimatedSize = isEstimated; | ||
@@ -236,3 +236,3 @@ header.parentKey = node.key; | ||
if (rectHeight == null) rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT; | ||
if (typeof this.indentationForItem === "function") x += this.indentationForItem(this.collection, node.key) || 0; | ||
if (typeof this.indentationForItem === 'function') x += this.indentationForItem(this.collection, node.key) || 0; | ||
let rect = new (0, $img26$Rect)(x, y, width - x, rectHeight); | ||
@@ -287,3 +287,3 @@ let layoutInfo = new (0, $img26$LayoutInfo)(node.type, node.key, rect); | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyBefore(key); | ||
@@ -297,3 +297,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyAfter(key); | ||
@@ -331,3 +331,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyAfter(key); | ||
@@ -341,3 +341,3 @@ } | ||
let item = collection.getItem(key); | ||
if (item.type === "item" && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
if (item.type === 'item' && (this.allowDisabledKeyFocus || !this.disabledKeys.has(item.key))) return key; | ||
key = collection.getKeyBefore(key); | ||
@@ -360,3 +360,3 @@ } | ||
layoutInfo.opacity = 0; | ||
layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)"; | ||
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)'; | ||
return layoutInfo; | ||
@@ -366,3 +366,3 @@ } | ||
layoutInfo.opacity = 0; | ||
layoutInfo.transform = "scale3d(0.8, 0.8, 0.8)"; | ||
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)'; | ||
return layoutInfo; | ||
@@ -375,3 +375,3 @@ } | ||
if (key == null || this.collection.size === 0) return { | ||
type: "root" | ||
type: 'root' | ||
}; | ||
@@ -381,5 +381,5 @@ let layoutInfo = this.getLayoutInfo(key); | ||
let target = { | ||
type: "item", | ||
type: 'item', | ||
key: layoutInfo.key, | ||
dropPosition: "on" | ||
dropPosition: 'on' | ||
}; | ||
@@ -392,16 +392,16 @@ // If dropping on the item isn't accepted, try the target before or after depending on the y position. | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
} else if (y <= rect.y + 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (y >= rect.maxY - 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
return target; | ||
@@ -408,0 +408,0 @@ } |
@@ -78,3 +78,3 @@ var $fe69e47e38ed0ac4$exports = require("./ListLayout.main.js"); | ||
this.wasLoading = this.isLoading; | ||
this.isLoading = loadingState === "loading" || loadingState === "loadingMore"; | ||
this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore'; | ||
this.stickyColumnIndices = []; | ||
@@ -101,3 +101,3 @@ for (let column of this.collection.columns)// The selection cell and any other sticky columns always need to be visible. | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(0, 0, 0, 0); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("header", "header", rect); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('header', 'header', rect); | ||
let y = 0; | ||
@@ -108,3 +108,3 @@ let width = 0; | ||
let layoutNode = this.buildChild(headerRow, 0, y); | ||
layoutNode.layoutInfo.parentKey = "header"; | ||
layoutNode.layoutInfo.parentKey = 'header'; | ||
y = layoutNode.layoutInfo.rect.maxY; | ||
@@ -117,3 +117,3 @@ width = Math.max(width, layoutNode.layoutInfo.rect.width); | ||
rect.height = y; | ||
this.layoutInfos.set("header", layoutInfo); | ||
this.layoutInfos.set('header', layoutInfo); | ||
return { | ||
@@ -127,3 +127,3 @@ layoutInfo: layoutInfo, | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(0, y, 0, 0); | ||
let row = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("headerrow", headerRow.key, rect); | ||
let row = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('headerrow', headerRow.key, rect); | ||
let height = 0; | ||
@@ -207,3 +207,3 @@ let columns = []; | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(0, y, 0, 0); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("rowgroup", "body", rect); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('rowgroup', 'body', rect); | ||
let startY = y; | ||
@@ -225,3 +225,3 @@ let skipped = 0; | ||
let layoutNode = this.buildChild(node, 0, y); | ||
layoutNode.layoutInfo.parentKey = "body"; | ||
layoutNode.layoutInfo.parentKey = 'body'; | ||
layoutNode.index = i; | ||
@@ -240,6 +240,6 @@ y = layoutNode.layoutInfo.rect.maxY; | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60); | ||
let loader = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("loader", "loader", rect); | ||
loader.parentKey = "body"; | ||
let loader = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('loader', 'loader', rect); | ||
loader.parentKey = 'body'; | ||
loader.isSticky = !this.disableSticky && children.length === 0; | ||
this.layoutInfos.set("loader", loader); | ||
this.layoutInfos.set('loader', loader); | ||
children.push({ | ||
@@ -253,6 +253,6 @@ layoutInfo: loader, | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80); | ||
let empty = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("empty", "empty", rect); | ||
empty.parentKey = "body"; | ||
let empty = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('empty', 'empty', rect); | ||
empty.parentKey = 'body'; | ||
empty.isSticky = !this.disableSticky; | ||
this.layoutInfos.set("empty", empty); | ||
this.layoutInfos.set('empty', empty); | ||
children.push({ | ||
@@ -267,3 +267,3 @@ layoutInfo: empty, | ||
rect.height = y - startY; | ||
this.layoutInfos.set("body", layoutInfo); | ||
this.layoutInfos.set('body', layoutInfo); | ||
return { | ||
@@ -277,13 +277,13 @@ layoutInfo: layoutInfo, | ||
switch(node.type){ | ||
case "headerrow": | ||
case 'headerrow': | ||
return this.buildHeaderRow(node, x, y); | ||
case "item": | ||
case 'item': | ||
return this.buildRow(node, x, y); | ||
case "column": | ||
case "placeholder": | ||
case 'column': | ||
case 'placeholder': | ||
return this.buildColumn(node, x, y); | ||
case "cell": | ||
case 'cell': | ||
return this.buildCell(node, x, y); | ||
default: | ||
throw new Error("Unknown node type " + node.type); | ||
throw new Error('Unknown node type ' + node.type); | ||
} | ||
@@ -293,3 +293,3 @@ } | ||
let rect = new (0, $9lycG$reactstatelyvirtualizer.Rect)(x, y, 0, 0); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)("row", node.key, rect); | ||
let layoutInfo = new (0, $9lycG$reactstatelyvirtualizer.LayoutInfo)('row', node.key, rect); | ||
let children = []; | ||
@@ -299,3 +299,3 @@ let height = 0; | ||
...(0, $9lycG$reactstatelycollections.getChildNodes)(node, this.collection) | ||
].entries())if (child.type === "cell") { | ||
].entries())if (child.type === 'cell') { | ||
if (x > this.validRect.maxX) { | ||
@@ -318,3 +318,3 @@ // Adjust existing cached layoutInfo to ensure that it is out of view. | ||
this.setChildHeights(children, height); | ||
rect.width = this.layoutInfos.get("header").rect.width; | ||
rect.width = this.layoutInfos.get('header').rect.width; | ||
rect.height = height + 1; // +1 for bottom border | ||
@@ -360,3 +360,3 @@ return { | ||
switch(node.layoutInfo.type){ | ||
case "header": | ||
case 'header': | ||
for (let child of node.children){ | ||
@@ -367,6 +367,6 @@ res.push(child.layoutInfo); | ||
break; | ||
case "rowgroup": | ||
case 'rowgroup': | ||
{ | ||
let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, "y"); | ||
let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, "y"); | ||
let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y'); | ||
let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y'); | ||
// Add persisted rows before the visible rows. | ||
@@ -396,7 +396,7 @@ let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key); | ||
} | ||
case "headerrow": | ||
case "row": | ||
case 'headerrow': | ||
case 'row': | ||
{ | ||
let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, "x"); | ||
let lastVisibleCell = this.binarySearch(node.children, rect.topRight, "x"); | ||
let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x'); | ||
let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x'); | ||
let stickyIndex = 0; | ||
@@ -423,3 +423,3 @@ // Add persisted/sticky cells before the visible cells. | ||
default: | ||
throw new Error("Unknown node type " + node.layoutInfo.type); | ||
throw new Error('Unknown node type ' + node.layoutInfo.type); | ||
} | ||
@@ -433,4 +433,4 @@ } | ||
let item = items[mid]; | ||
if (axis === "x" && item.layoutInfo.rect.maxX < point.x || axis === "y" && item.layoutInfo.rect.maxY < point.y) low = mid + 1; | ||
else if (axis === "x" && item.layoutInfo.rect.x > point.x || axis === "y" && item.layoutInfo.rect.y > point.y) high = mid - 1; | ||
if (axis === 'x' && item.layoutInfo.rect.maxX < point.x || axis === 'y' && item.layoutInfo.rect.maxY < point.y) low = mid + 1; | ||
else if (axis === 'x' && item.layoutInfo.rect.x > point.x || axis === 'y' && item.layoutInfo.rect.y > point.y) high = mid - 1; | ||
else return mid; | ||
@@ -453,3 +453,3 @@ } | ||
// stickyColumnIndices are always persisted along with any cells from persistedKeys. | ||
indices = collectionNode.type === "cell" || collectionNode.type === "column" ? [ | ||
indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [ | ||
...this.stickyColumnIndices | ||
@@ -479,5 +479,5 @@ ] : []; | ||
var _window_navigator_userAgentData; | ||
if (typeof window === "undefined" || window.navigator == null) return false; | ||
if (typeof window === 'undefined' || window.navigator == null) return false; | ||
let isChrome105; | ||
if (window.navigator["userAgentData"]) isChrome105 = (_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((b)=>b.brand === "Chromium" && Number(b.version) === 105); | ||
if (window.navigator['userAgentData']) isChrome105 = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((b)=>b.brand === 'Chromium' && Number(b.version) === 105); | ||
else { | ||
@@ -495,3 +495,3 @@ let regex = /Chrome\/(\d+)/; | ||
// Offset for height of header row | ||
y -= (_this_virtualizer_layout_getVisibleLayoutInfos_find = this.virtualizer.layout.getVisibleLayoutInfos(new (0, $9lycG$reactstatelyvirtualizer.Rect)(x, y, 1, 1)).find((info)=>info.type === "headerrow")) === null || _this_virtualizer_layout_getVisibleLayoutInfos_find === void 0 ? void 0 : _this_virtualizer_layout_getVisibleLayoutInfos_find.rect.height; | ||
y -= (_this_virtualizer_layout_getVisibleLayoutInfos_find = this.virtualizer.layout.getVisibleLayoutInfos(new (0, $9lycG$reactstatelyvirtualizer.Rect)(x, y, 1, 1)).find((info)=>info.type === 'headerrow')) === null || _this_virtualizer_layout_getVisibleLayoutInfos_find === void 0 ? void 0 : _this_virtualizer_layout_getVisibleLayoutInfos_find.rect.height; | ||
// Custom variation of this.virtualizer.keyAtPoint that ignores body | ||
@@ -501,3 +501,3 @@ let key; | ||
let rectAtPoint = new (0, $9lycG$reactstatelyvirtualizer.Rect)(point.x, point.y, 1, 1); | ||
let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter((info)=>info.type === "row"); | ||
let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter((info)=>info.type === 'row'); | ||
// Layout may return multiple layout infos in the case of | ||
@@ -507,3 +507,3 @@ // persisted keys, so find the first one that actually intersects. | ||
if (key == null || this.collection.size === 0) return { | ||
type: "root" | ||
type: 'root' | ||
}; | ||
@@ -513,5 +513,5 @@ let layoutInfo = this.getLayoutInfo(key); | ||
let target = { | ||
type: "item", | ||
type: 'item', | ||
key: layoutInfo.key, | ||
dropPosition: "on" | ||
dropPosition: 'on' | ||
}; | ||
@@ -524,16 +524,16 @@ // If dropping on the item isn't accepted, try the target before or after depending on the y position. | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
} else if (y <= rect.y + 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (y >= rect.maxY - 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
return target; | ||
@@ -540,0 +540,0 @@ } |
@@ -72,3 +72,3 @@ import {ListLayout as $61ef60fc9b1041f4$export$cacbb3924155d68e} from "./ListLayout.module.js"; | ||
this.wasLoading = this.isLoading; | ||
this.isLoading = loadingState === "loading" || loadingState === "loadingMore"; | ||
this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore'; | ||
this.stickyColumnIndices = []; | ||
@@ -95,3 +95,3 @@ for (let column of this.collection.columns)// The selection cell and any other sticky columns always need to be visible. | ||
let rect = new (0, $bmsJv$Rect)(0, 0, 0, 0); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)("header", "header", rect); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)('header', 'header', rect); | ||
let y = 0; | ||
@@ -102,3 +102,3 @@ let width = 0; | ||
let layoutNode = this.buildChild(headerRow, 0, y); | ||
layoutNode.layoutInfo.parentKey = "header"; | ||
layoutNode.layoutInfo.parentKey = 'header'; | ||
y = layoutNode.layoutInfo.rect.maxY; | ||
@@ -111,3 +111,3 @@ width = Math.max(width, layoutNode.layoutInfo.rect.width); | ||
rect.height = y; | ||
this.layoutInfos.set("header", layoutInfo); | ||
this.layoutInfos.set('header', layoutInfo); | ||
return { | ||
@@ -121,3 +121,3 @@ layoutInfo: layoutInfo, | ||
let rect = new (0, $bmsJv$Rect)(0, y, 0, 0); | ||
let row = new (0, $bmsJv$LayoutInfo)("headerrow", headerRow.key, rect); | ||
let row = new (0, $bmsJv$LayoutInfo)('headerrow', headerRow.key, rect); | ||
let height = 0; | ||
@@ -201,3 +201,3 @@ let columns = []; | ||
let rect = new (0, $bmsJv$Rect)(0, y, 0, 0); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)("rowgroup", "body", rect); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)('rowgroup', 'body', rect); | ||
let startY = y; | ||
@@ -219,3 +219,3 @@ let skipped = 0; | ||
let layoutNode = this.buildChild(node, 0, y); | ||
layoutNode.layoutInfo.parentKey = "body"; | ||
layoutNode.layoutInfo.parentKey = 'body'; | ||
layoutNode.index = i; | ||
@@ -234,6 +234,6 @@ y = layoutNode.layoutInfo.rect.maxY; | ||
let rect = new (0, $bmsJv$Rect)(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60); | ||
let loader = new (0, $bmsJv$LayoutInfo)("loader", "loader", rect); | ||
loader.parentKey = "body"; | ||
let loader = new (0, $bmsJv$LayoutInfo)('loader', 'loader', rect); | ||
loader.parentKey = 'body'; | ||
loader.isSticky = !this.disableSticky && children.length === 0; | ||
this.layoutInfos.set("loader", loader); | ||
this.layoutInfos.set('loader', loader); | ||
children.push({ | ||
@@ -247,6 +247,6 @@ layoutInfo: loader, | ||
let rect = new (0, $bmsJv$Rect)(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80); | ||
let empty = new (0, $bmsJv$LayoutInfo)("empty", "empty", rect); | ||
empty.parentKey = "body"; | ||
let empty = new (0, $bmsJv$LayoutInfo)('empty', 'empty', rect); | ||
empty.parentKey = 'body'; | ||
empty.isSticky = !this.disableSticky; | ||
this.layoutInfos.set("empty", empty); | ||
this.layoutInfos.set('empty', empty); | ||
children.push({ | ||
@@ -261,3 +261,3 @@ layoutInfo: empty, | ||
rect.height = y - startY; | ||
this.layoutInfos.set("body", layoutInfo); | ||
this.layoutInfos.set('body', layoutInfo); | ||
return { | ||
@@ -271,13 +271,13 @@ layoutInfo: layoutInfo, | ||
switch(node.type){ | ||
case "headerrow": | ||
case 'headerrow': | ||
return this.buildHeaderRow(node, x, y); | ||
case "item": | ||
case 'item': | ||
return this.buildRow(node, x, y); | ||
case "column": | ||
case "placeholder": | ||
case 'column': | ||
case 'placeholder': | ||
return this.buildColumn(node, x, y); | ||
case "cell": | ||
case 'cell': | ||
return this.buildCell(node, x, y); | ||
default: | ||
throw new Error("Unknown node type " + node.type); | ||
throw new Error('Unknown node type ' + node.type); | ||
} | ||
@@ -287,3 +287,3 @@ } | ||
let rect = new (0, $bmsJv$Rect)(x, y, 0, 0); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)("row", node.key, rect); | ||
let layoutInfo = new (0, $bmsJv$LayoutInfo)('row', node.key, rect); | ||
let children = []; | ||
@@ -293,3 +293,3 @@ let height = 0; | ||
...(0, $bmsJv$getChildNodes)(node, this.collection) | ||
].entries())if (child.type === "cell") { | ||
].entries())if (child.type === 'cell') { | ||
if (x > this.validRect.maxX) { | ||
@@ -312,3 +312,3 @@ // Adjust existing cached layoutInfo to ensure that it is out of view. | ||
this.setChildHeights(children, height); | ||
rect.width = this.layoutInfos.get("header").rect.width; | ||
rect.width = this.layoutInfos.get('header').rect.width; | ||
rect.height = height + 1; // +1 for bottom border | ||
@@ -354,3 +354,3 @@ return { | ||
switch(node.layoutInfo.type){ | ||
case "header": | ||
case 'header': | ||
for (let child of node.children){ | ||
@@ -361,6 +361,6 @@ res.push(child.layoutInfo); | ||
break; | ||
case "rowgroup": | ||
case 'rowgroup': | ||
{ | ||
let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, "y"); | ||
let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, "y"); | ||
let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y'); | ||
let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y'); | ||
// Add persisted rows before the visible rows. | ||
@@ -390,7 +390,7 @@ let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key); | ||
} | ||
case "headerrow": | ||
case "row": | ||
case 'headerrow': | ||
case 'row': | ||
{ | ||
let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, "x"); | ||
let lastVisibleCell = this.binarySearch(node.children, rect.topRight, "x"); | ||
let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x'); | ||
let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x'); | ||
let stickyIndex = 0; | ||
@@ -417,3 +417,3 @@ // Add persisted/sticky cells before the visible cells. | ||
default: | ||
throw new Error("Unknown node type " + node.layoutInfo.type); | ||
throw new Error('Unknown node type ' + node.layoutInfo.type); | ||
} | ||
@@ -427,4 +427,4 @@ } | ||
let item = items[mid]; | ||
if (axis === "x" && item.layoutInfo.rect.maxX < point.x || axis === "y" && item.layoutInfo.rect.maxY < point.y) low = mid + 1; | ||
else if (axis === "x" && item.layoutInfo.rect.x > point.x || axis === "y" && item.layoutInfo.rect.y > point.y) high = mid - 1; | ||
if (axis === 'x' && item.layoutInfo.rect.maxX < point.x || axis === 'y' && item.layoutInfo.rect.maxY < point.y) low = mid + 1; | ||
else if (axis === 'x' && item.layoutInfo.rect.x > point.x || axis === 'y' && item.layoutInfo.rect.y > point.y) high = mid - 1; | ||
else return mid; | ||
@@ -447,3 +447,3 @@ } | ||
// stickyColumnIndices are always persisted along with any cells from persistedKeys. | ||
indices = collectionNode.type === "cell" || collectionNode.type === "column" ? [ | ||
indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [ | ||
...this.stickyColumnIndices | ||
@@ -473,5 +473,5 @@ ] : []; | ||
var _window_navigator_userAgentData; | ||
if (typeof window === "undefined" || window.navigator == null) return false; | ||
if (typeof window === 'undefined' || window.navigator == null) return false; | ||
let isChrome105; | ||
if (window.navigator["userAgentData"]) isChrome105 = (_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((b)=>b.brand === "Chromium" && Number(b.version) === 105); | ||
if (window.navigator['userAgentData']) isChrome105 = (_window_navigator_userAgentData = window.navigator['userAgentData']) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((b)=>b.brand === 'Chromium' && Number(b.version) === 105); | ||
else { | ||
@@ -489,3 +489,3 @@ let regex = /Chrome\/(\d+)/; | ||
// Offset for height of header row | ||
y -= (_this_virtualizer_layout_getVisibleLayoutInfos_find = this.virtualizer.layout.getVisibleLayoutInfos(new (0, $bmsJv$Rect)(x, y, 1, 1)).find((info)=>info.type === "headerrow")) === null || _this_virtualizer_layout_getVisibleLayoutInfos_find === void 0 ? void 0 : _this_virtualizer_layout_getVisibleLayoutInfos_find.rect.height; | ||
y -= (_this_virtualizer_layout_getVisibleLayoutInfos_find = this.virtualizer.layout.getVisibleLayoutInfos(new (0, $bmsJv$Rect)(x, y, 1, 1)).find((info)=>info.type === 'headerrow')) === null || _this_virtualizer_layout_getVisibleLayoutInfos_find === void 0 ? void 0 : _this_virtualizer_layout_getVisibleLayoutInfos_find.rect.height; | ||
// Custom variation of this.virtualizer.keyAtPoint that ignores body | ||
@@ -495,3 +495,3 @@ let key; | ||
let rectAtPoint = new (0, $bmsJv$Rect)(point.x, point.y, 1, 1); | ||
let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter((info)=>info.type === "row"); | ||
let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter((info)=>info.type === 'row'); | ||
// Layout may return multiple layout infos in the case of | ||
@@ -501,3 +501,3 @@ // persisted keys, so find the first one that actually intersects. | ||
if (key == null || this.collection.size === 0) return { | ||
type: "root" | ||
type: 'root' | ||
}; | ||
@@ -507,5 +507,5 @@ let layoutInfo = this.getLayoutInfo(key); | ||
let target = { | ||
type: "item", | ||
type: 'item', | ||
key: layoutInfo.key, | ||
dropPosition: "on" | ||
dropPosition: 'on' | ||
}; | ||
@@ -518,16 +518,16 @@ // If dropping on the item isn't accepted, try the target before or after depending on the y position. | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
} else if (y <= rect.y + 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "before" | ||
})) target.dropPosition = "before"; | ||
dropPosition: 'before' | ||
})) target.dropPosition = 'before'; | ||
else if (y >= rect.maxY - 10 && isValidDropTarget({ | ||
...target, | ||
dropPosition: "after" | ||
})) target.dropPosition = "after"; | ||
dropPosition: 'after' | ||
})) target.dropPosition = 'after'; | ||
return target; | ||
@@ -534,0 +534,0 @@ } |
{ | ||
"name": "@react-stately/layout", | ||
"version": "3.13.9-nightly.4624+d80999e89", | ||
"version": "3.13.9", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,8 +25,8 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/collections": "3.0.0-nightly.2912+d80999e89", | ||
"@react-stately/table": "3.11.8-nightly.4624+d80999e89", | ||
"@react-stately/virtualizer": "3.7.1-nightly.4624+d80999e89", | ||
"@react-types/grid": "3.2.6-nightly.4624+d80999e89", | ||
"@react-types/shared": "3.0.0-nightly.2912+d80999e89", | ||
"@react-types/table": "3.9.5-nightly.4624+d80999e89", | ||
"@react-stately/collections": "^3.10.7", | ||
"@react-stately/table": "^3.11.8", | ||
"@react-stately/virtualizer": "^3.7.1", | ||
"@react-types/grid": "^3.2.6", | ||
"@react-types/shared": "^3.23.1", | ||
"@react-types/table": "^3.9.5", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -40,3 +40,3 @@ }, | ||
}, | ||
"gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882" | ||
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433" | ||
} |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
367135
+ Added@react-aria/ssr@3.9.5(transitive)
+ Added@react-aria/utils@3.25.2(transitive)
+ Added@react-stately/collections@3.10.9(transitive)
+ Added@react-stately/flags@3.0.3(transitive)
+ Added@react-stately/grid@3.9.2(transitive)
+ Added@react-stately/selection@3.16.2(transitive)
+ Added@react-stately/table@3.12.2(transitive)
+ Added@react-stately/utils@3.10.3(transitive)
+ Added@react-stately/virtualizer@3.7.1(transitive)
+ Added@react-types/grid@3.2.8(transitive)
+ Added@react-types/shared@3.24.1(transitive)
+ Added@react-types/table@3.10.1(transitive)
+ Addedclsx@2.1.1(transitive)
Updated@react-stately/table@^3.11.8
Updated@react-types/grid@^3.2.6
Updated@react-types/shared@^3.23.1
Updated@react-types/table@^3.9.5