{"version":3,"sources":["Picker.js"],"names":["React","Platform","PickerAndroid","PickerIOS","PickerWindows","PickerMacOS","MODE_DIALOG","MODE_DROPDOWN","PickerItem","Component","render","Picker","createRef","pickerRef","current","blur","focus","OS","props","children","mode"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;;;;;;AAEA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAAQC,QAAR,QAAuB,cAAvB;AAEA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,WAAP,MAAwB,eAAxB;AAMA,MAAMC,WAAW,GAAG,QAApB;AACA,MAAMC,aAAa,GAAG,UAAtB;;AA0BA;AACA;AACA;AACA,MAAMC,UAAN,SAAyBR,KAAK,CAACS,SAA/B,CAA0D;AACxDC,EAAAA,MAAM,GAAe;AACnB;AACA,UAAM,IAAN;AACD;;AAJuD;;AA4E1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,MAAN,SAAqBX,KAAK,CAACS,SAA3B,CAAkD;AAAA;AAAA;;AAAA,oDACbT,KAAK,CAACY,SAAN,EADa;;AAAA,kCAkB7B,MAAM;AAAA;;AACvB,oCAAKC,SAAL,CAAeC,OAAf,gFAAwBC,IAAxB;AACD,KApB+C;;AAAA,mCAsB5B,MAAM;AAAA;;AACxB,qCAAKF,SAAL,CAAeC,OAAf,kFAAwBE,KAAxB;AACD,KAxB+C;AAAA;;AA0BhDN,EAAAA,MAAM,GAAe;AACnB,QAAIT,QAAQ,CAACgB,EAAT,KAAgB,KAApB,EAA2B;AACzB;AACN;AACM,0BAAO,oBAAC,SAAD,EAAe,KAAKC,KAApB,EAA4B,KAAKA,KAAL,CAAWC,QAAvC,CAAP;AACD,KAJD,MAIO,IAAIlB,QAAQ,CAACgB,EAAT,KAAgB,OAApB,EAA6B;AAClC;AACN;AACM,0BAAO,oBAAC,WAAD,EAAiB,KAAKC,KAAtB,EAA8B,KAAKA,KAAL,CAAWC,QAAzC,CAAP;AACD,KAJM,MAIA,IAAIlB,QAAQ,CAACgB,EAAT,KAAgB,SAApB,EAA+B;AACpC;AAAA;;AACE;AACR;AACQ,4BAAC,aAAD;AAAe,UAAA,GAAG,EAAE,KAAKJ;AAAzB,WAAwC,KAAKK,KAA7C,GACG,KAAKA,KAAL,CAAWC,QADd;AAHF;AAOD,KARM,MAQA,IAAIlB,QAAQ,CAACgB,EAAT,KAAgB,SAApB,EAA+B;AACpC,0BACE,oBAAC,aAAD,EAAmB,KAAKC,KAAxB,EAAgC,KAAKA,KAAL,CAAWC,QAA3C,CADF;AAGD,KAJM,MAIA;AACL,aAAO,IAAP;AACD;AACF;;AAlD+C;;gBAA5CR,M,iBAKqCL,W;;gBALrCK,M,mBAUyCJ,a;;gBAVzCI,M,UAY6BH,U;;gBAZ7BG,M,kBAc+B;AACjCS,EAAAA,IAAI,EAAEd;AAD2B,C;;AAuCrC,eAAeK,MAAf","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\nimport * as React from 'react';\nimport {Platform} from 'react-native';\n\nimport PickerAndroid from './PickerAndroid';\nimport PickerIOS from './PickerIOS';\nimport PickerWindows from './PickerWindows';\nimport PickerMacOS from './PickerMacOS';\n\nimport type {TextStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';\nimport type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet';\nimport type {Node} from 'react';\n\nconst MODE_DIALOG = 'dialog';\nconst MODE_DROPDOWN = 'dropdown';\n\ntype PickerItemProps = $ReadOnly<{|\n /**\n * Text to display for this item.\n */\n label: string,\n\n /**\n * The value to be passed to picker's `onValueChange` callback when\n * this item is selected. Can be a string or an integer.\n */\n value?: ?(number | string),\n\n /**\n * Color of this item's text.\n * @platform android\n */\n color?: ColorValue,\n\n /**\n * Used to locate the item in end-to-end tests.\n */\n testID?: string,\n|}>;\n\n/**\n * Individual selectable item in a Picker.\n */\nclass PickerItem extends React.Component {\n render(): React.Node {\n // The items are not rendered directly\n throw null;\n }\n}\n\ntype PickerProps = $ReadOnly<{|\n children?: Node,\n style?: ?TextStyleProp,\n\n /**\n * Value matching value of one of the items. Can be a string or an integer.\n */\n selectedValue?: ?(number | string),\n\n /**\n * Callback for when an item is selected. This is called with the following parameters:\n * - `itemValue`: the `value` prop of the item that was selected\n * - `itemIndex`: the index of the selected item in this picker\n */\n onValueChange?: ?(itemValue: string | number, itemIndex: number) => mixed,\n\n /**\n * If set to false, the picker will be disabled, i.e. the user will not be able to make a\n * selection.\n * @platform android\n */\n enabled?: ?boolean,\n\n /**\n * On Android, specifies how to display the selection items when the user taps on the picker:\n *\n * - 'dialog': Show a modal dialog. This is the default.\n * - 'dropdown': Shows a dropdown anchored to the picker view\n *\n * @platform android\n */\n mode?: ?('dialog' | 'dropdown'),\n\n /**\n * Style to apply to each of the item labels.\n * @platform ios\n */\n itemStyle?: ?TextStyleProp,\n\n /**\n * Prompt string for this picker, used on Android in dialog mode as the title of the dialog.\n * @platform android\n */\n prompt?: ?string,\n\n /**\n * Placeholder string for this picker, used on Windows if no item has been selected.\n * @platform windows\n */\n placeholder?: ?string,\n\n /**\n * Used to locate this view in end-to-end tests.\n */\n testID?: ?string,\n\n /**\n * On Android, used to truncate the text with an ellipsis after computing the text layout, including line wrapping,\n * such that the total number of lines does not exceed this number. Default is '1'\n * @platform android\n */\n numberOfLines?: ?number,\n\n /**\n * The string used for the accessibility label. Will be read once focused on the picker but not on change.\n */\n accessibilityLabel?: ?string,\n|}>;\n\n/**\n * Renders the native picker component on iOS and Android. Example:\n *\n * this.setState({language: itemValue})}>\n * \n * \n * \n */\nclass Picker extends React.Component {\n pickerRef: React.ElementRef = React.createRef();\n /**\n * On Android, display the options in a dialog.\n */\n static MODE_DIALOG: typeof MODE_DIALOG = MODE_DIALOG;\n\n /**\n * On Android, display the options in a dropdown (this is the default).\n */\n static MODE_DROPDOWN: typeof MODE_DROPDOWN = MODE_DROPDOWN;\n\n static Item: typeof PickerItem = PickerItem;\n\n static defaultProps: PickerProps = {\n mode: MODE_DIALOG,\n };\n\n blur: () => void = () => {\n this.pickerRef.current?.blur();\n };\n\n focus: () => void = () => {\n this.pickerRef.current?.focus();\n };\n\n render(): React.Node {\n if (Platform.OS === 'ios') {\n /* $FlowFixMe(>=0.81.0 site=react_native_ios_fb) This suppression was\n * added when renaming suppression sites. */\n return {this.props.children};\n } else if (Platform.OS === 'macos') {\n /* $FlowFixMe(>=0.81.0 site=react_native_ios_fb) This suppression was\n * added when renaming suppression sites. */\n return {this.props.children};\n } else if (Platform.OS === 'android') {\n return (\n /* $FlowFixMe(>=0.81.0 site=react_native_android_fb) This suppression\n * was added when renaming suppression sites. */\n \n {this.props.children}\n \n );\n } else if (Platform.OS === 'windows') {\n return (\n {this.props.children}\n );\n } else {\n return null;\n }\n }\n}\n\nexport default Picker;\n"]}