{"ast":null,"code":"import { useComboBox as useComboBoxWeb } from '@react-aria/combobox';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nexport function useComboBox(props, state) {\n  var params = useComboBoxWeb(props, state);\n  var onKeyPress = params.inputProps.onKeyDown;\n  params.inputProps.onKeyDown = undefined;\n  params.inputProps.onKeyPress = onKeyPress;\n  params.inputProps.blurOnSubmit = false;\n  params.inputProps.onKeyDown = undefined;\n  return {\n    inputProps: mapDomPropsToRN(params.inputProps),\n    buttonProps: mapDomPropsToRN(params.buttonProps),\n    labelProps: mapDomPropsToRN(params.labelProps),\n    listBoxProps: mapDomPropsToRN(params.listBoxProps)\n  };\n}","map":{"version":3,"sources":["useComboBox.web.ts"],"names":["useComboBox","params","useComboBoxWeb","onKeyPress","inputProps","mapDomPropsToRN","buttonProps","labelProps","listBoxProps"],"mappings":"AAKA,SAASA,WAAW,IAApB,cAAA,QAAA,sBAAA;AACA,SAAA,eAAA,QAAA,0BAAA;AAiCA,OAAO,SAAA,WAAA,CAAA,KAAA,EAAA,KAAA,EAGS;AAEd,MAAMC,MAAM,GAAGC,cAAc,CAAA,KAAA,EAA7B,KAA6B,CAA7B;AAEA,MAAMC,UAAU,GAAGF,MAAM,CAANA,UAAAA,CAAnB,SAAA;AACAA,EAAAA,MAAM,CAANA,UAAAA,CAAAA,SAAAA,GALc,SAKdA;AAIAA,EAAAA,MAAM,CAANA,UAAAA,CAAAA,UAAAA,GATc,UASdA;AAGAA,EAAAA,MAAM,CAANA,UAAAA,CAAAA,YAAAA,GAAAA,KAAAA;AACAA,EAAAA,MAAM,CAANA,UAAAA,CAAAA,SAAAA,GAAAA,SAAAA;AAEA,SAAO;AACLG,IAAAA,UAAU,EAAEC,eAAe,CAACJ,MAAM,CAD7B,UACsB,CADtB;AAELK,IAAAA,WAAW,EAAED,eAAe,CAACJ,MAAM,CAF9B,WAEuB,CAFvB;AAGLM,IAAAA,UAAU,EAAEF,eAAe,CAACJ,MAAM,CAH7B,UAGsB,CAHtB;AAILO,IAAAA,YAAY,EAAEH,eAAe,CAACJ,MAAM,CAAP,YAAA;AAJxB,GAAP;AAMD","sourcesContent":["import { ComboBoxProps } from '@react-types/combobox';\nimport { ComboBoxState } from '@react-stately/combobox';\nimport { RefObject } from 'react';\nimport { KeyboardDelegate } from '@react-types/shared';\nimport { TextInput, View, Pressable, Touchable } from 'react-native';\nimport { useComboBox as useComboBoxWeb } from '@react-aria/combobox';\nimport { mapDomPropsToRN } from '@react-native-aria/utils';\nimport { TextInputProps } from 'react-native';\n\ninterface AriaComboBoxProps<T> extends ComboBoxProps<T> {\n  /** The ref for the input element. */\n  inputRef: RefObject<TextInput>;\n  /** The ref for the list box popover. */\n  popoverRef: RefObject<View>;\n  /** The ref for the list box. */\n  listBoxRef: RefObject<View>;\n  /** The ref for the list box popup trigger button.  */\n  buttonRef: RefObject<typeof Pressable | Touchable>;\n  /** An optional keyboard delegate implementation, to override the default. */\n  keyboardDelegate?: KeyboardDelegate;\n}\n\ninterface ComboBoxAria {\n  /** Props for the combo box menu trigger button. */\n  buttonProps: any;\n  /** Props for the combo box input element. */\n  inputProps: TextInputProps;\n  /** Props for the combo box menu. */\n  listBoxProps: any;\n  /** Props for the combo box label element. */\n  labelProps: any;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a combo box component.\n * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.\n * @param props - Props for the combo box.\n * @param state - State for the select, as returned by `useComboBoxState`.\n */\nexport function useComboBox<T>(\n  props: AriaComboBoxProps<T>,\n  state: ComboBoxState<T>\n): ComboBoxAria {\n  // @ts-ignore\n  const params = useComboBoxWeb(props, state);\n\n  const onKeyPress = params.inputProps.onKeyDown;\n  params.inputProps.onKeyDown = undefined;\n\n  // RN Web supports onKeyPress. It's same as onKeyDown\n  // https://necolas.github.io/react-native-web/docs/text-input/\n  params.inputProps.onKeyPress = onKeyPress;\n\n  // @ts-ignore\n  params.inputProps.blurOnSubmit = false;\n  params.inputProps.onKeyDown = undefined;\n\n  return {\n    inputProps: mapDomPropsToRN(params.inputProps),\n    buttonProps: mapDomPropsToRN(params.buttonProps),\n    labelProps: mapDomPropsToRN(params.labelProps),\n    listBoxProps: mapDomPropsToRN(params.listBoxProps),\n  };\n}\n"]},"metadata":{},"sourceType":"module"}