{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAsHD;;;CAGC,GACD,MAAM,yDAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,UAC1C,KAA4B,EAC5B,GAA2B;IAE3B,IAAI,iCAAC,6BAA6B,EAAE,GAAG,YAAW,GAAG;IACrD,IAAI,CAAA,GAAA,sBAAc,OAAO,+BACvB,qBAAO,gCAAC,CAAA,GAAA,yCAAgB;QAAG,GAAG,UAAU;QAAE,KAAK;;SAE/C,qBAAO,gCAAC,CAAA,GAAA,yCAAwB;QAAG,GAAG,UAAU;QAAE,KAAK;;AAE3D;AAGA,6DAA6D;AAC7D,MAAM,4CAAiB,CAAA,GAAA,aAAK","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 {\n  AriaLabelingProps,\n  DisabledBehavior,\n  DOMProps,\n  DOMRef,\n  Key,\n  SpectrumSelectionProps,\n  StyleProps\n} from '@react-types/shared';\nimport {\n  Cell,\n  Column,\n  ColumnSize,\n  Row,\n  TableBody,\n  TableHeader,\n  TableProps\n} 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>\n  extends\n    Omit<TableProps<T>, 'treeColumn' | 'expandedKeys' | 'defaultExpandedKeys' | 'onExpandedChange'>,\n    SpectrumSelectionProps,\n    DOMProps,\n    AriaLabelingProps,\n    StyleProps {\n  /**\n   * Sets the amount of vertical padding within each cell.\n   *\n   * @default 'regular'\n   */\n  density?: 'compact' | 'regular' | 'spacious';\n  /**\n   * Sets the overflow behavior for the cell contents.\n   *\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   *\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\n   * the TableView.\n   *\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\n   * first, see https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   *\n   * @private\n   * @version alpha\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\n   * https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   *\n   * @private\n   * @version alpha\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\n   * https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   *\n   * @private\n   * @version alpha\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\n   * https://react-spectrum.adobe.com/react-spectrum/TableView.html#expandable-rows.\n   *\n   * @private\n   * @version alpha\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,\n * compare, and take action on large amounts of data.\n */\nconst TableView = React.forwardRef(function TableView<T extends object>(\n  props: SpectrumTableProps<T>,\n  ref: DOMRef<HTMLDivElement>\n) {\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 {Cell, Row, Section, TableBody, TableHeader};\n"],"names":[],"version":3,"file":"TableView.mjs.map"}