@react-stately/layout 3.13.10-nightly.4673 → 3.13.10-nightly.4681

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;;;AAeM,MAAM,kDAAuB,CAAA,GAAA,oCAAS;IA4BjC,2BAA2B,mBAAwC,EAAW;QACtF,0CAA0C;QAC1C,OAAO,KAAK,CAAC,2BAA2B,wBACtC,CAAC,IAAI,CAAC,cAAc,IACpB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,IACrE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAC/B,EAAE,GAAG,KAAK,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAC5C,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,IAC5D,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,IAClE,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ;IAGxE;IAEA,qBAA0B;YACjB;QAAP,QAAO,sBAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,eAAtC,0CAAA,oBAAyC,IAAI,CAAC,IAAI;IAC3D;IAEA,eAAe,GAAQ,EAAU;YACxB;QAAP,OAAO,CAAA,oCAAA,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,kBAAjC,+CAAA,oCAAyC;IAClD;IAEA,kBAAkB,GAAQ,EAAU;QAClC,IAAI,SAAS,IAAI,CAAC,UAAU,CAAC,OAAO,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CAAC,cAAc;QACxC,IAAI,CAAC,YAAY,GAAG,QAAQ,YAAY;QACxC,IAAI,CAAC,mBAAmB,oBAAoB,GAAG,IAAI,CAAC,YAAY,CAAC,yCAAyC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO;QAClI,IAAI,CAAC,iBAAiB,GAAG;QACzB,IAAI,CAAC,mBAAmB,GAAG;QAC3B,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,4BAA4B,CAAC;IAC3E;AAqlBF","sources":["packages/@react-stately/layout/src/TableLayout.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 {ColumnSize, TableCollection} from '@react-types/table';\nimport {DropTarget, Key} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {LayoutNode, ListLayout, ListLayoutOptions} from './ListLayout';\nimport {TableColumnLayout} from '@react-stately/table';\n\ntype TableLayoutOptions<T> = ListLayoutOptions<T> & {\n columnLayout: TableColumnLayout<T>,\n initialCollection: TableCollection<T>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number> = new Map();\n stickyColumnIndices: number[];\n wasLoading = false;\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n private disableSticky: boolean;\n columnLayout: TableColumnLayout<T>;\n controlledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledColumns: Map<Key, GridNode<unknown>>;\n uncontrolledWidths: Map<Key, ColumnSize>;\n resizingColumn: Key | null;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.collection = options.initialCollection;\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n this.columnLayout = options.columnLayout;\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);\n }\n\n protected shouldInvalidateEverything(invalidationContext: InvalidationContext): boolean {\n // If columns changed, clear layout cache.\n return super.shouldInvalidateEverything(invalidationContext) || (\n !this.lastCollection ||\n this.collection.columns.length !== this.lastCollection.columns.length ||\n this.collection.columns.some((c, i) =>\n c.key !== this.lastCollection.columns[i].key ||\n c.props.width !== this.lastCollection.columns[i].props.width ||\n c.props.minWidth !== this.lastCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth\n )\n );\n }\n\n getResizerPosition(): Key {\n return this.getLayoutInfo(this.resizingColumn)?.rect.maxX;\n }\n\n getColumnWidth(key: Key): number {\n return this.columnLayout.getColumnWidth(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMinWidth(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n let column = this.collection.columns.find(col => col.key === key);\n if (!column) {\n return 0;\n }\n return this.columnLayout.getColumnMaxWidth(key);\n }\n\n // outside, where this is called, should call props.onColumnResizeStart...\n startResize(key: Key): void {\n this.resizingColumn = key;\n }\n\n // only way to call props.onColumnResize with the new size outside of Layout is to send the result back\n updateResizedColumns(key: Key, width: number): Map<Key, ColumnSize> {\n let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n this.uncontrolledWidths = map;\n // invalidate still uses setState, should happen at the same time the parent\n // component's state is processed as a result of props.onColumnResize\n if (this.uncontrolledWidths.size > 0) {\n this.virtualizer.invalidate({sizeChanged: true});\n }\n return newSizes;\n }\n\n endResize(): void {\n this.resizingColumn = null;\n }\n\n buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.wasLoading = this.isLoading;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);\n this.controlledColumns = controlledColumns;\n this.uncontrolledColumns = uncontrolledColumns;\n let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);\n\n this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);\n\n let header = this.buildHeader();\n let body = this.buildBody(0);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n buildHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', 'header', rect);\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y);\n layoutNode.layoutInfo.parentKey = 'header';\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set('header', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = columns.length;\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', 'body', rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let [i, node] of [...this.collection].entries()) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y);\n layoutNode.layoutInfo.parentKey = 'body';\n layoutNode.index = i;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = 'body';\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = 'body';\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set('body', layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let [i, child] of [...getChildNodes(node, this.collection)].entries()) {\n if (child.type === 'cell') {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = i;\n children.push(layoutNode);\n }\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get('header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\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) + 1; // +1 for border\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 if (!this.validRect.containsRect(rect) && this.lastCollection) {\n this.lastValidRect = this.validRect;\n this.validRect = this.validRect.union(rect);\n this.rootNodes = this.buildCollection();\n }\n\n let res: LayoutInfo[] = [];\n\n this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX <= point.x) || (axis === 'y' && item.layoutInfo.rect.maxY <= point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = this.layoutNodes.get(layoutInfo.key).index;\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\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"],"names":[],"version":3,"file":"TableLayout.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,MAAM,kDAAuB,CAAA,GAAA,oCAAS;IAkBnC,eAAe,aAAiC,EAAE,aAAwC,EAAE;QAClG,OAAO,CAAC,iBACN,cAAc,OAAO,KAAK,cAAc,OAAO,IAC/C,cAAc,OAAO,CAAC,MAAM,KAAK,cAAc,OAAO,CAAC,MAAM,IAC7D,cAAc,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAC7B,EAAE,GAAG,KAAK,cAAc,OAAO,CAAC,EAAE,CAAC,GAAG,IACtC,EAAE,KAAK,CAAC,KAAK,KAAK,cAAc,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,IACtD,EAAE,KAAK,CAAC,QAAQ,KAAK,cAAc,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,IAC5D,EAAE,KAAK,CAAC,QAAQ,KAAK,cAAc,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ;IAElE;IAEA,SAAS,mBAA0D,EAAQ;YAKrE;QAJJ,IAAI,gBAAgB,IAAI,CAAC,WAAW,CAAC,UAAU;QAE/C,iEAAiE;QACjE,gDAAgD;QAChD,KAAI,qCAAA,oBAAoB,aAAa,cAAjC,yDAAA,mCAAmC,YAAY,EACjD;YAAA,IAAI,oBAAoB,aAAa,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY,EAAE;gBACxE,IAAI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AAG,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAQ,IACjF,OAAO,YAAY,GAAG;aACjB,IAAI,KAAK,KAAK,IAAI,GAAG,MAAM,kBAAkB;YAAC,GAAG,MAAM;YAAE,cAAc;QAAO,IACnF,OAAO,YAAY,GAAG;QAGxB,OAAO;IACT;IArjBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAPR,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAMzC,IAAI,CAAC,eAAe,GAAG,QAAQ,eAAe,IAAI;QAClD,IAAI,CAAC,mBAAmB,GAAG,EAAE;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc;IAC1C;AAijBF","sources":["packages/@react-stately/layout/src/TableLayout.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 {DropTarget, Key} from '@react-types/shared';\nimport {getChildNodes} from '@react-stately/collections';\nimport {GridNode} from '@react-types/grid';\nimport {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';\nimport {LayoutNode, ListLayout, ListLayoutOptions, ListLayoutProps} from './ListLayout';\nimport {TableCollection} from '@react-types/table';\nimport {TableColumnLayout} from '@react-stately/table';\n\nexport interface TableLayoutOptions<T> extends ListLayoutOptions<T> {\n scrollContainer?: 'table' | 'body'\n}\n\nexport interface TableLayoutProps extends ListLayoutProps {\n columnWidths?: Map<Key, number>\n}\n\nexport class TableLayout<T> extends ListLayout<T> {\n collection: TableCollection<T>;\n lastCollection: TableCollection<T>;\n columnWidths: Map<Key, number>;\n stickyColumnIndices: number[];\n isLoading = false;\n lastPersistedKeys: Set<Key> = null;\n persistedIndices: Map<Key, number[]> = new Map();\n scrollContainer: 'table' | 'body';\n private disableSticky: boolean;\n\n constructor(options: TableLayoutOptions<T>) {\n super(options);\n this.scrollContainer = options.scrollContainer || 'table';\n this.stickyColumnIndices = [];\n this.disableSticky = this.checkChrome105();\n }\n\n private columnsChanged(newCollection: TableCollection<T>, oldCollection: TableCollection<T> | null) {\n return !oldCollection || \n newCollection.columns !== oldCollection.columns &&\n newCollection.columns.length !== oldCollection.columns.length ||\n newCollection.columns.some((c, i) =>\n c.key !== oldCollection.columns[i].key ||\n c.props.width !== oldCollection.columns[i].props.width ||\n c.props.minWidth !== oldCollection.columns[i].props.minWidth ||\n c.props.maxWidth !== oldCollection.columns[i].props.maxWidth\n );\n }\n\n validate(invalidationContext: InvalidationContext<TableLayoutProps>): void {\n let newCollection = this.virtualizer.collection as TableCollection<T>;\n\n // If columnWidths were provided via layoutOptions, update those.\n // Otherwise, calculate column widths ourselves.\n if (invalidationContext.layoutOptions?.columnWidths) {\n if (invalidationContext.layoutOptions.columnWidths !== this.columnWidths) {\n this.columnWidths = invalidationContext.layoutOptions.columnWidths;\n invalidationContext.sizeChanged = true;\n }\n } else if (invalidationContext.sizeChanged || this.columnsChanged(newCollection, this.collection)) {\n let columnLayout = new TableColumnLayout({});\n this.columnWidths = columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, newCollection, new Map());\n invalidationContext.sizeChanged = true;\n }\n\n super.validate(invalidationContext);\n }\n\n protected buildCollection(): LayoutNode[] {\n // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.\n let loadingState = this.collection.body.props.loadingState;\n this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';\n this.stickyColumnIndices = [];\n\n for (let column of this.collection.columns) {\n // The selection cell and any other sticky columns always need to be visible.\n // In addition, row headers need to be in the DOM for accessibility labeling.\n if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) {\n this.stickyColumnIndices.push(column.index);\n }\n }\n\n let header = this.buildColumnHeader();\n let body = this.buildBody(this.scrollContainer === 'body' ? 0 : header.layoutInfo.rect.height);\n this.lastPersistedKeys = null;\n\n body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);\n this.contentSize = new Size(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);\n return [\n header,\n body\n ];\n }\n\n private buildColumnHeader(): LayoutNode {\n let rect = new Rect(0, 0, 0, 0);\n let layoutInfo = new LayoutInfo('header', this.collection.head?.key ?? 'header', rect);\n layoutInfo.isSticky = true;\n layoutInfo.zIndex = 1;\n\n let y = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let headerRow of this.collection.headerRows) {\n let layoutNode = this.buildChild(headerRow, 0, y, layoutInfo.key);\n layoutNode.layoutInfo.parentKey = layoutInfo.key;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n layoutNode.index = children.length;\n children.push(layoutNode);\n }\n\n rect.width = width;\n rect.height = y;\n\n this.layoutInfos.set(layoutInfo.key, layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect\n };\n }\n\n private buildHeaderRow(headerRow: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let row = new LayoutInfo('headerrow', headerRow.key, rect);\n\n let height = 0;\n let columns: LayoutNode[] = [];\n for (let cell of getChildNodes(headerRow, this.collection)) {\n let layoutNode = this.buildChild(cell, x, y, row.key);\n layoutNode.layoutInfo.parentKey = row.key;\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = columns.length;\n columns.push(layoutNode);\n }\n for (let [i, layout] of columns.entries()) {\n layout.layoutInfo.zIndex = columns.length - i + 1;\n }\n\n this.setChildHeights(columns, height);\n\n rect.height = height;\n rect.width = x;\n\n return {\n layoutInfo: row,\n children: columns,\n validRect: rect\n };\n }\n\n private setChildHeights(children: LayoutNode[], height: number) {\n for (let child of children) {\n if (child.layoutInfo.rect.height !== height) {\n // Need to copy the layout info before we mutate it.\n child.layoutInfo = child.layoutInfo.copy();\n this.layoutInfos.set(child.layoutInfo.key, child.layoutInfo);\n\n child.layoutInfo.rect.height = height;\n }\n }\n }\n\n // used to get the column widths when rendering to the DOM\n private getRenderedColumnWidth(node: GridNode<T>) {\n let colspan = node.colspan ?? 1;\n let colIndex = node.colIndex ?? node.index;\n let width = 0;\n for (let i = colIndex; i < colIndex + colspan; i++) {\n let column = this.collection.columns[i];\n if (column?.key != null) {\n width += this.columnWidths.get(column.key);\n }\n }\n\n return width;\n }\n\n private getEstimatedHeight(node: GridNode<T>, width: number, height: number, estimatedHeight: number) {\n let isEstimated = false;\n\n // If no explicit height is available, use an estimated height.\n if (height == null) {\n // If a previous version of this layout info exists, reuse its height.\n // Mark as estimated if the size of the overall collection view changed,\n // or the content of the item changed.\n let previousLayoutNode = this.layoutNodes.get(node.key);\n if (previousLayoutNode) {\n height = previousLayoutNode.layoutInfo.rect.height;\n isEstimated = node !== previousLayoutNode.node || width !== previousLayoutNode.layoutInfo.rect.width || previousLayoutNode.layoutInfo.estimatedSize;\n } else {\n height = estimatedHeight;\n isEstimated = true;\n }\n }\n\n return {height, isEstimated};\n }\n\n private buildColumn(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.headingHeight, this.estimatedHeadingHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n layoutInfo.allowOverflow = true;\n\n return {\n layoutInfo,\n validRect: layoutInfo.rect\n };\n }\n\n private buildBody(y: number): LayoutNode {\n let rect = new Rect(0, y, 0, 0);\n let layoutInfo = new LayoutInfo('rowgroup', this.collection.body.key, rect);\n\n let startY = y;\n let skipped = 0;\n let width = 0;\n let children: LayoutNode[] = [];\n for (let [i, node] of [...getChildNodes(this.collection.body, this.collection)].entries()) {\n let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1;\n\n // Skip rows before the valid rectangle unless they are already cached.\n if (y + rowHeight < this.validRect.y && !this.isValid(node, y)) {\n y += rowHeight;\n skipped++;\n continue;\n }\n\n let layoutNode = this.buildChild(node, 0, y, layoutInfo.key);\n layoutNode.layoutInfo.parentKey = layoutInfo.key;\n layoutNode.index = i;\n y = layoutNode.layoutInfo.rect.maxY;\n width = Math.max(width, layoutNode.layoutInfo.rect.width);\n children.push(layoutNode);\n\n if (y > this.validRect.maxY) {\n // Estimate the remaining height for rows that we don't need to layout right now.\n y += (this.collection.size - (skipped + children.length)) * rowHeight;\n break;\n }\n }\n\n if (this.isLoading) {\n // Add some margin around the loader to ensure that scrollbars don't flicker in and out.\n let rect = new Rect(40, Math.max(y, 40), (width || this.virtualizer.visibleRect.width) - 80, children.length === 0 ? this.virtualizer.visibleRect.height - 80 : 60);\n let loader = new LayoutInfo('loader', 'loader', rect);\n loader.parentKey = layoutInfo.key;\n loader.isSticky = !this.disableSticky && children.length === 0;\n this.layoutInfos.set('loader', loader);\n children.push({layoutInfo: loader, validRect: loader.rect});\n y = loader.rect.maxY;\n width = Math.max(width, rect.width);\n } else if (children.length === 0) {\n if (this.enableEmptyState) {\n let rect = new Rect(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);\n let empty = new LayoutInfo('empty', 'empty', rect);\n empty.parentKey = layoutInfo.key;\n empty.isSticky = !this.disableSticky;\n this.layoutInfos.set('empty', empty);\n children.push({layoutInfo: empty, validRect: empty.rect});\n y = empty.rect.maxY;\n width = Math.max(width, rect.width);\n } else {\n y = this.virtualizer.visibleRect.maxY;\n }\n }\n\n rect.width = width;\n rect.height = y - startY;\n\n this.layoutInfos.set(layoutInfo.key, layoutInfo);\n\n return {\n layoutInfo,\n children,\n validRect: layoutInfo.rect.intersection(this.validRect)\n };\n }\n\n protected buildNode(node: GridNode<T>, x: number, y: number): LayoutNode {\n switch (node.type) {\n case 'headerrow':\n return this.buildHeaderRow(node, x, y);\n case 'item':\n return this.buildRow(node, x, y);\n case 'column':\n case 'placeholder':\n return this.buildColumn(node, x, y);\n case 'cell':\n return this.buildCell(node, x, y);\n default:\n throw new Error('Unknown node type ' + node.type);\n }\n }\n\n private buildRow(node: GridNode<T>, x: number, y: number): LayoutNode {\n let rect = new Rect(x, y, 0, 0);\n let layoutInfo = new LayoutInfo('row', node.key, rect);\n\n let children: LayoutNode[] = [];\n let height = 0;\n for (let [i, child] of [...getChildNodes(node, this.collection)].entries()) {\n if (child.type === 'cell') {\n if (x > this.validRect.maxX) {\n // Adjust existing cached layoutInfo to ensure that it is out of view.\n // This can happen due to column resizing.\n let layoutNode = this.layoutNodes.get(child.key);\n if (layoutNode) {\n layoutNode.layoutInfo.rect.x = x;\n x += layoutNode.layoutInfo.rect.width;\n }\n } else {\n let layoutNode = this.buildChild(child, x, y, layoutInfo.key);\n x = layoutNode.layoutInfo.rect.maxX;\n height = Math.max(height, layoutNode.layoutInfo.rect.height);\n layoutNode.index = i;\n children.push(layoutNode);\n }\n }\n }\n\n this.setChildHeights(children, height);\n\n rect.width = this.layoutInfos.get(this.collection.head?.key ?? 'header').rect.width;\n rect.height = height + 1; // +1 for bottom border\n\n return {\n layoutInfo,\n children,\n validRect: rect.intersection(this.validRect)\n };\n }\n\n private buildCell(node: GridNode<T>, x: number, y: number): LayoutNode {\n let width = this.getRenderedColumnWidth(node);\n let {height, isEstimated} = this.getEstimatedHeight(node, width, this.rowHeight, this.estimatedRowHeight);\n let rect = new Rect(x, y, width, height);\n let layoutInfo = new LayoutInfo(node.type, node.key, rect);\n layoutInfo.isSticky = !this.disableSticky && (node.props?.isDragButtonCell || node.props?.isSelectionCell);\n layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;\n layoutInfo.estimatedSize = isEstimated;\n\n return {\n layoutInfo,\n validRect: rect\n };\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) + 1; // +1 for border\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 this.buildPersistedIndices();\n for (let node of this.rootNodes) {\n res.push(node.layoutInfo);\n this.addVisibleLayoutInfos(res, node, rect);\n }\n\n return res;\n }\n\n private addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect) {\n if (!node.children || node.children.length === 0) {\n return;\n }\n\n switch (node.layoutInfo.type) {\n case 'header': {\n for (let child of node.children) {\n res.push(child.layoutInfo);\n this.addVisibleLayoutInfos(res, child, rect);\n }\n break;\n }\n case 'rowgroup': {\n let firstVisibleRow = this.binarySearch(node.children, rect.topLeft, 'y');\n let lastVisibleRow = this.binarySearch(node.children, rect.bottomRight, 'y');\n\n // Add persisted rows before the visible rows.\n let persistedRowIndices = this.persistedIndices.get(node.layoutInfo.key);\n let persistIndex = 0;\n while (\n persistedRowIndices &&\n persistIndex < persistedRowIndices.length &&\n persistedRowIndices[persistIndex] < firstVisibleRow\n ) {\n let idx = persistedRowIndices[persistIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n persistIndex++;\n }\n\n for (let i = firstVisibleRow; i <= lastVisibleRow; i++) {\n // Skip persisted rows that overlap with visible cells.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length && persistedRowIndices[persistIndex] < i) {\n persistIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[i], rect);\n }\n\n // Add persisted rows after the visible rows.\n while (persistedRowIndices && persistIndex < persistedRowIndices.length) {\n let idx = persistedRowIndices[persistIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n this.addVisibleLayoutInfos(res, node.children[idx], rect);\n }\n }\n break;\n }\n case 'headerrow':\n case 'row': {\n let firstVisibleCell = this.binarySearch(node.children, rect.topLeft, 'x');\n let lastVisibleCell = this.binarySearch(node.children, rect.topRight, 'x');\n let stickyIndex = 0;\n\n // Add persisted/sticky cells before the visible cells.\n let persistedCellIndices = this.persistedIndices.get(node.layoutInfo.key) || this.stickyColumnIndices;\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < firstVisibleCell) {\n let idx = persistedCellIndices[stickyIndex];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n stickyIndex++;\n }\n\n for (let i = firstVisibleCell; i <= lastVisibleCell; i++) {\n // Skip sticky cells that overlap with visible cells.\n while (stickyIndex < persistedCellIndices.length && persistedCellIndices[stickyIndex] < i) {\n stickyIndex++;\n }\n\n res.push(node.children[i].layoutInfo);\n }\n\n // Add any remaining sticky cells after the visible cells.\n while (stickyIndex < persistedCellIndices.length) {\n let idx = persistedCellIndices[stickyIndex++];\n if (idx < node.children.length) {\n res.push(node.children[idx].layoutInfo);\n }\n }\n break;\n }\n default:\n throw new Error('Unknown node type ' + node.layoutInfo.type);\n }\n }\n\n private binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y') {\n let low = 0;\n let high = items.length - 1;\n while (low <= high) {\n let mid = (low + high) >> 1;\n let item = items[mid];\n\n if ((axis === 'x' && item.layoutInfo.rect.maxX <= point.x) || (axis === 'y' && item.layoutInfo.rect.maxY <= point.y)) {\n low = mid + 1;\n } else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n\n return Math.max(0, Math.min(items.length - 1, low));\n }\n\n private buildPersistedIndices() {\n if (this.virtualizer.persistedKeys === this.lastPersistedKeys) {\n return;\n }\n\n this.lastPersistedKeys = this.virtualizer.persistedKeys;\n this.persistedIndices.clear();\n\n // Build a map of parentKey => indices of children to persist.\n for (let key of this.virtualizer.persistedKeys) {\n let layoutInfo = this.layoutInfos.get(key);\n\n // Walk up ancestors so parents are also persisted if children are.\n while (layoutInfo && layoutInfo.parentKey) {\n let collectionNode = this.collection.getItem(layoutInfo.key);\n let indices = this.persistedIndices.get(layoutInfo.parentKey);\n if (!indices) {\n // stickyColumnIndices are always persisted along with any cells from persistedKeys.\n indices = collectionNode?.type === 'cell' || collectionNode?.type === 'column' ? [...this.stickyColumnIndices] : [];\n this.persistedIndices.set(layoutInfo.parentKey, indices);\n }\n\n let index = this.layoutNodes.get(layoutInfo.key).index;\n\n if (!indices.includes(index)) {\n indices.push(index);\n }\n\n layoutInfo = this.layoutInfos.get(layoutInfo.parentKey);\n }\n }\n\n for (let indices of this.persistedIndices.values()) {\n indices.sort((a, b) => a - b);\n }\n }\n\n // Checks if Chrome version is 105 or greater\n private checkChrome105() {\n if (typeof window === 'undefined' || window.navigator == null) {\n return false;\n }\n\n let isChrome105;\n if (window.navigator['userAgentData']) {\n isChrome105 = window.navigator['userAgentData']?.brands.some(b => b.brand === 'Chromium' && Number(b.version) === 105);\n } else {\n let regex = /Chrome\\/(\\d+)/;\n let matches = regex.exec(window.navigator.userAgent);\n isChrome105 = matches && matches.length >= 2 && Number(matches[1]) === 105;\n }\n\n return isChrome105;\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n x += this.virtualizer.visibleRect.x;\n y += this.virtualizer.visibleRect.y;\n\n // Offset for height of header row\n y -= this.virtualizer.layout.getVisibleLayoutInfos(new Rect(x, y, 1, 1)).find(info => info.type === 'headerrow')?.rect.height;\n\n // Custom variation of this.virtualizer.keyAtPoint that ignores body\n let key: Key;\n let point = new Point(x, y);\n let rectAtPoint = new Rect(point.x, point.y, 1, 1);\n let layoutInfos = this.virtualizer.layout.getVisibleLayoutInfos(rectAtPoint).filter(info => info.type === 'row');\n\n // Layout may return multiple layout infos in the case of\n // persisted keys, so find the first one that actually intersects.\n for (let layoutInfo of layoutInfos) {\n if (layoutInfo.rect.intersects(rectAtPoint)) {\n key = layoutInfo.key;\n }\n }\n\n if (key == null || this.collection.size === 0) {\n return {type: 'root'};\n }\n\n let layoutInfo = this.getLayoutInfo(key);\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"],"names":[],"version":3,"file":"TableLayout.main.js.map"}
@@ -1,6 +1,7 @@
1
1
  import {ListLayout as $61ef60fc9b1041f4$export$cacbb3924155d68e} from "./ListLayout.mjs";
2
2
  import {getChildNodes as $bmsJv$getChildNodes} from "@react-stately/collections";
3
3
  import {Size as $bmsJv$Size, Rect as $bmsJv$Rect, LayoutInfo as $bmsJv$LayoutInfo, Point as $bmsJv$Point} from "@react-stately/virtualizer";
4
+ import {TableColumnLayout as $bmsJv$TableColumnLayout} from "@react-stately/table";
4
5
 
5
6
  /*
6
7
  * Copyright 2020 Adobe. All rights reserved.
@@ -15,72 +16,38 @@ import {Size as $bmsJv$Size, Rect as $bmsJv$Rect, LayoutInfo as $bmsJv$LayoutInf
15
16
  */
16
17
 
17
18
 
19
+
18
20
  class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$export$cacbb3924155d68e) {
19
- shouldInvalidateEverything(invalidationContext) {
20
- // If columns changed, clear layout cache.
21
- return super.shouldInvalidateEverything(invalidationContext) || !this.lastCollection || this.collection.columns.length !== this.lastCollection.columns.length || this.collection.columns.some((c, i)=>c.key !== this.lastCollection.columns[i].key || c.props.width !== this.lastCollection.columns[i].props.width || c.props.minWidth !== this.lastCollection.columns[i].props.minWidth || c.props.maxWidth !== this.lastCollection.columns[i].props.maxWidth);
22
- }
23
- getResizerPosition() {
24
- var _this_getLayoutInfo;
25
- return (_this_getLayoutInfo = this.getLayoutInfo(this.resizingColumn)) === null || _this_getLayoutInfo === void 0 ? void 0 : _this_getLayoutInfo.rect.maxX;
26
- }
27
- getColumnWidth(key) {
28
- var _this_columnLayout_getColumnWidth;
29
- return (_this_columnLayout_getColumnWidth = this.columnLayout.getColumnWidth(key)) !== null && _this_columnLayout_getColumnWidth !== void 0 ? _this_columnLayout_getColumnWidth : 0;
30
- }
31
- getColumnMinWidth(key) {
32
- let column = this.collection.columns.find((col)=>col.key === key);
33
- if (!column) return 0;
34
- return this.columnLayout.getColumnMinWidth(key);
35
- }
36
- getColumnMaxWidth(key) {
37
- let column = this.collection.columns.find((col)=>col.key === key);
38
- if (!column) return 0;
39
- return this.columnLayout.getColumnMaxWidth(key);
40
- }
41
- // outside, where this is called, should call props.onColumnResizeStart...
42
- startResize(key) {
43
- this.resizingColumn = key;
44
- }
45
- // only way to call props.onColumnResize with the new size outside of Layout is to send the result back
46
- updateResizedColumns(key, width) {
47
- let newControlled = new Map(Array.from(this.controlledColumns).map(([key, entry])=>[
48
- key,
49
- entry.props.width
50
- ]));
51
- let newSizes = this.columnLayout.resizeColumnWidth(this.virtualizer.visibleRect.width, this.collection, newControlled, this.uncontrolledWidths, key, width);
52
- let map = new Map(Array.from(this.uncontrolledColumns).map(([key])=>[
53
- key,
54
- newSizes.get(key)
55
- ]));
56
- map.set(key, width);
57
- this.uncontrolledWidths = map;
58
- // invalidate still uses setState, should happen at the same time the parent
59
- // component's state is processed as a result of props.onColumnResize
60
- if (this.uncontrolledWidths.size > 0) this.virtualizer.invalidate({
61
- sizeChanged: true
62
- });
63
- return newSizes;
21
+ columnsChanged(newCollection, oldCollection) {
22
+ return !oldCollection || newCollection.columns !== oldCollection.columns && newCollection.columns.length !== oldCollection.columns.length || newCollection.columns.some((c, i)=>c.key !== oldCollection.columns[i].key || c.props.width !== oldCollection.columns[i].props.width || c.props.minWidth !== oldCollection.columns[i].props.minWidth || c.props.maxWidth !== oldCollection.columns[i].props.maxWidth);
64
23
  }
65
- endResize() {
66
- this.resizingColumn = null;
24
+ validate(invalidationContext) {
25
+ var _invalidationContext_layoutOptions;
26
+ let newCollection = this.virtualizer.collection;
27
+ // If columnWidths were provided via layoutOptions, update those.
28
+ // Otherwise, calculate column widths ourselves.
29
+ if ((_invalidationContext_layoutOptions = invalidationContext.layoutOptions) === null || _invalidationContext_layoutOptions === void 0 ? void 0 : _invalidationContext_layoutOptions.columnWidths) {
30
+ if (invalidationContext.layoutOptions.columnWidths !== this.columnWidths) {
31
+ this.columnWidths = invalidationContext.layoutOptions.columnWidths;
32
+ invalidationContext.sizeChanged = true;
33
+ }
34
+ } else if (invalidationContext.sizeChanged || this.columnsChanged(newCollection, this.collection)) {
35
+ let columnLayout = new (0, $bmsJv$TableColumnLayout)({});
36
+ this.columnWidths = columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, newCollection, new Map());
37
+ invalidationContext.sizeChanged = true;
38
+ }
39
+ super.validate(invalidationContext);
67
40
  }
68
41
  buildCollection() {
69
42
  // Track whether we were previously loading. This is used to adjust the animations of async loading vs inserts.
70
43
  let loadingState = this.collection.body.props.loadingState;
71
- this.wasLoading = this.isLoading;
72
44
  this.isLoading = loadingState === 'loading' || loadingState === 'loadingMore';
73
45
  this.stickyColumnIndices = [];
74
46
  for (let column of this.collection.columns)// The selection cell and any other sticky columns always need to be visible.
75
47
  // In addition, row headers need to be in the DOM for accessibility labeling.
76
48
  if (column.props.isDragButtonCell || column.props.isSelectionCell || this.collection.rowHeaderColumnKeys.has(column.key)) this.stickyColumnIndices.push(column.index);
77
- let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);
78
- this.controlledColumns = controlledColumns;
79
- this.uncontrolledColumns = uncontrolledColumns;
80
- let colWidths = this.columnLayout.recombineColumns(this.collection.columns, this.uncontrolledWidths, uncontrolledColumns, controlledColumns);
81
- this.columnWidths = this.columnLayout.buildColumnWidths(this.virtualizer.visibleRect.width, this.collection, colWidths);
82
- let header = this.buildHeader();
83
- let body = this.buildBody(0);
49
+ let header = this.buildColumnHeader();
50
+ let body = this.buildBody(this.scrollContainer === 'body' ? 0 : header.layoutInfo.rect.height);
84
51
  this.lastPersistedKeys = null;
85
52
  body.layoutInfo.rect.width = Math.max(header.layoutInfo.rect.width, body.layoutInfo.rect.width);
86
53
  this.contentSize = new (0, $bmsJv$Size)(body.layoutInfo.rect.width, body.layoutInfo.rect.maxY);
@@ -89,15 +56,19 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
89
56
  body
90
57
  ];
91
58
  }
