{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAmFD;;CAEC,GACD,MAAM,yDAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UAA4B,KAA4B,EAAE,GAA2B;IAC/H,IAAI,iCAAC,6BAA6B,EAAE,GAAG,YAAW,GAAG;IACrD,IAAI,CAAA,GAAA,oDAAc,OAAO,+BACvB,qBAAO,0DAAC,CAAA,GAAA,2CAAgB;QAAG,GAAG,UAAU;QAAE,KAAK;;SAE/C,qBAAO,0DAAC,CAAA,GAAA,mDAAwB;QAAG,GAAG,UAAU;QAAE,KAAK;;AAE3D;AAGA,6DAA6D;AAC7D,MAAM,4CAAiB,CAAA,GAAA,uCAAK","sources":["packages/@adobe/react-spectrum/src/table/TableView.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 type {AriaLabelingProps, DisabledBehavior, DOMProps, DOMRef, Key, SpectrumSelectionProps, StyleProps} from '@react-types/shared';\nimport {Cell, Column, ColumnSize, Row, TableBody, TableHeader, TableProps} from 'react-stately/useTableState';\nimport type {DragAndDropHooks} from '../dnd/useDragAndDrop';\nimport React, {JSX, ReactElement} from 'react';\nimport {Section} from 'react-stately/Section';\nimport {SpectrumColumnProps} from './types';\nimport {tableNestedRows} from 'react-stately/private/flags/flags';\nimport {TableViewWithoutExpanding} from './TableViewWithoutExpanding';\nimport {TreeGridTableView} from './TreeGridTableView';\n\nexport interface SpectrumTableProps<T> extends Omit<TableProps<T>, 'treeColumn' | 'expandedKeys' | 'defaultExpandedKeys' | 'onExpandedChange'>, SpectrumSelectionProps, DOMProps, AriaLabelingProps, StyleProps {\n  /**\n   * Sets the amount of vertical padding within each cell.\n   * @default 'regular'\n   */\n  density?: 'compact' | 'regular' | 'spacious',\n  /**\n   * Sets the overflow behavior for the cell contents.\n   * @default 'truncate'\n   */\n  overflowMode?: 'wrap' | 'truncate',\n  /** Whether the TableView should be displayed with a quiet style. */\n  isQuiet?: boolean,\n  /** Sets what the TableView should render when there is no content to display. */\n  renderEmptyState?: () => JSX.Element,\n  /**\n   * Whether `disabledKeys` applies to all interactions, or only selection.\n   * @default \"selection\"\n   */\n  disabledBehavior?: DisabledBehavior,\n  /** Handler that is called when a user performs an action on a row. */\n  onAction?: (key: Key) => void,\n  /**\n   * Handler that is called when a user starts a column resize.\n   */\n  onResizeStart?: (widths: Map<Key, ColumnSize>) => void,\n  /**\n   * Handler that is called when a user performs a column resize.\n   * Can be used with the width property on columns to put the column widths into\n   * a controlled state.\n   */\n  onResize?: (widths: Map<Key, ColumnSize>) => void,\n  /**\n   * Handler that is called after a user performs a column resize.\n   * Can be used to store the widths of columns for another future session.\n   */\n  onResizeEnd?: (widths: Map<Key, ColumnSize>) => void,\n  /**\n   * The drag and drop hooks returned by `useDragAndDrop` used to enable drag and drop behavior for the TableView.\n   * @version beta\n   */\n  dragAndDropHooks?: DragAndDropHooks<NoInfer<T>>['dragAndDropHooks'],\n  /**\n   * Whether the TableView should support expandable rows. Requires the feature flag to be enabled first, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   * @version alpha\n   * @private\n   */\n  UNSTABLE_allowsExpandableRows?: boolean,\n  /**\n   * The currently expanded keys in the collection (controlled). Requires the feature flag to be\n   * enabled along with UNSTABLE_allowsExpandableRows, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   * @version alpha\n   * @private\n   */\n  UNSTABLE_expandedKeys?: 'all' | Iterable<Key>,\n  /**\n   * The initial expanded keys in the collection (uncontrolled). Requires the feature flag to be\n   * enabled along with UNSTABLE_allowsExpandableRows, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   * @version alpha\n   * @private\n   */\n  UNSTABLE_defaultExpandedKeys?: 'all' | Iterable<Key>,\n  /**\n   * Handler that is called when items are expanded or collapsed. Requires the feature flag to be\n   * enabled along with UNSTABLE_allowsExpandableRows, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   * @version alpha\n   * @private\n   */\n  UNSTABLE_onExpandedChange?: (keys: Set<Key>) => any\n}\n\n/**\n * Tables are containers for displaying information. They allow users to quickly scan, sort, compare, and take action on large amounts of data.\n */\nconst TableView = React.forwardRef(function TableView<T extends object>(props: SpectrumTableProps<T>, ref: DOMRef<HTMLDivElement>) {\n  let {UNSTABLE_allowsExpandableRows, ...otherProps} = props;\n  if (tableNestedRows() && UNSTABLE_allowsExpandableRows) {\n    return <TreeGridTableView {...otherProps} ref={ref} />;\n  } else {\n    return <TableViewWithoutExpanding {...otherProps} ref={ref} />;\n  }\n}) as <T>(props: SpectrumTableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\nexport {TableView};\n\n// Override TS for Column to support spectrum specific props.\nconst SpectrumColumn = Column as <T>(props: SpectrumColumnProps<T>) => JSX.Element;\nexport {SpectrumColumn as Column};\nexport {\n  Cell,\n  Row,\n  Section,\n  TableBody,\n  TableHeader\n};\n"],"names":[],"version":3,"file":"TableView.cjs.map"}