@react-stately/table 3.2.1-nightly.3335 → 3.2.1-nightly.3341

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 CHANGED
@@ -129,7 +129,7 @@ function $7aa22d80cd4ca621$export$cb895dcf85db1319(props) {
129
129
  setColumnWidths(newWidths);
130
130
  }
131
131
  /*
132
- returns the resolved column width in this order:
132
+ returns the resolved column width in this order:
133
133
  previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width
134
134
  */ let getResolvedColumnWidth = $56JBj$react.useCallback((column)=>{
135
135
  let columnProps = column.props;
@@ -186,7 +186,7 @@ function $7aa22d80cd4ca621$export$cb895dcf85db1319(props) {
186
186
  const colKeys = columns1.map((col)=>col.key
187
187
  );
188
188
  // if the columns change, need to rebuild widths.
189
- if (!colKeys.every((col, i)=>col === prevColKeys[i]
189
+ if (prevColKeys.length !== colKeys.length || !colKeys.every((col, i)=>col === prevColKeys[i]
190
190
  )) {
191
191
  columnsRef.current = columns1;
192
192
  const widths = buildColumnWidths(columns1, tableWidth.current);
@@ -215,16 +215,12 @@ function $7aa22d80cd4ca621$export$cb895dcf85db1319(props) {
215
215
  props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);
216
216
  affectedColumnWidthsRef.current = [];
217
217
  let widths = new Map(columnWidthsRef.current);
218
- // Need to set the resizeBufferColumn or "spooky column" back to 0 since done resizing;
219
- const bufferColumnKey = columnsRef.current[columnsRef.current.length - 1].key;
220
- widths.set(bufferColumnKey, 0);
221
218
  setColumnWidthsForRef(widths);
222
219
  }
223
220
  function resizeColumn(column1, newWidth) {
224
221
  let boundedWidth = Math.max($3122b463430f41b1$export$f556054ce4358701(column1.props.minWidth, tableWidth.current), Math.min(Math.floor(newWidth), $3122b463430f41b1$export$59185c62a7544aa0(column1.props.maxWidth, tableWidth.current)));
225
222
  // copy the columnWidths map and set the new width for the column being resized
226
223
  let widths = new Map(columnWidthsRef.current);
227
- widths.set(columnsRef.current[columnsRef.current.length - 1].key, 0);
228
224
  widths.set(column1.key, boundedWidth);
229
225
  // keep track of all columns that have been sized
230
226
  resizedColumnsRef.current.add(column1.key);
@@ -246,7 +242,6 @@ function $7aa22d80cd4ca621$export$cb895dcf85db1319(props) {
246
242
  ...widths,
247
243
  ...recalculatedColumnWidths
248
244
  ]);
249
- if (startResizeContentWidth.current > tableWidth.current) widths.set(columnsRef.current[columnsRef.current.length - 1].key, Math.max(0, startResizeContentWidth.current - $3122b463430f41b1$export$f61abf052f87399f(widths)));
250
245
  setColumnWidthsForRef(widths);
251
246
  /*
252
247
  when getting recalculated columns above, the column being resized is not considered "recalculated"
@@ -307,9 +302,7 @@ $parcel$export($e3f7784147dde23d$exports, "useTableState", () => $e3f7784147dde2
307
302
 
308
303
 
309
304
 
310
-
311
305
  const $7f5a58334d8866a5$var$ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);
312
- const $7f5a58334d8866a5$var$RESIZE_BUFFER_COLUMN_KEY = 'resize-buffer-column' + Math.random().toString(36).slice(2);
313
306
  function $7f5a58334d8866a5$var$buildHeaderRows(keyMap, columnNodes) {
314
307
  let columns = [];
315
308
  let seen = new Map();
@@ -513,38 +506,6 @@ class $7f5a58334d8866a5$export$596e1b2e2cf93690 extends $56JBj$reactstatelygrid.
513
506
  for (let child of node.childNodes)visit(child);
514
507
  };
515
508
  for (let node1 of nodes)visit(node1);
516
- if (Array.from(nodes).some((node)=>{
517
- var ref;
518
- return (ref = node.props) === null || ref === void 0 ? void 0 : ref.allowsResizing;
519
- })) {
520
- /*
521
- If the table content width > table width, a horizontal scroll bar is present.
522
- If a user tries to resize a column, making it smaller while they are scrolled to the
523
- end of the content horizontally, it shrinks the total table content width, causing
524
- things to snap around and breaks the resize behavior.
525
-
526
- To fix this, we add a resize buffer column (aka "spooky column") to the end of the table.
527
- The width of this column defaults to 0. If you try and shrink a column and the width of the
528
- table contents > table width, then the "spooky column" will grow to take up the difference
529
- so that the total table content width remains constant while you are resizing. Once you
530
- finish resizing, the "spooky column" snaps back to 0.
531
- */ let resizeBufferColumn = {
532
- type: 'column',
533
- key: $7f5a58334d8866a5$var$RESIZE_BUFFER_COLUMN_KEY,
534
- value: null,
535
- textValue: '',
536
- level: 0,
537
- index: columns.length,
538
- hasChildNodes: false,
539
- rendered: null,
540
- childNodes: [],
541
- props: {
542
- isResizeBuffer: true,
543
- defaultWidth: 0
544
- }
545
- };
546
- columns.push(resizeBufferColumn);
547
- }
548
509
  let headerRows = $7f5a58334d8866a5$var$buildHeaderRows(columnKeyMap, columns);
549
510
  headerRows.forEach((row, i)=>rows.splice(i, 0, row)
550
511
  );
@@ -589,12 +550,6 @@ function $e3f7784147dde23d$export$907bcc6c48325fd6(props) {
589
550
  ...props,
590
551
  collection: collection
591
552
  });
592
- const tableColumnResizeState = $7aa22d80cd4ca621$export$cb895dcf85db1319({
593
- columns: collection.columns,
594
- getDefaultWidth: props.getDefaultWidth,
595
- onColumnResize: props.onColumnResize,
596
- onColumnResizeEnd: props.onColumnResizeEnd
597
- });
598
553
  return {
599
554
  collection: collection,
600
555
  disabledKeys: disabledKeys,
@@ -607,8 +562,7 @@ function $e3f7784147dde23d$export$907bcc6c48325fd6(props) {
607
562
  column: columnKey,
608
563
  direction: direction !== null && direction !== void 0 ? direction : ((ref = props.sortDescriptor) === null || ref === void 0 ? void 0 : ref.column) === columnKey ? $e3f7784147dde23d$var$OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction] : 'ascending'
609
564
  });
610
- },
611
- ...tableColumnResizeState
565
+ }
612
566
  };
613
567
  }
