@react-stately/table 3.7.1-nightly.3679 → 3.7.1-nightly.3685

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/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED,AAIO,SAAS,0CAAS,KAAsB,EAAW;IACxD,OAAO,SAAS,IAAI,IAAK,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAI,AAAD;AACnG;AAEO,SAAS,0CAAoB,KAAa,EAAU;IACzD,IAAI,CAAC,OACH,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7D,IAAI,CAAC,OAAO;QACV,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,6GAA6G,CAAC,EACzI;QACF,OAAO;IACT,CAAC;IACD,OAAO,WAAW,KAAK,CAAC,EAAE;AAC5B;AAEO,SAAS,0CAAiB,KAAsB,EAAE,UAAkB,EAAU;IACnF,IAAI,OAAO,UAAU,UAAU;QAC7B,IAAI,QAAQ,MAAM,KAAK,CAAC;QACxB,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,sEAAsE;QAExF,OAAO,aAAc,CAAA,WAAW,KAAK,CAAC,EAAE,IAAI,GAAE;IAChD,CAAC;IACD,OAAO;AACT;AAGO,SAAS,0CAAY,QAAyB,EAAE,UAAkB,EAAU;IACjF,OAAO,YAAY,IAAI,GACnB,0CAAiB,UAAU,cAC3B,OAAO,gBAAgB;AAC7B;AAGO,SAAS,0CAAY,QAAyB,EAAE,UAAkB,EAAU;IACjF,OAAO,YAAY,IAAI,GACnB,0CAAiB,UAAU,cAC3B,CAAC;AACP;AAEA,qFAAqF;AACrF,SAAS,wCAAkB,cAA+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CAAC;QACH;QACA,kBAAiB,UAAuC,EAAE;YACxD,8CAA8C;YAC9C,OAAO,WAAW,OAAO,CAAC,MAAM,KAAK,QAAQ,OAAO,CAAC,MAAM,IACzD,WAAW,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,GAAG,KAAK,QAAQ,OAAO,CAAC,EAAE,CAAC,GAAG,KAClE,WAAW,uBAAuB,KAAK,QAAQ,uBAAuB,IACtE,WAAW,aAAa,KAAK,QAAQ,aAAa;QACtD;IACF;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAO;;;AClFX;;;;;;;;;;CAUC,GAED,AAIA,SAAS,2BAAK,KAAgB,EAAgB;IAC5C,OAAO,IAAI;AACb;AAEA,2BAAK,iBAAiB,GAAG,UAAU,kBAAqB,KAAgB,EAA6B;IACnG,IAAI,YAAC,SAAQ,EAAC,GAAG;IAEjB,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAE,AAAD,KAAM,KAAK,CAAC,aAAa,IAAI;IAC5G,MAAM;QACJ,MAAM;QACN,OAAO;QACP,UAAU;mBACV;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe,KAAK;IACtB;AACF;AAEA;;CAEC,GACD,oEAAoE;AACpE,IAAI,4CAAQ;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key, useCallback, useMemo, useState} from 'react';\nimport {TableColumnLayout} from './TableColumnLayout';\nimport {TableState} from './useTableState';\n\nexport interface TableColumnResizeStateProps<T> {\n /**\n * Current width of the table or table viewport that the columns\n * should be calculated against.\n **/\n tableWidth: number,\n /** A function that is called to find the default width for a given column. */\n getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined,\n /** A function that is called to find the default minWidth for a given column. */\n getDefaultMinWidth?: (node: GridNode<T>) => ColumnSize | null | undefined\n}\nexport interface TableColumnResizeState<T> {\n /**\n * Called to update the state that a resize event has occurred.\n * Returns the new widths for all columns based on the resized column.\n **/\n onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: (key: Key) => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Gets the current width for the specified column. */\n getColumnWidth: (key: Key) => number,\n /** Gets the current minWidth for the specified column. */\n getColumnMinWidth: (key: Key) => number,\n /** Gets the current maxWidth for the specified column. */\n getColumnMaxWidth: (key: Key) => number,\n /** Currently calculated widths for all columns. */\n widths: Map<Key, number>,\n /** Key of the currently resizing column. */\n resizingColumn: Key | null,\n /** A reference to the table state. */\n tableState: TableState<T>\n}\n\n/**\n * Provides column width state management for a table component with column resizing support. Handles building\n * a map of column widths calculated from the table's width and any provided column width information from the collection.\n * In addition, it tracks the currently resizing column and provides callbacks for updating the widths upon resize operations.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<T>, state: TableState<T>): TableColumnResizeState<T> {\n let {\n getDefaultWidth,\n getDefaultMinWidth,\n tableWidth = 0\n } = props;\n\n let [resizingColumn, setResizingColumn] = useState<Key | null>(null);\n let columnLayout = useMemo(\n () => new TableColumnLayout({\n getDefaultWidth,\n getDefaultMinWidth\n }),\n [getDefaultWidth, getDefaultMinWidth]\n );\n\n let [controlledColumns, uncontrolledColumns] = useMemo(() =>\n columnLayout.splitColumnsIntoControlledAndUncontrolled(state.collection.columns)\n , [state.collection.columns, columnLayout]);\n\n // uncontrolled column widths\n let [uncontrolledWidths, setUncontrolledWidths] = useState(() =>\n columnLayout.getInitialUncontrolledWidths(uncontrolledColumns)\n );\n // combine columns back into one map that maintains same order as the columns\n let colWidths = useMemo(() =>\n columnLayout.recombineColumns(state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns)\n , [state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns, columnLayout]);\n\n let onColumnResizeStart = useCallback((key: Key) => {\n setResizingColumn(key);\n }, [setResizingColumn]);\n\n let onColumnResize = useCallback((key: Key, width: number): Map<Key, ColumnSize> => {\n let newControlled = new Map(Array.from(controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = columnLayout.resizeColumnWidth(tableWidth, state.collection, newControlled, uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n setUncontrolledWidths(map);\n return newSizes;\n }, [controlledColumns, uncontrolledColumns, setUncontrolledWidths, tableWidth, columnLayout, state.collection, uncontrolledWidths]);\n\n let onColumnResizeEnd = useCallback(() => {\n setResizingColumn(null);\n }, [setResizingColumn]);\n\n let columnWidths = useMemo(() =>\n columnLayout.buildColumnWidths(tableWidth, state.collection, colWidths)\n , [tableWidth, state.collection, colWidths, columnLayout]);\n\n return useMemo(() => ({\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth: (key: Key) =>\n columnLayout.getColumnWidth(key),\n getColumnMinWidth: (key: Key) =>\n columnLayout.getColumnMinWidth(key),\n getColumnMaxWidth: (key: Key) =>\n columnLayout.getColumnMaxWidth(key),\n widths: columnWidths,\n tableState: state\n }), [\n columnLayout,\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n columnWidths,\n state\n ]);\n}\n","/*\n * Copyright 2022 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 {\n calculateColumnSizes,\n getMaxWidth,\n getMinWidth,\n isStatic,\n parseFractionalUnit\n} from './TableUtils';\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\nexport interface TableColumnLayoutOptions<T> {\n getDefaultWidth?: (column: GridNode<T>) => ColumnSize | null | undefined,\n getDefaultMinWidth?: (column: GridNode<T>) => ColumnSize | null | undefined\n}\n\nexport class TableColumnLayout<T> {\n getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n columnWidths: Map<Key, number> = new Map();\n columnMinWidths: Map<Key, number> = new Map();\n columnMaxWidths: Map<Key, number> = new Map();\n\n constructor(options: TableColumnLayoutOptions<T>) {\n this.getDefaultWidth = options?.getDefaultWidth ?? (() => '1fr');\n this.getDefaultMinWidth = options?.getDefaultMinWidth ?? (() => 0);\n }\n\n /** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */\n splitColumnsIntoControlledAndUncontrolled(columns: Array<GridNode<T>>): [Map<Key, GridNode<T>>, Map<Key, GridNode<T>>] {\n return columns.reduce((acc, col) => {\n if (col.props.width != null) {\n acc[0].set(col.key, col);\n } else {\n acc[1].set(col.key, col);\n }\n return acc;\n }, [new Map(), new Map()]);\n }\n\n /** Takes uncontrolled and controlled widths and joins them into a single Map. */\n recombineColumns(columns: Array<GridNode<T>>, uncontrolledWidths: Map<Key, ColumnSize>, uncontrolledColumns: Map<Key, GridNode<T>>, controlledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(columns.map(col => {\n if (uncontrolledColumns.has(col.key)) {\n return [col.key, uncontrolledWidths.get(col.key)];\n } else {\n return [col.key, controlledColumns.get(col.key).props.width];\n }\n }));\n }\n\n /** Used to make an initial Map of the uncontrolled widths based on default widths. */\n getInitialUncontrolledWidths(uncontrolledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(Array.from(uncontrolledColumns).map(([key, col]) =>\n [key, col.props.defaultWidth ?? this.getDefaultWidth?.(col) ?? '1fr']\n ));\n }\n\n getColumnWidth(key: Key): number {\n return this.columnWidths.get(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n return this.columnMinWidths.get(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n return this.columnMaxWidths.get(key);\n }\n\n resizeColumnWidth(tableWidth: number, collection: TableCollection<T>, controlledWidths: Map<Key, ColumnSize>, uncontrolledWidths: Map<Key, ColumnSize>, col = null, width: number): Map<Key, ColumnSize> {\n let prevColumnWidths = this.columnWidths;\n // resizing a column\n let resizeIndex = Infinity;\n let controlledArray = Array.from(controlledWidths);\n let uncontrolledArray = Array.from(uncontrolledWidths);\n let combinedArray = controlledArray.concat(uncontrolledArray);\n let resizingChanged = new Map<Key, ColumnSize>(combinedArray);\n let frKeys = new Map();\n let percentKeys = new Map();\n let frKeysToTheRight = new Map();\n let minWidths = new Map();\n // freeze columns to the left to their previous pixel value\n // at the same time count how many total FR's are in play and which of those FRs are\n // to the right or left of the resizing column\n collection.columns.forEach((column, i) => {\n let frKey;\n minWidths.set(column.key, this.getDefaultMinWidth(collection.columns[i]));\n if (col !== column.key && !column.column.props.width && !isStatic(uncontrolledWidths.get(column.key))) {\n // uncontrolled don't have props.width for us, so instead get from our state\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(uncontrolledWidths.get(column.key) as string));\n } else if (col !== column.key && !isStatic(column.column.props.width) && !uncontrolledWidths.get(column.key)) {\n // controlledWidths will be the same in the collection\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(column.column.props.width));\n } else if (col !== column.key && column.column.props.width?.endsWith?.('%')) {\n percentKeys.set(column.key, column.column.props.width);\n }\n // don't freeze columns to the right of the resizing one\n if (resizeIndex < i) {\n if (frKey) {\n frKeysToTheRight.set(frKey, frKeys.get(frKey));\n }\n return;\n }\n // we already know the new size of the resizing column\n if (column.key === col) {\n resizeIndex = i;\n return;\n }\n // freeze column to previous value\n resizingChanged.set(column.key, prevColumnWidths.get(column.key));\n });\n resizingChanged.set(col, Math.floor(width));\n\n // predict pixels sizes for all columns based on resize\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n resizingChanged,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // set all new column widths for onResize event\n // columns going in will be the same order as the columns coming out\n let newWidths = new Map<Key, ColumnSize>();\n // set all column widths based on calculateColumnSize\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n newWidths.set(key, width);\n });\n\n // add FR's back as they were to columns to the right\n Array.from(frKeys).forEach(([key]) => {\n if (frKeysToTheRight.has(key)) {\n newWidths.set(key, `${frKeysToTheRight.get(key)}fr`);\n }\n });\n\n // put back in percents\n Array.from(percentKeys).forEach(([key, width]) => {\n // resizing locks a column to a px width\n if (key === col) {\n return;\n }\n newWidths.set(key, width);\n });\n return newWidths;\n }\n\n buildColumnWidths(tableWidth: number, collection: TableCollection<T>, widths: Map<Key, ColumnSize>) {\n this.columnWidths = new Map();\n this.columnMinWidths = new Map();\n this.columnMaxWidths = new Map();\n\n // initial layout or table/window resizing\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n widths,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // columns going in will be the same order as the columns coming out\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n let column = collection.columns[index];\n this.columnWidths.set(key, width);\n this.columnMinWidths.set(key, getMinWidth(column.column.props.minWidth ?? this.getDefaultMinWidth(column), tableWidth));\n this.columnMaxWidths.set(key, getMaxWidth(column.column.props.maxWidth, tableWidth));\n });\n return this.columnWidths;\n }\n}\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {Key} from 'react';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width: number | string): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableWidth * (parseFloat(match[0]) / 100);\n }\n return width;\n}\n\n\nexport function getMaxWidth(maxWidth: number | string, tableWidth: number): number {\n return maxWidth != null\n ? parseStaticWidth(maxWidth, tableWidth)\n : Number.MAX_SAFE_INTEGER;\n}\n\n// cannot support FR units, we'd need to know everything else in the table to do that\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 0;\n}\n\n// tell us the delta between min width and target width vs max width and target width\nfunction mapDynamicColumns(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): (IndexedColumn & {delta: number})[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => column ? sum + parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) : sum,\n 0\n );\n\n let columns = dynamicColumns.map((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.column.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.column.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n delta\n };\n });\n\n return columns;\n}\n\n// mutates columns to set their width\nfunction findDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): void {\n let fractions = dynamicColumns.reduce(\n (sum, col) => col ? sum + col.width : sum,\n 0\n );\n\n dynamicColumns.forEach((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (column.width * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.column.minWidth, tableWidth),\n Math.min(Math.round(targetWidth), getMaxWidth(column.column.maxWidth, tableWidth))\n );\n availableSpace -= width;\n fractions -= column.width;\n column.width = width;\n });\n}\n\nexport function getDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n\n // sort is nlogn and copying is n, so copying and sorting is faster than sorting twice\n // sort by delta's to prioritize assigning width\n let sorted = [...columns].sort((a, b) => {\n if (a && b) {\n return b.delta - a.delta;\n }\n return a ? -1 : 1;\n });\n // this function mutates the column entries, so no need to have it return anything\n // plus we don't need to undo the sort since we already have the correct order\n findDynamicColumnWidths(sorted, availableSpace, tableWidth);\n\n return columns;\n}\n\n\nexport interface IColumn {\n minWidth?: number | string,\n maxWidth?: number | string,\n width?: number | string,\n defaultWidth?: number | string,\n key?: Key\n}\nexport interface IndexedColumn {\n column: IColumn,\n index: number,\n width: number,\n isDynamic?: boolean,\n delta?: number\n}\n\nexport function calculateColumnSizes(availableWidth: number, columns: IColumn[], changedColumns: Map<Key, ColumnSize>, getDefaultWidth, getDefaultMinWidth) {\n let remainingSpace = availableWidth;\n let {staticColumns, dynamicColumns} = columns.reduce((acc, column, index) => {\n let width = changedColumns.get(column.key) != null ? changedColumns.get(column.key) : column.width ?? column.defaultWidth ?? getDefaultWidth?.(index) ?? '1fr';\n let minWidth = column.minWidth ?? getDefaultMinWidth?.(index);\n column.minWidth = minWidth;\n\n if (isStatic(width)) {\n let w = parseStaticWidth(width, availableWidth);\n w = Math.max(\n getMinWidth(column.minWidth, availableWidth),\n Math.min(Math.floor(w), getMaxWidth(column.maxWidth, availableWidth)));\n acc.staticColumns.push({index, column, width: w} as IndexedColumn);\n acc.dynamicColumns.push(null);\n remainingSpace -= w;\n } else {\n let w = parseFractionalUnit(width);\n acc.staticColumns.push(null);\n acc.dynamicColumns.push({index, column, width: w} as IndexedColumn);\n }\n return acc;\n }, {staticColumns: [] as IndexedColumn[], dynamicColumns: [] as IndexedColumn[]});\n let newColWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, availableWidth);\n\n return staticColumns.map((col, i) => {\n if (col) {\n return col.width;\n }\n return newColWidths[i].width;\n });\n}\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo, useState} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,\n /** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n isKeyboardNavigationDisabled: boolean,\n /** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n setKeyboardNavigationDisabled: (val: boolean) => void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = useState(false);\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection, disabledBehavior: 'selection'});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,\n setKeyboardNavigationDisabled,\n sort(columnKey: Key, direction?: 'ascending' | 'descending') {\n props.onSortChange({\n column: columnKey,\n direction: direction ?? (props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending')\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns: GridNode<T>[][] = [];\n let seen = new Map();\n for (let column of columnNodes) {\n let parentKey = column.parentKey;\n let col = [column];\n\n while (parentKey) {\n let parent: GridNode<T> = keyMap.get(parentKey);\n\n // If we've already seen this parent, than it is shared\n // with a previous column. If the current column is taller\n // than the previous column, than we need to shift the parent\n // in the previous column so it's level with the current column.\n if (seen.has(parent)) {\n parent.colspan++;\n\n let {column, index} = seen.get(parent);\n if (index > col.length) {\n break;\n }\n\n for (let i = index; i < col.length; i++) {\n column.splice(i, 0, null);\n }\n\n // Adjust shifted indices\n for (let i = col.length; i < column.length; i++) {\n // eslint-disable-next-line max-depth\n if (column[i] && seen.has(column[i])) {\n seen.get(column[i]).index = i;\n }\n }\n } else {\n parent.colspan = 1;\n col.push(parent);\n seen.set(parent, {column: col, index: col.length - 1});\n }\n\n parentKey = parent.parentKey;\n }\n\n columns.push(col);\n column.index = columns.length - 1;\n }\n\n let maxLength = Math.max(...columns.map(c => c.length));\n let headerRows = Array(maxLength).fill(0).map(() => []);\n\n // Convert columns into rows.\n let colIndex = 0;\n for (let column of columns) {\n let i = maxLength - 1;\n for (let item of column) {\n if (item) {\n // Fill the space up until the current column with a placeholder\n let row = headerRows[i];\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < colIndex) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + item.key,\n colspan: colIndex - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null\n };\n\n // eslint-disable-next-line max-depth\n if (row.length > 0) {\n row[row.length - 1].nextKey = placeholder.key;\n placeholder.prevKey = row[row.length - 1].key;\n }\n\n row.push(placeholder);\n }\n\n if (row.length > 0) {\n row[row.length - 1].nextKey = item.key;\n item.prevKey = row[row.length - 1].key;\n }\n\n item.level = i;\n item.colIndex = colIndex;\n row.push(item);\n }\n\n i--;\n }\n\n colIndex++;\n }\n\n // Add placeholders at the end of each row that is shorter than the maximum\n let i = 0;\n for (let row of headerRows) {\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < columnNodes.length) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + row[row.length - 1].key,\n colspan: columnNodes.length - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null,\n prevKey: row[row.length - 1].key\n };\n\n row.push(placeholder);\n }\n\n i++;\n }\n\n return headerRows.map((childNodes, index) => {\n let row: GridNode<T> = {\n type: 'headerrow',\n key: 'headerrow-' + index,\n index,\n value: null,\n rendered: null,\n level: 0,\n hasChildNodes: true,\n childNodes,\n textValue: null\n };\n\n return row;\n });\n}\n\nexport class TableCollection<T> extends GridCollection<T> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n _size: number = 0;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\n // Add cell for selection checkboxes if needed.\n if (opts?.showSelectionCheckboxes) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n let rows = [];\n let columnKeyMap = new Map();\n let visit = (node: GridNode<T>) => {\n switch (node.type) {\n case 'body':\n body = node;\n break;\n case 'column':\n columnKeyMap.set(node.key, node);\n if (!node.hasChildNodes) {\n columns.push(node);\n\n if (node.props.isRowHeader) {\n rowHeaderColumnKeys.add(node.key);\n }\n }\n break;\n case 'item':\n rows.push(node);\n return; // do not go into childNodes\n }\n for (let child of node.childNodes) {\n visit(child);\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];\n headerRows.forEach((row, i) => rows.splice(i, 0, row));\n\n super({\n columnCount: columns.length,\n items: rows,\n visitNode: node => {\n node.column = columns[node.index];\n return node;\n }\n });\n this.columns = columns;\n this.rowHeaderColumnKeys = rowHeaderColumnKeys;\n this.body = body;\n this.headerRows = headerRows;\n this._size = [...body.childNodes].length;\n\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return this._size;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.prevKey : null;\n }\n\n getKeyAfter(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.nextKey : null;\n }\n\n getFirstKey() {\n return [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.key;\n }\n\n getItem(key: Key) {\n return this.keyMap.get(key);\n }\n\n at(idx: number) {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n}\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {ColumnProps} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nColumn.getCollectionNode = function* getCollectionNode<T>(props: ColumnProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>, void, GridNode<T>[]> {\n let {title, children, childColumns} = props;\n\n let rendered = title || children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];\n\n let fullNodes = yield {\n type: 'column',\n hasChildNodes: !!childColumns || (title && React.Children.count(children) > 0),\n rendered,\n textValue,\n props,\n *childNodes() {\n if (childColumns) {\n for (let child of childColumns) {\n yield {\n type: 'column',\n value: child\n };\n }\n } else if (title) {\n let childColumns: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n childColumns.push({\n type: 'column',\n element: child as ReactElement<ColumnProps<T>>\n });\n });\n\n yield* childColumns;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // This is a bit of a hack, but it works.\n // If this method is called, then there's a cached version of this node available.\n // But, we need to keep the list of columns in the new context up to date.\n updateContext(newContext);\n return false;\n }\n };\n\n let updateContext = (context: CollectionBuilderContext<T>) => {\n // register leaf columns on the context so that <Row> can access them\n for (let node of fullNodes) {\n if (!node.hasChildNodes) {\n context.columns.push(node);\n }\n }\n };\n\n updateContext(context);\n};\n\n/**\n * A Column represents a field of each item within a Table. Columns may also contain nested\n * Column elements to represent column groups. Nested columns can be statically defined as\n * children, or dynamically generated using a function based on the `childColumns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Column = Column as <T>(props: ColumnProps<T>) => JSX.Element;\nexport {_Column as Column};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED,AAIO,SAAS,0CAAS,KAAsB,EAAW;IACxD,OAAO,SAAS,IAAI,IAAK,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAI,AAAD;AACnG;AAEO,SAAS,0CAAoB,KAAa,EAAU;IACzD,IAAI,CAAC,OACH,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7D,IAAI,CAAC,OAAO;QACV,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,6GAA6G,CAAC,E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K,CAAC,aAAa,IAAI;IAC5G,MAAM;QACJ,MAAM;QACN,OAAO;QACP,UAAU;mBACV;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe,KAAK;IACtB;AACF;AAEA;;CAEC,GACD,oEAAoE;AACpE,IAAI,4CAAQ;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key, useCallback, useMemo, useState} from 'react';\nimport {TableColumnLayout} from './TableColumnLayout';\nimport {TableState} from './useTableState';\n\nexport interface TableColumnResizeStateProps<T> {\n /**\n * Current width of the table or table viewport that the columns\n * should be calculated against.\n */\n tableWidth: number,\n /** A function that is called to find the default width for a given column. */\n getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined,\n /** A function that is called to find the default minWidth for a given column. */\n getDefaultMinWidth?: (node: GridNode<T>) => ColumnSize | null | undefined\n}\nexport interface TableColumnResizeState<T> {\n /**\n * Called to update the state that a resize event has occurred.\n * Returns the new widths for all columns based on the resized column.\n */\n onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: (key: Key) => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Gets the current width for the specified column. */\n getColumnWidth: (key: Key) => number,\n /** Gets the current minWidth for the specified column. */\n getColumnMinWidth: (key: Key) => number,\n /** Gets the current maxWidth for the specified column. */\n getColumnMaxWidth: (key: Key) => number,\n /** Currently calculated widths for all columns. */\n widths: Map<Key, number>,\n /** Key of the currently resizing column. */\n resizingColumn: Key | null,\n /** A reference to the table state. */\n tableState: TableState<T>\n}\n\n/**\n * Provides column width state management for a table component with column resizing support. Handles building\n * a map of column widths calculated from the table's width and any provided column width information from the collection.\n * In addition, it tracks the currently resizing column and provides callbacks for updating the widths upon resize operations.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<T>, state: TableState<T>): TableColumnResizeState<T> {\n let {\n getDefaultWidth,\n getDefaultMinWidth,\n tableWidth = 0\n } = props;\n\n let [resizingColumn, setResizingColumn] = useState<Key | null>(null);\n let columnLayout = useMemo(\n () => new TableColumnLayout({\n getDefaultWidth,\n getDefaultMinWidth\n }),\n [getDefaultWidth, getDefaultMinWidth]\n );\n\n let [controlledColumns, uncontrolledColumns] = useMemo(() =>\n columnLayout.splitColumnsIntoControlledAndUncontrolled(state.collection.columns)\n , [state.collection.columns, columnLayout]);\n\n // uncontrolled column widths\n let [uncontrolledWidths, setUncontrolledWidths] = useState(() =>\n columnLayout.getInitialUncontrolledWidths(uncontrolledColumns)\n );\n // combine columns back into one map that maintains same order as the columns\n let colWidths = useMemo(() =>\n columnLayout.recombineColumns(state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns)\n , [state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns, columnLayout]);\n\n let onColumnResizeStart = useCallback((key: Key) => {\n setResizingColumn(key);\n }, [setResizingColumn]);\n\n let onColumnResize = useCallback((key: Key, width: number): Map<Key, ColumnSize> => {\n let newControlled = new Map(Array.from(controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = columnLayout.resizeColumnWidth(tableWidth, state.collection, newControlled, uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n setUncontrolledWidths(map);\n return newSizes;\n }, [controlledColumns, uncontrolledColumns, setUncontrolledWidths, tableWidth, columnLayout, state.collection, uncontrolledWidths]);\n\n let onColumnResizeEnd = useCallback(() => {\n setResizingColumn(null);\n }, [setResizingColumn]);\n\n let columnWidths = useMemo(() =>\n columnLayout.buildColumnWidths(tableWidth, state.collection, colWidths)\n , [tableWidth, state.collection, colWidths, columnLayout]);\n\n return useMemo(() => ({\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth: (key: Key) =>\n columnLayout.getColumnWidth(key),\n getColumnMinWidth: (key: Key) =>\n columnLayout.getColumnMinWidth(key),\n getColumnMaxWidth: (key: Key) =>\n columnLayout.getColumnMaxWidth(key),\n widths: columnWidths,\n tableState: state\n }), [\n columnLayout,\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n columnWidths,\n state\n ]);\n}\n","/*\n * Copyright 2022 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 {\n calculateColumnSizes,\n getMaxWidth,\n getMinWidth,\n isStatic,\n parseFractionalUnit\n} from './TableUtils';\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\nexport interface TableColumnLayoutOptions<T> {\n getDefaultWidth?: (column: GridNode<T>) => ColumnSize | null | undefined,\n getDefaultMinWidth?: (column: GridNode<T>) => ColumnSize | null | undefined\n}\n\nexport class TableColumnLayout<T> {\n getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n columnWidths: Map<Key, number> = new Map();\n columnMinWidths: Map<Key, number> = new Map();\n columnMaxWidths: Map<Key, number> = new Map();\n\n constructor(options: TableColumnLayoutOptions<T>) {\n this.getDefaultWidth = options?.getDefaultWidth ?? (() => '1fr');\n this.getDefaultMinWidth = options?.getDefaultMinWidth ?? (() => 0);\n }\n\n /** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */\n splitColumnsIntoControlledAndUncontrolled(columns: Array<GridNode<T>>): [Map<Key, GridNode<T>>, Map<Key, GridNode<T>>] {\n return columns.reduce((acc, col) => {\n if (col.props.width != null) {\n acc[0].set(col.key, col);\n } else {\n acc[1].set(col.key, col);\n }\n return acc;\n }, [new Map(), new Map()]);\n }\n\n /** Takes uncontrolled and controlled widths and joins them into a single Map. */\n recombineColumns(columns: Array<GridNode<T>>, uncontrolledWidths: Map<Key, ColumnSize>, uncontrolledColumns: Map<Key, GridNode<T>>, controlledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(columns.map(col => {\n if (uncontrolledColumns.has(col.key)) {\n return [col.key, uncontrolledWidths.get(col.key)];\n } else {\n return [col.key, controlledColumns.get(col.key).props.width];\n }\n }));\n }\n\n /** Used to make an initial Map of the uncontrolled widths based on default widths. */\n getInitialUncontrolledWidths(uncontrolledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(Array.from(uncontrolledColumns).map(([key, col]) =>\n [key, col.props.defaultWidth ?? this.getDefaultWidth?.(col) ?? '1fr']\n ));\n }\n\n getColumnWidth(key: Key): number {\n return this.columnWidths.get(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n return this.columnMinWidths.get(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n return this.columnMaxWidths.get(key);\n }\n\n resizeColumnWidth(tableWidth: number, collection: TableCollection<T>, controlledWidths: Map<Key, ColumnSize>, uncontrolledWidths: Map<Key, ColumnSize>, col = null, width: number): Map<Key, ColumnSize> {\n let prevColumnWidths = this.columnWidths;\n // resizing a column\n let resizeIndex = Infinity;\n let controlledArray = Array.from(controlledWidths);\n let uncontrolledArray = Array.from(uncontrolledWidths);\n let combinedArray = controlledArray.concat(uncontrolledArray);\n let resizingChanged = new Map<Key, ColumnSize>(combinedArray);\n let frKeys = new Map();\n let percentKeys = new Map();\n let frKeysToTheRight = new Map();\n let minWidths = new Map();\n // freeze columns to the left to their previous pixel value\n // at the same time count how many total FR's are in play and which of those FRs are\n // to the right or left of the resizing column\n collection.columns.forEach((column, i) => {\n let frKey;\n minWidths.set(column.key, this.getDefaultMinWidth(collection.columns[i]));\n if (col !== column.key && !column.column.props.width && !isStatic(uncontrolledWidths.get(column.key))) {\n // uncontrolled don't have props.width for us, so instead get from our state\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(uncontrolledWidths.get(column.key) as string));\n } else if (col !== column.key && !isStatic(column.column.props.width) && !uncontrolledWidths.get(column.key)) {\n // controlledWidths will be the same in the collection\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(column.column.props.width));\n } else if (col !== column.key && column.column.props.width?.endsWith?.('%')) {\n percentKeys.set(column.key, column.column.props.width);\n }\n // don't freeze columns to the right of the resizing one\n if (resizeIndex < i) {\n if (frKey) {\n frKeysToTheRight.set(frKey, frKeys.get(frKey));\n }\n return;\n }\n // we already know the new size of the resizing column\n if (column.key === col) {\n resizeIndex = i;\n return;\n }\n // freeze column to previous value\n resizingChanged.set(column.key, prevColumnWidths.get(column.key));\n });\n resizingChanged.set(col, Math.floor(width));\n\n // predict pixels sizes for all columns based on resize\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n resizingChanged,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // set all new column widths for onResize event\n // columns going in will be the same order as the columns coming out\n let newWidths = new Map<Key, ColumnSize>();\n // set all column widths based on calculateColumnSize\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n newWidths.set(key, width);\n });\n\n // add FR's back as they were to columns to the right\n Array.from(frKeys).forEach(([key]) => {\n if (frKeysToTheRight.has(key)) {\n newWidths.set(key, `${frKeysToTheRight.get(key)}fr`);\n }\n });\n\n // put back in percents\n Array.from(percentKeys).forEach(([key, width]) => {\n // resizing locks a column to a px width\n if (key === col) {\n return;\n }\n newWidths.set(key, width);\n });\n return newWidths;\n }\n\n buildColumnWidths(tableWidth: number, collection: TableCollection<T>, widths: Map<Key, ColumnSize>) {\n this.columnWidths = new Map();\n this.columnMinWidths = new Map();\n this.columnMaxWidths = new Map();\n\n // initial layout or table/window resizing\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n widths,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // columns going in will be the same order as the columns coming out\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n let column = collection.columns[index];\n this.columnWidths.set(key, width);\n this.columnMinWidths.set(key, getMinWidth(column.column.props.minWidth ?? this.getDefaultMinWidth(column), tableWidth));\n this.columnMaxWidths.set(key, getMaxWidth(column.column.props.maxWidth, tableWidth));\n });\n return this.columnWidths;\n }\n}\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {Key} from 'react';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width: number | string): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableWidth * (parseFloat(match[0]) / 100);\n }\n return width;\n}\n\n\nexport function getMaxWidth(maxWidth: number | string, tableWidth: number): number {\n return maxWidth != null\n ? parseStaticWidth(maxWidth, tableWidth)\n : Number.MAX_SAFE_INTEGER;\n}\n\n// cannot support FR units, we'd need to know everything else in the table to do that\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 0;\n}\n\n// tell us the delta between min width and target width vs max width and target width\nfunction mapDynamicColumns(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): (IndexedColumn & {delta: number})[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => column ? sum + parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) : sum,\n 0\n );\n\n let columns = dynamicColumns.map((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.column.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.column.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n delta\n };\n });\n\n return columns;\n}\n\n// mutates columns to set their width\nfunction findDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): void {\n let fractions = dynamicColumns.reduce(\n (sum, col) => col ? sum + col.width : sum,\n 0\n );\n\n dynamicColumns.forEach((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (column.width * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.column.minWidth, tableWidth),\n Math.min(Math.round(targetWidth), getMaxWidth(column.column.maxWidth, tableWidth))\n );\n availableSpace -= width;\n fractions -= column.width;\n column.width = width;\n });\n}\n\nexport function getDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n\n // sort is nlogn and copying is n, so copying and sorting is faster than sorting twice\n // sort by delta's to prioritize assigning width\n let sorted = [...columns].sort((a, b) => {\n if (a && b) {\n return b.delta - a.delta;\n }\n return a ? -1 : 1;\n });\n // this function mutates the column entries, so no need to have it return anything\n // plus we don't need to undo the sort since we already have the correct order\n findDynamicColumnWidths(sorted, availableSpace, tableWidth);\n\n return columns;\n}\n\n\nexport interface IColumn {\n minWidth?: number | string,\n maxWidth?: number | string,\n width?: number | string,\n defaultWidth?: number | string,\n key?: Key\n}\nexport interface IndexedColumn {\n column: IColumn,\n index: number,\n width: number,\n isDynamic?: boolean,\n delta?: number\n}\n\nexport function calculateColumnSizes(availableWidth: number, columns: IColumn[], changedColumns: Map<Key, ColumnSize>, getDefaultWidth, getDefaultMinWidth) {\n let remainingSpace = availableWidth;\n let {staticColumns, dynamicColumns} = columns.reduce((acc, column, index) => {\n let width = changedColumns.get(column.key) != null ? changedColumns.get(column.key) : column.width ?? column.defaultWidth ?? getDefaultWidth?.(index) ?? '1fr';\n let minWidth = column.minWidth ?? getDefaultMinWidth?.(index);\n column.minWidth = minWidth;\n\n if (isStatic(width)) {\n let w = parseStaticWidth(width, availableWidth);\n w = Math.max(\n getMinWidth(column.minWidth, availableWidth),\n Math.min(Math.floor(w), getMaxWidth(column.maxWidth, availableWidth)));\n acc.staticColumns.push({index, column, width: w} as IndexedColumn);\n acc.dynamicColumns.push(null);\n remainingSpace -= w;\n } else {\n let w = parseFractionalUnit(width);\n acc.staticColumns.push(null);\n acc.dynamicColumns.push({index, column, width: w} as IndexedColumn);\n }\n return acc;\n }, {staticColumns: [] as IndexedColumn[], dynamicColumns: [] as IndexedColumn[]});\n let newColWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, availableWidth);\n\n return staticColumns.map((col, i) => {\n if (col) {\n return col.width;\n }\n return newColWidths[i].width;\n });\n}\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo, useState} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,\n /** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n isKeyboardNavigationDisabled: boolean,\n /** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n setKeyboardNavigationDisabled: (val: boolean) => void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = useState(false);\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection, disabledBehavior: 'selection'});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,\n setKeyboardNavigationDisabled,\n sort(columnKey: Key, direction?: 'ascending' | 'descending') {\n props.onSortChange({\n column: columnKey,\n direction: direction ?? (props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending')\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns: GridNode<T>[][] = [];\n let seen = new Map();\n for (let column of columnNodes) {\n let parentKey = column.parentKey;\n let col = [column];\n\n while (parentKey) {\n let parent: GridNode<T> = keyMap.get(parentKey);\n\n // If we've already seen this parent, than it is shared\n // with a previous column. If the current column is taller\n // than the previous column, than we need to shift the parent\n // in the previous column so it's level with the current column.\n if (seen.has(parent)) {\n parent.colspan++;\n\n let {column, index} = seen.get(parent);\n if (index > col.length) {\n break;\n }\n\n for (let i = index; i < col.length; i++) {\n column.splice(i, 0, null);\n }\n\n // Adjust shifted indices\n for (let i = col.length; i < column.length; i++) {\n // eslint-disable-next-line max-depth\n if (column[i] && seen.has(column[i])) {\n seen.get(column[i]).index = i;\n }\n }\n } else {\n parent.colspan = 1;\n col.push(parent);\n seen.set(parent, {column: col, index: col.length - 1});\n }\n\n parentKey = parent.parentKey;\n }\n\n columns.push(col);\n column.index = columns.length - 1;\n }\n\n let maxLength = Math.max(...columns.map(c => c.length));\n let headerRows = Array(maxLength).fill(0).map(() => []);\n\n // Convert columns into rows.\n let colIndex = 0;\n for (let column of columns) {\n let i = maxLength - 1;\n for (let item of column) {\n if (item) {\n // Fill the space up until the current column with a placeholder\n let row = headerRows[i];\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < colIndex) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + item.key,\n colspan: colIndex - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null\n };\n\n // eslint-disable-next-line max-depth\n if (row.length > 0) {\n row[row.length - 1].nextKey = placeholder.key;\n placeholder.prevKey = row[row.length - 1].key;\n }\n\n row.push(placeholder);\n }\n\n if (row.length > 0) {\n row[row.length - 1].nextKey = item.key;\n item.prevKey = row[row.length - 1].key;\n }\n\n item.level = i;\n item.colIndex = colIndex;\n row.push(item);\n }\n\n i--;\n }\n\n colIndex++;\n }\n\n // Add placeholders at the end of each row that is shorter than the maximum\n let i = 0;\n for (let row of headerRows) {\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < columnNodes.length) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + row[row.length - 1].key,\n colspan: columnNodes.length - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null,\n prevKey: row[row.length - 1].key\n };\n\n row.push(placeholder);\n }\n\n i++;\n }\n\n return headerRows.map((childNodes, index) => {\n let row: GridNode<T> = {\n type: 'headerrow',\n key: 'headerrow-' + index,\n index,\n value: null,\n rendered: null,\n level: 0,\n hasChildNodes: true,\n childNodes,\n textValue: null\n };\n\n return row;\n });\n}\n\nexport class TableCollection<T> extends GridCollection<T> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n _size: number = 0;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\n // Add cell for selection checkboxes if needed.\n if (opts?.showSelectionCheckboxes) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n let rows = [];\n let columnKeyMap = new Map();\n let visit = (node: GridNode<T>) => {\n switch (node.type) {\n case 'body':\n body = node;\n break;\n case 'column':\n columnKeyMap.set(node.key, node);\n if (!node.hasChildNodes) {\n columns.push(node);\n\n if (node.props.isRowHeader) {\n rowHeaderColumnKeys.add(node.key);\n }\n }\n break;\n case 'item':\n rows.push(node);\n return; // do not go into childNodes\n }\n for (let child of node.childNodes) {\n visit(child);\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];\n headerRows.forEach((row, i) => rows.splice(i, 0, row));\n\n super({\n columnCount: columns.length,\n items: rows,\n visitNode: node => {\n node.column = columns[node.index];\n return node;\n }\n });\n this.columns = columns;\n this.rowHeaderColumnKeys = rowHeaderColumnKeys;\n this.body = body;\n this.headerRows = headerRows;\n this._size = [...body.childNodes].length;\n\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return this._size;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.prevKey : null;\n }\n\n getKeyAfter(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.nextKey : null;\n }\n\n getFirstKey() {\n return [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.key;\n }\n\n getItem(key: Key) {\n return this.keyMap.get(key);\n }\n\n at(idx: number) {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n}\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {ColumnProps} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nColumn.getCollectionNode = function* getCollectionNode<T>(props: ColumnProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>, void, GridNode<T>[]> {\n let {title, children, childColumns} = props;\n\n let rendered = title || children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];\n\n let fullNodes = yield {\n type: 'column',\n hasChildNodes: !!childColumns || (title && React.Children.count(children) > 0),\n rendered,\n textValue,\n props,\n *childNodes() {\n if (childColumns) {\n for (let child of childColumns) {\n yield {\n type: 'column',\n value: child\n };\n }\n } else if (title) {\n let childColumns: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n childColumns.push({\n type: 'column',\n element: child as ReactElement<ColumnProps<T>>\n });\n });\n\n yield* childColumns;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // This is a bit of a hack, but it works.\n // If this method is called, then there's a cached version of this node available.\n // But, we need to keep the list of columns in the new context up to date.\n updateContext(newContext);\n return false;\n }\n };\n\n let updateContext = (context: CollectionBuilderContext<T>) => {\n // register leaf columns on the context so that <Row> can access them\n for (let node of fullNodes) {\n if (!node.hasChildNodes) {\n context.columns.push(node);\n }\n }\n };\n\n updateContext(context);\n};\n\n/**\n * A Column represents a field of each item within a Table. Columns may also contain nested\n * Column elements to represent column groups. Nested columns can be statically defined as\n * children, or dynamically generated using a function based on the `childColumns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Column = Column as <T>(props: ColumnProps<T>) => JSX.Element;\nexport {_Column as Column};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED,AAIO,SAAS,0CAAS,KAAsB,EAAW;IACxD,OAAO,SAAS,IAAI,IAAK,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAI,AAAD;AACnG;AAEO,SAAS,0CAAoB,KAAa,EAAU;IACzD,IAAI,CAAC,OACH,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7D,IAAI,CAAC,OAAO;QACV,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,6GAA6G,CAAC,EACzI;QACF,OAAO;IACT,CAAC;IACD,OAAO,WAAW,KAAK,CAAC,EAAE;AAC5B;AAEO,SAAS,0CAAiB,KAAsB,EAAE,UAAkB,EAAU;IACnF,IAAI,OAAO,UAAU,UAAU;QAC7B,IAAI,QAAQ,MAAM,KAAK,CAAC;QACxB,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,sEAAsE;QAExF,OAAO,aAAc,CAAA,WAAW,KAAK,CAAC,EAAE,IAAI,GAAE;IAChD,CAAC;IACD,OAAO;AACT;AAGO,SAAS,0CAAY,QAAyB,EAAE,UAAkB,EAAU;IACjF,OAAO,YAAY,IAAI,GACnB,0CAAiB,UAAU,cAC3B,OAAO,gBAAgB;AAC7B;AAGO,SAAS,0CAAY,QAAyB,EAAE,UAAkB,EAAU;IACjF,OAAO,YAAY,IAAI,GACnB,0CAAiB,UAAU,cAC3B,CAAC;AACP;AAEA,qFAAqF;AACrF,SAAS,wCAAkB,cAA+B,EAAE,cAAsB,EAAE,UAAkB,EAAuC;IAC3I,IAAI,YAAY,eAAe,MAA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,MAAM,KAAK,QAAQ,OAAO,CAAC,MAAM,IACzD,WAAW,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAM,EAAE,GAAG,KAAK,QAAQ,OAAO,CAAC,EAAE,CAAC,GAAG,KAClE,WAAW,uBAAuB,KAAK,QAAQ,uBAAuB,IACtE,WAAW,aAAa,KAAK,QAAQ,aAAa;QACtD;IACF;AACF;AAEA;;;;CAIC,GACD,oEAAoE;AACpE,IAAI,4CAAO;;;AClFX;;;;;;;;;;CAUC,GAED,AAIA,SAAS,2BAAK,KAAgB,EAAgB;IAC5C,OAAO,IAAI;AACb;AAEA,2BAAK,iBAAiB,GAAG,UAAU,kBAAqB,KAAgB,EAA6B;IACnG,IAAI,YAAC,SAAQ,EAAC,GAAG;IAEjB,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAE,AAAD,KAAM,KAAK,CAAC,aAAa,IAAI;IAC5G,MAAM;QACJ,MAAM;QACN,OAAO;QACP,UAAU;mBACV;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe,KAAK;IACtB;AACF;AAEA;;CAEC,GACD,oEAAoE;AACpE,IAAI,4CAAQ;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key, useCallback, useMemo, useState} from 'react';\nimport {TableColumnLayout} from './TableColumnLayout';\nimport {TableState} from './useTableState';\n\nexport interface TableColumnResizeStateProps<T> {\n /**\n * Current width of the table or table viewport that the columns\n * should be calculated against.\n **/\n tableWidth: number,\n /** A function that is called to find the default width for a given column. */\n getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined,\n /** A function that is called to find the default minWidth for a given column. */\n getDefaultMinWidth?: (node: GridNode<T>) => ColumnSize | null | undefined\n}\nexport interface TableColumnResizeState<T> {\n /**\n * Called to update the state that a resize event has occurred.\n * Returns the new widths for all columns based on the resized column.\n **/\n onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: (key: Key) => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Gets the current width for the specified column. */\n getColumnWidth: (key: Key) => number,\n /** Gets the current minWidth for the specified column. */\n getColumnMinWidth: (key: Key) => number,\n /** Gets the current maxWidth for the specified column. */\n getColumnMaxWidth: (key: Key) => number,\n /** Currently calculated widths for all columns. */\n widths: Map<Key, number>,\n /** Key of the currently resizing column. */\n resizingColumn: Key | null,\n /** A reference to the table state. */\n tableState: TableState<T>\n}\n\n/**\n * Provides column width state management for a table component with column resizing support. Handles building\n * a map of column widths calculated from the table's width and any provided column width information from the collection.\n * In addition, it tracks the currently resizing column and provides callbacks for updating the widths upon resize operations.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<T>, state: TableState<T>): TableColumnResizeState<T> {\n let {\n getDefaultWidth,\n getDefaultMinWidth,\n tableWidth = 0\n } = props;\n\n let [resizingColumn, setResizingColumn] = useState<Key | null>(null);\n let columnLayout = useMemo(\n () => new TableColumnLayout({\n getDefaultWidth,\n getDefaultMinWidth\n }),\n [getDefaultWidth, getDefaultMinWidth]\n );\n\n let [controlledColumns, uncontrolledColumns] = useMemo(() =>\n columnLayout.splitColumnsIntoControlledAndUncontrolled(state.collection.columns)\n , [state.collection.columns, columnLayout]);\n\n // uncontrolled column widths\n let [uncontrolledWidths, setUncontrolledWidths] = useState(() =>\n columnLayout.getInitialUncontrolledWidths(uncontrolledColumns)\n );\n // combine columns back into one map that maintains same order as the columns\n let colWidths = useMemo(() =>\n columnLayout.recombineColumns(state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns)\n , [state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns, columnLayout]);\n\n let onColumnResizeStart = useCallback((key: Key) => {\n setResizingColumn(key);\n }, [setResizingColumn]);\n\n let onColumnResize = useCallback((key: Key, width: number): Map<Key, ColumnSize> => {\n let newControlled = new Map(Array.from(controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = columnLayout.resizeColumnWidth(tableWidth, state.collection, newControlled, uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n setUncontrolledWidths(map);\n return newSizes;\n }, [controlledColumns, uncontrolledColumns, setUncontrolledWidths, tableWidth, columnLayout, state.collection, uncontrolledWidths]);\n\n let onColumnResizeEnd = useCallback(() => {\n setResizingColumn(null);\n }, [setResizingColumn]);\n\n let columnWidths = useMemo(() =>\n columnLayout.buildColumnWidths(tableWidth, state.collection, colWidths)\n , [tableWidth, state.collection, colWidths, columnLayout]);\n\n return useMemo(() => ({\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth: (key: Key) =>\n columnLayout.getColumnWidth(key),\n getColumnMinWidth: (key: Key) =>\n columnLayout.getColumnMinWidth(key),\n getColumnMaxWidth: (key: Key) =>\n columnLayout.getColumnMaxWidth(key),\n widths: columnWidths,\n tableState: state\n }), [\n columnLayout,\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n columnWidths,\n state\n ]);\n}\n","/*\n * Copyright 2022 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 {\n calculateColumnSizes,\n getMaxWidth,\n getMinWidth,\n isStatic,\n parseFractionalUnit\n} from './TableUtils';\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\nexport interface TableColumnLayoutOptions<T> {\n getDefaultWidth?: (column: GridNode<T>) => ColumnSize | null | undefined,\n getDefaultMinWidth?: (column: GridNode<T>) => ColumnSize | null | undefined\n}\n\nexport class TableColumnLayout<T> {\n getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n columnWidths: Map<Key, number> = new Map();\n columnMinWidths: Map<Key, number> = new Map();\n columnMaxWidths: Map<Key, number> = new Map();\n\n constructor(options: TableColumnLayoutOptions<T>) {\n this.getDefaultWidth = options?.getDefaultWidth ?? (() => '1fr');\n this.getDefaultMinWidth = options?.getDefaultMinWidth ?? (() => 0);\n }\n\n /** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */\n splitColumnsIntoControlledAndUncontrolled(columns: Array<GridNode<T>>): [Map<Key, GridNode<T>>, Map<Key, GridNode<T>>] {\n return columns.reduce((acc, col) => {\n if (col.props.width != null) {\n acc[0].set(col.key, col);\n } else {\n acc[1].set(col.key, col);\n }\n return acc;\n }, [new Map(), new Map()]);\n }\n\n /** Takes uncontrolled and controlled widths and joins them into a single Map. */\n recombineColumns(columns: Array<GridNode<T>>, uncontrolledWidths: Map<Key, ColumnSize>, uncontrolledColumns: Map<Key, GridNode<T>>, controlledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(columns.map(col => {\n if (uncontrolledColumns.has(col.key)) {\n return [col.key, uncontrolledWidths.get(col.key)];\n } else {\n return [col.key, controlledColumns.get(col.key).props.width];\n }\n }));\n }\n\n /** Used to make an initial Map of the uncontrolled widths based on default widths. */\n getInitialUncontrolledWidths(uncontrolledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(Array.from(uncontrolledColumns).map(([key, col]) =>\n [key, col.props.defaultWidth ?? this.getDefaultWidth?.(col) ?? '1fr']\n ));\n }\n\n getColumnWidth(key: Key): number {\n return this.columnWidths.get(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n return this.columnMinWidths.get(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n return this.columnMaxWidths.get(key);\n }\n\n resizeColumnWidth(tableWidth: number, collection: TableCollection<T>, controlledWidths: Map<Key, ColumnSize>, uncontrolledWidths: Map<Key, ColumnSize>, col = null, width: number): Map<Key, ColumnSize> {\n let prevColumnWidths = this.columnWidths;\n // resizing a column\n let resizeIndex = Infinity;\n let controlledArray = Array.from(controlledWidths);\n let uncontrolledArray = Array.from(uncontrolledWidths);\n let combinedArray = controlledArray.concat(uncontrolledArray);\n let resizingChanged = new Map<Key, ColumnSize>(combinedArray);\n let frKeys = new Map();\n let percentKeys = new Map();\n let frKeysToTheRight = new Map();\n let minWidths = new Map();\n // freeze columns to the left to their previous pixel value\n // at the same time count how many total FR's are in play and which of those FRs are\n // to the right or left of the resizing column\n collection.columns.forEach((column, i) => {\n let frKey;\n minWidths.set(column.key, this.getDefaultMinWidth(collection.columns[i]));\n if (col !== column.key && !column.column.props.width && !isStatic(uncontrolledWidths.get(column.key))) {\n // uncontrolled don't have props.width for us, so instead get from our state\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(uncontrolledWidths.get(column.key) as string));\n } else if (col !== column.key && !isStatic(column.column.props.width) && !uncontrolledWidths.get(column.key)) {\n // controlledWidths will be the same in the collection\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(column.column.props.width));\n } else if (col !== column.key && column.column.props.width?.endsWith?.('%')) {\n percentKeys.set(column.key, column.column.props.width);\n }\n // don't freeze columns to the right of the resizing one\n if (resizeIndex < i) {\n if (frKey) {\n frKeysToTheRight.set(frKey, frKeys.get(frKey));\n }\n return;\n }\n // we already know the new size of the resizing column\n if (column.key === col) {\n resizeIndex = i;\n return;\n }\n // freeze column to previous value\n resizingChanged.set(column.key, prevColumnWidths.get(column.key));\n });\n resizingChanged.set(col, Math.floor(width));\n\n // predict pixels sizes for all columns based on resize\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n resizingChanged,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // set all new column widths for onResize event\n // columns going in will be the same order as the columns coming out\n let newWidths = new Map<Key, ColumnSize>();\n // set all column widths based on calculateColumnSize\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n newWidths.set(key, width);\n });\n\n // add FR's back as they were to columns to the right\n Array.from(frKeys).forEach(([key]) => {\n if (frKeysToTheRight.has(key)) {\n newWidths.set(key, `${frKeysToTheRight.get(key)}fr`);\n }\n });\n\n // put back in percents\n Array.from(percentKeys).forEach(([key, width]) => {\n // resizing locks a column to a px width\n if (key === col) {\n return;\n }\n newWidths.set(key, width);\n });\n return newWidths;\n }\n\n buildColumnWidths(tableWidth: number, collection: TableCollection<T>, widths: Map<Key, ColumnSize>) {\n this.columnWidths = new Map();\n this.columnMinWidths = new Map();\n this.columnMaxWidths = new Map();\n\n // initial layout or table/window resizing\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n widths,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // columns going in will be the same order as the columns coming out\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n let column = collection.columns[index];\n this.columnWidths.set(key, width);\n this.columnMinWidths.set(key, getMinWidth(column.column.props.minWidth ?? this.getDefaultMinWidth(column), tableWidth));\n this.columnMaxWidths.set(key, getMaxWidth(column.column.props.maxWidth, tableWidth));\n });\n return this.columnWidths;\n }\n}\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {Key} from 'react';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width: number | string): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableWidth * (parseFloat(match[0]) / 100);\n }\n return width;\n}\n\n\nexport function getMaxWidth(maxWidth: number | string, tableWidth: number): number {\n return maxWidth != null\n ? parseStaticWidth(maxWidth, tableWidth)\n : Number.MAX_SAFE_INTEGER;\n}\n\n// cannot support FR units, we'd need to know everything else in the table to do that\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 0;\n}\n\n// tell us the delta between min width and target width vs max width and target width\nfunction mapDynamicColumns(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): (IndexedColumn & {delta: number})[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => column ? sum + parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) : sum,\n 0\n );\n\n let columns = dynamicColumns.map((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.column.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.column.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n delta\n };\n });\n\n return columns;\n}\n\n// mutates columns to set their width\nfunction findDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): void {\n let fractions = dynamicColumns.reduce(\n (sum, col) => col ? sum + col.width : sum,\n 0\n );\n\n dynamicColumns.forEach((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (column.width * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.column.minWidth, tableWidth),\n Math.min(Math.round(targetWidth), getMaxWidth(column.column.maxWidth, tableWidth))\n );\n availableSpace -= width;\n fractions -= column.width;\n column.width = width;\n });\n}\n\nexport function getDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n\n // sort is nlogn and copying is n, so copying and sorting is faster than sorting twice\n // sort by delta's to prioritize assigning width\n let sorted = [...columns].sort((a, b) => {\n if (a && b) {\n return b.delta - a.delta;\n }\n return a ? -1 : 1;\n });\n // this function mutates the column entries, so no need to have it return anything\n // plus we don't need to undo the sort since we already have the correct order\n findDynamicColumnWidths(sorted, availableSpace, tableWidth);\n\n return columns;\n}\n\n\nexport interface IColumn {\n minWidth?: number | string,\n maxWidth?: number | string,\n width?: number | string,\n defaultWidth?: number | string,\n key?: Key\n}\nexport interface IndexedColumn {\n column: IColumn,\n index: number,\n width: number,\n isDynamic?: boolean,\n delta?: number\n}\n\nexport function calculateColumnSizes(availableWidth: number, columns: IColumn[], changedColumns: Map<Key, ColumnSize>, getDefaultWidth, getDefaultMinWidth) {\n let remainingSpace = availableWidth;\n let {staticColumns, dynamicColumns} = columns.reduce((acc, column, index) => {\n let width = changedColumns.get(column.key) != null ? changedColumns.get(column.key) : column.width ?? column.defaultWidth ?? getDefaultWidth?.(index) ?? '1fr';\n let minWidth = column.minWidth ?? getDefaultMinWidth?.(index);\n column.minWidth = minWidth;\n\n if (isStatic(width)) {\n let w = parseStaticWidth(width, availableWidth);\n w = Math.max(\n getMinWidth(column.minWidth, availableWidth),\n Math.min(Math.floor(w), getMaxWidth(column.maxWidth, availableWidth)));\n acc.staticColumns.push({index, column, width: w} as IndexedColumn);\n acc.dynamicColumns.push(null);\n remainingSpace -= w;\n } else {\n let w = parseFractionalUnit(width);\n acc.staticColumns.push(null);\n acc.dynamicColumns.push({index, column, width: w} as IndexedColumn);\n }\n return acc;\n }, {staticColumns: [] as IndexedColumn[], dynamicColumns: [] as IndexedColumn[]});\n let newColWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, availableWidth);\n\n return staticColumns.map((col, i) => {\n if (col) {\n return col.width;\n }\n return newColWidths[i].width;\n });\n}\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo, useState} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,\n /** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n isKeyboardNavigationDisabled: boolean,\n /** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n setKeyboardNavigationDisabled: (val: boolean) => void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = useState(false);\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection, disabledBehavior: 'selection'});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,\n setKeyboardNavigationDisabled,\n sort(columnKey: Key, direction?: 'ascending' | 'descending') {\n props.onSortChange({\n column: columnKey,\n direction: direction ?? (props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending')\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns: GridNode<T>[][] = [];\n let seen = new Map();\n for (let column of columnNodes) {\n let parentKey = column.parentKey;\n let col = [column];\n\n while (parentKey) {\n let parent: GridNode<T> = keyMap.get(parentKey);\n\n // If we've already seen this parent, than it is shared\n // with a previous column. If the current column is taller\n // than the previous column, than we need to shift the parent\n // in the previous column so it's level with the current column.\n if (seen.has(parent)) {\n parent.colspan++;\n\n let {column, index} = seen.get(parent);\n if (index > col.length) {\n break;\n }\n\n for (let i = index; i < col.length; i++) {\n column.splice(i, 0, null);\n }\n\n // Adjust shifted indices\n for (let i = col.length; i < column.length; i++) {\n // eslint-disable-next-line max-depth\n if (column[i] && seen.has(column[i])) {\n seen.get(column[i]).index = i;\n }\n }\n } else {\n parent.colspan = 1;\n col.push(parent);\n seen.set(parent, {column: col, index: col.length - 1});\n }\n\n parentKey = parent.parentKey;\n }\n\n columns.push(col);\n column.index = columns.length - 1;\n }\n\n let maxLength = Math.max(...columns.map(c => c.length));\n let headerRows = Array(maxLength).fill(0).map(() => []);\n\n // Convert columns into rows.\n let colIndex = 0;\n for (let column of columns) {\n let i = maxLength - 1;\n for (let item of column) {\n if (item) {\n // Fill the space up until the current column with a placeholder\n let row = headerRows[i];\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < colIndex) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + item.key,\n colspan: colIndex - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null\n };\n\n // eslint-disable-next-line max-depth\n if (row.length > 0) {\n row[row.length - 1].nextKey = placeholder.key;\n placeholder.prevKey = row[row.length - 1].key;\n }\n\n row.push(placeholder);\n }\n\n if (row.length > 0) {\n row[row.length - 1].nextKey = item.key;\n item.prevKey = row[row.length - 1].key;\n }\n\n item.level = i;\n item.colIndex = colIndex;\n row.push(item);\n }\n\n i--;\n }\n\n colIndex++;\n }\n\n // Add placeholders at the end of each row that is shorter than the maximum\n let i = 0;\n for (let row of headerRows) {\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < columnNodes.length) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + row[row.length - 1].key,\n colspan: columnNodes.length - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null,\n prevKey: row[row.length - 1].key\n };\n\n row.push(placeholder);\n }\n\n i++;\n }\n\n return headerRows.map((childNodes, index) => {\n let row: GridNode<T> = {\n type: 'headerrow',\n key: 'headerrow-' + index,\n index,\n value: null,\n rendered: null,\n level: 0,\n hasChildNodes: true,\n childNodes,\n textValue: null\n };\n\n return row;\n });\n}\n\nexport class TableCollection<T> extends GridCollection<T> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n _size: number = 0;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\n // Add cell for selection checkboxes if needed.\n if (opts?.showSelectionCheckboxes) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n let rows = [];\n let columnKeyMap = new Map();\n let visit = (node: GridNode<T>) => {\n switch (node.type) {\n case 'body':\n body = node;\n break;\n case 'column':\n columnKeyMap.set(node.key, node);\n if (!node.hasChildNodes) {\n columns.push(node);\n\n if (node.props.isRowHeader) {\n rowHeaderColumnKeys.add(node.key);\n }\n }\n break;\n case 'item':\n rows.push(node);\n return; // do not go into childNodes\n }\n for (let child of node.childNodes) {\n visit(child);\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];\n headerRows.forEach((row, i) => rows.splice(i, 0, row));\n\n super({\n columnCount: columns.length,\n items: rows,\n visitNode: node => {\n node.column = columns[node.index];\n return node;\n }\n });\n this.columns = columns;\n this.rowHeaderColumnKeys = rowHeaderColumnKeys;\n this.body = body;\n this.headerRows = headerRows;\n this._size = [...body.childNodes].length;\n\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return this._size;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.prevKey : null;\n }\n\n getKeyAfter(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.nextKey : null;\n }\n\n getFirstKey() {\n return [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.key;\n }\n\n getItem(key: Key) {\n return this.keyMap.get(key);\n }\n\n at(idx: number) {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n}\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {ColumnProps} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nColumn.getCollectionNode = function* getCollectionNode<T>(props: ColumnProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>, void, GridNode<T>[]> {\n let {title, children, childColumns} = props;\n\n let rendered = title || children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];\n\n let fullNodes = yield {\n type: 'column',\n hasChildNodes: !!childColumns || (title && React.Children.count(children) > 0),\n rendered,\n textValue,\n props,\n *childNodes() {\n if (childColumns) {\n for (let child of childColumns) {\n yield {\n type: 'column',\n value: child\n };\n }\n } else if (title) {\n let childColumns: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n childColumns.push({\n type: 'column',\n element: child as ReactElement<ColumnProps<T>>\n });\n });\n\n yield* childColumns;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // This is a bit of a hack, but it works.\n // If this method is called, then there's a cached version of this node available.\n // But, we need to keep the list of columns in the new context up to date.\n updateContext(newContext);\n return false;\n }\n };\n\n let updateContext = (context: CollectionBuilderContext<T>) => {\n // register leaf columns on the context so that <Row> can access them\n for (let node of fullNodes) {\n if (!node.hasChildNodes) {\n context.columns.push(node);\n }\n }\n };\n\n updateContext(context);\n};\n\n/**\n * A Column represents a field of each item within a Table. Columns may also contain nested\n * Column elements to represent column groups. Nested columns can be statically defined as\n * children, or dynamically generated using a function based on the `childColumns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Column = Column as <T>(props: ColumnProps<T>) => JSX.Element;\nexport {_Column as Column};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED;ACZA;;;;;;;;;;CAUC,GAED,AAIO,SAAS,0CAAS,KAAsB,EAAW;IACxD,OAAO,SAAS,IAAI,IAAK,CAAA,CAAC,MAAM,UAAoB,AAAC,OAAO,OAAQ,KAAK,CAAC,oBAAoB,IAAI,AAAD;AACnG;AAEO,SAAS,0CAAoB,KAAa,EAAU;IACzD,IAAI,CAAC,OACH,OAAO;IAET,IAAI,QAAQ,MAAM,KAAK,CAAC;IACxB,6DAA6D;IAC7D,IAAI,CAAC,OAAO;QACV,QAAQ,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,6GAA6G,CAAC,EACzI;QACF,OAAO;IACT,CAAC;IACD,OAAO,WAAW,KAAK,CAAC,EAAE;AAC5B;AAEO,SAAS,0CAAiB,KAAsB,EAAE,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;IACtB;AACF;AAEA;;CAEC,GACD,oEAAoE;AACpE,IAAI,4CAAQ;;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/Cell.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\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key, useCallback, useMemo, useState} from 'react';\nimport {TableColumnLayout} from './TableColumnLayout';\nimport {TableState} from './useTableState';\n\nexport interface TableColumnResizeStateProps<T> {\n /**\n * Current width of the table or table viewport that the columns\n * should be calculated against.\n */\n tableWidth: number,\n /** A function that is called to find the default width for a given column. */\n getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined,\n /** A function that is called to find the default minWidth for a given column. */\n getDefaultMinWidth?: (node: GridNode<T>) => ColumnSize | null | undefined\n}\nexport interface TableColumnResizeState<T> {\n /**\n * Called to update the state that a resize event has occurred.\n * Returns the new widths for all columns based on the resized column.\n */\n onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: (key: Key) => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Gets the current width for the specified column. */\n getColumnWidth: (key: Key) => number,\n /** Gets the current minWidth for the specified column. */\n getColumnMinWidth: (key: Key) => number,\n /** Gets the current maxWidth for the specified column. */\n getColumnMaxWidth: (key: Key) => number,\n /** Currently calculated widths for all columns. */\n widths: Map<Key, number>,\n /** Key of the currently resizing column. */\n resizingColumn: Key | null,\n /** A reference to the table state. */\n tableState: TableState<T>\n}\n\n/**\n * Provides column width state management for a table component with column resizing support. Handles building\n * a map of column widths calculated from the table's width and any provided column width information from the collection.\n * In addition, it tracks the currently resizing column and provides callbacks for updating the widths upon resize operations.\n * @param props - Props for the table.\n * @param state - State for the table, as returned by `useTableState`.\n */\nexport function useTableColumnResizeState<T>(props: TableColumnResizeStateProps<T>, state: TableState<T>): TableColumnResizeState<T> {\n let {\n getDefaultWidth,\n getDefaultMinWidth,\n tableWidth = 0\n } = props;\n\n let [resizingColumn, setResizingColumn] = useState<Key | null>(null);\n let columnLayout = useMemo(\n () => new TableColumnLayout({\n getDefaultWidth,\n getDefaultMinWidth\n }),\n [getDefaultWidth, getDefaultMinWidth]\n );\n\n let [controlledColumns, uncontrolledColumns] = useMemo(() =>\n columnLayout.splitColumnsIntoControlledAndUncontrolled(state.collection.columns)\n , [state.collection.columns, columnLayout]);\n\n // uncontrolled column widths\n let [uncontrolledWidths, setUncontrolledWidths] = useState(() =>\n columnLayout.getInitialUncontrolledWidths(uncontrolledColumns)\n );\n // combine columns back into one map that maintains same order as the columns\n let colWidths = useMemo(() =>\n columnLayout.recombineColumns(state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns)\n , [state.collection.columns, uncontrolledWidths, uncontrolledColumns, controlledColumns, columnLayout]);\n\n let onColumnResizeStart = useCallback((key: Key) => {\n setResizingColumn(key);\n }, [setResizingColumn]);\n\n let onColumnResize = useCallback((key: Key, width: number): Map<Key, ColumnSize> => {\n let newControlled = new Map(Array.from(controlledColumns).map(([key, entry]) => [key, entry.props.width]));\n let newSizes = columnLayout.resizeColumnWidth(tableWidth, state.collection, newControlled, uncontrolledWidths, key, width);\n\n let map = new Map(Array.from(uncontrolledColumns).map(([key]) => [key, newSizes.get(key)]));\n map.set(key, width);\n setUncontrolledWidths(map);\n return newSizes;\n }, [controlledColumns, uncontrolledColumns, setUncontrolledWidths, tableWidth, columnLayout, state.collection, uncontrolledWidths]);\n\n let onColumnResizeEnd = useCallback(() => {\n setResizingColumn(null);\n }, [setResizingColumn]);\n\n let columnWidths = useMemo(() =>\n columnLayout.buildColumnWidths(tableWidth, state.collection, colWidths)\n , [tableWidth, state.collection, colWidths, columnLayout]);\n\n return useMemo(() => ({\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth: (key: Key) =>\n columnLayout.getColumnWidth(key),\n getColumnMinWidth: (key: Key) =>\n columnLayout.getColumnMinWidth(key),\n getColumnMaxWidth: (key: Key) =>\n columnLayout.getColumnMaxWidth(key),\n widths: columnWidths,\n tableState: state\n }), [\n columnLayout,\n resizingColumn,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n columnWidths,\n state\n ]);\n}\n","/*\n * Copyright 2022 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 {\n calculateColumnSizes,\n getMaxWidth,\n getMinWidth,\n isStatic,\n parseFractionalUnit\n} from './TableUtils';\nimport {ColumnSize, TableCollection} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\nexport interface TableColumnLayoutOptions<T> {\n getDefaultWidth?: (column: GridNode<T>) => ColumnSize | null | undefined,\n getDefaultMinWidth?: (column: GridNode<T>) => ColumnSize | null | undefined\n}\n\nexport class TableColumnLayout<T> {\n getDefaultWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n getDefaultMinWidth: (column: GridNode<T>) => ColumnSize | null | undefined;\n columnWidths: Map<Key, number> = new Map();\n columnMinWidths: Map<Key, number> = new Map();\n columnMaxWidths: Map<Key, number> = new Map();\n\n constructor(options: TableColumnLayoutOptions<T>) {\n this.getDefaultWidth = options?.getDefaultWidth ?? (() => '1fr');\n this.getDefaultMinWidth = options?.getDefaultMinWidth ?? (() => 0);\n }\n\n /** Takes an array of columns and splits it into 2 maps of columns with controlled and columns with uncontrolled widths. */\n splitColumnsIntoControlledAndUncontrolled(columns: Array<GridNode<T>>): [Map<Key, GridNode<T>>, Map<Key, GridNode<T>>] {\n return columns.reduce((acc, col) => {\n if (col.props.width != null) {\n acc[0].set(col.key, col);\n } else {\n acc[1].set(col.key, col);\n }\n return acc;\n }, [new Map(), new Map()]);\n }\n\n /** Takes uncontrolled and controlled widths and joins them into a single Map. */\n recombineColumns(columns: Array<GridNode<T>>, uncontrolledWidths: Map<Key, ColumnSize>, uncontrolledColumns: Map<Key, GridNode<T>>, controlledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(columns.map(col => {\n if (uncontrolledColumns.has(col.key)) {\n return [col.key, uncontrolledWidths.get(col.key)];\n } else {\n return [col.key, controlledColumns.get(col.key).props.width];\n }\n }));\n }\n\n /** Used to make an initial Map of the uncontrolled widths based on default widths. */\n getInitialUncontrolledWidths(uncontrolledColumns: Map<Key, GridNode<T>>): Map<Key, ColumnSize> {\n return new Map(Array.from(uncontrolledColumns).map(([key, col]) =>\n [key, col.props.defaultWidth ?? this.getDefaultWidth?.(col) ?? '1fr']\n ));\n }\n\n getColumnWidth(key: Key): number {\n return this.columnWidths.get(key) ?? 0;\n }\n\n getColumnMinWidth(key: Key): number {\n return this.columnMinWidths.get(key);\n }\n\n getColumnMaxWidth(key: Key): number {\n return this.columnMaxWidths.get(key);\n }\n\n resizeColumnWidth(tableWidth: number, collection: TableCollection<T>, controlledWidths: Map<Key, ColumnSize>, uncontrolledWidths: Map<Key, ColumnSize>, col = null, width: number): Map<Key, ColumnSize> {\n let prevColumnWidths = this.columnWidths;\n // resizing a column\n let resizeIndex = Infinity;\n let controlledArray = Array.from(controlledWidths);\n let uncontrolledArray = Array.from(uncontrolledWidths);\n let combinedArray = controlledArray.concat(uncontrolledArray);\n let resizingChanged = new Map<Key, ColumnSize>(combinedArray);\n let frKeys = new Map();\n let percentKeys = new Map();\n let frKeysToTheRight = new Map();\n let minWidths = new Map();\n // freeze columns to the left to their previous pixel value\n // at the same time count how many total FR's are in play and which of those FRs are\n // to the right or left of the resizing column\n collection.columns.forEach((column, i) => {\n let frKey;\n minWidths.set(column.key, this.getDefaultMinWidth(collection.columns[i]));\n if (col !== column.key && !column.column.props.width && !isStatic(uncontrolledWidths.get(column.key))) {\n // uncontrolled don't have props.width for us, so instead get from our state\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(uncontrolledWidths.get(column.key) as string));\n } else if (col !== column.key && !isStatic(column.column.props.width) && !uncontrolledWidths.get(column.key)) {\n // controlledWidths will be the same in the collection\n frKey = column.key;\n frKeys.set(column.key, parseFractionalUnit(column.column.props.width));\n } else if (col !== column.key && column.column.props.width?.endsWith?.('%')) {\n percentKeys.set(column.key, column.column.props.width);\n }\n // don't freeze columns to the right of the resizing one\n if (resizeIndex < i) {\n if (frKey) {\n frKeysToTheRight.set(frKey, frKeys.get(frKey));\n }\n return;\n }\n // we already know the new size of the resizing column\n if (column.key === col) {\n resizeIndex = i;\n return;\n }\n // freeze column to previous value\n resizingChanged.set(column.key, prevColumnWidths.get(column.key));\n });\n resizingChanged.set(col, Math.floor(width));\n\n // predict pixels sizes for all columns based on resize\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n resizingChanged,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // set all new column widths for onResize event\n // columns going in will be the same order as the columns coming out\n let newWidths = new Map<Key, ColumnSize>();\n // set all column widths based on calculateColumnSize\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n newWidths.set(key, width);\n });\n\n // add FR's back as they were to columns to the right\n Array.from(frKeys).forEach(([key]) => {\n if (frKeysToTheRight.has(key)) {\n newWidths.set(key, `${frKeysToTheRight.get(key)}fr`);\n }\n });\n\n // put back in percents\n Array.from(percentKeys).forEach(([key, width]) => {\n // resizing locks a column to a px width\n if (key === col) {\n return;\n }\n newWidths.set(key, width);\n });\n return newWidths;\n }\n\n buildColumnWidths(tableWidth: number, collection: TableCollection<T>, widths: Map<Key, ColumnSize>) {\n this.columnWidths = new Map();\n this.columnMinWidths = new Map();\n this.columnMaxWidths = new Map();\n\n // initial layout or table/window resizing\n let columnWidths = calculateColumnSizes(\n tableWidth,\n collection.columns.map(col => ({...col.column.props, key: col.key})),\n widths,\n (i) => this.getDefaultWidth(collection.columns[i]),\n (i) => this.getDefaultMinWidth(collection.columns[i])\n );\n\n // columns going in will be the same order as the columns coming out\n columnWidths.forEach((width, index) => {\n let key = collection.columns[index].key;\n let column = collection.columns[index];\n this.columnWidths.set(key, width);\n this.columnMinWidths.set(key, getMinWidth(column.column.props.minWidth ?? this.getDefaultMinWidth(column), tableWidth));\n this.columnMaxWidths.set(key, getMaxWidth(column.column.props.maxWidth, tableWidth));\n });\n return this.columnWidths;\n }\n}\n","/*\n * Copyright 2022 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} from '@react-types/table';\nimport {Key} from 'react';\n\n// numbers and percents are considered static. *fr units or a lack of units are considered dynamic.\nexport function isStatic(width: number | string): boolean {\n return width != null && (!isNaN(width as number) || (String(width)).match(/^(\\d+)(?=%$)/) !== null);\n}\n\nexport function parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n }\n let match = width.match(/^(.+)(?=fr$)/);\n // if width is the incorrect format, just default it to a 1fr\n if (!match) {\n console.warn(`width: ${width} is not a supported format, width should be a number (ex. 150), percentage (ex. '50%') or fr unit (ex. '2fr')`,\n 'defaulting to \\'1fr\\'');\n return 1;\n }\n return parseFloat(match[0]);\n}\n\nexport function parseStaticWidth(width: number | string, tableWidth: number): number {\n if (typeof width === 'string') {\n let match = width.match(/^(\\d+)(?=%$)/);\n if (!match) {\n throw new Error('Only percentages or numbers are supported for static column widths');\n }\n return tableWidth * (parseFloat(match[0]) / 100);\n }\n return width;\n}\n\n\nexport function getMaxWidth(maxWidth: number | string, tableWidth: number): number {\n return maxWidth != null\n ? parseStaticWidth(maxWidth, tableWidth)\n : Number.MAX_SAFE_INTEGER;\n}\n\n// cannot support FR units, we'd need to know everything else in the table to do that\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 0;\n}\n\n// tell us the delta between min width and target width vs max width and target width\nfunction mapDynamicColumns(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): (IndexedColumn & {delta: number})[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => column ? sum + parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) : sum,\n 0\n );\n\n let columns = dynamicColumns.map((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (parseFractionalUnit((column.column.width || column.column.defaultWidth) as string) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.column.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.column.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n delta\n };\n });\n\n return columns;\n}\n\n// mutates columns to set their width\nfunction findDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number): void {\n let fractions = dynamicColumns.reduce(\n (sum, col) => col ? sum + col.width : sum,\n 0\n );\n\n dynamicColumns.forEach((column) => {\n if (!column) {\n return null;\n }\n const targetWidth =\n (column.width * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.column.minWidth, tableWidth),\n Math.min(Math.round(targetWidth), getMaxWidth(column.column.maxWidth, tableWidth))\n );\n availableSpace -= width;\n fractions -= column.width;\n column.width = width;\n });\n}\n\nexport function getDynamicColumnWidths(dynamicColumns: IndexedColumn[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n\n // sort is nlogn and copying is n, so copying and sorting is faster than sorting twice\n // sort by delta's to prioritize assigning width\n let sorted = [...columns].sort((a, b) => {\n if (a && b) {\n return b.delta - a.delta;\n }\n return a ? -1 : 1;\n });\n // this function mutates the column entries, so no need to have it return anything\n // plus we don't need to undo the sort since we already have the correct order\n findDynamicColumnWidths(sorted, availableSpace, tableWidth);\n\n return columns;\n}\n\n\nexport interface IColumn {\n minWidth?: number | string,\n maxWidth?: number | string,\n width?: number | string,\n defaultWidth?: number | string,\n key?: Key\n}\nexport interface IndexedColumn {\n column: IColumn,\n index: number,\n width: number,\n isDynamic?: boolean,\n delta?: number\n}\n\nexport function calculateColumnSizes(availableWidth: number, columns: IColumn[], changedColumns: Map<Key, ColumnSize>, getDefaultWidth, getDefaultMinWidth) {\n let remainingSpace = availableWidth;\n let {staticColumns, dynamicColumns} = columns.reduce((acc, column, index) => {\n let width = changedColumns.get(column.key) != null ? changedColumns.get(column.key) : column.width ?? column.defaultWidth ?? getDefaultWidth?.(index) ?? '1fr';\n let minWidth = column.minWidth ?? getDefaultMinWidth?.(index);\n column.minWidth = minWidth;\n\n if (isStatic(width)) {\n let w = parseStaticWidth(width, availableWidth);\n w = Math.max(\n getMinWidth(column.minWidth, availableWidth),\n Math.min(Math.floor(w), getMaxWidth(column.maxWidth, availableWidth)));\n acc.staticColumns.push({index, column, width: w} as IndexedColumn);\n acc.dynamicColumns.push(null);\n remainingSpace -= w;\n } else {\n let w = parseFractionalUnit(width);\n acc.staticColumns.push(null);\n acc.dynamicColumns.push({index, column, width: w} as IndexedColumn);\n }\n return acc;\n }, {staticColumns: [] as IndexedColumn[], dynamicColumns: [] as IndexedColumn[]});\n let newColWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, availableWidth);\n\n return staticColumns.map((col, i) => {\n if (col) {\n return col.width;\n }\n return newColWidths[i].width;\n });\n}\n","/*\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 {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, useMemo, useState} from 'react';\nimport {MultipleSelectionStateProps} from '@react-stately/selection';\nimport {TableCollection} from './TableCollection';\nimport {useCollection} from '@react-stately/collections';\n\nexport interface TableState<T> extends GridState<T, ITableCollection<T>> {\n /** A collection of rows and columns in the table. */\n collection: ITableCollection<T>,\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes: boolean,\n /** The current sorted column and direction. */\n sortDescriptor: SortDescriptor,\n /** Calls the provided onSortChange handler with the provided column key and sort direction. */\n sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,\n /** Whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n isKeyboardNavigationDisabled: boolean,\n /** Set whether keyboard navigation is disabled, such as when the arrow keys should be handled by a component within a cell. */\n setKeyboardNavigationDisabled: (val: boolean) => void\n}\n\nexport interface CollectionBuilderContext<T> {\n showSelectionCheckboxes: boolean,\n selectionMode: SelectionMode,\n columns: Node<T>[]\n}\n\nexport interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {\n /** Whether the row selection checkboxes should be displayed. */\n showSelectionCheckboxes?: boolean\n}\n\nconst OPPOSITE_SORT_DIRECTION = {\n ascending: 'descending' as SortDirection,\n descending: 'ascending' as SortDirection\n};\n\n/**\n * Provides state management for a table component. Handles building a collection\n * of columns and rows from props. In addition, it tracks row selection and manages sort order changes.\n */\nexport function useTableState<T extends object>(props: TableStateProps<T>): TableState<T> {\n let [isKeyboardNavigationDisabled, setKeyboardNavigationDisabled] = useState(false);\n let {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }), [props.children, props.showSelectionCheckboxes, selectionMode]);\n\n let collection = useCollection<T, TableCollection<T>>(\n props,\n (nodes, prev) => new TableCollection(nodes, prev, context),\n context\n );\n let {disabledKeys, selectionManager} = useGridState({...props, collection, disabledBehavior: 'selection'});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\n isKeyboardNavigationDisabled: collection.size === 0 || isKeyboardNavigationDisabled,\n setKeyboardNavigationDisabled,\n sort(columnKey: Key, direction?: 'ascending' | 'descending') {\n props.onSortChange({\n column: columnKey,\n direction: direction ?? (props.sortDescriptor?.column === columnKey\n ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]\n : 'ascending')\n });\n }\n };\n}\n","/*\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 */\nimport {GridCollection} from '@react-stately/grid';\nimport {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ninterface GridCollectionOptions {\n showSelectionCheckboxes?: boolean\n}\n\nconst ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns: GridNode<T>[][] = [];\n let seen = new Map();\n for (let column of columnNodes) {\n let parentKey = column.parentKey;\n let col = [column];\n\n while (parentKey) {\n let parent: GridNode<T> = keyMap.get(parentKey);\n\n // If we've already seen this parent, than it is shared\n // with a previous column. If the current column is taller\n // than the previous column, than we need to shift the parent\n // in the previous column so it's level with the current column.\n if (seen.has(parent)) {\n parent.colspan++;\n\n let {column, index} = seen.get(parent);\n if (index > col.length) {\n break;\n }\n\n for (let i = index; i < col.length; i++) {\n column.splice(i, 0, null);\n }\n\n // Adjust shifted indices\n for (let i = col.length; i < column.length; i++) {\n // eslint-disable-next-line max-depth\n if (column[i] && seen.has(column[i])) {\n seen.get(column[i]).index = i;\n }\n }\n } else {\n parent.colspan = 1;\n col.push(parent);\n seen.set(parent, {column: col, index: col.length - 1});\n }\n\n parentKey = parent.parentKey;\n }\n\n columns.push(col);\n column.index = columns.length - 1;\n }\n\n let maxLength = Math.max(...columns.map(c => c.length));\n let headerRows = Array(maxLength).fill(0).map(() => []);\n\n // Convert columns into rows.\n let colIndex = 0;\n for (let column of columns) {\n let i = maxLength - 1;\n for (let item of column) {\n if (item) {\n // Fill the space up until the current column with a placeholder\n let row = headerRows[i];\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < colIndex) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + item.key,\n colspan: colIndex - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null\n };\n\n // eslint-disable-next-line max-depth\n if (row.length > 0) {\n row[row.length - 1].nextKey = placeholder.key;\n placeholder.prevKey = row[row.length - 1].key;\n }\n\n row.push(placeholder);\n }\n\n if (row.length > 0) {\n row[row.length - 1].nextKey = item.key;\n item.prevKey = row[row.length - 1].key;\n }\n\n item.level = i;\n item.colIndex = colIndex;\n row.push(item);\n }\n\n i--;\n }\n\n colIndex++;\n }\n\n // Add placeholders at the end of each row that is shorter than the maximum\n let i = 0;\n for (let row of headerRows) {\n let rowLength = row.reduce((p, c) => p + c.colspan, 0);\n if (rowLength < columnNodes.length) {\n let placeholder: GridNode<T> = {\n type: 'placeholder',\n key: 'placeholder-' + row[row.length - 1].key,\n colspan: columnNodes.length - rowLength,\n index: rowLength,\n value: null,\n rendered: null,\n level: i,\n hasChildNodes: false,\n childNodes: [],\n textValue: null,\n prevKey: row[row.length - 1].key\n };\n\n row.push(placeholder);\n }\n\n i++;\n }\n\n return headerRows.map((childNodes, index) => {\n let row: GridNode<T> = {\n type: 'headerrow',\n key: 'headerrow-' + index,\n index,\n value: null,\n rendered: null,\n level: 0,\n hasChildNodes: true,\n childNodes,\n textValue: null\n };\n\n return row;\n });\n}\n\nexport class TableCollection<T> extends GridCollection<T> {\n headerRows: GridNode<T>[];\n columns: GridNode<T>[];\n rowHeaderColumnKeys: Set<Key>;\n body: GridNode<T>;\n _size: number = 0;\n\n constructor(nodes: Iterable<GridNode<T>>, prev?: TableCollection<T>, opts?: GridCollectionOptions) {\n let rowHeaderColumnKeys: Set<Key> = new Set();\n let body: GridNode<T>;\n let columns = [];\n\n // Add cell for selection checkboxes if needed.\n if (opts?.showSelectionCheckboxes) {\n let rowHeaderColumn: GridNode<T> = {\n type: 'column',\n key: ROW_HEADER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: 0,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isSelectionCell: true\n }\n };\n\n columns.unshift(rowHeaderColumn);\n }\n\n let rows = [];\n let columnKeyMap = new Map();\n let visit = (node: GridNode<T>) => {\n switch (node.type) {\n case 'body':\n body = node;\n break;\n case 'column':\n columnKeyMap.set(node.key, node);\n if (!node.hasChildNodes) {\n columns.push(node);\n\n if (node.props.isRowHeader) {\n rowHeaderColumnKeys.add(node.key);\n }\n }\n break;\n case 'item':\n rows.push(node);\n return; // do not go into childNodes\n }\n for (let child of node.childNodes) {\n visit(child);\n }\n };\n\n for (let node of nodes) {\n visit(node);\n }\n\n let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];\n headerRows.forEach((row, i) => rows.splice(i, 0, row));\n\n super({\n columnCount: columns.length,\n items: rows,\n visitNode: node => {\n node.column = columns[node.index];\n return node;\n }\n });\n this.columns = columns;\n this.rowHeaderColumnKeys = rowHeaderColumnKeys;\n this.body = body;\n this.headerRows = headerRows;\n this._size = [...body.childNodes].length;\n\n // Default row header column to the first one.\n if (this.rowHeaderColumnKeys.size === 0) {\n this.rowHeaderColumnKeys.add(this.columns[opts?.showSelectionCheckboxes ? 1 : 0].key);\n }\n }\n\n *[Symbol.iterator]() {\n yield* this.body.childNodes;\n }\n\n get size() {\n return this._size;\n }\n\n getKeys() {\n return this.keyMap.keys();\n }\n\n getKeyBefore(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.prevKey : null;\n }\n\n getKeyAfter(key: Key) {\n let node = this.keyMap.get(key);\n return node ? node.nextKey : null;\n }\n\n getFirstKey() {\n return [...this.body.childNodes][0]?.key;\n }\n\n getLastKey() {\n let rows = [...this.body.childNodes];\n return rows[rows.length - 1]?.key;\n }\n\n getItem(key: Key) {\n return this.keyMap.get(key);\n }\n\n at(idx: number) {\n const keys = [...this.getKeys()];\n return this.getItem(keys[idx]);\n }\n}\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableHeaderProps} from '@react-types/table';\n\nfunction TableHeader<T>(props: TableHeaderProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableHeader.getCollectionNode = function* getCollectionNode<T>(props: TableHeaderProps<T>): Generator<PartialNode<T>, void, any> {\n let {children, columns} = props;\n if (typeof children === 'function') {\n if (!columns) {\n throw new Error('props.children was a function but props.columns is missing');\n }\n\n for (let column of columns) {\n yield {\n type: 'column',\n value: column,\n renderer: children\n };\n }\n } else {\n let columns: PartialNode<T>[] = [];\n React.Children.forEach(children, column => {\n columns.push({\n type: 'column',\n element: column\n });\n });\n\n yield* columns;\n }\n};\n\n/**\n * A TableHeader is a container for the Column elements in a Table. Columns can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `columns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableHeader = TableHeader as <T>(props: TableHeaderProps<T>) => JSX.Element;\nexport {_TableHeader as TableHeader};\n","/*\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 {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {TableBodyProps} from '@react-types/table';\n\nfunction TableBody<T>(props: TableBodyProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nTableBody.getCollectionNode = function* getCollectionNode<T>(props: TableBodyProps<T>): Generator<PartialNode<T>> {\n let {children, items} = props;\n yield {\n type: 'body',\n hasChildNodes: true,\n props,\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, item => {\n items.push({\n type: 'item',\n element: item\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n/**\n * A TableBody is a container for the Row elements of a Table. Rows can be statically defined\n * as children, or generated dynamically using a function based on the data passed to the `items` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _TableBody = TableBody as <T>(props: TableBodyProps<T>) => JSX.Element;\nexport {_TableBody as TableBody};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {ColumnProps} from '@react-types/table';\nimport {GridNode} from '@react-types/grid';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\n\nfunction Column<T>(props: ColumnProps<T>): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nColumn.getCollectionNode = function* getCollectionNode<T>(props: ColumnProps<T>, context: CollectionBuilderContext<T>): Generator<PartialNode<T>, void, GridNode<T>[]> {\n let {title, children, childColumns} = props;\n\n let rendered = title || children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'];\n\n let fullNodes = yield {\n type: 'column',\n hasChildNodes: !!childColumns || (title && React.Children.count(children) > 0),\n rendered,\n textValue,\n props,\n *childNodes() {\n if (childColumns) {\n for (let child of childColumns) {\n yield {\n type: 'column',\n value: child\n };\n }\n } else if (title) {\n let childColumns: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n childColumns.push({\n type: 'column',\n element: child as ReactElement<ColumnProps<T>>\n });\n });\n\n yield* childColumns;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // This is a bit of a hack, but it works.\n // If this method is called, then there's a cached version of this node available.\n // But, we need to keep the list of columns in the new context up to date.\n updateContext(newContext);\n return false;\n }\n };\n\n let updateContext = (context: CollectionBuilderContext<T>) => {\n // register leaf columns on the context so that <Row> can access them\n for (let node of fullNodes) {\n if (!node.hasChildNodes) {\n context.columns.push(node);\n }\n }\n };\n\n updateContext(context);\n};\n\n/**\n * A Column represents a field of each item within a Table. Columns may also contain nested\n * Column elements to represent column groups. Nested columns can be statically defined as\n * children, or dynamically generated using a function based on the `childColumns` prop.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Column = Column as <T>(props: ColumnProps<T>) => JSX.Element;\nexport {_Column as Column};\n","/*\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 {CollectionBuilderContext} from './useTableState';\nimport {PartialNode} from '@react-stately/collections';\nimport React, {ReactElement} from 'react';\nimport {RowProps} from '@react-types/table';\n\nfunction Row(props: RowProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nRow.getCollectionNode = function* getCollectionNode<T>(props: RowProps, context: CollectionBuilderContext<T>): Generator<PartialNode<T>> {\n let {children, textValue} = props;\n\n yield {\n type: 'item',\n props: props,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: true,\n *childNodes() {\n // Process cells first\n if (context.showSelectionCheckboxes && context.selectionMode !== 'none') {\n yield {\n type: 'cell',\n key: 'header', // this is combined with the row key by CollectionBuilder\n props: {\n isSelectionCell: true\n }\n };\n }\n\n if (typeof children === 'function') {\n for (let column of context.columns) {\n yield {\n type: 'cell',\n element: children(column.key),\n key: column.key // this is combined with the row key by CollectionBuilder\n };\n }\n } else {\n let cells: PartialNode<T>[] = [];\n React.Children.forEach(children, cell => {\n cells.push({\n type: 'cell',\n element: cell\n });\n });\n\n if (cells.length !== context.columns.length) {\n throw new Error(`Cell count must match column count. Found ${cells.length} cells and ${context.columns.length} columns.`);\n }\n\n yield* cells;\n }\n },\n shouldInvalidate(newContext: CollectionBuilderContext<T>) {\n // Invalidate all rows if the columns changed.\n return newContext.columns.length !== context.columns.length ||\n newContext.columns.some((c, i) => c.key !== context.columns[i].key) ||\n newContext.showSelectionCheckboxes !== context.showSelectionCheckboxes ||\n newContext.selectionMode !== context.selectionMode;\n }\n };\n};\n\n/**\n * A Row represents a single item in a Table and contains Cell elements for each column.\n * Cells can be statically defined as children, or generated dynamically using a function\n * based on the columns defined in the TableHeader.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Row = Row as (props: RowProps) => JSX.Element;\nexport {_Row as Row};\n","/*\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 {CellProps} from '@react-types/table';\nimport {PartialNode} from '@react-stately/collections';\nimport {ReactElement} from 'react';\n\nfunction Cell(props: CellProps): ReactElement { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -79,7 +79,7 @@ export interface TableColumnResizeStateProps<T> {
79
79
  /**
80
80
  * Current width of the table or table viewport that the columns
81
81
  * should be calculated against.
82
- **/
82
+ */
83
83
  tableWidth: number;
84
84
  /** A function that is called to find the default width for a given column. */
85
85
  getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined;
@@ -90,7 +90,7 @@ export interface TableColumnResizeState<T> {
90
90
  /**
91
91
  * Called to update the state that a resize event has occurred.
92
92
  * Returns the new widths for all columns based on the resized column.
93
- **/
93
+ */
94
94
  onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>;
95
95
  /** Callback for when onColumnResize has started. */
96
96
  onColumnResizeStart: (key: Key) => void;
@@ -1 +1 @@
1
- {"mappings":";;;;;;ACuBA,mCAA0C,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACzE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;CAC5E;AAED,+BAA+B,CAAC;IAC9B,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACxE,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3E,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;IAC3C,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;IAC9C,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;gBAElC,OAAO,EAAE,yBAAyB,CAAC,CAAC;IAKhD,2HAA2H;IAC3H,yCAAyC,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,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,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;CAC1B;AAED;;;;;;GAMG;AACH,0CAA0C,CAAC,EAAE,KAAK,EAAE,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAyEnI;ACtFD;;;GAGG;AAEH,OAAA,IAAI,gDAAiE,WAAW,CAAC;ACEjF;;;GAGG;AAEH,OAAA,IAAI,4CAA2D,WAAW,CAAC;ACgB3E;;;;GAIG;AAEH,OAAA,IAAI,sCAAkD,WAAW,CAAC;ACLlE;;;;GAIG;AAEH,OAAA,IAAI,aAAsB,QAAQ,KAAK,WAAW,CAAC;AChDnD;;GAEG;AAEH,OAAA,IAAI,cAAwB,SAAS,KAAK,WAAW,CAAC;ACxBtD,YAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAS3G,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-stately/table/src/packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Cell.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,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 */\n\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;;ACuBA,mCAA0C,CAAC;IACzC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACzE,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAA;CAC5E;AAED,+BAA+B,CAAC;IAC9B,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IACxE,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3E,YAAY,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;IAC3C,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAa;IAC9C,e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AAE,GAAG,KAAK,MAAM,CAAC;IACxC,mDAAmD;IACnD,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzB,4CAA4C;IAC5C,cAAc,EAAE,GAAG,GAAG,IAAI,CAAC;IAC3B,sCAAsC;IACtC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;CAC1B;AAED;;;;;;GAMG;AACH,0CAA0C,CAAC,EAAE,KAAK,EAAE,4BAA4B,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,GAAG,uBAAuB,CAAC,CAAC,CAyEnI;ACtFD;;;GAGG;AAEH,OAAA,IAAI,gDAAiE,WAAW,CAAC;ACEjF;;;GAGG;AAEH,OAAA,IAAI,4CAA2D,WAAW,CAAC;ACgB3E;;;;GAIG;AAEH,OAAA,IAAI,sCAAkD,WAAW,CAAC;ACLlE;;;;GAIG;AAEH,OAAA,IAAI,aAAsB,QAAQ,KAAK,WAAW,CAAC;AChDnD;;GAEG;AAEH,OAAA,IAAI,cAAwB,SAAS,KAAK,WAAW,CAAC;ACxBtD,YAAY,EAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAS3G,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-stately/table/src/packages/@react-stately/table/src/TableUtils.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableColumnLayout.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableCollection.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableHeader.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/TableBody.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Column.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Row.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/Cell.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,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 */\n\nexport type {TableColumnResizeState, TableColumnResizeStateProps} from './useTableColumnResizeState';\nexport type {TableState, CollectionBuilderContext, TableStateProps} from './useTableState';\nexport type {TableHeaderProps, TableBodyProps, ColumnProps, RowProps, CellProps} from '@react-types/table';\n\nexport {useTableColumnResizeState} from './useTableColumnResizeState';\nexport {useTableState} from './useTableState';\nexport {TableHeader} from './TableHeader';\nexport {TableBody} from './TableBody';\nexport {Column} from './Column';\nexport {Row} from './Row';\nexport {Cell} from './Cell';\nexport {Section} from '@react-stately/collections';\nexport {TableCollection} from './TableCollection';\nexport {TableColumnLayout} from './TableColumnLayout';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-stately/table",
3
- "version": "3.7.1-nightly.3679+62d779c7f",
3
+ "version": "3.7.1-nightly.3685+97ff9f95d",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -17,12 +17,12 @@
17
17
  "url": "https://github.com/adobe/react-spectrum"
18
18
  },
19
19
  "dependencies": {
20
- "@react-stately/collections": "3.0.0-nightly.1979+62d779c7f",
21
- "@react-stately/grid": "3.4.3-nightly.3679+62d779c7f",
22
- "@react-stately/selection": "3.0.0-nightly.1979+62d779c7f",
23
- "@react-types/grid": "3.1.6-nightly.3679+62d779c7f",
24
- "@react-types/shared": "3.0.0-nightly.1979+62d779c7f",
25
- "@react-types/table": "3.4.1-nightly.3679+62d779c7f",
20
+ "@react-stately/collections": "3.0.0-nightly.1985+97ff9f95d",
21
+ "@react-stately/grid": "3.4.3-nightly.3685+97ff9f95d",
22
+ "@react-stately/selection": "3.0.0-nightly.1985+97ff9f95d",
23
+ "@react-types/grid": "3.1.6-nightly.3685+97ff9f95d",
24
+ "@react-types/shared": "3.0.0-nightly.1985+97ff9f95d",
25
+ "@react-types/table": "3.4.1-nightly.3685+97ff9f95d",
26
26
  "@swc/helpers": "^0.4.14"
27
27
  },
28
28
  "peerDependencies": {
@@ -31,5 +31,5 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  },
34
- "gitHead": "62d779c7f82a9c1e88b912850af342af8ea5156f"
34
+ "gitHead": "97ff9f95d91befaf87251e52ea484f81daae8f3a"
35
35
  }
@@ -20,7 +20,7 @@ export interface TableColumnResizeStateProps<T> {
20
20
  /**
21
21
  * Current width of the table or table viewport that the columns
22
22
  * should be calculated against.
23
- **/
23
+ */
24
24
  tableWidth: number,
25
25
  /** A function that is called to find the default width for a given column. */
26
26
  getDefaultWidth?: (node: GridNode<T>) => ColumnSize | null | undefined,
@@ -31,7 +31,7 @@ export interface TableColumnResizeState<T> {
31
31
  /**
32
32
  * Called to update the state that a resize event has occurred.
33
33
  * Returns the new widths for all columns based on the resized column.
34
- **/
34
+ */
35
35
  onColumnResize: (key: Key, width: number) => Map<Key, ColumnSize>,
36
36
  /** Callback for when onColumnResize has started. */
37
37
  onColumnResizeStart: (key: Key) => void,