@react-stately/layout 3.13.10-nightly.4647 → 3.13.10-nightly.4654
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.
- package/dist/ListLayout.main.js +38 -28
- package/dist/ListLayout.main.js.map +1 -1
- package/dist/ListLayout.mjs +38 -28
- package/dist/ListLayout.module.js +38 -28
- package/dist/ListLayout.module.js.map +1 -1
- package/dist/TableLayout.main.js +15 -14
- package/dist/TableLayout.main.js.map +1 -1
- package/dist/TableLayout.mjs +15 -14
- package/dist/TableLayout.module.js +15 -14
- package/dist/TableLayout.module.js.map +1 -1
- package/dist/types.d.ts +9 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/ListLayout.ts +54 -35
- package/src/TableLayout.ts +14 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAeM,MAAM,kDAAuB,CAAA,GAAA,yCAAS;IA4BjC,2BAA2B,mBAA0D,EAAW;QACxG,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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AA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,UAAU,GAAG,QAAQ,iBAAiB;QAC3C,IAAI,CAAC,mBAAmB,GAAG,EAAE;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,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;AAwlBF","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, Node} 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<Node<T>, unknown>): 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 // relayoutNow 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.relayoutNow({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 // 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 }\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 getInitialLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getInitialLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\n }\n\n getFinalLayoutInfo(layoutInfo: LayoutInfo) {\n let res = super.getFinalLayoutInfo(layoutInfo);\n res.transform = null;\n return res;\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.module.js.map"}
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAeM,MAAM,kDAAuB,CAAA,GAAA,yCAAS;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;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c;QAAO,IACnF,OAAO,YAAY,GAAG;QAGxB,OAAO;IACT;IA9lBA,YAAY,OAA8B,CAAE;QAC1C,KAAK,CAAC;aAdR,eAAiC,IAAI;aAErC,aAAa;aACb,YAAY;aACZ,oBAA8B;aAC9B,mBAAuC,IAAI;QAUzC,IAAI,CAAC,UAAU,GAAG,QAAQ,iBAAiB;QAC3C,IAAI,CAAC,mBAAmB,GAAG,EAAE;QAC7B,IAAI,CAAC,aAAa,GAAG,IAAI,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.module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ export interface LayoutNode {
|
|
|
24
24
|
validRect: Rect;
|
|
25
25
|
index?: number;
|
|
26
26
|
}
|
|
27
|
+
interface ListLayoutProps {
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
}
|
|
27
30
|
/**
|
|
28
31
|
* The ListLayout class is an implementation of a collection view {@link Layout}
|
|
29
32
|
* it is used for creating lists and lists with indented sub-lists.
|
|
@@ -34,7 +37,7 @@ export interface LayoutNode {
|
|
|
34
37
|
* delegate with an additional method to do this (it uses the same delegate object as
|
|
35
38
|
* the collection view itself).
|
|
36
39
|
*/
|
|
37
|
-
export class ListLayout<T> extends Layout<Node<T
|
|
40
|
+
export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements KeyboardDelegate, DropTargetDelegate {
|
|
38
41
|
protected rowHeight: number;
|
|
39
42
|
protected estimatedRowHeight: number;
|
|
40
43
|
protected headingHeight: number;
|
|
@@ -64,9 +67,11 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
|
|
|
64
67
|
constructor(options?: ListLayoutOptions<T>);
|
|
65
68
|
getLayoutInfo(key: Key): LayoutInfo;
|
|
66
69
|
getVisibleLayoutInfos(rect: Rect): LayoutInfo[];
|
|
70
|
+
layoutIfNeeded(rect: Rect): void;
|
|
71
|
+
ensureLayoutInfo(key: Key): boolean;
|
|
67
72
|
isVisible(node: LayoutNode, rect: Rect): boolean;
|
|
68
|
-
protected shouldInvalidateEverything(invalidationContext: InvalidationContext<
|
|
69
|
-
validate(invalidationContext: InvalidationContext<
|
|
73
|
+
protected shouldInvalidateEverything(invalidationContext: InvalidationContext<ListLayoutProps>): boolean;
|
|
74
|
+
validate(invalidationContext: InvalidationContext<ListLayoutProps>): void;
|
|
70
75
|
buildCollection(): LayoutNode[];
|
|
71
76
|
isValid(node: Node<T>, y: number): boolean;
|
|
72
77
|
buildChild(node: Node<T>, x: number, y: number): LayoutNode;
|
|
@@ -84,8 +89,6 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
|
|
|
84
89
|
getFirstKey(): Key | null;
|
|
85
90
|
getLastKey(): Key | null;
|
|
86
91
|
getKeyForSearch(search: string, fromKey?: Key): Key | null;
|
|
87
|
-
getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
88
|
-
getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
89
92
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget;
|
|
90
93
|
}
|
|
91
94
|
type TableLayoutOptions<T> = ListLayoutOptions<T> & {
|
|
@@ -107,7 +110,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
107
110
|
uncontrolledWidths: Map<Key, ColumnSize>;
|
|
108
111
|
resizingColumn: Key | null;
|
|
109
112
|
constructor(options: TableLayoutOptions<T>);
|
|
110
|
-
protected shouldInvalidateEverything(invalidationContext: InvalidationContext
|
|
113
|
+
protected shouldInvalidateEverything(invalidationContext: InvalidationContext): boolean;
|
|
111
114
|
getResizerPosition(): Key;
|
|
112
115
|
getColumnWidth(key: Key): number;
|
|
113
116
|
getColumnMinWidth(key: Key): number;
|
|
@@ -133,8 +136,6 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
133
136
|
addVisibleLayoutInfos(res: LayoutInfo[], node: LayoutNode, rect: Rect): void;
|
|
134
137
|
binarySearch(items: LayoutNode[], point: Point, axis: 'x' | 'y'): number;
|
|
135
138
|
buildPersistedIndices(): void;
|
|
136
|
-
getInitialLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
137
|
-
getFinalLayoutInfo(layoutInfo: LayoutInfo): LayoutInfo;
|
|
138
139
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget;
|
|
139
140
|
}
|
|
140
141
|
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAgBA,8BAA8B,CAAC,IAAI;IACjC,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,WAAW,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IAC3E,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC;AAGF;IACE,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IACrB,UAAU,EAAE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,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;IAsC7D,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;IAe9D,qBAAqB,CAAC,IAAI,EAAE,IAAI;IA4BhC,qBAAqB,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI;IA4FrE,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,GAAG,GAAG;IAmB/D,qBAAqB;IAsDrB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,GAAG,UAAU;CAkD7G","sources":["packages/@react-stately/layout/src/packages/@react-stately/layout/src/ListLayout.ts","packages/@react-stately/layout/src/packages/@react-stately/layout/src/TableLayout.ts","packages/@react-stately/layout/src/packages/@react-stately/layout/src/index.ts","packages/@react-stately/layout/src/index.ts"],"sourcesContent":[null,null,null,"/*\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 */\nexport type {ListLayoutOptions, LayoutNode} from './ListLayout';\nexport {ListLayout} from './ListLayout';\nexport {TableLayout} from './TableLayout';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/layout",
|
|
3
|
-
"version": "3.13.10-nightly.
|
|
3
|
+
"version": "3.13.10-nightly.4654+8577c4d8b",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-stately/collections": "3.0.0-nightly.
|
|
26
|
-
"@react-stately/table": "3.11.9-nightly.
|
|
27
|
-
"@react-stately/virtualizer": "3.7.2-nightly.
|
|
28
|
-
"@react-types/grid": "3.2.7-nightly.
|
|
29
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
30
|
-
"@react-types/table": "3.9.6-nightly.
|
|
25
|
+
"@react-stately/collections": "3.0.0-nightly.2942+8577c4d8b",
|
|
26
|
+
"@react-stately/table": "3.11.9-nightly.4654+8577c4d8b",
|
|
27
|
+
"@react-stately/virtualizer": "3.7.2-nightly.4654+8577c4d8b",
|
|
28
|
+
"@react-types/grid": "3.2.7-nightly.4654+8577c4d8b",
|
|
29
|
+
"@react-types/shared": "3.0.0-nightly.2942+8577c4d8b",
|
|
30
|
+
"@react-types/table": "3.9.6-nightly.4654+8577c4d8b",
|
|
31
31
|
"@swc/helpers": "^0.5.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8577c4d8bed1f37db3c840f230e844fd877d084a"
|
|
40
40
|
}
|
package/src/ListLayout.ts
CHANGED
|
@@ -38,6 +38,10 @@ export interface LayoutNode {
|
|
|
38
38
|
index?: number
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
interface ListLayoutProps {
|
|
42
|
+
isLoading?: boolean
|
|
43
|
+
}
|
|
44
|
+
|
|
41
45
|
const DEFAULT_HEIGHT = 48;
|
|
42
46
|
|
|
43
47
|
/**
|
|
@@ -50,7 +54,7 @@ const DEFAULT_HEIGHT = 48;
|
|
|
50
54
|
* delegate with an additional method to do this (it uses the same delegate object as
|
|
51
55
|
* the collection view itself).
|
|
52
56
|
*/
|
|
53
|
-
export class ListLayout<T> extends Layout<Node<T
|
|
57
|
+
export class ListLayout<T> extends Layout<Node<T>, ListLayoutProps> implements KeyboardDelegate, DropTargetDelegate {
|
|
54
58
|
protected rowHeight: number;
|
|
55
59
|
protected estimatedRowHeight: number;
|
|
56
60
|
protected headingHeight: number;
|
|
@@ -101,30 +105,22 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
|
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
getLayoutInfo(key: Key) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// If the layout info wasn't found, it might be outside the bounds of the area that we've
|
|
107
|
-
// computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.
|
|
108
|
-
// Compute the full layout and try again.
|
|
109
|
-
if (!res && this.validRect.area < this.contentSize.area && this.lastCollection) {
|
|
110
|
-
this.lastValidRect = this.validRect;
|
|
111
|
-
this.validRect = new Rect(0, 0, Infinity, Infinity);
|
|
112
|
-
this.rootNodes = this.buildCollection();
|
|
113
|
-
this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);
|
|
114
|
-
res = this.layoutInfos.get(key);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return res!;
|
|
108
|
+
this.ensureLayoutInfo(key);
|
|
109
|
+
return this.layoutInfos.get(key)!;
|
|
118
110
|
}
|
|
119
111
|
|
|
120
112
|
getVisibleLayoutInfos(rect: Rect) {
|
|
113
|
+
// Adjust rect to keep number of visible rows consistent.
|
|
114
|
+
// (only if height > 1 for getDropTargetFromPoint)
|
|
115
|
+
if (rect.height > 1) {
|
|
116
|
+
let rowHeight = (this.rowHeight ?? this.estimatedRowHeight);
|
|
117
|
+
rect.y = Math.floor(rect.y / rowHeight) * rowHeight;
|
|
118
|
+
rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
121
|
// If layout hasn't yet been done for the requested rect, union the
|
|
122
122
|
// new rect with the existing valid rect, and recompute.
|
|
123
|
-
|
|
124
|
-
this.lastValidRect = this.validRect;
|
|
125
|
-
this.validRect = this.validRect.union(rect);
|
|
126
|
-
this.rootNodes = this.buildCollection();
|
|
127
|
-
}
|
|
123
|
+
this.layoutIfNeeded(rect);
|
|
128
124
|
|
|
129
125
|
let res: LayoutInfo[] = [];
|
|
130
126
|
|
|
@@ -147,25 +143,60 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
|
|
|
147
143
|
return res;
|
|
148
144
|
}
|
|
149
145
|
|
|
146
|
+
layoutIfNeeded(rect: Rect) {
|
|
147
|
+
if (!this.lastCollection) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!this.validRect.containsRect(rect)) {
|
|
152
|
+
this.lastValidRect = this.validRect;
|
|
153
|
+
this.validRect = this.validRect.union(rect);
|
|
154
|
+
this.rootNodes = this.buildCollection();
|
|
155
|
+
} else {
|
|
156
|
+
// Ensure all of the persisted keys are available.
|
|
157
|
+
for (let key of this.virtualizer.persistedKeys) {
|
|
158
|
+
if (this.ensureLayoutInfo(key)) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
ensureLayoutInfo(key: Key) {
|
|
166
|
+
// If the layout info wasn't found, it might be outside the bounds of the area that we've
|
|
167
|
+
// computed layout for so far. This can happen when accessing a random key, e.g pressing Home/End.
|
|
168
|
+
// Compute the full layout and try again.
|
|
169
|
+
if (!this.layoutInfos.has(key) && this.validRect.area < this.contentSize.area && this.lastCollection) {
|
|
170
|
+
this.lastValidRect = this.validRect;
|
|
171
|
+
this.validRect = new Rect(0, 0, Infinity, Infinity);
|
|
172
|
+
this.rootNodes = this.buildCollection();
|
|
173
|
+
this.validRect = new Rect(0, 0, this.contentSize.width, this.contentSize.height);
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
|
|
150
180
|
isVisible(node: LayoutNode, rect: Rect) {
|
|
151
181
|
return node.layoutInfo.rect.intersects(rect) || node.layoutInfo.isSticky || this.virtualizer.isPersistedKey(node.layoutInfo.key);
|
|
152
182
|
}
|
|
153
183
|
|
|
154
|
-
protected shouldInvalidateEverything(invalidationContext: InvalidationContext<
|
|
184
|
+
protected shouldInvalidateEverything(invalidationContext: InvalidationContext<ListLayoutProps>) {
|
|
155
185
|
// Invalidate cache if the size of the collection changed.
|
|
156
186
|
// In this case, we need to recalculate the entire layout.
|
|
157
187
|
return invalidationContext.sizeChanged;
|
|
158
188
|
}
|
|
159
189
|
|
|
160
|
-
validate(invalidationContext: InvalidationContext<
|
|
190
|
+
validate(invalidationContext: InvalidationContext<ListLayoutProps>) {
|
|
161
191
|
this.collection = this.virtualizer.collection;
|
|
192
|
+
this.isLoading = invalidationContext.layoutOptions?.isLoading || false;
|
|
162
193
|
|
|
163
194
|
// Reset valid rect if we will have to invalidate everything.
|
|
164
195
|
// Otherwise we can reuse cached layout infos outside the current visible rect.
|
|
165
196
|
this.invalidateEverything = this.shouldInvalidateEverything(invalidationContext);
|
|
166
197
|
if (this.invalidateEverything) {
|
|
167
198
|
this.lastValidRect = this.validRect;
|
|
168
|
-
this.validRect = this.virtualizer.
|
|
199
|
+
this.validRect = this.virtualizer.visibleRect.copy();
|
|
169
200
|
}
|
|
170
201
|
|
|
171
202
|
this.rootNodes = this.buildCollection();
|
|
@@ -558,18 +589,6 @@ export class ListLayout<T> extends Layout<Node<T>> implements KeyboardDelegate,
|
|
|
558
589
|
return null;
|
|
559
590
|
}
|
|
560
591
|
|
|
561
|
-
getInitialLayoutInfo(layoutInfo: LayoutInfo) {
|
|
562
|
-
layoutInfo.opacity = 0;
|
|
563
|
-
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
564
|
-
return layoutInfo;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
getFinalLayoutInfo(layoutInfo: LayoutInfo) {
|
|
568
|
-
layoutInfo.opacity = 0;
|
|
569
|
-
layoutInfo.transform = 'scale3d(0.8, 0.8, 0.8)';
|
|
570
|
-
return layoutInfo;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
592
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {
|
|
574
593
|
x += this.virtualizer.visibleRect.x;
|
|
575
594
|
y += this.virtualizer.visibleRect.y;
|
package/src/TableLayout.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import {ColumnSize, TableCollection} from '@react-types/table';
|
|
14
|
-
import {DropTarget, Key
|
|
14
|
+
import {DropTarget, Key} from '@react-types/shared';
|
|
15
15
|
import {getChildNodes} from '@react-stately/collections';
|
|
16
16
|
import {GridNode} from '@react-types/grid';
|
|
17
17
|
import {InvalidationContext, LayoutInfo, Point, Rect, Size} from '@react-stately/virtualizer';
|
|
@@ -51,7 +51,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
51
51
|
this.uncontrolledWidths = this.columnLayout.getInitialUncontrolledWidths(uncontrolledColumns);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
protected shouldInvalidateEverything(invalidationContext: InvalidationContext
|
|
54
|
+
protected shouldInvalidateEverything(invalidationContext: InvalidationContext): boolean {
|
|
55
55
|
// If columns changed, clear layout cache.
|
|
56
56
|
return super.shouldInvalidateEverything(invalidationContext) || (
|
|
57
57
|
!this.lastCollection ||
|
|
@@ -102,10 +102,10 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
102
102
|
let map = new Map(Array.from(this.uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));
|
|
103
103
|
map.set(key, width);
|
|
104
104
|
this.uncontrolledWidths = map;
|
|
105
|
-
//
|
|
105
|
+
// invalidate still uses setState, should happen at the same time the parent
|
|
106
106
|
// component's state is processed as a result of props.onColumnResize
|
|
107
107
|
if (this.uncontrolledWidths.size > 0) {
|
|
108
|
-
this.virtualizer.
|
|
108
|
+
this.virtualizer.invalidate({sizeChanged: true});
|
|
109
109
|
}
|
|
110
110
|
return newSizes;
|
|
111
111
|
}
|
|
@@ -404,6 +404,14 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
getVisibleLayoutInfos(rect: Rect) {
|
|
407
|
+
// Adjust rect to keep number of visible rows consistent.
|
|
408
|
+
// (only if height > 1 for getDropTargetFromPoint)
|
|
409
|
+
if (rect.height > 1) {
|
|
410
|
+
let rowHeight = (this.rowHeight ?? this.estimatedRowHeight) + 1; // +1 for border
|
|
411
|
+
rect.y = Math.floor(rect.y / rowHeight) * rowHeight;
|
|
412
|
+
rect.height = Math.ceil(rect.height / rowHeight) * rowHeight;
|
|
413
|
+
}
|
|
414
|
+
|
|
407
415
|
// If layout hasn't yet been done for the requested rect, union the
|
|
408
416
|
// new rect with the existing valid rect, and recompute.
|
|
409
417
|
if (!this.validRect.containsRect(rect) && this.lastCollection) {
|
|
@@ -471,6 +479,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
471
479
|
let idx = persistedRowIndices[persistIndex++];
|
|
472
480
|
if (idx < node.children.length) {
|
|
473
481
|
res.push(node.children[idx].layoutInfo);
|
|
482
|
+
this.addVisibleLayoutInfos(res, node.children[idx], rect);
|
|
474
483
|
}
|
|
475
484
|
}
|
|
476
485
|
break;
|
|
@@ -521,7 +530,7 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
521
530
|
let mid = (low + high) >> 1;
|
|
522
531
|
let item = items[mid];
|
|
523
532
|
|
|
524
|
-
if ((axis === 'x' && item.layoutInfo.rect.maxX
|
|
533
|
+
if ((axis === 'x' && item.layoutInfo.rect.maxX <= point.x) || (axis === 'y' && item.layoutInfo.rect.maxY <= point.y)) {
|
|
525
534
|
low = mid + 1;
|
|
526
535
|
} else if ((axis === 'x' && item.layoutInfo.rect.x > point.x) || (axis === 'y' && item.layoutInfo.rect.y > point.y)) {
|
|
527
536
|
high = mid - 1;
|
|
@@ -570,18 +579,6 @@ export class TableLayout<T> extends ListLayout<T> {
|
|
|
570
579
|
}
|
|
571
580
|
}
|
|
572
581
|
|
|
573
|
-
getInitialLayoutInfo(layoutInfo: LayoutInfo) {
|
|
574
|
-
let res = super.getInitialLayoutInfo(layoutInfo);
|
|
575
|
-
res.transform = null;
|
|
576
|
-
return res;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
getFinalLayoutInfo(layoutInfo: LayoutInfo) {
|
|
580
|
-
let res = super.getFinalLayoutInfo(layoutInfo);
|
|
581
|
-
res.transform = null;
|
|
582
|
-
return res;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
582
|
// Checks if Chrome version is 105 or greater
|
|
586
583
|
private checkChrome105() {
|
|
587
584
|
if (typeof window === 'undefined' || window.navigator == null) {
|