614
568
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SESgB,yCAAe,CAAC,MAAwB,EAAU,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAC,CAAC,GA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AAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/utils.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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","\nimport {ColumnProps} from '@react-types/table';\nimport {getContentWidth, getDynamicColumnWidths, getMaxWidth, getMinWidth, isStatic, parseStaticWidth} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {Key, MutableRefObject, useCallback, useRef, useState} from 'react';\n\nexport interface AffectedColumnWidth {\n /** The column key. */\n key: Key,\n /** The column width. */\n width: number\n}\nexport interface AffectedColumnWidths extends Array<AffectedColumnWidth> {}\n\nexport interface ColumnResizeState<T> {\n /** A ref whose current value is the state of all the column widths. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Setter for the table width. */\n setTableWidth: (width: number) => void,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: () => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean\n}\n\nexport interface ColumnResizeStateProps<T> {\n /** Collection of existing columns. */\n columns: GridNode<T>[],\n /** Callback to determine what the default width of a column should be. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** The default table width. */\n tableWidth?: number\n}\n\nexport function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>): ColumnResizeState<T> {\n const {columns, getDefaultWidth, tableWidth: defaultTableWidth = null} = props;\n const columnsRef = useRef<GridNode<T>[]>([]);\n const tableWidth = useRef<number>(defaultTableWidth);\n const isResizing = useRef<boolean>(null);\n const startResizeContentWidth = useRef<number>();\n\n const [columnWidths, setColumnWidths] = useState<Map<Key, number>>(new Map(columns.map(col => [col.key, 0])));\n const columnWidthsRef = useRef<Map<Key, number>>(columnWidths);\n const affectedColumnWidthsRef = useRef<AffectedColumnWidths>([]);\n const [resizedColumns, setResizedColumns] = useState<Set<Key>>(new Set());\n const resizedColumnsRef = useRef<Set<Key>>(resizedColumns);\n\n function setColumnWidthsForRef(newWidths: Map<Key, number>) {\n columnWidthsRef.current = newWidths;\n // new map so that change detection is triggered\n setColumnWidths(newWidths);\n }\n /*\n returns the resolved column width in this order: \n previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width\n */\n let getResolvedColumnWidth = useCallback((column: GridNode<T>): (number | string) => {\n let columnProps = column.props as ColumnProps<T>;\n return resizedColumns?.has(column.key) ? columnWidthsRef.current.get(column.key) : columnProps.width ?? columnProps.defaultWidth ?? getDefaultWidth?.(column.props) ?? '1fr';\n }, [getDefaultWidth, resizedColumns]);\n\n let getStaticAndDynamicColumns = useCallback((columns: GridNode<T>[]) : { staticColumns: GridNode<T>[], dynamicColumns: GridNode<T>[] } => columns.reduce((acc, column) => {\n let width = getResolvedColumnWidth(column);\n return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]}; \n }, {staticColumns: [], dynamicColumns: []}), [getResolvedColumnWidth]);\n\n let buildColumnWidths = useCallback((affectedColumns: GridNode<T>[], availableSpace: number): Map<Key, number> => {\n const widths = new Map<Key, number>();\n let remainingSpace = availableSpace;\n\n const {staticColumns, dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n staticColumns.forEach(column => {\n let width = getResolvedColumnWidth(column);\n let w = parseStaticWidth(width, tableWidth.current);\n widths.set(column.key, w);\n remainingSpace -= w;\n });\n\n // dynamic columns\n if (dynamicColumns.length > 0) {\n const newColumnWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, tableWidth.current);\n for (let column of newColumnWidths) {\n widths.set(column.key, column.calculatedWidth);\n }\n }\n\n return widths;\n }, [getStaticAndDynamicColumns, getResolvedColumnWidth]);\n\n\n const prevColKeys = columnsRef.current.map(col => col.key);\n const colKeys = columns.map(col => col.key);\n // if the columns change, need to rebuild widths.\n if (!colKeys.every((col, i) => col === prevColKeys[i])) {\n columnsRef.current = columns;\n const widths = buildColumnWidths(columns, tableWidth.current);\n setColumnWidthsForRef(widths);\n }\n\n function setTableWidth(width: number) {\n if (width && width !== tableWidth.current) {\n tableWidth.current = width;\n if (!isResizing.current) {\n const widths = buildColumnWidths(columns, width);\n setColumnWidthsForRef(widths);\n }\n }\n }\n\n function onColumnResizeStart() {\n isResizing.current = true;\n startResizeContentWidth.current = getContentWidth(columnWidthsRef.current);\n }\n\n function onColumnResize(column: GridNode<T>, width: number) {\n let widthsObj = resizeColumn(column, width);\n affectedColumnWidthsRef.current = widthsObj;\n props.onColumnResize && props.onColumnResize(affectedColumnWidthsRef.current);\n }\n\n function onColumnResizeEnd() {\n isResizing.current = false;\n props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);\n affectedColumnWidthsRef.current = [];\n\n let widths = new Map<Key, number>(columnWidthsRef.current);\n // Need to set the resizeBufferColumn or \"spooky column\" back to 0 since done resizing;\n const bufferColumnKey = columnsRef.current[columnsRef.current.length - 1].key;\n widths.set(bufferColumnKey, 0);\n setColumnWidthsForRef(widths);\n }\n\n function resizeColumn(column: GridNode<T>, newWidth: number) : AffectedColumnWidths {\n let boundedWidth = Math.max(\n getMinWidth(column.props.minWidth, tableWidth.current),\n Math.min(Math.floor(newWidth), getMaxWidth(column.props.maxWidth, tableWidth.current)));\n\n // copy the columnWidths map and set the new width for the column being resized\n let widths = new Map<Key, number>(columnWidthsRef.current);\n widths.set(columnsRef.current[columnsRef.current.length - 1].key, 0);\n widths.set(column.key, boundedWidth);\n\n // keep track of all columns that have been sized\n resizedColumnsRef.current.add(column.key);\n setResizedColumns(resizedColumnsRef.current);\n\n // get the columns affected by resize and remaining space\n const resizeIndex = columnsRef.current.findIndex(col => col.key === column.key);\n let affectedColumns = columnsRef.current.slice(resizeIndex + 1);\n\n // we only care about the columns that CAN be resized, we ignore static columns.\n let {dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n // available space for affected columns\n let availableSpace = columnsRef.current.reduce((acc, column, index) => {\n if (index <= resizeIndex || isStatic(getResolvedColumnWidth(column))) {\n return acc - widths.get(column.key);\n }\n return acc;\n }, tableWidth.current);\n \n // merge the unaffected column widths and the recalculated column widths\n let recalculatedColumnWidths = buildColumnWidths(dynamicColumns, availableSpace);\n widths = new Map<Key, number>([...widths, ...recalculatedColumnWidths]);\n\n if (startResizeContentWidth.current > tableWidth.current) {\n widths.set(columnsRef.current[columnsRef.current.length - 1].key, Math.max(0, startResizeContentWidth.current - getContentWidth(widths)));\n }\n setColumnWidthsForRef(widths);\n\n /*\n when getting recalculated columns above, the column being resized is not considered \"recalculated\"\n so we need to add it to the list of affected columns\n */\n let allAffectedColumns = ([[column.key, boundedWidth], ...recalculatedColumnWidths] as [Key, number][]).map(([key, width]) => ({key, width}));\n return allAffectedColumns;\n }\n\n // This function is regenerated whenever columnWidthsRef.current changes in order to get the new correct ref value.\n let getColumnWidth = useCallback((key: Key): number => columnWidthsRef.current.get(key) ?? 0, [columnWidthsRef.current]);\n\n let getColumnMinWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMinWidth(columns[columnIndex].props.minWidth, tableWidth.current);\n }, [columns]);\n\n let getColumnMaxWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMaxWidth(columns[columnIndex].props.maxWidth, tableWidth.current);\n }, [columns]);\n\n return {\n columnWidths: columnWidthsRef,\n setTableWidth,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth,\n getColumnMinWidth,\n getColumnMaxWidth,\n isResizingColumn: isResizing.current\n };\n}\n","import {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ntype mappedColumn<T> = GridNode<T> & {\n index: number,\n delta: number,\n calculatedWidth?: number\n};\n\nexport function getContentWidth(widths: Map<Key, number>): number {\n return Array.from(widths).map(e => e[1]).reduce((acc, cur) => acc + cur, 0);\n}\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\nfunction parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n } \n let match = width.match(/^(\\d+)(?=fr$)/);\n // if width is the incorrect format, just deafult 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 parseInt(match[0], 10);\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 * (parseInt(match[0], 10) / 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 : Infinity;\n}\n\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 75;\n}\n\nfunction mapDynamicColumns<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => sum + parseFractionalUnit(column.props.defaultWidth),\n 0\n );\n \n let columns = dynamicColumns.map((column, index) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.props.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.props.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n index,\n delta \n };\n });\n \n return columns;\n}\n\nfunction findDynamicColumnWidths<T>(dynamicColumns: mappedColumn<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, col) => sum + parseFractionalUnit(col.props.defaultWidth),\n 0\n );\n\n const columns = dynamicColumns.map((column) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.props.minWidth, tableWidth),\n Math.min(Math.floor(targetWidth), getMaxWidth(column.props.maxWidth, tableWidth))\n );\n column.calculatedWidth = width;\n availableSpace -= width;\n fractions -= parseFractionalUnit(column.props.defaultWidth);\n return column;\n });\n\n return columns;\n} \n \nexport function getDynamicColumnWidths<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n \n columns.sort((a, b) => b.delta - a.delta);\n columns = findDynamicColumnWidths(columns, availableSpace, tableWidth);\n columns.sort((a, b) => a.index - b.index);\n \n return columns;\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 {AffectedColumnWidths, useTableColumnResizeState} from './useTableColumnResizeState';\nimport {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, MutableRefObject, useMemo} 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 /** A map of all the column widths by key. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Runs at the start of resizing. */\n onColumnResizeStart: () => void,\n /** Triggers the onColumnResizeEnd prop. */\n onColumnResizeEnd: () => void,\n /** Need to be able to set the table width so that it can be used to calculate the column widths, this will trigger a recalc. */\n setTableWidth: (width: number) => 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 /** Function for determining the default width of columns. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void\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 {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\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});\n \n const tableColumnResizeState = useTableColumnResizeState({columns: collection.columns, getDefaultWidth: props.getDefaultWidth, onColumnResize: props.onColumnResize, onColumnResizeEnd: props.onColumnResizeEnd});\n\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\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 ...tableColumnResizeState\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);\nconst RESIZE_BUFFER_COLUMN_KEY = 'resize-buffer-column' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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 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 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.index = 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\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 if (Array.from(nodes).some(node => node.props?.allowsResizing)) {\n /* \n If the table content width > table width, a horizontal scroll bar is present.\n If a user tries to resize a column, making it smaller while they are scrolled to the\n end of the content horizontally, it shrinks the total table content width, causing\n things to snap around and breaks the resize behavior.\n \n To fix this, we add a resize buffer column (aka \"spooky column\") to the end of the table.\n The width of this column defaults to 0. If you try and shrink a column and the width of the\n table contents > table width, then the \"spooky column\" will grow to take up the difference\n so that the total table content width remains constant while you are resizing. Once you\n finish resizing, the \"spooky column\" snaps back to 0.\n */\n let resizeBufferColumn: GridNode<T> = {\n type: 'column',\n key: RESIZE_BUFFER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: columns.length,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isResizeBuffer: true,\n defaultWidth: 0\n }\n };\n columns.push(resizeBufferColumn);\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\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.body.childNodes].length;\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SESgB,yCAAe,CAAC,MAAwB,EAAU,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAC,CAAC,GAAI,CAAC,CAAC,CAAC;MAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAK,GAAG,GAAG,GAAG;MAAE,CAAC;AAC5E,CAAC;SAGe,yCAAQ,CAAC,KAAsB,EAAW,CAAC;IACzD,MAAM,CAAC,KAAK,IAAI,IAAI,MAAM,KAAK,CAAC,KAAK,KAAgB,MAAM,CAAC,KAAK,EAAG,KAAK,qBAAqB,IAAI;AACpG,CAAC;SAEQ,yCAAmB,CAAC,KAAa,EAAU,CAAC;IACnD,EAAE,GAAG,KAAK,EACR,MAAM,CAAC,CAAC;IAEV,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;IACnB,EAA6D,AAA7D,2DAA6D;IACjE,EAAE,GAAG,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,6GAA6G,GACtI,CAAuB;QA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,CAAC;IACH,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAI,GAAG,yBAAG;;;;;;SClEL,0BAAI,CAAC,KAAgB,EAAgB,CAAC;IAC7C,MAAM,CAAC,IAAI;AACb,CAAC;AAED,0BAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAI,KAAgB,EAA6B,CAAC;IACpG,GAAG,CAAC,CAAC,WAAA,QAAQ,EAAA,CAAC,GAAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/utils.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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","\nimport {ColumnProps} from '@react-types/table';\nimport {getContentWidth, getDynamicColumnWidths, getMaxWidth, getMinWidth, isStatic, parseStaticWidth} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {Key, MutableRefObject, useCallback, useRef, useState} from 'react';\n\nexport interface AffectedColumnWidth {\n /** The column key. */\n key: Key,\n /** The column width. */\n width: number\n}\nexport interface AffectedColumnWidths extends Array<AffectedColumnWidth> {}\n\nexport interface ColumnResizeState<T> {\n /** A ref whose current value is the state of all the column widths. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Setter for the table width. */\n setTableWidth: (width: number) => void,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: () => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean\n}\n\nexport interface ColumnResizeStateProps<T> {\n /** Collection of existing columns. */\n columns: GridNode<T>[],\n /** Callback to determine what the default width of a column should be. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** The default table width. */\n tableWidth?: number\n}\n\nexport function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>): ColumnResizeState<T> {\n const {columns, getDefaultWidth, tableWidth: defaultTableWidth = null} = props;\n const columnsRef = useRef<GridNode<T>[]>([]);\n const tableWidth = useRef<number>(defaultTableWidth);\n const isResizing = useRef<boolean>(null);\n const startResizeContentWidth = useRef<number>();\n\n const [columnWidths, setColumnWidths] = useState<Map<Key, number>>(new Map(columns.map(col => [col.key, 0])));\n const columnWidthsRef = useRef<Map<Key, number>>(columnWidths);\n const affectedColumnWidthsRef = useRef<AffectedColumnWidths>([]);\n const [resizedColumns, setResizedColumns] = useState<Set<Key>>(new Set());\n const resizedColumnsRef = useRef<Set<Key>>(resizedColumns);\n\n function setColumnWidthsForRef(newWidths: Map<Key, number>) {\n columnWidthsRef.current = newWidths;\n // new map so that change detection is triggered\n setColumnWidths(newWidths);\n }\n /*\n returns the resolved column width in this order:\n previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width\n */\n let getResolvedColumnWidth = useCallback((column: GridNode<T>): (number | string) => {\n let columnProps = column.props as ColumnProps<T>;\n return resizedColumns?.has(column.key) ? columnWidthsRef.current.get(column.key) : columnProps.width ?? columnProps.defaultWidth ?? getDefaultWidth?.(column.props) ?? '1fr';\n }, [getDefaultWidth, resizedColumns]);\n\n let getStaticAndDynamicColumns = useCallback((columns: GridNode<T>[]) : { staticColumns: GridNode<T>[], dynamicColumns: GridNode<T>[] } => columns.reduce((acc, column) => {\n let width = getResolvedColumnWidth(column);\n return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]};\n }, {staticColumns: [], dynamicColumns: []}), [getResolvedColumnWidth]);\n\n let buildColumnWidths = useCallback((affectedColumns: GridNode<T>[], availableSpace: number): Map<Key, number> => {\n const widths = new Map<Key, number>();\n let remainingSpace = availableSpace;\n\n const {staticColumns, dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n staticColumns.forEach(column => {\n let width = getResolvedColumnWidth(column);\n let w = parseStaticWidth(width, tableWidth.current);\n widths.set(column.key, w);\n remainingSpace -= w;\n });\n\n // dynamic columns\n if (dynamicColumns.length > 0) {\n const newColumnWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, tableWidth.current);\n for (let column of newColumnWidths) {\n widths.set(column.key, column.calculatedWidth);\n }\n }\n\n return widths;\n }, [getStaticAndDynamicColumns, getResolvedColumnWidth]);\n\n\n const prevColKeys = columnsRef.current.map(col => col.key);\n const colKeys = columns.map(col => col.key);\n // if the columns change, need to rebuild widths.\n if (prevColKeys.length !== colKeys.length || !colKeys.every((col, i) => col === prevColKeys[i])) {\n columnsRef.current = columns;\n const widths = buildColumnWidths(columns, tableWidth.current);\n setColumnWidthsForRef(widths);\n }\n\n function setTableWidth(width: number) {\n if (width && width !== tableWidth.current) {\n tableWidth.current = width;\n if (!isResizing.current) {\n const widths = buildColumnWidths(columns, width);\n setColumnWidthsForRef(widths);\n }\n }\n }\n\n function onColumnResizeStart() {\n isResizing.current = true;\n startResizeContentWidth.current = getContentWidth(columnWidthsRef.current);\n }\n\n function onColumnResize(column: GridNode<T>, width: number) {\n let widthsObj = resizeColumn(column, width);\n affectedColumnWidthsRef.current = widthsObj;\n props.onColumnResize && props.onColumnResize(affectedColumnWidthsRef.current);\n }\n\n function onColumnResizeEnd() {\n isResizing.current = false;\n props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);\n affectedColumnWidthsRef.current = [];\n\n let widths = new Map<Key, number>(columnWidthsRef.current);\n setColumnWidthsForRef(widths);\n }\n\n function resizeColumn(column: GridNode<T>, newWidth: number) : AffectedColumnWidths {\n let boundedWidth = Math.max(\n getMinWidth(column.props.minWidth, tableWidth.current),\n Math.min(Math.floor(newWidth), getMaxWidth(column.props.maxWidth, tableWidth.current)));\n\n // copy the columnWidths map and set the new width for the column being resized\n let widths = new Map<Key, number>(columnWidthsRef.current);\n widths.set(column.key, boundedWidth);\n\n // keep track of all columns that have been sized\n resizedColumnsRef.current.add(column.key);\n setResizedColumns(resizedColumnsRef.current);\n\n // get the columns affected by resize and remaining space\n const resizeIndex = columnsRef.current.findIndex(col => col.key === column.key);\n let affectedColumns = columnsRef.current.slice(resizeIndex + 1);\n\n // we only care about the columns that CAN be resized, we ignore static columns.\n let {dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n // available space for affected columns\n let availableSpace = columnsRef.current.reduce((acc, column, index) => {\n if (index <= resizeIndex || isStatic(getResolvedColumnWidth(column))) {\n return acc - widths.get(column.key);\n }\n return acc;\n }, tableWidth.current);\n\n // merge the unaffected column widths and the recalculated column widths\n let recalculatedColumnWidths = buildColumnWidths(dynamicColumns, availableSpace);\n widths = new Map<Key, number>([...widths, ...recalculatedColumnWidths]);\n\n setColumnWidthsForRef(widths);\n\n /*\n when getting recalculated columns above, the column being resized is not considered \"recalculated\"\n so we need to add it to the list of affected columns\n */\n let allAffectedColumns = ([[column.key, boundedWidth], ...recalculatedColumnWidths] as [Key, number][]).map(([key, width]) => ({key, width}));\n return allAffectedColumns;\n }\n\n // This function is regenerated whenever columnWidthsRef.current changes in order to get the new correct ref value.\n let getColumnWidth = useCallback((key: Key): number => columnWidthsRef.current.get(key) ?? 0, [columnWidthsRef.current]);\n\n let getColumnMinWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMinWidth(columns[columnIndex].props.minWidth, tableWidth.current);\n }, [columns]);\n\n let getColumnMaxWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMaxWidth(columns[columnIndex].props.maxWidth, tableWidth.current);\n }, [columns]);\n\n return {\n columnWidths: columnWidthsRef,\n setTableWidth,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth,\n getColumnMinWidth,\n getColumnMaxWidth,\n isResizingColumn: isResizing.current\n };\n}\n","import {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ntype mappedColumn<T> = GridNode<T> & {\n index: number,\n delta: number,\n calculatedWidth?: number\n};\n\nexport function getContentWidth(widths: Map<Key, number>): number {\n return Array.from(widths).map(e => e[1]).reduce((acc, cur) => acc + cur, 0);\n}\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\nfunction parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n } \n let match = width.match(/^(\\d+)(?=fr$)/);\n // if width is the incorrect format, just deafult 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 parseInt(match[0], 10);\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 * (parseInt(match[0], 10) / 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 : Infinity;\n}\n\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 75;\n}\n\nfunction mapDynamicColumns<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => sum + parseFractionalUnit(column.props.defaultWidth),\n 0\n );\n \n let columns = dynamicColumns.map((column, index) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.props.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.props.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n index,\n delta \n };\n });\n \n return columns;\n}\n\nfunction findDynamicColumnWidths<T>(dynamicColumns: mappedColumn<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, col) => sum + parseFractionalUnit(col.props.defaultWidth),\n 0\n );\n\n const columns = dynamicColumns.map((column) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.props.minWidth, tableWidth),\n Math.min(Math.floor(targetWidth), getMaxWidth(column.props.maxWidth, tableWidth))\n );\n column.calculatedWidth = width;\n availableSpace -= width;\n fractions -= parseFractionalUnit(column.props.defaultWidth);\n return column;\n });\n\n return columns;\n} \n \nexport function getDynamicColumnWidths<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n \n columns.sort((a, b) => b.delta - a.delta);\n columns = findDynamicColumnWidths(columns, availableSpace, tableWidth);\n columns.sort((a, b) => a.index - b.index);\n \n return columns;\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} 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}\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 {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\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});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\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 = [];\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 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 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.index = 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\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\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.body.childNodes].length;\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"}
package/dist/module.js CHANGED
@@ -108,7 +108,7 @@ function $292bc4e09cd0eb62$export$cb895dcf85db1319(props) {
108
108
  setColumnWidths(newWidths);
109
109
  }
110
110
  /*
111
- returns the resolved column width in this order:
111
+ returns the resolved column width in this order:
112
112
  previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width
113
113
  */ let getResolvedColumnWidth = $1BfjW$useCallback((column)=>{
114
114
  let columnProps = column.props;
@@ -165,7 +165,7 @@ function $292bc4e09cd0eb62$export$cb895dcf85db1319(props) {
165
165
  const colKeys = columns1.map((col)=>col.key
166
166
  );
167
167
  // if the columns change, need to rebuild widths.
168
- if (!colKeys.every((col, i)=>col === prevColKeys[i]
168
+ if (prevColKeys.length !== colKeys.length || !colKeys.every((col, i)=>col === prevColKeys[i]
169
169
  )) {
170
170
  columnsRef.current = columns1;
171
171
  const widths = buildColumnWidths(columns1, tableWidth.current);
@@ -194,16 +194,12 @@ function $292bc4e09cd0eb62$export$cb895dcf85db1319(props) {
194
194
  props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);
195
195
  affectedColumnWidthsRef.current = [];
196
196
  let widths = new Map(columnWidthsRef.current);
197
- // Need to set the resizeBufferColumn or "spooky column" back to 0 since done resizing;
198
- const bufferColumnKey = columnsRef.current[columnsRef.current.length - 1].key;
199
- widths.set(bufferColumnKey, 0);
200
197
  setColumnWidthsForRef(widths);
201
198
  }
202
199
  function resizeColumn(column1, newWidth) {
203
200
  let boundedWidth = Math.max($30561577df230a30$export$f556054ce4358701(column1.props.minWidth, tableWidth.current), Math.min(Math.floor(newWidth), $30561577df230a30$export$59185c62a7544aa0(column1.props.maxWidth, tableWidth.current)));
204
201
  // copy the columnWidths map and set the new width for the column being resized
205
202
  let widths = new Map(columnWidthsRef.current);
206
- widths.set(columnsRef.current[columnsRef.current.length - 1].key, 0);
207
203
  widths.set(column1.key, boundedWidth);
208
204
  // keep track of all columns that have been sized
209
205
  resizedColumnsRef.current.add(column1.key);
@@ -225,7 +221,6 @@ function $292bc4e09cd0eb62$export$cb895dcf85db1319(props) {
225
221
  ...widths,
226
222
  ...recalculatedColumnWidths
227
223
  ]);
228
- if (startResizeContentWidth.current > tableWidth.current) widths.set(columnsRef.current[columnsRef.current.length - 1].key, Math.max(0, startResizeContentWidth.current - $30561577df230a30$export$f61abf052f87399f(widths)));
229
224
  setColumnWidthsForRef(widths);
230
225
  /*
231
226
  when getting recalculated columns above, the column being resized is not considered "recalculated"
@@ -286,9 +281,7 @@ $parcel$export($4a0dd036d492cee4$exports, "useTableState", () => $4a0dd036d492ce
286
281
 
287
282
 
288
283
 
289
-
290
284
  const $788781baa30117fa$var$ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);
291
- const $788781baa30117fa$var$RESIZE_BUFFER_COLUMN_KEY = 'resize-buffer-column' + Math.random().toString(36).slice(2);
292
285
  function $788781baa30117fa$var$buildHeaderRows(keyMap, columnNodes) {
293
286
  let columns = [];
294
287
  let seen = new Map();
@@ -492,38 +485,6 @@ class $788781baa30117fa$export$596e1b2e2cf93690 extends $1BfjW$GridCollection {
492
485
  for (let child of node.childNodes)visit(child);
493
486
  };
494
487
  for (let node1 of nodes)visit(node1);
495
- if (Array.from(nodes).some((node)=>{
496
- var ref;
497
- return (ref = node.props) === null || ref === void 0 ? void 0 : ref.allowsResizing;
498
- })) {
499
- /*
500
- If the table content width > table width, a horizontal scroll bar is present.
501
- If a user tries to resize a column, making it smaller while they are scrolled to the
502
- end of the content horizontally, it shrinks the total table content width, causing
503
- things to snap around and breaks the resize behavior.
504
-
505
- To fix this, we add a resize buffer column (aka "spooky column") to the end of the table.
506
- The width of this column defaults to 0. If you try and shrink a column and the width of the
507
- table contents > table width, then the "spooky column" will grow to take up the difference
508
- so that the total table content width remains constant while you are resizing. Once you
509
- finish resizing, the "spooky column" snaps back to 0.
510
- */ let resizeBufferColumn = {
511
- type: 'column',
512
- key: $788781baa30117fa$var$RESIZE_BUFFER_COLUMN_KEY,
513
- value: null,
514
- textValue: '',
515
- level: 0,
516
- index: columns.length,
517
- hasChildNodes: false,
518
- rendered: null,
519
- childNodes: [],
520
- props: {
521
- isResizeBuffer: true,
522
- defaultWidth: 0
523
- }
524
- };
525
- columns.push(resizeBufferColumn);
526
- }
527
488
  let headerRows = $788781baa30117fa$var$buildHeaderRows(columnKeyMap, columns);
528
489
  headerRows.forEach((row, i)=>rows.splice(i, 0, row)
529
490
  );
@@ -568,12 +529,6 @@ function $4a0dd036d492cee4$export$907bcc6c48325fd6(props) {
568
529
  ...props,
569
530
  collection: collection
570
531
  });
571
- const tableColumnResizeState = $292bc4e09cd0eb62$export$cb895dcf85db1319({
572
- columns: collection.columns,
573
- getDefaultWidth: props.getDefaultWidth,
574
- onColumnResize: props.onColumnResize,
575
- onColumnResizeEnd: props.onColumnResizeEnd
576
- });
577
532
  return {
578
533
  collection: collection,
579
534
  disabledKeys: disabledKeys,
@@ -586,8 +541,7 @@ function $4a0dd036d492cee4$export$907bcc6c48325fd6(props) {
586
541
  column: columnKey,
587
542
  direction: direction !== null && direction !== void 0 ? direction : ((ref = props.sortDescriptor) === null || ref === void 0 ? void 0 : ref.column) === columnKey ? $4a0dd036d492cee4$var$OPPOSITE_SORT_DIRECTION[props.s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,GAAG,yBAAG;;;;;;SClEL,0BAAI,CAAC,KAAgB,EAAgB,CAAC;IAC7C,MAAM,CAAC,IAAI;AACb,CAAC;AAED,0BAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAI,KAAgB,EAA6B,CAAC;IACpG,GAAG,CAAC,CAAC,WAAA,QAAQ,EAAA,CAAC,GAAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/utils.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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","\nimport {ColumnProps} from '@react-types/table';\nimport {getContentWidth, getDynamicColumnWidths, getMaxWidth, getMinWidth, isStatic, parseStaticWidth} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {Key, MutableRefObject, useCallback, useRef, useState} from 'react';\n\nexport interface AffectedColumnWidth {\n /** The column key. */\n key: Key,\n /** The column width. */\n width: number\n}\nexport interface AffectedColumnWidths extends Array<AffectedColumnWidth> {}\n\nexport interface ColumnResizeState<T> {\n /** A ref whose current value is the state of all the column widths. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Setter for the table width. */\n setTableWidth: (width: number) => void,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: () => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean\n}\n\nexport interface ColumnResizeStateProps<T> {\n /** Collection of existing columns. */\n columns: GridNode<T>[],\n /** Callback to determine what the default width of a column should be. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** The default table width. */\n tableWidth?: number\n}\n\nexport function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>): ColumnResizeState<T> {\n const {columns, getDefaultWidth, tableWidth: defaultTableWidth = null} = props;\n const columnsRef = useRef<GridNode<T>[]>([]);\n const tableWidth = useRef<number>(defaultTableWidth);\n const isResizing = useRef<boolean>(null);\n const startResizeContentWidth = useRef<number>();\n\n const [columnWidths, setColumnWidths] = useState<Map<Key, number>>(new Map(columns.map(col => [col.key, 0])));\n const columnWidthsRef = useRef<Map<Key, number>>(columnWidths);\n const affectedColumnWidthsRef = useRef<AffectedColumnWidths>([]);\n const [resizedColumns, setResizedColumns] = useState<Set<Key>>(new Set());\n const resizedColumnsRef = useRef<Set<Key>>(resizedColumns);\n\n function setColumnWidthsForRef(newWidths: Map<Key, number>) {\n columnWidthsRef.current = newWidths;\n // new map so that change detection is triggered\n setColumnWidths(newWidths);\n }\n /*\n returns the resolved column width in this order: \n previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width\n */\n let getResolvedColumnWidth = useCallback((column: GridNode<T>): (number | string) => {\n let columnProps = column.props as ColumnProps<T>;\n return resizedColumns?.has(column.key) ? columnWidthsRef.current.get(column.key) : columnProps.width ?? columnProps.defaultWidth ?? getDefaultWidth?.(column.props) ?? '1fr';\n }, [getDefaultWidth, resizedColumns]);\n\n let getStaticAndDynamicColumns = useCallback((columns: GridNode<T>[]) : { staticColumns: GridNode<T>[], dynamicColumns: GridNode<T>[] } => columns.reduce((acc, column) => {\n let width = getResolvedColumnWidth(column);\n return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]}; \n }, {staticColumns: [], dynamicColumns: []}), [getResolvedColumnWidth]);\n\n let buildColumnWidths = useCallback((affectedColumns: GridNode<T>[], availableSpace: number): Map<Key, number> => {\n const widths = new Map<Key, number>();\n let remainingSpace = availableSpace;\n\n const {staticColumns, dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n staticColumns.forEach(column => {\n let width = getResolvedColumnWidth(column);\n let w = parseStaticWidth(width, tableWidth.current);\n widths.set(column.key, w);\n remainingSpace -= w;\n });\n\n // dynamic columns\n if (dynamicColumns.length > 0) {\n const newColumnWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, tableWidth.current);\n for (let column of newColumnWidths) {\n widths.set(column.key, column.calculatedWidth);\n }\n }\n\n return widths;\n }, [getStaticAndDynamicColumns, getResolvedColumnWidth]);\n\n\n const prevColKeys = columnsRef.current.map(col => col.key);\n const colKeys = columns.map(col => col.key);\n // if the columns change, need to rebuild widths.\n if (!colKeys.every((col, i) => col === prevColKeys[i])) {\n columnsRef.current = columns;\n const widths = buildColumnWidths(columns, tableWidth.current);\n setColumnWidthsForRef(widths);\n }\n\n function setTableWidth(width: number) {\n if (width && width !== tableWidth.current) {\n tableWidth.current = width;\n if (!isResizing.current) {\n const widths = buildColumnWidths(columns, width);\n setColumnWidthsForRef(widths);\n }\n }\n }\n\n function onColumnResizeStart() {\n isResizing.current = true;\n startResizeContentWidth.current = getContentWidth(columnWidthsRef.current);\n }\n\n function onColumnResize(column: GridNode<T>, width: number) {\n let widthsObj = resizeColumn(column, width);\n affectedColumnWidthsRef.current = widthsObj;\n props.onColumnResize && props.onColumnResize(affectedColumnWidthsRef.current);\n }\n\n function onColumnResizeEnd() {\n isResizing.current = false;\n props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);\n affectedColumnWidthsRef.current = [];\n\n let widths = new Map<Key, number>(columnWidthsRef.current);\n // Need to set the resizeBufferColumn or \"spooky column\" back to 0 since done resizing;\n const bufferColumnKey = columnsRef.current[columnsRef.current.length - 1].key;\n widths.set(bufferColumnKey, 0);\n setColumnWidthsForRef(widths);\n }\n\n function resizeColumn(column: GridNode<T>, newWidth: number) : AffectedColumnWidths {\n let boundedWidth = Math.max(\n getMinWidth(column.props.minWidth, tableWidth.current),\n Math.min(Math.floor(newWidth), getMaxWidth(column.props.maxWidth, tableWidth.current)));\n\n // copy the columnWidths map and set the new width for the column being resized\n let widths = new Map<Key, number>(columnWidthsRef.current);\n widths.set(columnsRef.current[columnsRef.current.length - 1].key, 0);\n widths.set(column.key, boundedWidth);\n\n // keep track of all columns that have been sized\n resizedColumnsRef.current.add(column.key);\n setResizedColumns(resizedColumnsRef.current);\n\n // get the columns affected by resize and remaining space\n const resizeIndex = columnsRef.current.findIndex(col => col.key === column.key);\n let affectedColumns = columnsRef.current.slice(resizeIndex + 1);\n\n // we only care about the columns that CAN be resized, we ignore static columns.\n let {dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n // available space for affected columns\n let availableSpace = columnsRef.current.reduce((acc, column, index) => {\n if (index <= resizeIndex || isStatic(getResolvedColumnWidth(column))) {\n return acc - widths.get(column.key);\n }\n return acc;\n }, tableWidth.current);\n \n // merge the unaffected column widths and the recalculated column widths\n let recalculatedColumnWidths = buildColumnWidths(dynamicColumns, availableSpace);\n widths = new Map<Key, number>([...widths, ...recalculatedColumnWidths]);\n\n if (startResizeContentWidth.current > tableWidth.current) {\n widths.set(columnsRef.current[columnsRef.current.length - 1].key, Math.max(0, startResizeContentWidth.current - getContentWidth(widths)));\n }\n setColumnWidthsForRef(widths);\n\n /*\n when getting recalculated columns above, the column being resized is not considered \"recalculated\"\n so we need to add it to the list of affected columns\n */\n let allAffectedColumns = ([[column.key, boundedWidth], ...recalculatedColumnWidths] as [Key, number][]).map(([key, width]) => ({key, width}));\n return allAffectedColumns;\n }\n\n // This function is regenerated whenever columnWidthsRef.current changes in order to get the new correct ref value.\n let getColumnWidth = useCallback((key: Key): number => columnWidthsRef.current.get(key) ?? 0, [columnWidthsRef.current]);\n\n let getColumnMinWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMinWidth(columns[columnIndex].props.minWidth, tableWidth.current);\n }, [columns]);\n\n let getColumnMaxWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMaxWidth(columns[columnIndex].props.maxWidth, tableWidth.current);\n }, [columns]);\n\n return {\n columnWidths: columnWidthsRef,\n setTableWidth,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth,\n getColumnMinWidth,\n getColumnMaxWidth,\n isResizingColumn: isResizing.current\n };\n}\n","import {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ntype mappedColumn<T> = GridNode<T> & {\n index: number,\n delta: number,\n calculatedWidth?: number\n};\n\nexport function getContentWidth(widths: Map<Key, number>): number {\n return Array.from(widths).map(e => e[1]).reduce((acc, cur) => acc + cur, 0);\n}\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\nfunction parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n } \n let match = width.match(/^(\\d+)(?=fr$)/);\n // if width is the incorrect format, just deafult 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 parseInt(match[0], 10);\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 * (parseInt(match[0], 10) / 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 : Infinity;\n}\n\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 75;\n}\n\nfunction mapDynamicColumns<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => sum + parseFractionalUnit(column.props.defaultWidth),\n 0\n );\n \n let columns = dynamicColumns.map((column, index) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.props.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.props.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n index,\n delta \n };\n });\n \n return columns;\n}\n\nfunction findDynamicColumnWidths<T>(dynamicColumns: mappedColumn<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, col) => sum + parseFractionalUnit(col.props.defaultWidth),\n 0\n );\n\n const columns = dynamicColumns.map((column) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.props.minWidth, tableWidth),\n Math.min(Math.floor(targetWidth), getMaxWidth(column.props.maxWidth, tableWidth))\n );\n column.calculatedWidth = width;\n availableSpace -= width;\n fractions -= parseFractionalUnit(column.props.defaultWidth);\n return column;\n });\n\n return columns;\n} \n \nexport function getDynamicColumnWidths<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n \n columns.sort((a, b) => b.delta - a.delta);\n columns = findDynamicColumnWidths(columns, availableSpace, tableWidth);\n columns.sort((a, b) => a.index - b.index);\n \n return columns;\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 {AffectedColumnWidths, useTableColumnResizeState} from './useTableColumnResizeState';\nimport {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';\nimport {GridNode} from '@react-types/grid';\nimport {GridState, useGridState} from '@react-stately/grid';\nimport {TableCollection as ITableCollection} from '@react-types/table';\nimport {Key, MutableRefObject, useMemo} 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 /** A map of all the column widths by key. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Runs at the start of resizing. */\n onColumnResizeStart: () => void,\n /** Triggers the onColumnResizeEnd prop. */\n onColumnResizeEnd: () => void,\n /** Need to be able to set the table width so that it can be used to calculate the column widths, this will trigger a recalc. */\n setTableWidth: (width: number) => 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 /** Function for determining the default width of columns. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void\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 {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\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});\n \n const tableColumnResizeState = useTableColumnResizeState({columns: collection.columns, getDefaultWidth: props.getDefaultWidth, onColumnResize: props.onColumnResize, onColumnResizeEnd: props.onColumnResizeEnd});\n\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\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 ...tableColumnResizeState\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);\nconst RESIZE_BUFFER_COLUMN_KEY = 'resize-buffer-column' + Math.random().toString(36).slice(2);\n\nfunction buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {\n let columns = [];\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 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 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.index = 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\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 if (Array.from(nodes).some(node => node.props?.allowsResizing)) {\n /* \n If the table content width > table width, a horizontal scroll bar is present.\n If a user tries to resize a column, making it smaller while they are scrolled to the\n end of the content horizontally, it shrinks the total table content width, causing\n things to snap around and breaks the resize behavior.\n \n To fix this, we add a resize buffer column (aka \"spooky column\") to the end of the table.\n The width of this column defaults to 0. If you try and shrink a column and the width of the\n table contents > table width, then the \"spooky column\" will grow to take up the difference\n so that the total table content width remains constant while you are resizing. Once you\n finish resizing, the \"spooky column\" snaps back to 0.\n */\n let resizeBufferColumn: GridNode<T> = {\n type: 'column',\n key: RESIZE_BUFFER_COLUMN_KEY,\n value: null,\n textValue: '',\n level: 0,\n index: columns.length,\n hasChildNodes: false,\n rendered: null,\n childNodes: [],\n props: {\n isResizeBuffer: true,\n defaultWidth: 0\n }\n };\n columns.push(resizeBufferColumn);\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\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.body.childNodes].length;\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":";;;;;;;;;;;;;;;;;;SESgB,yCAAe,CAAC,MAAwB,EAAU,CAAC;IACjE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAC,CAAC,GAAI,CAAC,CAAC,CAAC;MAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAK,GAAG,GAAG,GAAG;MAAE,CAAC;AAC5E,CAAC;SAGe,yCAAQ,CAAC,KAAsB,EAAW,CAAC;IACzD,MAAM,CAAC,KAAK,IAAI,IAAI,MAAM,KAAK,CAAC,KAAK,KAAgB,MAAM,CAAC,KAAK,EAAG,KAAK,qBAAqB,IAAI;AACpG,CAAC;SAEQ,yCAAmB,CAAC,KAAa,EAAU,CAAC;IACnD,EAAE,GAAG,KAAK,EACR,MAAM,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AAC,GAAK,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG;iBAClE,UAAU,CAAC,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,IACtE,UAAU,CAAC,aAAa,KAAK,OAAO,CAAC,aAAa;QACtD,CAAC;IACH,CAAC;AACH,CAAC;AAED,EAIG,AAJH;;;;CAIG,AAJH,EAIG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAI,GAAG,yBAAG;;;;;;SClEL,0BAAI,CAAC,KAAgB,EAAgB,CAAC;IAC7C,MAAM,CAAC,IAAI;AACb,CAAC;AAED,0BAAI,CAAC,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAI,KAAgB,EAA6B,CAAC;IACpG,GAAG,CAAC,CAAC,WAAA,QAAQ,EAAA,CAAC,GAAG,KAAK;IAEtB,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,QAAQ,GAAG,CAAE,MAAK,KAAK,CAAC,CAAY,gBAAK,CAAE;UACxG,CAAC;QACL,IAAI,EAAE,CAAM;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,QAAQ;mBAClB,SAAS;QACT,CAAY,aAAE,KAAK,CAAC,CAAY;QAChC,aAAa,EAAE,KAAK;IACtB,CAAC;AACH,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,EAAoE,AAApE,kEAAoE;AACpE,GAAG,CAAC,yCAAK,GAAG,0BAAI;","sources":["packages/@react-stately/table/src/index.ts","packages/@react-stately/table/src/useTableColumnResizeState.ts","packages/@react-stately/table/src/utils.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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n","\nimport {ColumnProps} from '@react-types/table';\nimport {getContentWidth, getDynamicColumnWidths, getMaxWidth, getMinWidth, isStatic, parseStaticWidth} from './utils';\nimport {GridNode} from '@react-types/grid';\nimport {Key, MutableRefObject, useCallback, useRef, useState} from 'react';\n\nexport interface AffectedColumnWidth {\n /** The column key. */\n key: Key,\n /** The column width. */\n width: number\n}\nexport interface AffectedColumnWidths extends Array<AffectedColumnWidth> {}\n\nexport interface ColumnResizeState<T> {\n /** A ref whose current value is the state of all the column widths. */\n columnWidths: MutableRefObject<Map<Key, number>>,\n /** Setter for the table width. */\n setTableWidth: (width: number) => void,\n /** Trigger a resize and recalc. */\n onColumnResize: (column: GridNode<T>, width: number) => void,\n /** Callback for when onColumnResize has started. */\n onColumnResizeStart: () => void,\n /** Callback for when onColumnResize has ended. */\n onColumnResizeEnd: () => void,\n /** Getter for column width. */\n getColumnWidth(key: Key): number,\n /** Getter for column min width. */\n getColumnMinWidth(key: Key): number,\n /** Getter for column max widths. */\n getColumnMaxWidth(key: Key): number,\n /** Boolean for if a column is being resized. */\n isResizingColumn: boolean\n}\n\nexport interface ColumnResizeStateProps<T> {\n /** Collection of existing columns. */\n columns: GridNode<T>[],\n /** Callback to determine what the default width of a column should be. */\n getDefaultWidth?: (props) => string | number,\n /** Callback that is invoked during the entirety of the resize event. */\n onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** Callback that is invoked when the resize event is ended. */\n onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void,\n /** The default table width. */\n tableWidth?: number\n}\n\nexport function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>): ColumnResizeState<T> {\n const {columns, getDefaultWidth, tableWidth: defaultTableWidth = null} = props;\n const columnsRef = useRef<GridNode<T>[]>([]);\n const tableWidth = useRef<number>(defaultTableWidth);\n const isResizing = useRef<boolean>(null);\n const startResizeContentWidth = useRef<number>();\n\n const [columnWidths, setColumnWidths] = useState<Map<Key, number>>(new Map(columns.map(col => [col.key, 0])));\n const columnWidthsRef = useRef<Map<Key, number>>(columnWidths);\n const affectedColumnWidthsRef = useRef<AffectedColumnWidths>([]);\n const [resizedColumns, setResizedColumns] = useState<Set<Key>>(new Set());\n const resizedColumnsRef = useRef<Set<Key>>(resizedColumns);\n\n function setColumnWidthsForRef(newWidths: Map<Key, number>) {\n columnWidthsRef.current = newWidths;\n // new map so that change detection is triggered\n setColumnWidths(newWidths);\n }\n /*\n returns the resolved column width in this order:\n previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width\n */\n let getResolvedColumnWidth = useCallback((column: GridNode<T>): (number | string) => {\n let columnProps = column.props as ColumnProps<T>;\n return resizedColumns?.has(column.key) ? columnWidthsRef.current.get(column.key) : columnProps.width ?? columnProps.defaultWidth ?? getDefaultWidth?.(column.props) ?? '1fr';\n }, [getDefaultWidth, resizedColumns]);\n\n let getStaticAndDynamicColumns = useCallback((columns: GridNode<T>[]) : { staticColumns: GridNode<T>[], dynamicColumns: GridNode<T>[] } => columns.reduce((acc, column) => {\n let width = getResolvedColumnWidth(column);\n return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]};\n }, {staticColumns: [], dynamicColumns: []}), [getResolvedColumnWidth]);\n\n let buildColumnWidths = useCallback((affectedColumns: GridNode<T>[], availableSpace: number): Map<Key, number> => {\n const widths = new Map<Key, number>();\n let remainingSpace = availableSpace;\n\n const {staticColumns, dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n staticColumns.forEach(column => {\n let width = getResolvedColumnWidth(column);\n let w = parseStaticWidth(width, tableWidth.current);\n widths.set(column.key, w);\n remainingSpace -= w;\n });\n\n // dynamic columns\n if (dynamicColumns.length > 0) {\n const newColumnWidths = getDynamicColumnWidths(dynamicColumns, remainingSpace, tableWidth.current);\n for (let column of newColumnWidths) {\n widths.set(column.key, column.calculatedWidth);\n }\n }\n\n return widths;\n }, [getStaticAndDynamicColumns, getResolvedColumnWidth]);\n\n\n const prevColKeys = columnsRef.current.map(col => col.key);\n const colKeys = columns.map(col => col.key);\n // if the columns change, need to rebuild widths.\n if (prevColKeys.length !== colKeys.length || !colKeys.every((col, i) => col === prevColKeys[i])) {\n columnsRef.current = columns;\n const widths = buildColumnWidths(columns, tableWidth.current);\n setColumnWidthsForRef(widths);\n }\n\n function setTableWidth(width: number) {\n if (width && width !== tableWidth.current) {\n tableWidth.current = width;\n if (!isResizing.current) {\n const widths = buildColumnWidths(columns, width);\n setColumnWidthsForRef(widths);\n }\n }\n }\n\n function onColumnResizeStart() {\n isResizing.current = true;\n startResizeContentWidth.current = getContentWidth(columnWidthsRef.current);\n }\n\n function onColumnResize(column: GridNode<T>, width: number) {\n let widthsObj = resizeColumn(column, width);\n affectedColumnWidthsRef.current = widthsObj;\n props.onColumnResize && props.onColumnResize(affectedColumnWidthsRef.current);\n }\n\n function onColumnResizeEnd() {\n isResizing.current = false;\n props.onColumnResizeEnd && props.onColumnResizeEnd(affectedColumnWidthsRef.current);\n affectedColumnWidthsRef.current = [];\n\n let widths = new Map<Key, number>(columnWidthsRef.current);\n setColumnWidthsForRef(widths);\n }\n\n function resizeColumn(column: GridNode<T>, newWidth: number) : AffectedColumnWidths {\n let boundedWidth = Math.max(\n getMinWidth(column.props.minWidth, tableWidth.current),\n Math.min(Math.floor(newWidth), getMaxWidth(column.props.maxWidth, tableWidth.current)));\n\n // copy the columnWidths map and set the new width for the column being resized\n let widths = new Map<Key, number>(columnWidthsRef.current);\n widths.set(column.key, boundedWidth);\n\n // keep track of all columns that have been sized\n resizedColumnsRef.current.add(column.key);\n setResizedColumns(resizedColumnsRef.current);\n\n // get the columns affected by resize and remaining space\n const resizeIndex = columnsRef.current.findIndex(col => col.key === column.key);\n let affectedColumns = columnsRef.current.slice(resizeIndex + 1);\n\n // we only care about the columns that CAN be resized, we ignore static columns.\n let {dynamicColumns} = getStaticAndDynamicColumns(affectedColumns);\n\n // available space for affected columns\n let availableSpace = columnsRef.current.reduce((acc, column, index) => {\n if (index <= resizeIndex || isStatic(getResolvedColumnWidth(column))) {\n return acc - widths.get(column.key);\n }\n return acc;\n }, tableWidth.current);\n\n // merge the unaffected column widths and the recalculated column widths\n let recalculatedColumnWidths = buildColumnWidths(dynamicColumns, availableSpace);\n widths = new Map<Key, number>([...widths, ...recalculatedColumnWidths]);\n\n setColumnWidthsForRef(widths);\n\n /*\n when getting recalculated columns above, the column being resized is not considered \"recalculated\"\n so we need to add it to the list of affected columns\n */\n let allAffectedColumns = ([[column.key, boundedWidth], ...recalculatedColumnWidths] as [Key, number][]).map(([key, width]) => ({key, width}));\n return allAffectedColumns;\n }\n\n // This function is regenerated whenever columnWidthsRef.current changes in order to get the new correct ref value.\n let getColumnWidth = useCallback((key: Key): number => columnWidthsRef.current.get(key) ?? 0, [columnWidthsRef.current]);\n\n let getColumnMinWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMinWidth(columns[columnIndex].props.minWidth, tableWidth.current);\n }, [columns]);\n\n let getColumnMaxWidth = useCallback((key: Key) => {\n const columnIndex = columns.findIndex(col => col.key === key);\n if (columnIndex === -1) {\n return;\n }\n return getMaxWidth(columns[columnIndex].props.maxWidth, tableWidth.current);\n }, [columns]);\n\n return {\n columnWidths: columnWidthsRef,\n setTableWidth,\n onColumnResize,\n onColumnResizeStart,\n onColumnResizeEnd,\n getColumnWidth,\n getColumnMinWidth,\n getColumnMaxWidth,\n isResizingColumn: isResizing.current\n };\n}\n","import {GridNode} from '@react-types/grid';\nimport {Key} from 'react';\n\ntype mappedColumn<T> = GridNode<T> & {\n index: number,\n delta: number,\n calculatedWidth?: number\n};\n\nexport function getContentWidth(widths: Map<Key, number>): number {\n return Array.from(widths).map(e => e[1]).reduce((acc, cur) => acc + cur, 0);\n}\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\nfunction parseFractionalUnit(width: string): number {\n if (!width) {\n return 1;\n } \n let match = width.match(/^(\\d+)(?=fr$)/);\n // if width is the incorrect format, just deafult 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 parseInt(match[0], 10);\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 * (parseInt(match[0], 10) / 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 : Infinity;\n}\n\nexport function getMinWidth(minWidth: number | string, tableWidth: number): number {\n return minWidth != null\n ? parseStaticWidth(minWidth, tableWidth)\n : 75;\n}\n\nfunction mapDynamicColumns<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, column) => sum + parseFractionalUnit(column.props.defaultWidth),\n 0\n );\n \n let columns = dynamicColumns.map((column, index) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n const delta = Math.max(\n getMinWidth(column.props.minWidth, tableWidth) - targetWidth,\n targetWidth - getMaxWidth(column.props.maxWidth, tableWidth)\n );\n\n return {\n ...column,\n index,\n delta \n };\n });\n \n return columns;\n}\n\nfunction findDynamicColumnWidths<T>(dynamicColumns: mappedColumn<T>[], availableSpace: number, tableWidth: number): mappedColumn<T>[] {\n let fractions = dynamicColumns.reduce(\n (sum, col) => sum + parseFractionalUnit(col.props.defaultWidth),\n 0\n );\n\n const columns = dynamicColumns.map((column) => {\n const targetWidth =\n (parseFractionalUnit(column.props.defaultWidth) * availableSpace) / fractions;\n let width = Math.max(\n getMinWidth(column.props.minWidth, tableWidth),\n Math.min(Math.floor(targetWidth), getMaxWidth(column.props.maxWidth, tableWidth))\n );\n column.calculatedWidth = width;\n availableSpace -= width;\n fractions -= parseFractionalUnit(column.props.defaultWidth);\n return column;\n });\n\n return columns;\n} \n \nexport function getDynamicColumnWidths<T>(dynamicColumns: GridNode<T>[], availableSpace: number, tableWidth: number) {\n let columns = mapDynamicColumns(dynamicColumns, availableSpace, tableWidth);\n \n columns.sort((a, b) => b.delta - a.delta);\n columns = findDynamicColumnWidths(columns, availableSpace, tableWidth);\n columns.sort((a, b) => a.index - b.index);\n \n return columns;\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} 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}\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 {selectionMode = 'none'} = props;\n\n let context = useMemo(() => ({\n showSelectionCheckboxes: props.showSelectionCheckboxes && selectionMode !== 'none',\n selectionMode,\n columns: []\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});\n\n return {\n collection,\n disabledKeys,\n selectionManager,\n showSelectionCheckboxes: props.showSelectionCheckboxes || false,\n sortDescriptor: props.sortDescriptor,\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 = [];\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 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 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.index = 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\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\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.body.childNodes].length;\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
@@ -65,24 +65,6 @@ export interface TableState<T> extends GridState<T, TableCollection<T>> {
65
65
  sortDescriptor: SortDescriptor;
66
66
  /** Calls the provided onSortChange handler with the provided column key and sort direction. */
67
67
  sort(columnKey: Key, direction?: 'ascending' | 'descending'): void;
68
- /** A map of all the column widths by key. */
69
- columnWidths: MutableRefObject<Map<Key, number>>;
70
- /** Boolean for if a column is being resized. */
71
- isResizingColumn: boolean;
72
- /** Getter for column width. */
73
- getColumnWidth(key: Key): number;
74
- /** Getter for column min width. */
75
- getColumnMinWidth(key: Key): number;
76
- /** Getter for column max widths. */
77
- getColumnMaxWidth(key: Key): number;
78
- /** Trigger a resize and recalc. */
79
- onColumnResize: (column: GridNode<T>, width: number) => void;
80
- /** Runs at the start of resizing. */
81
- onColumnResizeStart: () => void;
82
- /** Triggers the onColumnResizeEnd prop. */
83
- onColumnResizeEnd: () => void;
84
- /** Need to be able to set the table width so that it can be used to calculate the column widths, this will trigger a recalc. */
85
- setTableWidth: (width: number) => void;
86
68
  }
87
69
  export interface CollectionBuilderContext<T> {
88
70
  showSelectionCheckboxes: boolean;
@@ -92,12 +74,6 @@ export interface CollectionBuilderContext<T> {
92
74
  export interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {
93
75
  /** Whether the row selection checkboxes should be displayed. */
94
76
  showSelectionCheckboxes?: boolean;
95
- /** Function for determining the default width of columns. */
96
- getDefaultWidth?: (props: any) => string | number;
97
- /** Callback that is invoked during the entirety of the resize event. */
98
- onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void;
99
- /** Callback that is invoked when the resize event is ended. */
100
- onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void;
101
77
  }
102
78
  /**
103
79
  * Provides state management for a table component. Handles building a collection
@@ -1 +1 @@
1
- {"mappings":";;;;;;AAGA,kBAAkB,CAAC,IAAI,SAAS,CAAC,CAAC,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAEF,gCAAgC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,CAEhE;AAGD,yBAAyB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAExD;AAgBD,iCAAiC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CASnF;AAGD,4BAA4B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,4BAA4B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIjF;AAgDD,uCAAuC,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAQlH;ACxG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C,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAE,2BAA2B,EAAE,QAAQ;IAClG,gEAAgE;IAChE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,6DAA6D;IAC7D,eAAe,CAAC,EAAE,CAAC,KAAK,KAAA,KAAK,MAAM,GAAG,MAAM,CAAC;IAC7C,wEAAwE;IACxE,cAAc,CAAC,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACtE,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,CAAC,oBAAoB,EAAE,oBAAoB,KAAK,IAAI,CAAA;CACzE;AAOD;;;GAGG;AACH,8BAA8B,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAmCxF;ACjED;;;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;AClBtD,OAAO,EAAC,OAAO,EAAC,MAAM,4BAA4B,CAAC","sources":["packages/@react-stately/table/src/packages/@react-stately/table/src/utils.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableColumnResizeState.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/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,"/*\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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;;AAGA,kBAAkB,CAAC,IAAI,SAAS,CAAC,CAAC,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;AAEF,gCAAgC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,MAAM,CAEhE;AAGD,yBAAyB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAExD;AAgBD,iCAAiC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CASnF;AAGD,4BAA4B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,4BAA4B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIjF;AAgDD,uCAAuC,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EA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ils.ts","packages/@react-stately/table/src/packages/@react-stately/table/src/useTableColumnResizeState.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/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,"/*\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 * from './useTableColumnResizeState';\nexport * from './utils';\nexport * from './useTableState';\nexport * from './TableHeader';\nexport * from './TableBody';\nexport * from './Column';\nexport * from './Row';\nexport * from './Cell';\nexport {Section} from '@react-stately/collections';\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.2.1-nightly.3335+70e769acf",
3
+ "version": "3.2.1-nightly.3341+0056d8b46",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,13 +18,12 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/utils": "3.0.0-nightly.1635+70e769acf",
22
- "@react-stately/collections": "3.0.0-nightly.1635+70e769acf",
23
- "@react-stately/grid": "3.2.2-nightly.3335+70e769acf",
24
- "@react-stately/selection": "3.0.0-nightly.1635+70e769acf",
25
- "@react-types/grid": "3.1.2-nightly.3335+70e769acf",
26
- "@react-types/shared": "3.0.0-nightly.1635+70e769acf",
27
- "@react-types/table": "3.2.1-nightly.3335+70e769acf"
21
+ "@react-stately/collections": "3.0.0-nightly.1641+0056d8b46",
22
+ "@react-stately/grid": "3.2.2-nightly.3341+0056d8b46",
23
+ "@react-stately/selection": "3.0.0-nightly.1641+0056d8b46",
24
+ "@react-types/grid": "3.1.2-nightly.3341+0056d8b46",
25
+ "@react-types/shared": "3.0.0-nightly.1641+0056d8b46",
26
+ "@react-types/table": "3.2.1-nightly.3341+0056d8b46"
28
27
  },
29
28
  "peerDependencies": {
30
29
  "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
@@ -32,5 +31,5 @@
32
31
  "publishConfig": {
33
32
  "access": "public"
34
33
  },
35
- "gitHead": "70e769acf639fc4ef3a704cb8fad81349cb4137a"
34
+ "gitHead": "0056d8b4614269a9e3267ea7ce91c12d45771c19"
36
35
  }
@@ -18,7 +18,6 @@ interface GridCollectionOptions {
18
18
  }
19
19
 
20
20
  const ROW_HEADER_COLUMN_KEY = 'row-header-column-' + Math.random().toString(36).slice(2);
21
- const RESIZE_BUFFER_COLUMN_KEY = 'resize-buffer-column' + Math.random().toString(36).slice(2);
22
21
 
23
22
  function buildHeaderRows<T>(keyMap: Map<Key, GridNode<T>>, columnNodes: GridNode<T>[]): GridNode<T>[] {
24
23
  let columns = [];
@@ -218,37 +217,6 @@ export class TableCollection<T> extends GridCollection<T> {
218
217
  visit(node);
219
218
  }
220
219
 
221
- if (Array.from(nodes).some(node => node.props?.allowsResizing)) {
222
- /*
223
- If the table content width > table width, a horizontal scroll bar is present.
224
- If a user tries to resize a column, making it smaller while they are scrolled to the
225
- end of the content horizontally, it shrinks the total table content width, causing
226
- things to snap around and breaks the resize behavior.
227
-
228
- To fix this, we add a resize buffer column (aka "spooky column") to the end of the table.
229
- The width of this column defaults to 0. If you try and shrink a column and the width of the
230
- table contents > table width, then the "spooky column" will grow to take up the difference
231
- so that the total table content width remains constant while you are resizing. Once you
232
- finish resizing, the "spooky column" snaps back to 0.
233
- */
234
- let resizeBufferColumn: GridNode<T> = {
235
- type: 'column',
236
- key: RESIZE_BUFFER_COLUMN_KEY,
237
- value: null,
238
- textValue: '',
239
- level: 0,
240
- index: columns.length,
241
- hasChildNodes: false,
242
- rendered: null,
243
- childNodes: [],
244
- props: {
245
- isResizeBuffer: true,
246
- defaultWidth: 0
247
- }
248
- };
249
- columns.push(resizeBufferColumn);
250
- }
251
-
252
220
  let headerRows = buildHeaderRows(columnKeyMap, columns) as GridNode<T>[];
253
221
  headerRows.forEach((row, i) => rows.splice(i, 0, row));
254
222
 
@@ -65,7 +65,7 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
65
65
  setColumnWidths(newWidths);
66
66
  }
67
67
  /*
68
- returns the resolved column width in this order:
68
+ returns the resolved column width in this order:
69
69
  previously calculated width -> controlled width prop -> uncontrolled defaultWidth prop -> dev assigned width -> default dynamic width
70
70
  */
71
71
  let getResolvedColumnWidth = useCallback((column: GridNode<T>): (number | string) => {
@@ -75,7 +75,7 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
75
75
 
76
76
  let getStaticAndDynamicColumns = useCallback((columns: GridNode<T>[]) : { staticColumns: GridNode<T>[], dynamicColumns: GridNode<T>[] } => columns.reduce((acc, column) => {
77
77
  let width = getResolvedColumnWidth(column);
78
- return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]};
78
+ return isStatic(width) ? {...acc, staticColumns: [...acc.staticColumns, column]} : {...acc, dynamicColumns: [...acc.dynamicColumns, column]};
79
79
  }, {staticColumns: [], dynamicColumns: []}), [getResolvedColumnWidth]);
80
80
 
81
81
  let buildColumnWidths = useCallback((affectedColumns: GridNode<T>[], availableSpace: number): Map<Key, number> => {
@@ -106,7 +106,7 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
106
106
  const prevColKeys = columnsRef.current.map(col => col.key);
107
107
  const colKeys = columns.map(col => col.key);
108
108
  // if the columns change, need to rebuild widths.
109
- if (!colKeys.every((col, i) => col === prevColKeys[i])) {
109
+ if (prevColKeys.length !== colKeys.length || !colKeys.every((col, i) => col === prevColKeys[i])) {
110
110
  columnsRef.current = columns;
111
111
  const widths = buildColumnWidths(columns, tableWidth.current);
112
112
  setColumnWidthsForRef(widths);
@@ -139,9 +139,6 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
139
139
  affectedColumnWidthsRef.current = [];
140
140
 
141
141
  let widths = new Map<Key, number>(columnWidthsRef.current);
142
- // Need to set the resizeBufferColumn or "spooky column" back to 0 since done resizing;
143
- const bufferColumnKey = columnsRef.current[columnsRef.current.length - 1].key;
144
- widths.set(bufferColumnKey, 0);
145
142
  setColumnWidthsForRef(widths);
146
143
  }
147
144
 
@@ -152,7 +149,6 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
152
149
 
153
150
  // copy the columnWidths map and set the new width for the column being resized
154
151
  let widths = new Map<Key, number>(columnWidthsRef.current);
155
- widths.set(columnsRef.current[columnsRef.current.length - 1].key, 0);
156
152
  widths.set(column.key, boundedWidth);
157
153
 
158
154
  // keep track of all columns that have been sized
@@ -173,14 +169,11 @@ export function useTableColumnResizeState<T>(props: ColumnResizeStateProps<T>):
173
169
  }
174
170
  return acc;
175
171
  }, tableWidth.current);
176
-
172
+
177
173
  // merge the unaffected column widths and the recalculated column widths
178
174
  let recalculatedColumnWidths = buildColumnWidths(dynamicColumns, availableSpace);
179
175
  widths = new Map<Key, number>([...widths, ...recalculatedColumnWidths]);
180
176
 
181
- if (startResizeContentWidth.current > tableWidth.current) {
182
- widths.set(columnsRef.current[columnsRef.current.length - 1].key, Math.max(0, startResizeContentWidth.current - getContentWidth(widths)));
183
- }
184
177
  setColumnWidthsForRef(widths);
185
178
 
186
179
  /*
@@ -10,12 +10,10 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {AffectedColumnWidths, useTableColumnResizeState} from './useTableColumnResizeState';
14
13
  import {CollectionBase, Node, SelectionMode, Sortable, SortDescriptor, SortDirection} from '@react-types/shared';
15
- import {GridNode} from '@react-types/grid';
16
14
  import {GridState, useGridState} from '@react-stately/grid';
17
15
  import {TableCollection as ITableCollection} from '@react-types/table';
18
- import {Key, MutableRefObject, useMemo} from 'react';
16
+ import {Key, useMemo} from 'react';
19
17
  import {MultipleSelectionStateProps} from '@react-stately/selection';
20
18
  import {TableCollection} from './TableCollection';
21
19
  import {useCollection} from '@react-stately/collections';
@@ -28,25 +26,7 @@ export interface TableState<T> extends GridState<T, ITableCollection<T>> {
28
26
  /** The current sorted column and direction. */
29
27
  sortDescriptor: SortDescriptor,
30
28
  /** Calls the provided onSortChange handler with the provided column key and sort direction. */
31
- sort(columnKey: Key, direction?: 'ascending' | 'descending'): void,
32
- /** A map of all the column widths by key. */
33
- columnWidths: MutableRefObject<Map<Key, number>>,
34
- /** Boolean for if a column is being resized. */
35
- isResizingColumn: boolean,
36
- /** Getter for column width. */
37
- getColumnWidth(key: Key): number,
38
- /** Getter for column min width. */
39
- getColumnMinWidth(key: Key): number,
40
- /** Getter for column max widths. */
41
- getColumnMaxWidth(key: Key): number,
42
- /** Trigger a resize and recalc. */
43
- onColumnResize: (column: GridNode<T>, width: number) => void,
44
- /** Runs at the start of resizing. */
45
- onColumnResizeStart: () => void,
46
- /** Triggers the onColumnResizeEnd prop. */
47
- onColumnResizeEnd: () => void,
48
- /** Need to be able to set the table width so that it can be used to calculate the column widths, this will trigger a recalc. */
49
- setTableWidth: (width: number) => void
29
+ sort(columnKey: Key, direction?: 'ascending' | 'descending'): void
50
30
  }
51
31
 
52
32
  export interface CollectionBuilderContext<T> {
@@ -57,13 +37,7 @@ export interface CollectionBuilderContext<T> {
57
37
 
58
38
  export interface TableStateProps<T> extends CollectionBase<T>, MultipleSelectionStateProps, Sortable {
59
39
  /** Whether the row selection checkboxes should be displayed. */
60
- showSelectionCheckboxes?: boolean,
61
- /** Function for determining the default width of columns. */
62
- getDefaultWidth?: (props) => string | number,
63
- /** Callback that is invoked during the entirety of the resize event. */
64
- onColumnResize?: (affectedColumnWidths: AffectedColumnWidths) => void,
65
- /** Callback that is invoked when the resize event is ended. */
66
- onColumnResizeEnd?: (affectedColumnWidths: AffectedColumnWidths) => void
40
+ showSelectionCheckboxes?: boolean
67
41
  }
68
42
 
69
43
  const OPPOSITE_SORT_DIRECTION = {
@@ -90,9 +64,6 @@ export function useTableState<T extends object>(props: TableStateProps<T>): Tabl
90
64
  context
91
65
  );
92
66
  let {disabledKeys, selectionManager} = useGridState({...props, collection});
93
-
94
- const tableColumnResizeState = useTableColumnResizeState({columns: collection.columns, getDefaultWidth: props.getDefaultWidth, onColumnResize: props.onColumnResize, onColumnResizeEnd: props.onColumnResizeEnd});
95
-
96
67
 
97
68
  return {
98
69
  collection,
@@ -107,7 +78,6 @@ export function useTableState<T extends object>(props: TableStateProps<T>): Tabl
107
78
  ? OPPOSITE_SORT_DIRECTION[props.sortDescriptor.direction]
108
79
  : 'ascending')
109
80
  });
110
- },
111
- ...tableColumnResizeState
81
+ }
112
82
  };
113
83
  }