{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAaM,MAAM,0DAAoB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,kBACzD,KAA4B,EAC5B,GAA2B;IAE3B,IAAI,kBAAC,cAAc,oBAAE,gBAAgB,EAAC,GAAG;IACzC,IAAI,CAAC,yBAAyB,2BAA2B,GAAG,CAAA,GAAA,eAAO,EACjE,mBAAmB;IAErB,IAAI,mBAAmB,CAAC,CAAC,kBAAkB;IAC3C,IAAI,QAAQ,CAAA,GAAA,gCAAwB,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,qBAAO,gCAAC,CAAA,GAAA,yCAAY;QAAG,GAAG,KAAK;QAAE,OAAO;QAAO,KAAK;;AACtD","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<\n  SpectrumTableProps<T>,\n  'UNSTABLE_allowsExpandableRows'\n> {}\n\nexport const TreeGridTableView = React.forwardRef(function TreeGridTableView<T extends object>(\n  props: TreeGridTableProps<T>,\n  ref: DOMRef<HTMLDivElement>\n) {\n  let {selectionStyle, dragAndDropHooks} = props;\n  let [showSelectionCheckboxes, setShowSelectionCheckboxes] = useState(\n    selectionStyle !== 'highlight'\n  );\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 <TableViewBase {...props} state={state} ref={ref} />;\n}) as <T>(props: TreeGridTableProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"TreeGridTableView.mjs.map"}