@react-stately/layout 4.1.1 → 4.2.0

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.
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAgCD,MAAM,uCAAiB;AAUhB,MAAM,kDAA+B,CAAA,GAAA,qCAAK;IAwC/C,0CAA0C;IAC1C,IAAc,aAAkC;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAE,UAAU;IACrC;IAEA,cAAc,GAAQ,EAAE;YAEf;QADP,IAAI,CAAC,gBAAgB,CAAC;QACtB,OAAO,EAAA,wBAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAArB,4CAAA,sBAA2B,UAAU,KAAI;IAClD;IAEA,sBAAsB,IAAU,EAAE;QAChC,yDAAyD;QACzD,kDAAkD;QAClD,IAAI,KAAK,MAAM,GAAG,GAAG;gBACH,iBAAA;YAAhB,IAAI,YAAY,CAAA,OAAA,CAAA,kBAAA,IAAI,CAAC,SAAS,cAAd,6BAAA,kBAAkB,IAAI,CAAC,kBAAkB,cAAzC,kBAAA,OAA6C;YAC7D,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,aAAa;YAC1C,KAAK,MAAM,GAAG,KAAK,IAAI,CAAC,KAAK,MAAM,GAAG,aAAa;QACrD;QAEA,mEAAmE;QACnE,wDAAwD;QACxD,IAAI,CAAC,cAAc,CAAC;QAEpB,IAAI,MAAoB,EAAE;QAE1B,IAAI,WAAW,CAAC;YACd,KAAK,IAAI,QAAQ,MACf,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,OAAO;gBAC9B,IAAI,IAAI,CAAC,KAAK,UAAU;gBAExB,IAAI,KAAK,QAAQ,EACf,SAAS,KAAK,QAAQ;YAE1B;QAEJ;QAEA,SAAS,IAAI,CAAC,SAAS;QACvB,OAAO;IACT;IAEU,eAAe,IAAU,EAAE;QACnC,IAAI,CAAC,I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,CAAC,aAAa,GAAG,CAAA,yBAAA,QAAQ,aAAa,cAArB,oCAAA,yBAAyB;YAChB;QAA9B,IAAI,CAAC,sBAAsB,GAAG,CAAA,kCAAA,QAAQ,sBAAsB,cAA9B,6CAAA,kCAAkC;YAC5C;QAApB,IAAI,CAAC,YAAY,GAAG,CAAA,wBAAA,QAAQ,YAAY,cAApB,mCAAA,wBAAwB;QAC5C,IAAI,CAAC,sBAAsB,GAAG,QAAQ,sBAAsB,IAAI;QAChE,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,SAAS,GAAG;QACjB,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,oBAAoB,GAAG;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA,GAAA,mCAAG;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA,GAAA,mCAAG;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,GAAA,mCAAG;IAC5B;AA+ZF","sources":["packages/@react-stately/layout/src/ListLayout.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, DropTarget, DropTargetDelegate, ItemDropTarget, Key, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\n\nexport interface ListLayoutOptions {\n /** The fixed height of a row in px. */\n rowHeight?: number,\n /** The estimated height of a row, when row heights are variable. */\n estimatedRowHeight?: number,\n /** The fixed height of a section header in px. */\n headingHeight?: number,\n /** The estimated height of a section header, when the height is variable. */\n estimatedHeadingHeight?: number,\n /** The fixed height of a loader element in px. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n */\n loaderHeight?: number,\n /** The thickness of the drop indicator. */\n dropIndicatorThickness?: number\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * The ListLayout class is an implementation of a virtualizer {@link Layout}.\n * To configure a ListLayout, you can use the properties to define the\n * layouts and/or use the method for defining indentation.\n * The {@link ListKeyboardDelegate} extends the existing virtualizer\n * delegate with an additional method to do this (it uses the same delegate object as\n * the virtualizer itself).\n */\nexport class ListLayout<T, O = any> extends Layout<Node<T>, O> implements DropTargetDelegate {\n protected rowHeight: number | null;\n protected estimatedRowHeight: number | null;\n protected headingHeight: number | null;\n protected estimatedHeadingHeight: number | null;\n protected loaderHeight: number | null;\n protected dropIndicatorThickness: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n private lastWidth: number;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowHeight = options.rowHeight ?? null;\n this.estimatedRowHeight = options.estimatedRowHeight ?? null;\n this.headingHeight = options.headingHeight ?? null;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight ?? null;\n this.loaderHeight = options.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastWidth = 0;\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n getLayoutInfo(key: Key) {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 for getDropTargetFromPoint)\n if (rect.height > 1) {\n let rowHeight = this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT;\n rect.y = Math.floor(rect.y / rowHeight) * rowHeight;\n rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect) {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n \n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!this.layoutNodes.has(key) && this.requestedRect.area < this.contentSize.area && this.lastCollection) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || node.layoutInfo.type === 'header' || this.virtualizer!.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>) {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n return invalidationContext.sizeChanged || false;\n }\n\n update(invalidationContext: InvalidationContext<O>) {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastWidth = this.virtualizer!.visibleRect.width;\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(y = 0): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let skipped = 0;\n let nodes: LayoutNode[] = [];\n for (let node of collection) {\n let rowHeight = this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y, null);\n y = layoutNode.layoutInfo.rect.maxY;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.requestedRect.maxY) {\n y += (collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, y);\n return nodes;\n }\n\n protected isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === cached.layoutInfo.rect.y &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('loader', node.key, rect);\n rect.width = this.virtualizer!.contentSize.width;\n rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight || DEFAULT_HEIGHT;\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.visibleRect.width;\n let rect = new Rect(0, y, width, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT);\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y, layoutInfo.key);\n y = layoutNode.layoutInfo.rect.maxY;\n children.push(layoutNode);\n\n if (y > this.requestedRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n rect.height = y - startY;\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer!.visibleRect.width;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(0, y, width, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer!.visibleRect.width;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect = new Rect(x, y, width - x, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect,\n node\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect.height = Math.min(this.validRect.height, layoutInfo.rect.y - this.validRect.y);\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n this.requestedRect.height += newLayoutInfo.rect.height - layoutInfo.rect.height;\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n let key = this.virtualizer!.keyAtPoint(new Point(x, y));\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.y - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else if (target.dropPosition === 'after') {\n rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n"],"names":[],"version":3,"file":"ListLayout.main.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC;;AAqDD,MAAM,uCAAiB;AAOhB,MAAM,kDAAuE,CAAA,GAAA,qCAAK;IA0CvF,0CAA0C;IAC1C,IAAc,aAAkC;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAE,UAAU;IACrC;IAEA,cAAc,GAAQ,EAAE;YAEf;QADP,IAAI,CAAC,gBAAgB,CAAC;QACtB,OAAO,EAAA,wBAAA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAArB,4CAAA,sBAA2B,UAAU,KAAI;IAClD;IAEA,sBAAsB,IAAU,EAAE;QAChC,yDAAyD;QACzD,kDAAkD;QAClD,IAAI,KAAK,MAAM,GAAG,GAAG;gBACF,iBAAA;YAAjB,IAAI,YAAY,AAAC,CAAA,CAAA,OAAA,CAAA,kBAAA,IAAI,CAAC,SAAS,cAAd,6BAAA,kBAAkB,IAAI,CAAC,kBAAkB,cAAzC,kBAAA,OAA6C,oCAAa,IAAK,IAAI,CAAC,GAAG;YACxF,KAAK,CAAC,GAAG,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,aAAa;YAC1C,KAAK,MAAM,GAAG,KAAK,IAAI,CAAC,KAAK,MAAM,GAAG,aAAa;QACrD;QAEA,mEAAmE;QACnE,wDAAwD;QACxD,IAAI,CAAC,cAAc,CAAC;QAEpB,IAAI,MAAoB,EAAE;QAE1B,IAAI,WAAW,CAAC;YACd,KAAK,IAAI,QAAQ,MACf,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,OAAO;gBAC9B,IAAI,IAAI,CAAC,KAAK,UAAU;gBAExB,IAAI,KAAK,QAAQ,EACf,SAAS,KAAK,QAAQ;YAE1B;QAEJ;QAEA,SAAS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AAG,CAAA,yBAAA,QAAQ,aAAa,cAArB,oCAAA,yBAAyB;YAChB;QAA9B,IAAI,CAAC,sBAAsB,GAAG,CAAA,kCAAA,QAAQ,sBAAsB,cAA9B,6CAAA,kCAAkC;YAC5C;QAApB,IAAI,CAAC,YAAY,GAAG,CAAA,wBAAA,QAAQ,YAAY,cAApB,mCAAA,wBAAwB;QAC5C,IAAI,CAAC,sBAAsB,GAAG,QAAQ,sBAAsB,IAAI;QAChE,IAAI,CAAC,GAAG,GAAG,QAAQ,GAAG,IAAI;QAC1B,IAAI,CAAC,OAAO,GAAG,QAAQ,OAAO,IAAI;QAClC,IAAI,CAAC,WAAW,GAAG,IAAI;QACvB,IAAI,CAAC,SAAS,GAAG,EAAE;QACnB,IAAI,CAAC,cAAc,GAAG;QACtB,IAAI,CAAC,oBAAoB,GAAG;QAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA,GAAA,mCAAG;QACxB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAA,GAAA,mCAAG;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA,GAAA,mCAAG;IAC5B;AA6bF","sources":["packages/@react-stately/layout/src/ListLayout.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {Collection, DropTarget, DropTargetDelegate, ItemDropTarget, Key, Node} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {InvalidationContext, Layout, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\n\nexport interface ListLayoutOptions {\n /**\n * The fixed height of a row in px.\n * @default 48\n */\n rowHeight?: number,\n /** The estimated height of a row, when row heights are variable. */\n estimatedRowHeight?: number,\n /**\n * The fixed height of a section header in px.\n * @default 48\n */\n headingHeight?: number,\n /** The estimated height of a section header, when the height is variable. */\n estimatedHeadingHeight?: number,\n /** \n * The fixed height of a loader element in px. This loader is specifically for\n * \"load more\" elements rendered when loading more rows at the root level or inside nested row/sections.\n * @default 48\n */\n loaderHeight?: number,\n /**\n * The thickness of the drop indicator.\n * @default 2\n */\n dropIndicatorThickness?: number,\n /**\n * The gap between items.\n * @default 0\n */\n gap?: number,\n /**\n * The padding around the list.\n * @default 0\n */\n padding?: number\n}\n\n// A wrapper around LayoutInfo that supports hierarchy\nexport interface LayoutNode {\n node?: Node<unknown>,\n layoutInfo: LayoutInfo,\n children?: LayoutNode[],\n validRect: Rect,\n index?: number\n}\n\nconst DEFAULT_HEIGHT = 48;\n\n/**\n * ListLayout is a virtualizer Layout implementation\n * that arranges its items in a vertical stack. It supports both fixed\n * and variable height items.\n */\nexport class ListLayout<T, O extends ListLayoutOptions = ListLayoutOptions> extends Layout<Node<T>, O> implements DropTargetDelegate {\n protected rowHeight: number | null;\n protected estimatedRowHeight: number | null;\n protected headingHeight: number | null;\n protected estimatedHeadingHeight: number | null;\n protected loaderHeight: number | null;\n protected dropIndicatorThickness: number;\n protected gap: number;\n protected padding: number;\n protected layoutNodes: Map<Key, LayoutNode>;\n protected contentSize: Size;\n protected lastCollection: Collection<Node<T>> | null;\n protected rootNodes: LayoutNode[];\n private invalidateEverything: boolean;\n /** The rectangle containing currently valid layout infos. */\n protected validRect: Rect;\n /** The rectangle of requested layout infos so far. */\n protected requestedRect: Rect;\n\n /**\n * Creates a new ListLayout with options. See the list of properties below for a description\n * of the options that can be provided.\n */\n constructor(options: ListLayoutOptions = {}) {\n super();\n this.rowHeight = options.rowHeight ?? null;\n this.estimatedRowHeight = options.estimatedRowHeight ?? null;\n this.headingHeight = options.headingHeight ?? null;\n this.estimatedHeadingHeight = options.estimatedHeadingHeight ?? null;\n this.loaderHeight = options.loaderHeight ?? null;\n this.dropIndicatorThickness = options.dropIndicatorThickness || 2;\n this.gap = options.gap || 0;\n this.padding = options.padding || 0;\n this.layoutNodes = new Map();\n this.rootNodes = [];\n this.lastCollection = null;\n this.invalidateEverything = false;\n this.validRect = new Rect();\n this.requestedRect = new Rect();\n this.contentSize = new Size();\n }\n\n // Backward compatibility for subclassing.\n protected get collection(): Collection<Node<T>> {\n return this.virtualizer!.collection;\n }\n\n getLayoutInfo(key: Key) {\n this.ensureLayoutInfo(key);\n return this.layoutNodes.get(key)?.layoutInfo || null;\n }\n\n getVisibleLayoutInfos(rect: Rect) {\n // Adjust rect to keep number of visible rows consistent.\n // (only if height > 1 for getDropTargetFromPoint)\n if (rect.height > 1) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT) + this.gap;\n rect.y = Math.floor(rect.y / rowHeight) * rowHeight;\n rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;\n }\n\n // If layout hasn't yet been done for the requested rect, union the\n // new rect with the existing valid rect, and recompute.\n this.layoutIfNeeded(rect);\n\n let res: LayoutInfo[] = [];\n\n let addNodes = (nodes: LayoutNode[]) => {\n for (let node of nodes) {\n if (this.isVisible(node, rect)) {\n res.push(node.layoutInfo);\n\n if (node.children) {\n addNodes(node.children);\n }\n }\n }\n };\n\n addNodes(this.rootNodes);\n return res;\n }\n\n protected layoutIfNeeded(rect: Rect) {\n if (!this.lastCollection) {\n return;\n }\n\n if (!this.requestedRect.containsRect(rect)) {\n this.requestedRect = this.requestedRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n \n // Ensure all of the persisted keys are available.\n for (let key of this.virtualizer!.persistedKeys) {\n if (this.ensureLayoutInfo(key)) {\n return;\n }\n }\n }\n\n private ensureLayoutInfo(key: Key) {\n // If the layout info wasn't found, it might be outside the bounds of the area that we've\n // computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.\n // Compute the full layout and try again.\n if (!this.layoutNodes.has(key) && this.requestedRect.area < this.contentSize.area && this.lastCollection) {\n this.requestedRect = new Rect(0, 0, Infinity, Infinity);\n this.rootNodes = this.buildCollection();\n this.requestedRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);\n return true;\n }\n\n return false;\n }\n\n protected isVisible(node: LayoutNode, rect: Rect) {\n return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || node.layoutInfo.type === 'header' || this.virtualizer!.isPersistedKey(node.layoutInfo.key);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext<O>): boolean {\n // Invalidate cache if the size of the collection changed.\n // In this case, we need to recalculate the entire layout.\n // Also invalidate if fixed sizes/gaps change.\n let options = invalidationContext.layoutOptions;\n return invalidationContext.sizeChanged\n || this.rowHeight !== (options?.rowHeight ?? this.rowHeight)\n || this.headingHeight !== (options?.headingHeight ?? this.headingHeight)\n || this.loaderHeight !== (options?.loaderHeight ?? this.loaderHeight)\n || this.gap !== (options?.gap ?? this.gap)\n || this.padding !== (options?.padding ?? this.padding);\n }\n\n shouldInvalidateLayoutOptions(newOptions: O, oldOptions: O): boolean {\n return newOptions.rowHeight !== oldOptions.rowHeight\n || newOptions.estimatedRowHeight !== oldOptions.estimatedRowHeight\n || newOptions.headingHeight !== oldOptions.headingHeight\n || newOptions.estimatedHeadingHeight !== oldOptions.estimatedHeadingHeight\n || newOptions.loaderHeight !== oldOptions.loaderHeight\n || newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness\n || newOptions.gap !== oldOptions.gap\n || newOptions.padding !== oldOptions.padding;\n }\n\n update(invalidationContext: InvalidationContext<O>) {\n let collection = this.virtualizer!.collection;\n\n // Reset valid rect if we will have to invalidate everything.\n // Otherwise we can reuse cached layout infos outside the current visible rect.\n this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);\n if (this.invalidateEverything) {\n this.requestedRect = this.virtualizer!.visibleRect.copy();\n this.layoutNodes.clear();\n }\n\n let options = invalidationContext.layoutOptions;\n this.rowHeight = options?.rowHeight ?? this.rowHeight;\n this.estimatedRowHeight = options?.estimatedRowHeight ?? this.estimatedRowHeight;\n this.headingHeight = options?.headingHeight ?? this.headingHeight;\n this.estimatedHeadingHeight = options?.estimatedHeadingHeight ?? this.estimatedHeadingHeight;\n this.loaderHeight = options?.loaderHeight ?? this.loaderHeight;\n this.dropIndicatorThickness = options?.dropIndicatorThickness ?? this.dropIndicatorThickness;\n this.gap = options?.gap ?? this.gap;\n this.padding = options?.padding ?? this.padding;\n\n this.rootNodes = this.buildCollection();\n\n // Remove deleted layout nodes\n if (this.lastCollection && collection !== this.lastCollection) {\n for (let key of this.lastCollection.getKeys()) {\n if (!collection.getItem(key)) {\n let layoutNode = this.layoutNodes.get(key);\n if (layoutNode) {\n this.layoutNodes.delete(key);\n }\n }\n }\n }\n\n this.lastCollection = collection;\n this.invalidateEverything = false;\n this.validRect = this.requestedRect.copy();\n }\n\n protected buildCollection(y = this.padding): LayoutNode[] {\n let collection = this.virtualizer!.collection;\n let skipped = 0;\n let nodes: LayoutNode[] = [];\n for (let node of collection) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (node.type === 'item' && y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, this.padding, y, null);\n y = layoutNode.layoutInfo.rect.maxY + this.gap;\n nodes.push(layoutNode);\n\n if (node.type === 'item' && y > this.requestedRect.maxY) {\n y += (collection.size - (nodes.length + skipped)) * rowHeight;\n break;\n }\n }\n\n y -= this.gap;\n y += this.padding;\n this.contentSize = new Size(this.virtualizer!.visibleRect.width, y);\n return nodes;\n }\n\n protected isValid(node: Node<T>, y: number) {\n let cached = this.layoutNodes.get(node.key);\n return (\n !this.invalidateEverything &&\n cached &&\n cached.node === node &&\n y === cached.layoutInfo.rect.y &&\n cached.layoutInfo.rect.intersects(this.validRect) &&\n cached.validRect.containsRect(cached.layoutInfo.rect.intersection(this.requestedRect))\n );\n }\n\n protected buildChild(node: Node<T>, x: number, y: number, parentKey: Key | null): LayoutNode {\n if (this.isValid(node, y)) {\n return this.layoutNodes.get(node.key)!;\n }\n\n let layoutNode = this.buildNode(node, x, y);\n\n layoutNode.layoutInfo.parentKey = parentKey ?? null;\n this.layoutNodes.set(node.key, layoutNode);\n return layoutNode;\n }\n\n protected buildNode(node: Node<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'section':\n return this.buildSection(node, x, y);\n case 'item':\n return this.buildItem(node, x, y);\n case 'header':\n return this.buildSectionHeader(node, x, y);\n case 'loader':\n return this.buildLoader(node, x, y);\n default:\n throw new Error('Unsupported node type: ' + node.type);\n }\n }\n\n protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, this.padding, 0);\n let layoutInfo = new LayoutInfo('loader', node.key, rect);\n rect.width = this.virtualizer!.contentSize.width - this.padding - x;\n rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight || DEFAULT_HEIGHT;\n\n return {\n layoutInfo,\n validRect: rect.intersection(this.requestedRect)\n };\n }\n\n protected buildSection(node: Node<T>, x: number, y: number): LayoutNode {\n let collection = this.virtualizer!.collection;\n let width = this.virtualizer!.visibleRect.width - this.padding;\n let rect = new Rect(x, y, width - x, 0);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n\n let startY = y;\n let skipped = 0;\n let children: LayoutNode[] = [];\n for (let child of getChildNodes(node, collection)) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight ?? DEFAULT_HEIGHT) + this.gap;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(child, x, y, layoutInfo.key);\n y = layoutNode.layoutInfo.rect.maxY + this.gap;\n children.push(layoutNode);\n\n if (y > this.requestedRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += ([...getChildNodes(node, collection)].length - (children.length + skipped)) * rowHeight;\n break;\n }\n }\n\n y -= this.gap;\n rect.height = y - startY;\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildSectionHeader(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer!.visibleRect.width - this.padding;\n let rectHeight = this.headingHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n let previousLayoutInfo = previousLayoutNode?.layoutInfo;\n if (previousLayoutInfo) {\n let curNode = this.virtualizer!.collection.getItem(node.key);\n let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;\n rectHeight = previousLayoutInfo.rect.height;\n isEstimated = width !== previousLayoutInfo.rect.width || curNode !== lastNode || previousLayoutInfo.estimatedSize;\n } else {\n rectHeight = (node.rendered ? this.estimatedHeadingHeight : 0);\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let headerRect = new Rect(x, y, width - x, rectHeight);\n let header = new LayoutInfo('header', node.key, headerRect);\n header.estimatedSize = isEstimated;\n return {\n layoutInfo: header,\n children: [],\n validRect: header.rect.intersection(this.requestedRect),\n node\n };\n }\n\n protected buildItem(node: Node<T>, x: number, y: number): LayoutNode {\n let width = this.virtualizer!.visibleRect.width - this.padding - x;\n let rectHeight = this.rowHeight;\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (rectHeight == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall virtualizer changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n rectHeight = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = width !== previousLayoutNode.layoutInfo.rect.width || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n rectHeight = this.estimatedRowHeight;\n isEstimated = true;\n }\n }\n\n if (rectHeight == null) {\n rectHeight = DEFAULT_HEIGHT;\n }\n\n let rect = new Rect(x, y, width, rectHeight);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.estimatedSize = isEstimated;\n return {\n layoutInfo,\n children: [],\n validRect: layoutInfo.rect,\n node\n };\n }\n\n updateItemSize(key: Key, size: Size) {\n let layoutNode = this.layoutNodes.get(key);\n // If no layoutInfo, item has been deleted/removed.\n if (!layoutNode) {\n return false;\n }\n\n let collection = this.virtualizer!.collection;\n let layoutInfo = layoutNode.layoutInfo;\n layoutInfo.estimatedSize = false;\n if (layoutInfo.rect.height !== size.height) {\n // Copy layout info rather than mutating so that later caches are invalidated.\n let newLayoutInfo = layoutInfo.copy();\n newLayoutInfo.rect.height = size.height;\n layoutNode.layoutInfo = newLayoutInfo;\n\n // Items after this layoutInfo will need to be repositioned to account for the new height.\n // Adjust the validRect so that only items above remain valid.\n this.validRect.height = Math.min(this.validRect.height, layoutInfo.rect.y - this.validRect.y);\n\n // The requestedRect also needs to be adjusted to account for the height difference.\n this.requestedRect.height += newLayoutInfo.rect.height - layoutInfo.rect.height;\n\n // Invalidate layout for this layout node and all parents\n this.updateLayoutNode(key, layoutInfo, newLayoutInfo);\n\n let node = layoutInfo.parentKey != null ? collection.getItem(layoutInfo.parentKey) : null;\n while (node) {\n this.updateLayoutNode(node.key, layoutInfo, newLayoutInfo);\n node = node.parentKey != null ? collection.getItem(node.parentKey) : null;\n }\n\n return true;\n }\n\n return false;\n }\n\n private updateLayoutNode(key: Key, oldLayoutInfo: LayoutInfo, newLayoutInfo: LayoutInfo) {\n let n = this.layoutNodes.get(key);\n if (n) {\n // Invalidate by intersecting the validRect of this node with the overall validRect.\n n.validRect = n.validRect.intersection(this.validRect);\n\n // Replace layout info in LayoutNode\n if (n.layoutInfo === oldLayoutInfo) {\n n.layoutInfo = newLayoutInfo;\n }\n }\n }\n\n getContentSize() {\n return this.contentSize;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null {\n x += this.virtualizer!.visibleRect.x;\n y += this.virtualizer!.visibleRect.y;\n\n let key = this.virtualizer!.keyAtPoint(new Point(x, y));\n if (key == null || this.virtualizer!.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\n if (!layoutInfo) {\n return null;\n }\n\n let rect = layoutInfo.rect;\n let target: DropTarget = {\n type: 'item',\n key: layoutInfo.key,\n dropPosition: 'on'\n };\n\n // If dropping on the item isn't accepted, try the target before or after depending on the y position.\n // Otherwise, if dropping on the item is accepted, still try the before/after positions if within 10px\n // of the top or bottom of the item.\n if (!isValidDropTarget(target)) {\n if (y <= rect.y + rect.height / 2 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n } else if (y <= rect.y + 10 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = 'before';\n } else if (y >= rect.maxY - 10 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = 'after';\n }\n\n return target;\n }\n\n getDropTargetLayoutInfo(target: ItemDropTarget): LayoutInfo {\n let layoutInfo = this.getLayoutInfo(target.key)!;\n let rect: Rect;\n if (target.dropPosition === 'before') {\n rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.y - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else if (target.dropPosition === 'after') {\n rect = new Rect(layoutInfo.rect.x, layoutInfo.rect.maxY - this.dropIndicatorThickness / 2, layoutInfo.rect.width, this.dropIndicatorThickness);\n } else {\n rect = layoutInfo.rect;\n }\n\n return new LayoutInfo('dropIndicator', target.key + ':' + target.dropPosition, rect);\n }\n}\n"],"names":[],"version":3,"file":"ListLayout.main.js.map"}
@@ -29,7 +29,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
29
29
  // (only if height > 1 for getDropTargetFromPoint)
30
30
  if (rect.height > 1) {
31
31
  var _this_rowHeight, _ref;
32
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
32
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
33
33
  rect.y = Math.floor(rect.y / rowHeight) * rowHeight;
34
34
  rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;
35
35
  }
@@ -75,7 +75,13 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
75
75
  shouldInvalidateEverything(invalidationContext) {
76
76
  // Invalidate cache if the size of the collection changed.
77
77
  // In this case, we need to recalculate the entire layout.
78
- return invalidationContext.sizeChanged || false;
78
+ // Also invalidate if fixed sizes/gaps change.
79
+ let options = invalidationContext.layoutOptions;
80
+ var _options_rowHeight, _options_headingHeight, _options_loaderHeight, _options_gap, _options_padding;
81
+ return invalidationContext.sizeChanged || this.rowHeight !== ((_options_rowHeight = options === null || options === void 0 ? void 0 : options.rowHeight) !== null && _options_rowHeight !== void 0 ? _options_rowHeight : this.rowHeight) || this.headingHeight !== ((_options_headingHeight = options === null || options === void 0 ? void 0 : options.headingHeight) !== null && _options_headingHeight !== void 0 ? _options_headingHeight : this.headingHeight) || this.loaderHeight !== ((_options_loaderHeight = options === null || options === void 0 ? void 0 : options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : this.loaderHeight) || this.gap !== ((_options_gap = options === null || options === void 0 ? void 0 : options.gap) !== null && _options_gap !== void 0 ? _options_gap : this.gap) || this.padding !== ((_options_padding = options === null || options === void 0 ? void 0 : options.padding) !== null && _options_padding !== void 0 ? _options_padding : this.padding);
82
+ }
83
+ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
84
+ return newOptions.rowHeight !== oldOptions.rowHeight || newOptions.estimatedRowHeight !== oldOptions.estimatedRowHeight || newOptions.headingHeight !== oldOptions.headingHeight || newOptions.estimatedHeadingHeight !== oldOptions.estimatedHeadingHeight || newOptions.loaderHeight !== oldOptions.loaderHeight || newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness || newOptions.gap !== oldOptions.gap || newOptions.padding !== oldOptions.padding;
79
85
  }
80
86
  update(invalidationContext) {
81
87
  let collection = this.virtualizer.collection;
@@ -86,6 +92,23 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
86
92
  this.requestedRect = this.virtualizer.visibleRect.copy();
87
93
  this.layoutNodes.clear();
88
94
  }
95
+ let options = invalidationContext.layoutOptions;
96
+ var _options_rowHeight;
97
+ this.rowHeight = (_options_rowHeight = options === null || options === void 0 ? void 0 : options.rowHeight) !== null && _options_rowHeight !== void 0 ? _options_rowHeight : this.rowHeight;
98
+ var _options_estimatedRowHeight;
99
+ this.estimatedRowHeight = (_options_estimatedRowHeight = options === null || options === void 0 ? void 0 : options.estimatedRowHeight) !== null && _options_estimatedRowHeight !== void 0 ? _options_estimatedRowHeight : this.estimatedRowHeight;
100
+ var _options_headingHeight;
101
+ this.headingHeight = (_options_headingHeight = options === null || options === void 0 ? void 0 : options.headingHeight) !== null && _options_headingHeight !== void 0 ? _options_headingHeight : this.headingHeight;
102
+ var _options_estimatedHeadingHeight;
103
+ this.estimatedHeadingHeight = (_options_estimatedHeadingHeight = options === null || options === void 0 ? void 0 : options.estimatedHeadingHeight) !== null && _options_estimatedHeadingHeight !== void 0 ? _options_estimatedHeadingHeight : this.estimatedHeadingHeight;
104
+ var _options_loaderHeight;
105
+ this.loaderHeight = (_options_loaderHeight = options === null || options === void 0 ? void 0 : options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : this.loaderHeight;
106
+ var _options_dropIndicatorThickness;
107
+ this.dropIndicatorThickness = (_options_dropIndicatorThickness = options === null || options === void 0 ? void 0 : options.dropIndicatorThickness) !== null && _options_dropIndicatorThickness !== void 0 ? _options_dropIndicatorThickness : this.dropIndicatorThickness;
108
+ var _options_gap;
109
+ this.gap = (_options_gap = options === null || options === void 0 ? void 0 : options.gap) !== null && _options_gap !== void 0 ? _options_gap : this.gap;
110
+ var _options_padding;
111
+ this.padding = (_options_padding = options === null || options === void 0 ? void 0 : options.padding) !== null && _options_padding !== void 0 ? _options_padding : this.padding;
89
112
  this.rootNodes = this.buildCollection();
90
113
  // Remove deleted layout nodes
91
114
  if (this.lastCollection && collection !== this.lastCollection) {
@@ -94,32 +117,33 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
94
117
  if (layoutNode) this.layoutNodes.delete(key);
95
118
  }
96
119
  }
97
- this.lastWidth = this.virtualizer.visibleRect.width;
98
120
  this.lastCollection = collection;
99
121
  this.invalidateEverything = false;
100
122
  this.validRect = this.requestedRect.copy();
101
123
  }
102
- buildCollection(y = 0) {
124
+ buildCollection(y = this.padding) {
103
125
  let collection = this.virtualizer.collection;
104
126
  let skipped = 0;
105
127
  let nodes = [];
106
128
  for (let node of collection){
107
129
  var _this_rowHeight, _ref;
108
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
130
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
109
131
  // Skip rows before the valid rectangle unless they are already cached.
110
132
  if (node.type === 'item' && y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {
111
133
  y += rowHeight;
112
134
  skipped++;
113
135
  continue;
114
136
  }
115
- let layoutNode = this.buildChild(node, 0, y, null);
116
- y = layoutNode.layoutInfo.rect.maxY;
137
+ let layoutNode = this.buildChild(node, this.padding, y, null);
138
+ y = layoutNode.layoutInfo.rect.maxY + this.gap;
117
139
  nodes.push(layoutNode);
118
140
  if (node.type === 'item' && y > this.requestedRect.maxY) {
119
141
  y += (collection.size - (nodes.length + skipped)) * rowHeight;
120
142
  break;
121
143
  }
122
144
  }
145
+ y -= this.gap;
146
+ y += this.padding;
123
147
  this.contentSize = new (0, $img26$Size)(this.virtualizer.visibleRect.width, y);
124
148
  return nodes;
125
149
  }
@@ -149,9 +173,9 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
149
173
  }
150
174
  }
151
175
  buildLoader(node, x, y) {
152
- let rect = new (0, $img26$Rect)(x, y, 0, 0);
176
+ let rect = new (0, $img26$Rect)(x, y, this.padding, 0);
153
177
  let layoutInfo = new (0, $img26$LayoutInfo)('loader', node.key, rect);
154
- rect.width = this.virtualizer.contentSize.width;
178
+ rect.width = this.virtualizer.contentSize.width - this.padding - x;
155
179
  rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight || $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
156
180
  return {
157
181
  layoutInfo: layoutInfo,
@@ -160,15 +184,15 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
160
184
  }
161
185
  buildSection(node, x, y) {
162
186
  let collection = this.virtualizer.collection;
163
- let width = this.virtualizer.visibleRect.width;
164
- let rect = new (0, $img26$Rect)(0, y, width, 0);
187
+ let width = this.virtualizer.visibleRect.width - this.padding;
188
+ let rect = new (0, $img26$Rect)(x, y, width - x, 0);
165
189
  let layoutInfo = new (0, $img26$LayoutInfo)(node.type, node.key, rect);
166
190
  let startY = y;
167
191
  let skipped = 0;
168
192
  let children = [];
169
193
  for (let child of (0, $img26$getChildNodes)(node, collection)){
170
194
  var _this_rowHeight, _ref;
171
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
195
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
172
196
  // Skip rows before the valid rectangle unless they are already cached.
173
197
  if (y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {
174
198
  y += rowHeight;
@@ -176,7 +200,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
176
200
  continue;
177
201
  }
178
202
  let layoutNode = this.buildChild(child, x, y, layoutInfo.key);
179
- y = layoutNode.layoutInfo.rect.maxY;
203
+ y = layoutNode.layoutInfo.rect.maxY + this.gap;
180
204
  children.push(layoutNode);
181
205
  if (y > this.requestedRect.maxY) {
182
206
  // Estimate the remaining height for rows that we don't need to layout right now.
@@ -186,6 +210,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
186
210
  break;
187
211
  }
188
212
  }
213
+ y -= this.gap;
189
214
  rect.height = y - startY;
190
215
  return {
191
216
  layoutInfo: layoutInfo,
@@ -195,7 +220,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
195
220
  };
196
221
  }
197
222
  buildSectionHeader(node, x, y) {
198
- let width = this.virtualizer.visibleRect.width;
223
+ let width = this.virtualizer.visibleRect.width - this.padding;
199
224
  let rectHeight = this.headingHeight;
200
225
  let isEstimated = false;
201
226
  // If no explicit height is available, use an estimated height.
@@ -209,14 +234,14 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
209
234
  let curNode = this.virtualizer.collection.getItem(node.key);
210
235
  let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;
211
236
  rectHeight = previousLayoutInfo.rect.height;
212
- isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutInfo.estimatedSize;
237
+ isEstimated = width !== previousLayoutInfo.rect.width || curNode !== lastNode || previousLayoutInfo.estimatedSize;
213
238
  } else {
214
239
  rectHeight = node.rendered ? this.estimatedHeadingHeight : 0;
215
240
  isEstimated = true;
216
241
  }
217
242
  }
218
243
  if (rectHeight == null) rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
219
- let headerRect = new (0, $img26$Rect)(0, y, width, rectHeight);
244
+ let headerRect = new (0, $img26$Rect)(x, y, width - x, rectHeight);
220
245
  let header = new (0, $img26$LayoutInfo)('header', node.key, headerRect);
221
246
  header.estimatedSize = isEstimated;
222
247
  return {
@@ -227,7 +252,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
227
252
  };
228
253
  }
229
254
  buildItem(node, x, y) {
230
- let width = this.virtualizer.visibleRect.width;
255
+ let width = this.virtualizer.visibleRect.width - this.padding - x;
231
256
  let rectHeight = this.rowHeight;
232
257
  let isEstimated = false;
233
258
  // If no explicit height is available, use an estimated height.
@@ -238,14 +263,14 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
238
263
  let previousLayoutNode = this.layoutNodes.get(node.key);
239
264
  if (previousLayoutNode) {
240
265
  rectHeight = previousLayoutNode.layoutInfo.rect.height;
241
- isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;
266
+ isEstimated = width !== previousLayoutNode.layoutInfo.rect.width || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;
242
267
  } else {
243
268
  rectHeight = this.estimatedRowHeight;
244
269
  isEstimated = true;
245
270
  }
246
271
  }
247
272
  if (rectHeight == null) rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
248
- let rect = new (0, $img26$Rect)(x, y, width - x, rectHeight);
273
+ let rect = new (0, $img26$Rect)(x, y, width, rectHeight);
249
274
  let layoutInfo = new (0, $img26$LayoutInfo)(node.type, node.key, rect);
250
275
  layoutInfo.estimatedSize = isEstimated;
251
276
  return {
@@ -356,9 +381,10 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
356
381
  var _options_loaderHeight;
357
382
  this.loaderHeight = (_options_loaderHeight = options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : null;
358
383
  this.dropIndicatorThickness = options.dropIndicatorThickness || 2;
384
+ this.gap = options.gap || 0;
385
+ this.padding = options.padding || 0;
359
386
  this.layoutNodes = new Map();
360
387
  this.rootNodes = [];
361
- this.lastWidth = 0;
362
388
  this.lastCollection = null;
363
389
  this.invalidateEverything = false;
364
390
  this.validRect = new (0, $img26$Rect)();
@@ -29,7 +29,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
29
29
  // (only if height > 1 for getDropTargetFromPoint)
30
30
  if (rect.height > 1) {
31
31
  var _this_rowHeight, _ref;
32
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
32
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
33
33
  rect.y = Math.floor(rect.y / rowHeight) * rowHeight;
34
34
  rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;
35
35
  }
@@ -75,7 +75,13 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
75
75
  shouldInvalidateEverything(invalidationContext) {
76
76
  // Invalidate cache if the size of the collection changed.
77
77
  // In this case, we need to recalculate the entire layout.
78
- return invalidationContext.sizeChanged || false;
78
+ // Also invalidate if fixed sizes/gaps change.
79
+ let options = invalidationContext.layoutOptions;
80
+ var _options_rowHeight, _options_headingHeight, _options_loaderHeight, _options_gap, _options_padding;
81
+ return invalidationContext.sizeChanged || this.rowHeight !== ((_options_rowHeight = options === null || options === void 0 ? void 0 : options.rowHeight) !== null && _options_rowHeight !== void 0 ? _options_rowHeight : this.rowHeight) || this.headingHeight !== ((_options_headingHeight = options === null || options === void 0 ? void 0 : options.headingHeight) !== null && _options_headingHeight !== void 0 ? _options_headingHeight : this.headingHeight) || this.loaderHeight !== ((_options_loaderHeight = options === null || options === void 0 ? void 0 : options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : this.loaderHeight) || this.gap !== ((_options_gap = options === null || options === void 0 ? void 0 : options.gap) !== null && _options_gap !== void 0 ? _options_gap : this.gap) || this.padding !== ((_options_padding = options === null || options === void 0 ? void 0 : options.padding) !== null && _options_padding !== void 0 ? _options_padding : this.padding);
82
+ }
83
+ shouldInvalidateLayoutOptions(newOptions, oldOptions) {
84
+ return newOptions.rowHeight !== oldOptions.rowHeight || newOptions.estimatedRowHeight !== oldOptions.estimatedRowHeight || newOptions.headingHeight !== oldOptions.headingHeight || newOptions.estimatedHeadingHeight !== oldOptions.estimatedHeadingHeight || newOptions.loaderHeight !== oldOptions.loaderHeight || newOptions.dropIndicatorThickness !== oldOptions.dropIndicatorThickness || newOptions.gap !== oldOptions.gap || newOptions.padding !== oldOptions.padding;
79
85
  }
80
86
  update(invalidationContext) {
81
87
  let collection = this.virtualizer.collection;
@@ -86,6 +92,23 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
86
92
  this.requestedRect = this.virtualizer.visibleRect.copy();
87
93
  this.layoutNodes.clear();
88
94
  }
95
+ let options = invalidationContext.layoutOptions;
96
+ var _options_rowHeight;
97
+ this.rowHeight = (_options_rowHeight = options === null || options === void 0 ? void 0 : options.rowHeight) !== null && _options_rowHeight !== void 0 ? _options_rowHeight : this.rowHeight;
98
+ var _options_estimatedRowHeight;
99
+ this.estimatedRowHeight = (_options_estimatedRowHeight = options === null || options === void 0 ? void 0 : options.estimatedRowHeight) !== null && _options_estimatedRowHeight !== void 0 ? _options_estimatedRowHeight : this.estimatedRowHeight;
100
+ var _options_headingHeight;
101
+ this.headingHeight = (_options_headingHeight = options === null || options === void 0 ? void 0 : options.headingHeight) !== null && _options_headingHeight !== void 0 ? _options_headingHeight : this.headingHeight;
102
+ var _options_estimatedHeadingHeight;
103
+ this.estimatedHeadingHeight = (_options_estimatedHeadingHeight = options === null || options === void 0 ? void 0 : options.estimatedHeadingHeight) !== null && _options_estimatedHeadingHeight !== void 0 ? _options_estimatedHeadingHeight : this.estimatedHeadingHeight;
104
+ var _options_loaderHeight;
105
+ this.loaderHeight = (_options_loaderHeight = options === null || options === void 0 ? void 0 : options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : this.loaderHeight;
106
+ var _options_dropIndicatorThickness;
107
+ this.dropIndicatorThickness = (_options_dropIndicatorThickness = options === null || options === void 0 ? void 0 : options.dropIndicatorThickness) !== null && _options_dropIndicatorThickness !== void 0 ? _options_dropIndicatorThickness : this.dropIndicatorThickness;
108
+ var _options_gap;
109
+ this.gap = (_options_gap = options === null || options === void 0 ? void 0 : options.gap) !== null && _options_gap !== void 0 ? _options_gap : this.gap;
110
+ var _options_padding;
111
+ this.padding = (_options_padding = options === null || options === void 0 ? void 0 : options.padding) !== null && _options_padding !== void 0 ? _options_padding : this.padding;
89
112
  this.rootNodes = this.buildCollection();
90
113
  // Remove deleted layout nodes
91
114
  if (this.lastCollection && collection !== this.lastCollection) {
@@ -94,32 +117,33 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
94
117
  if (layoutNode) this.layoutNodes.delete(key);
95
118
  }
96
119
  }
97
- this.lastWidth = this.virtualizer.visibleRect.width;
98
120
  this.lastCollection = collection;
99
121
  this.invalidateEverything = false;
100
122
  this.validRect = this.requestedRect.copy();
101
123
  }
102
- buildCollection(y = 0) {
124
+ buildCollection(y = this.padding) {
103
125
  let collection = this.virtualizer.collection;
104
126
  let skipped = 0;
105
127
  let nodes = [];
106
128
  for (let node of collection){
107
129
  var _this_rowHeight, _ref;
108
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
130
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
109
131
  // Skip rows before the valid rectangle unless they are already cached.
110
132
  if (node.type === 'item' && y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {
111
133
  y += rowHeight;
112
134
  skipped++;
113
135
  continue;
114
136
  }
115
- let layoutNode = this.buildChild(node, 0, y, null);
116
- y = layoutNode.layoutInfo.rect.maxY;
137
+ let layoutNode = this.buildChild(node, this.padding, y, null);
138
+ y = layoutNode.layoutInfo.rect.maxY + this.gap;
117
139
  nodes.push(layoutNode);
118
140
  if (node.type === 'item' && y > this.requestedRect.maxY) {
119
141
  y += (collection.size - (nodes.length + skipped)) * rowHeight;
120
142
  break;
121
143
  }
122
144
  }
145
+ y -= this.gap;
146
+ y += this.padding;
123
147
  this.contentSize = new (0, $img26$Size)(this.virtualizer.visibleRect.width, y);
124
148
  return nodes;
125
149
  }
@@ -149,9 +173,9 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
149
173
  }
150
174
  }
151
175
  buildLoader(node, x, y) {
152
- let rect = new (0, $img26$Rect)(x, y, 0, 0);
176
+ let rect = new (0, $img26$Rect)(x, y, this.padding, 0);
153
177
  let layoutInfo = new (0, $img26$LayoutInfo)('loader', node.key, rect);
154
- rect.width = this.virtualizer.contentSize.width;
178
+ rect.width = this.virtualizer.contentSize.width - this.padding - x;
155
179
  rect.height = this.loaderHeight || this.rowHeight || this.estimatedRowHeight || $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
156
180
  return {
157
181
  layoutInfo: layoutInfo,
@@ -160,15 +184,15 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
160
184
  }
161
185
  buildSection(node, x, y) {
162
186
  let collection = this.virtualizer.collection;
163
- let width = this.virtualizer.visibleRect.width;
164
- let rect = new (0, $img26$Rect)(0, y, width, 0);
187
+ let width = this.virtualizer.visibleRect.width - this.padding;
188
+ let rect = new (0, $img26$Rect)(x, y, width - x, 0);
165
189
  let layoutInfo = new (0, $img26$LayoutInfo)(node.type, node.key, rect);
166
190
  let startY = y;
167
191
  let skipped = 0;
168
192
  let children = [];
169
193
  for (let child of (0, $img26$getChildNodes)(node, collection)){
170
194
  var _this_rowHeight, _ref;
171
- let rowHeight = (_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
195
+ let rowHeight = ((_ref = (_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) !== null && _ref !== void 0 ? _ref : $61ef60fc9b1041f4$var$DEFAULT_HEIGHT) + this.gap;
172
196
  // Skip rows before the valid rectangle unless they are already cached.
173
197
  if (y + rowHeight < this.requestedRect.y && !this.isValid(node, y)) {
174
198
  y += rowHeight;
@@ -176,7 +200,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
176
200
  continue;
177
201
  }
178
202
  let layoutNode = this.buildChild(child, x, y, layoutInfo.key);
179
- y = layoutNode.layoutInfo.rect.maxY;
203
+ y = layoutNode.layoutInfo.rect.maxY + this.gap;
180
204
  children.push(layoutNode);
181
205
  if (y > this.requestedRect.maxY) {
182
206
  // Estimate the remaining height for rows that we don't need to layout right now.
@@ -186,6 +210,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
186
210
  break;
187
211
  }
188
212
  }
213
+ y -= this.gap;
189
214
  rect.height = y - startY;
190
215
  return {
191
216
  layoutInfo: layoutInfo,
@@ -195,7 +220,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
195
220
  };
196
221
  }
197
222
  buildSectionHeader(node, x, y) {
198
- let width = this.virtualizer.visibleRect.width;
223
+ let width = this.virtualizer.visibleRect.width - this.padding;
199
224
  let rectHeight = this.headingHeight;
200
225
  let isEstimated = false;
201
226
  // If no explicit height is available, use an estimated height.
@@ -209,14 +234,14 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
209
234
  let curNode = this.virtualizer.collection.getItem(node.key);
210
235
  let lastNode = this.lastCollection ? this.lastCollection.getItem(node.key) : null;
211
236
  rectHeight = previousLayoutInfo.rect.height;
212
- isEstimated = width !== this.lastWidth || curNode !== lastNode || previousLayoutInfo.estimatedSize;
237
+ isEstimated = width !== previousLayoutInfo.rect.width || curNode !== lastNode || previousLayoutInfo.estimatedSize;
213
238
  } else {
214
239
  rectHeight = node.rendered ? this.estimatedHeadingHeight : 0;
215
240
  isEstimated = true;
216
241
  }
217
242
  }
218
243
  if (rectHeight == null) rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
219
- let headerRect = new (0, $img26$Rect)(0, y, width, rectHeight);
244
+ let headerRect = new (0, $img26$Rect)(x, y, width - x, rectHeight);
220
245
  let header = new (0, $img26$LayoutInfo)('header', node.key, headerRect);
221
246
  header.estimatedSize = isEstimated;
222
247
  return {
@@ -227,7 +252,7 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
227
252
  };
228
253
  }
229
254
  buildItem(node, x, y) {
230
- let width = this.virtualizer.visibleRect.width;
255
+ let width = this.virtualizer.visibleRect.width - this.padding - x;
231
256
  let rectHeight = this.rowHeight;
232
257
  let isEstimated = false;
233
258
  // If no explicit height is available, use an estimated height.
@@ -238,14 +263,14 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
238
263
  let previousLayoutNode = this.layoutNodes.get(node.key);
239
264
  if (previousLayoutNode) {
240
265
  rectHeight = previousLayoutNode.layoutInfo.rect.height;
241
- isEstimated = width !== this.lastWidth || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;
266
+ isEstimated = width !== previousLayoutNode.layoutInfo.rect.width || node !== previousLayoutNode.node || previousLayoutNode.layoutInfo.estimatedSize;
242
267
  } else {
243
268
  rectHeight = this.estimatedRowHeight;
244
269
  isEstimated = true;
245
270
  }
246
271
  }
247
272
  if (rectHeight == null) rectHeight = $61ef60fc9b1041f4$var$DEFAULT_HEIGHT;
248
- let rect = new (0, $img26$Rect)(x, y, width - x, rectHeight);
273
+ let rect = new (0, $img26$Rect)(x, y, width, rectHeight);
249
274
  let layoutInfo = new (0, $img26$LayoutInfo)(node.type, node.key, rect);
250
275
  layoutInfo.estimatedSize = isEstimated;
251
276
  return {
@@ -356,9 +381,10 @@ class $61ef60fc9b1041f4$export$cacbb3924155d68e extends (0, $img26$Layout) {
356
381
  var _options_loaderHeight;
357
382
  this.loaderHeight = (_options_loaderHeight = options.loaderHeight) !== null && _options_loaderHeight !== void 0 ? _options_loaderHeight : null;
358
383
  this.dropIndicatorThickness = options.dropIndicatorThickness || 2;
384
+ this.gap = options.gap || 0;
385
+ this.padding = options.padding || 0;
359
386
  this.layoutNodes = new Map();
360
387
  this.rootNodes = [];
361
- this.lastWidth = 0;
362
388
  this.lastCollection = null;
363
389
  this.invalidateEverything = false;
364
390
  this.validRect = new (0, $img26$Rect)();