{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAUM,MAAM,0DAAoB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,kBAAoC,KAA4B,EAAE,GAA2B;IACtJ,IAAI,kBACF,cAAc,oBACd,gBAAgB,EACjB,GAAG;IACJ,IAAI,CAAC,yBAAyB,2BAA2B,GAAG,CAAA,GAAA,qBAAO,EAAE,mBAAmB;IACxF,IAAI,mBAAmB,CAAC,CAAC,kBAAkB;IAC3C,IAAI,QAAQ,CAAA,GAAA,yEAAwB,EAAE;QACpC,GAAG,KAAK;iCACR;QACA,iBAAiB;QACjB,mBAAmB,MAAM,cAAc,KAAK,cAAc,YAAY;IACxE;IAEA,+HAA+H;IAC/H,IAAI,uBAAuB,MAAM,gBAAgB,CAAC,iBAAiB,KAAK;IACxE,IAAI,yBAAyB,yBAC3B,2BAA2B;IAG7B,qBACE,0DAAC,CAAA,GAAA,uCAAY;QAAG,GAAG,KAAK;QAAE,OAAO;QAAO,KAAK;;AAEjD","sources":["packages/@adobe/react-spectrum/src/table/TreeGridTableView.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 {DOMRef} from '@react-types/shared';\nimport React, {ReactElement, useState} from 'react';\nimport {SpectrumTableProps} from './TableView';\nimport {TableViewBase} from './TableViewBase';\nimport {UNSTABLE_useTreeGridState} from 'react-stately/private/table/useTreeGridState';\n\nexport interface TreeGridTableProps<T> extends Omit<SpectrumTableProps<T>, 'UNSTABLE_allowsExpandableRows'> {}\n\nexport const TreeGridTableView = React.forwardRef(function TreeGridTableView<T extends object>(props: TreeGridTableProps<T>, ref: DOMRef<HTMLDivElement>) {\n  let {\n    selectionStyle,\n    dragAndDropHooks\n  } = props;\n  let [showSelectionCheckboxes, setShowSelectionCheckboxes] = useState(selectionStyle !== 'highlight');\n  let isTableDraggable = !!dragAndDropHooks?.useDraggableCollectionState;\n  let state = UNSTABLE_useTreeGridState({\n    ...props,\n    showSelectionCheckboxes,\n    showDragButtons: isTableDraggable,\n    selectionBehavior: props.selectionStyle === 'highlight' ? 'replace' : 'toggle'\n  });\n\n  // If the selection behavior changes in state, we need to update showSelectionCheckboxes here due to the circular dependency...\n  let shouldShowCheckboxes = state.selectionManager.selectionBehavior !== 'replace';\n  if (shouldShowCheckboxes !== showSelectionCheckboxes) {\n    setShowSelectionCheckboxes(shouldShowCheckboxes);\n  }\n\n  return (\n    <TableViewBase {...props} state={state} ref={ref} />\n  );\n}) as <T>(props: TreeGridTableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"TreeGridTableView.cjs.map"}