92
- buildHeader() {
59
+ buildColumnHeader() {
60
+ var _this_collection_head;
93
61
  let rect = new (0, $bmsJv$Rect)(0, 0, 0, 0);
94
- let layoutInfo = new (0, $bmsJv$LayoutInfo)('header', 'header', rect);
62
+ var _this_collection_head_key;
63
+ let layoutInfo = new (0, $bmsJv$LayoutInfo)('header', (_this_collection_head_key = (_this_collection_head = this.collection.head) === null || _this_collection_head === void 0 ? void 0 : _this_collection_head.key) !== null && _this_collection_head_key !== void 0 ? _this_collection_head_key : 'header', rect);
64
+ layoutInfo.isSticky = true;
65
+ layoutInfo.zIndex = 1;
95
66
  let y = 0;
96
67
  let width = 0;
97
68
  let children = [];
98
69
  for (let headerRow of this.collection.headerRows){
99
- let layoutNode = this.buildChild(headerRow, 0, y);
100
- layoutNode.layoutInfo.parentKey = 'header';
70
+ let layoutNode = this.buildChild(headerRow, 0, y, layoutInfo.key);
71
+ layoutNode.layoutInfo.parentKey = layoutInfo.key;
101
72
  y = layoutNode.layoutInfo.rect.maxY;
102
73
  width = Math.max(width, layoutNode.layoutInfo.rect.width);
103
74
  layoutNode.index = children.length;
@@ -105,7 +76,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
105
76
  }
106
77
  rect.width = width;
107
78
  rect.height = y;
108
- this.layoutInfos.set('header', layoutInfo);
79
+ this.layoutInfos.set(layoutInfo.key, layoutInfo);
109
80
  return {
110
81
  layoutInfo: layoutInfo,
111
82
  children: children,
@@ -118,7 +89,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
118
89
  let height = 0;
119
90
  let columns = [];
120
91
  for (let cell of (0, $bmsJv$getChildNodes)(headerRow, this.collection)){
121
- let layoutNode = this.buildChild(cell, x, y);
92
+ let layoutNode = this.buildChild(cell, x, y, row.key);
122
93
  layoutNode.layoutInfo.parentKey = row.key;
123
94
  x = layoutNode.layoutInfo.rect.maxX;
124
95
  height = Math.max(height, layoutNode.layoutInfo.rect.height);
@@ -186,6 +157,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
186
157
  layoutInfo.isSticky = !this.disableSticky && (((_node_props = node.props) === null || _node_props === void 0 ? void 0 : _node_props.isDragButtonCell) || ((_node_props1 = node.props) === null || _node_props1 === void 0 ? void 0 : _node_props1.isSelectionCell));
187
158
  layoutInfo.zIndex = layoutInfo.isSticky ? 2 : 1;
188
159
  layoutInfo.estimatedSize = isEstimated;
160
+ layoutInfo.allowOverflow = true;
189
161
  return {
190
162
  layoutInfo: layoutInfo,
191
163
  validRect: layoutInfo.rect
@@ -193,13 +165,13 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
193
165
  }
194
166
  buildBody(y) {
195
167
  let rect = new (0, $bmsJv$Rect)(0, y, 0, 0);
196
- let layoutInfo = new (0, $bmsJv$LayoutInfo)('rowgroup', 'body', rect);
168
+ let layoutInfo = new (0, $bmsJv$LayoutInfo)('rowgroup', this.collection.body.key, rect);
197
169
  let startY = y;
198
170
  let skipped = 0;
199
171
  let width = 0;
200
172
  let children = [];
201
173
  for (let [i, node] of [
202
- ...this.collection
174
+ ...(0, $bmsJv$getChildNodes)(this.collection.body, this.collection)
203
175
  ].entries()){
204
176
  var _this_rowHeight;
205
177
  let rowHeight = ((_this_rowHeight = this.rowHeight) !== null && _this_rowHeight !== void 0 ? _this_rowHeight : this.estimatedRowHeight) + 1;
@@ -209,8 +181,8 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
209
181
  skipped++;
210
182
  continue;
211
183
  }
212
- let layoutNode = this.buildChild(node, 0, y);
213
- layoutNode.layoutInfo.parentKey = 'body';
184
+ let layoutNode = this.buildChild(node, 0, y, layoutInfo.key);
185
+ layoutNode.layoutInfo.parentKey = layoutInfo.key;
214
186
  layoutNode.index = i;
215
187
  y = layoutNode.layoutInfo.rect.maxY;
216
188
  width = Math.max(width, layoutNode.layoutInfo.rect.width);
@@ -225,7 +197,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
225
197
  // Add some margin around the loader to ensure that scrollbars don't flicker in and out.
226
198
  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);
227
199
  let loader = new (0, $bmsJv$LayoutInfo)('loader', 'loader', rect);
228
- loader.parentKey = 'body';
200
+ loader.parentKey = layoutInfo.key;
229
201
  loader.isSticky = !this.disableSticky && children.length === 0;
230
202
  this.layoutInfos.set('loader', loader);
231
203
  children.push({
@@ -235,21 +207,23 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
235
207
  y = loader.rect.maxY;
236
208
  width = Math.max(width, rect.width);
237
209
  } else if (children.length === 0) {
238
- let rect = new (0, $bmsJv$Rect)(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);
239
- let empty = new (0, $bmsJv$LayoutInfo)('empty', 'empty', rect);
240
- empty.parentKey = 'body';
241
- empty.isSticky = !this.disableSticky;
242
- this.layoutInfos.set('empty', empty);
243
- children.push({
244
- layoutInfo: empty,
245
- validRect: empty.rect
246
- });
247
- y = empty.rect.maxY;
248
- width = Math.max(width, rect.width);
210
+ if (this.enableEmptyState) {
211
+ let rect = new (0, $bmsJv$Rect)(40, Math.max(y, 40), this.virtualizer.visibleRect.width - 80, this.virtualizer.visibleRect.height - 80);
212
+ let empty = new (0, $bmsJv$LayoutInfo)('empty', 'empty', rect);
213
+ empty.parentKey = layoutInfo.key;
214
+ empty.isSticky = !this.disableSticky;
215
+ this.layoutInfos.set('empty', empty);
216
+ children.push({
217
+ layoutInfo: empty,
218
+ validRect: empty.rect
219
+ });
220
+ y = empty.rect.maxY;
221
+ width = Math.max(width, rect.width);
222
+ } else y = this.virtualizer.visibleRect.maxY;
249
223
  }
250
224
  rect.width = width;
251
225
  rect.height = y - startY;
252
- this.layoutInfos.set('body', layoutInfo);
226
+ this.layoutInfos.set(layoutInfo.key, layoutInfo);
253
227
  return {
254
228
  layoutInfo: layoutInfo,
255
229
  children: children,
@@ -272,6 +246,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
272
246
  }
273
247
  }
274
248
  buildRow(node, x, y) {
249
+ var _this_collection_head;
275
250
  let rect = new (0, $bmsJv$Rect)(x, y, 0, 0);
276
251
  let layoutInfo = new (0, $bmsJv$LayoutInfo)('row', node.key, rect);
277
252
  let children = [];
@@ -288,7 +263,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
288
263
  x += layoutNode.layoutInfo.rect.width;
289
264
  }
290
265
  } else {
291
- let layoutNode = this.buildChild(child, x, y);
266
+ let layoutNode = this.buildChild(child, x, y, layoutInfo.key);
292
267
  x = layoutNode.layoutInfo.rect.maxX;
293
268
  height = Math.max(height, layoutNode.layoutInfo.rect.height);
294
269
  layoutNode.index = i;
@@ -296,7 +271,8 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
296
271
  }
297
272
  }
298
273
  this.setChildHeights(children, height);
299
- rect.width = this.layoutInfos.get('header').rect.width;
274
+ var _this_collection_head_key;
275
+ rect.width = this.layoutInfos.get((_this_collection_head_key = (_this_collection_head = this.collection.head) === null || _this_collection_head === void 0 ? void 0 : _this_collection_head.key) !== null && _this_collection_head_key !== void 0 ? _this_collection_head_key : 'header').rect.width;
300
276
  rect.height = height + 1; // +1 for bottom border
301
277
  return {
302
278
  layoutInfo: layoutInfo,
@@ -329,11 +305,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
329
305
  }
330
306
  // If layout hasn't yet been done for the requested rect, union the
331
307
  // new rect with the existing valid rect, and recompute.
332
- if (!this.validRect.containsRect(rect) && this.lastCollection) {
333
- this.lastValidRect = this.validRect;
334
- this.validRect = this.validRect.union(rect);
335
- this.rootNodes = this.buildCollection();
336
- }
308
+ this.layoutIfNeeded(rect);
337
309
  let res = [];
338
310
  this.buildPersistedIndices();
339
311
  for (let node of this.rootNodes){
@@ -436,7 +408,7 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
436
408
  let indices = this.persistedIndices.get(layoutInfo.parentKey);
437
409
  if (!indices) {
438
410
  // stickyColumnIndices are always persisted along with any cells from persistedKeys.
439
- indices = collectionNode.type === 'cell' || collectionNode.type === 'column' ? [
411
+ indices = (collectionNode === null || collectionNode === void 0 ? void 0 : collectionNode.type) === 'cell' || (collectionNode === null || collectionNode === void 0 ? void 0 : collectionNode.type) === 'column' ? [
440
412
  ...this.stickyColumnIndices
441
413
  ] : [];
442
414
  this.persistedIndices.set(layoutInfo.parentKey, indices);
@@ -509,19 +481,12 @@ class $a152112e902709bf$export$62444c3c724b1b20 extends (0, $61ef60fc9b1041f4$ex
509
481
  }
510
482
  constructor(options){
511
483
  super(options);
512
- this.columnWidths = new Map();
513
- this.wasLoading = false;
514
484
  this.isLoading = false;
515
485
  this.lastPersistedKeys = null;
516
486
  this.persistedIndices = new Map();
517
- this.collection = options.initialCollection;
487
+ this.scrollContainer = options.scrollContainer || 'table';
518
488
  this.stickyColumnIndices = [];
519
489
  this.disableSticky = this.checkChrome105();
520
- this.columnLayout = options.columnLayout;
521
- let [controlledColumns, uncontrolledColumns] = this.columnLayout.splitColumnsIntoControlledAndUncontrolled(this.collection.columns);
522
- this.controlledColumns = controlledColumns;
523
- this.uncontrolledColumns = uncontrolledColumns;
524
- this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);
525
490
  }
526
491
  }
527
492