{"ast":null,"code":"'use strict';\n\nimport _extends from \"@babel/runtime/helpers/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nvar _jsxFileName = \"/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-modal-selector/index.js\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport View from \"react-native-web/dist/exports/View\";\nimport Modal from \"react-native-web/dist/exports/Modal\";\nimport Text from \"react-native-web/dist/exports/Text\";\nimport ScrollView from \"react-native-web/dist/exports/ScrollView\";\nimport TouchableOpacity from \"react-native-web/dist/exports/TouchableOpacity\";\nimport TouchableWithoutFeedback from \"react-native-web/dist/exports/TouchableWithoutFeedback\";\nimport { ViewPropTypes as RNViewPropTypes } from \"react-native-web/dist/index\";\nimport styles from \"./style\";\nvar ViewPropTypes = RNViewPropTypes || View.propTypes;\nvar componentIndex = 0;\nvar propTypes = {\n  data: PropTypes.array,\n  onChange: PropTypes.func,\n  onModalOpen: PropTypes.func,\n  onModalClose: PropTypes.func,\n  keyExtractor: PropTypes.func,\n  labelExtractor: PropTypes.func,\n  visible: PropTypes.bool,\n  closeOnChange: PropTypes.bool,\n  initValue: PropTypes.string,\n  animationType: PropTypes.oneOf(['none', 'slide', 'fade']),\n  style: ViewPropTypes.style,\n  selectStyle: ViewPropTypes.style,\n  selectTextStyle: Text.propTypes.style,\n  optionStyle: ViewPropTypes.style,\n  optionTextStyle: Text.propTypes.style,\n  optionContainerStyle: ViewPropTypes.style,\n  sectionStyle: ViewPropTypes.style,\n  childrenContainerStyle: ViewPropTypes.style,\n  touchableStyle: ViewPropTypes.style,\n  touchableActiveOpacity: PropTypes.number,\n  sectionTextStyle: Text.propTypes.style,\n  selectedItemTextStyle: Text.propTypes.style,\n  cancelContainerStyle: ViewPropTypes.style,\n  cancelStyle: ViewPropTypes.style,\n  cancelTextStyle: Text.propTypes.style,\n  overlayStyle: ViewPropTypes.style,\n  initValueTextStyle: Text.propTypes.style,\n  cancelText: PropTypes.string,\n  disabled: PropTypes.bool,\n  supportedOrientations: PropTypes.arrayOf(PropTypes.oneOf(['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'])),\n  keyboardShouldPersistTaps: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n  backdropPressToClose: PropTypes.bool,\n  openButtonContainerAccessible: PropTypes.bool,\n  listItemAccessible: PropTypes.bool,\n  cancelButtonAccessible: PropTypes.bool,\n  scrollViewAccessible: PropTypes.bool,\n  scrollViewAccessibilityLabel: PropTypes.string,\n  cancelButtonAccessibilityLabel: PropTypes.string,\n  passThruProps: PropTypes.object,\n  selectTextPassThruProps: PropTypes.object,\n  optionTextPassThruProps: PropTypes.object,\n  cancelTextPassThruProps: PropTypes.object,\n  scrollViewPassThruProps: PropTypes.object,\n  modalOpenerHitSlop: PropTypes.object,\n  customSelector: PropTypes.node,\n  selectedKey: PropTypes.any,\n  enableShortPress: PropTypes.bool,\n  enableLongPress: PropTypes.bool,\n  optionsTestIDPrefix: PropTypes.string\n};\nvar defaultProps = {\n  data: [],\n  onChange: function onChange() {},\n  onModalOpen: function onModalOpen() {},\n  onModalClose: function onModalClose() {},\n  keyExtractor: function keyExtractor(item) {\n    return item.key;\n  },\n  labelExtractor: function labelExtractor(item) {\n    return item.label;\n  },\n  componentExtractor: function componentExtractor(item) {\n    return item.component;\n  },\n  visible: false,\n  closeOnChange: true,\n  initValue: 'Select me!',\n  animationType: 'slide',\n  style: {},\n  selectStyle: {},\n  selectTextStyle: {},\n  optionStyle: {},\n  optionTextStyle: {},\n  optionContainerStyle: {},\n  sectionStyle: {},\n  childrenContainerStyle: {},\n  touchableStyle: {},\n  touchableActiveOpacity: 0.2,\n  sectionTextStyle: {},\n  selectedItemTextStyle: {},\n  cancelContainerStyle: {},\n  cancelStyle: {},\n  cancelTextStyle: {},\n  overlayStyle: {},\n  initValueTextStyle: {},\n  cancelText: 'cancel',\n  disabled: false,\n  supportedOrientations: ['portrait', 'landscape'],\n  keyboardShouldPersistTaps: 'always',\n  backdropPressToClose: false,\n  openButtonContainerAccessible: false,\n  listItemAccessible: false,\n  cancelButtonAccessible: false,\n  scrollViewAccessible: false,\n  scrollViewAccessibilityLabel: \"\",\n  cancelButtonAccessibilityLabel: \"\",\n  passThruProps: {},\n  selectTextPassThruProps: {},\n  optionTextPassThruProps: {},\n  cancelTextPassThruProps: {},\n  scrollViewPassThruProps: {},\n  modalOpenerHitSlop: {\n    top: 0,\n    bottom: 0,\n    left: 0,\n    right: 0\n  },\n  customSelector: undefined,\n  selectedKey: '',\n  enableShortPress: true,\n  enableLongPress: false,\n  optionsTestIDPrefix: 'default'\n};\n\nvar ModalSelector = function (_React$Component) {\n  _inherits(ModalSelector, _React$Component);\n\n  var _super = _createSuper(ModalSelector);\n\n  function ModalSelector(props) {\n    var _this;\n\n    _classCallCheck(this, ModalSelector);\n\n    _this = _super.call(this, props);\n\n    _this.validateSelectedKey = function (key) {\n      var selectedItem = _this.props.data.filter(function (item) {\n        return _this.props.keyExtractor(item) === key;\n      });\n\n      var selectedLabel = selectedItem.length > 0 ? _this.props.labelExtractor(selectedItem[0]) : _this.props.initValue;\n      var selectedKey = selectedItem.length > 0 ? key : undefined;\n      return {\n        label: selectedLabel,\n        key: selectedKey\n      };\n    };\n\n    _this.onChange = function (item) {\n      _this.props.onChange(item);\n\n      _this.setState({\n        selected: _this.props.labelExtractor(item),\n        changedItem: item\n      }, function () {\n        if (_this.props.closeOnChange) _this.close(item);\n      });\n    };\n\n    _this.close = function (item) {\n      _this.props.onModalClose(item);\n\n      _this.setState({\n        modalVisible: false\n      });\n    };\n\n    _this.open = function () {\n      var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n      if (!params.longPress && !_this.props.enableShortPress) {\n        return;\n      }\n\n      if (params.longPress && !_this.props.enableLongPress) {\n        return;\n      }\n\n      _this.props.onModalOpen(params);\n\n      _this.setState({\n        modalVisible: true,\n        changedItem: undefined\n      });\n    };\n\n    _this.renderSection = function (section) {\n      var optionComponent = _this.props.componentExtractor(section);\n\n      var component = optionComponent || React.createElement(Text, {\n        style: [styles.sectionTextStyle, _this.props.sectionTextStyle]\n      }, _this.props.labelExtractor(section));\n      return React.createElement(View, {\n        key: _this.props.keyExtractor(section),\n        style: [styles.sectionStyle, _this.props.sectionStyle]\n      }, component);\n    };\n\n    _this.renderOption = function (option, isLastItem, isFirstItem) {\n      var optionComponent = _this.props.componentExtractor(option);\n\n      var optionLabel = _this.props.labelExtractor(option);\n\n      var isSelectedItem = optionLabel === _this.state.selected;\n      var component = optionComponent || React.createElement(Text, _extends({\n        style: [styles.optionTextStyle, _this.props.optionTextStyle, isSelectedItem && _this.props.selectedItemTextStyle]\n      }, _this.props.optionTextPassThruProps), optionLabel);\n      return React.createElement(TouchableOpacity, _extends({\n        key: _this.props.keyExtractor(option),\n        testID: option.testID || _this.props.optionsTestIDPrefix + '-' + optionLabel,\n        onPress: function onPress() {\n          return _this.onChange(option);\n        },\n        activeOpacity: _this.props.touchableActiveOpacity,\n        accessible: _this.props.listItemAccessible,\n        accessibilityLabel: option.accessibilityLabel || undefined,\n        importantForAccessibility: isFirstItem ? 'yes' : 'no'\n      }, _this.props.passThruProps), React.createElement(View, {\n        style: [styles.optionStyle, _this.props.optionStyle, isLastItem && {\n          borderBottomWidth: 0\n        }]\n      }, component));\n    };\n\n    _this.renderOptionList = function () {\n      var _this$props = _this.props,\n          data = _this$props.data,\n          backdropPressToClose = _this$props.backdropPressToClose,\n          scrollViewPassThruProps = _this$props.scrollViewPassThruProps,\n          overlayStyle = _this$props.overlayStyle,\n          optionContainerStyle = _this$props.optionContainerStyle,\n          keyboardShouldPersistTaps = _this$props.keyboardShouldPersistTaps,\n          scrollViewAccessible = _this$props.scrollViewAccessible,\n          scrollViewAccessibilityLabel = _this$props.scrollViewAccessibilityLabel,\n          cancelContainerStyle = _this$props.cancelContainerStyle,\n          touchableActiveOpacity = _this$props.touchableActiveOpacity,\n          cancelButtonAccessible = _this$props.cancelButtonAccessible,\n          cancelButtonAccessibilityLabel = _this$props.cancelButtonAccessibilityLabel,\n          cancelStyle = _this$props.cancelStyle,\n          cancelTextStyle = _this$props.cancelTextStyle,\n          cancelText = _this$props.cancelText;\n      var options = data.map(function (item, index) {\n        if (item.section) {\n          return _this.renderSection(item);\n        }\n\n        return _this.renderOption(item, index === data.length - 1, index === 0);\n      });\n      var Overlay = View;\n      var overlayProps = {\n        style: {\n          flex: 1\n        }\n      };\n\n      if (backdropPressToClose) {\n        Overlay = TouchableWithoutFeedback;\n        overlayProps = {\n          key: \"modalSelector\" + componentIndex++,\n          accessible: false,\n          onPress: _this.close\n        };\n      }\n\n      var optionsContainerStyle = {\n        paddingHorizontal: 10\n      };\n\n      if (scrollViewPassThruProps && scrollViewPassThruProps.horizontal) {\n        optionsContainerStyle.flexDirection = 'row';\n      }\n\n      return React.createElement(Overlay, overlayProps, React.createElement(View, {\n        style: [styles.overlayStyle, overlayStyle]\n      }, React.createElement(View, {\n        style: [styles.optionContainer, optionContainerStyle]\n      }, React.createElement(ScrollView, _extends({\n        keyboardShouldPersistTaps: keyboardShouldPersistTaps,\n        accessible: scrollViewAccessible,\n        accessibilityLabel: scrollViewAccessibilityLabel\n      }, scrollViewPassThruProps), React.createElement(View, {\n        style: optionsContainerStyle\n      }, options))), React.createElement(View, {\n        style: [styles.cancelContainer, cancelContainerStyle]\n      }, React.createElement(TouchableOpacity, {\n        onPress: _this.close,\n        activeOpacity: touchableActiveOpacity,\n        accessible: cancelButtonAccessible,\n        accessibilityLabel: cancelButtonAccessibilityLabel\n      }, React.createElement(View, {\n        style: [styles.cancelStyle, cancelStyle]\n      }, React.createElement(Text, _extends({\n        style: [styles.cancelTextStyle, cancelTextStyle]\n      }, _this.props.cancelTextPassThruProps), cancelText))))));\n    };\n\n    _this.renderChildren = function () {\n      if (_this.props.children) {\n        return _this.props.children;\n      }\n\n      var initSelectStyle = _this.props.initValue === _this.state.selected ? [styles.initValueTextStyle, _this.props.initValueTextStyle] : [styles.selectTextStyle, _this.props.selectTextStyle];\n      return React.createElement(View, {\n        style: [styles.selectStyle, _this.props.selectStyle]\n      }, React.createElement(Text, _extends({\n        style: initSelectStyle\n      }, _this.props.selectTextPassThruProps), _this.state.selected));\n    };\n\n    var _selectedItem = _this.validateSelectedKey(props.selectedKey);\n\n    _this.state = {\n      modalVisible: props.visible,\n      selected: _selectedItem.label,\n      cancelText: props.cancelText,\n      changedItem: _selectedItem.key\n    };\n    return _this;\n  }\n\n  _createClass(ModalSelector, [{\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate(prevProps, prevState) {\n      var newState = {};\n      var doUpdate = false;\n\n      if (prevProps.initValue !== this.props.initValue) {\n        newState.selected = this.props.initValue;\n        doUpdate = true;\n      }\n\n      if (prevProps.visible !== this.props.visible) {\n        newState.modalVisible = this.props.visible;\n        doUpdate = true;\n      }\n\n      if (prevProps.selectedKey !== this.props.selectedKey || prevProps.data !== this.props.data) {\n        var selectedItem = this.validateSelectedKey(this.props.selectedKey);\n        newState.selected = selectedItem.label;\n        newState.changedItem = selectedItem.key;\n        doUpdate = true;\n      }\n\n      if (doUpdate) {\n        this.setState(newState);\n      }\n    }\n  }, {\n    key: \"getSelectedItem\",\n    value: function getSelectedItem() {\n      return this.state.changedItem;\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n\n      var dp = React.createElement(Modal, {\n        transparent: true,\n        ref: function ref(element) {\n          return _this2.model = element;\n        },\n        supportedOrientations: this.props.supportedOrientations,\n        visible: this.state.modalVisible,\n        onRequestClose: this.close,\n        animationType: this.props.animationType,\n        onDismiss: function onDismiss() {\n          return _this2.state.changedItem && _this2.props.onChange(_this2.state.changedItem);\n        }\n      }, this.renderOptionList());\n      return React.createElement(View, _extends({\n        style: this.props.style\n      }, this.props.passThruProps), dp, this.props.customSelector ? this.props.customSelector : React.createElement(TouchableOpacity, {\n        hitSlop: this.props.modalOpenerHitSlop,\n        activeOpacity: this.props.touchableActiveOpacity,\n        style: this.props.touchableStyle,\n        onPress: this.open,\n        onLongPress: function onLongPress() {\n          return _this2.open({\n            longPress: true\n          });\n        },\n        disabled: this.props.disabled,\n        accessible: this.props.openButtonContainerAccessible\n      }, React.createElement(View, {\n        style: this.props.childrenContainerStyle,\n        pointerEvents: \"none\"\n      }, this.renderChildren())));\n    }\n  }]);\n\n  return ModalSelector;\n}(React.Component);\n\nexport { ModalSelector as default };\nModalSelector.propTypes = propTypes;\nModalSelector.defaultProps = defaultProps;","map":{"version":3,"sources":["/Users/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-modal-selector/index.js"],"names":["React","PropTypes","ViewPropTypes","RNViewPropTypes","styles","View","propTypes","componentIndex","data","array","onChange","func","onModalOpen","onModalClose","keyExtractor","labelExtractor","visible","bool","closeOnChange","initValue","string","animationType","oneOf","style","selectStyle","selectTextStyle","Text","optionStyle","optionTextStyle","optionContainerStyle","sectionStyle","childrenContainerStyle","touchableStyle","touchableActiveOpacity","number","sectionTextStyle","selectedItemTextStyle","cancelContainerStyle","cancelStyle","cancelTextStyle","overlayStyle","initValueTextStyle","cancelText","disabled","supportedOrientations","arrayOf","keyboardShouldPersistTaps","oneOfType","backdropPressToClose","openButtonContainerAccessible","listItemAccessible","cancelButtonAccessible","scrollViewAccessible","scrollViewAccessibilityLabel","cancelButtonAccessibilityLabel","passThruProps","object","selectTextPassThruProps","optionTextPassThruProps","cancelTextPassThruProps","scrollViewPassThruProps","modalOpenerHitSlop","customSelector","node","selectedKey","any","enableShortPress","enableLongPress","optionsTestIDPrefix","defaultProps","item","key","label","componentExtractor","component","top","bottom","left","right","undefined","ModalSelector","props","validateSelectedKey","selectedItem","filter","selectedLabel","length","setState","selected","changedItem","close","modalVisible","open","params","longPress","renderSection","section","optionComponent","renderOption","option","isLastItem","isFirstItem","optionLabel","isSelectedItem","state","testID","accessibilityLabel","borderBottomWidth","renderOptionList","options","map","index","Overlay","overlayProps","flex","TouchableWithoutFeedback","accessible","onPress","optionsContainerStyle","paddingHorizontal","horizontal","flexDirection","optionContainer","cancelContainer","renderChildren","children","initSelectStyle","prevProps","prevState","newState","doUpdate","dp","element","model","Component"],"mappings":"AAAA;;;;;;;;;;;;;;;AAEA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;;;;;;;SASIC,aAAa,IAAIC,e;AAGrB,OAAOC,MAAP;AAEA,IAAMF,aAAa,GAAGC,eAAe,IAAIE,IAAI,CAACC,SAA9C;AAEA,IAAIC,cAAc,GAAG,CAArB;AAEA,IAAMD,SAAS,GAAG;AACdE,EAAAA,IAAI,EAA4BP,SAAS,CAACQ,KAD5B;AAEdC,EAAAA,QAAQ,EAAwBT,SAAS,CAACU,IAF5B;AAGdC,EAAAA,WAAW,EAAqBX,SAAS,CAACU,IAH5B;AAIdE,EAAAA,YAAY,EAAoBZ,SAAS,CAACU,IAJ5B;AAKdG,EAAAA,YAAY,EAAoBb,SAAS,CAACU,IAL5B;AAMdI,EAAAA,cAAc,EAAkBd,SAAS,CAACU,IAN5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AAK3B,KAAL,CAAW1D;AAAxB,SAAmC,KAAK0D,KAAL,CAAW1B,aAA9C,GACK4E,EADL,EAEK,KAAKlD,KAAL,CAAWnB,cAAX,GACG,KAAKmB,KAAL,CAAWnB,cADd,GAGG,oBAAC,gBAAD;AACI,QAAA,OAAO,EAAE,KAAKmB,KAAL,CAAWpB,kBADxB;AAEI,QAAA,aAAa,EAAE,KAAKoB,KAAL,CAAWhD,sBAF9B;AAGI,QAAA,KAAK,EAAE,KAAKgD,KAAL,CAAWjD,cAHtB;AAII,QAAA,OAAO,EAAE,KAAK4D,IAJlB;AAKI,QAAA,WAAW,EAAE;AAAA,iBAAM,MAAI,CAACA,IAAL,CAAU;AAACE,YAAAA,SAAS,EAAE;AAAZ,WAAV,CAAN;AAAA,SALjB;AAMI,QAAA,QAAQ,EAAE,KAAKb,KAAL,CAAWtC,QANzB;AAOI,QAAA,UAAU,EAAE,KAAKsC,KAAL,CAAWhC;AAP3B,SASI,oBAAC,IAAD;AAAM,QAAA,KAAK,EAAE,KAAKgC,KAAL,CAAWlD,sBAAxB;AAAgD,QAAA,aAAa,EAAC;AAA9D,SACK,KAAK6F,cAAL,EADL,CATJ,CALR,CADJ;AAsBH;;;;EA/OsC5H,KAAK,CAACsI,S;;SAA5BtD,a;AAkPrBA,aAAa,CAAC1E,SAAd,GAA0BA,SAA1B;AACA0E,aAAa,CAACX,YAAd,GAA6BA,YAA7B","sourcesContent":["'use strict';\r\n\r\nimport React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport {\r\n    View,\r\n    Modal,\r\n    Text,\r\n    ScrollView,\r\n    TouchableOpacity,\r\n    TouchableWithoutFeedback,\r\n    ViewPropTypes as RNViewPropTypes,\r\n} from 'react-native';\r\n\r\nimport styles from './style';\r\n\r\nconst ViewPropTypes = RNViewPropTypes || View.propTypes;\r\n\r\nlet componentIndex = 0;\r\n\r\nconst propTypes = {\r\n    data:                           PropTypes.array,\r\n    onChange:                       PropTypes.func,\r\n    onModalOpen:                    PropTypes.func,\r\n    onModalClose:                   PropTypes.func,\r\n    keyExtractor:                   PropTypes.func,\r\n    labelExtractor:                 PropTypes.func,\r\n    visible:                        PropTypes.bool,\r\n    closeOnChange:                  PropTypes.bool,\r\n    initValue:                      PropTypes.string,\r\n    animationType:                  PropTypes.oneOf(['none', 'slide', 'fade']),\r\n    style:                          ViewPropTypes.style,\r\n    selectStyle:                    ViewPropTypes.style,\r\n    selectTextStyle:                Text.propTypes.style,\r\n    optionStyle:                    ViewPropTypes.style,\r\n    optionTextStyle:                Text.propTypes.style,\r\n    optionContainerStyle:           ViewPropTypes.style,\r\n    sectionStyle:                   ViewPropTypes.style,\r\n    childrenContainerStyle:         ViewPropTypes.style,\r\n    touchableStyle:                 ViewPropTypes.style,\r\n    touchableActiveOpacity:         PropTypes.number,\r\n    sectionTextStyle:               Text.propTypes.style,\r\n    selectedItemTextStyle:          Text.propTypes.style,\r\n    cancelContainerStyle:           ViewPropTypes.style,\r\n    cancelStyle:                    ViewPropTypes.style,\r\n    cancelTextStyle:                Text.propTypes.style,\r\n    overlayStyle:                   ViewPropTypes.style,\r\n    initValueTextStyle:             Text.propTypes.style,\r\n    cancelText:                     PropTypes.string,\r\n    disabled:                       PropTypes.bool,\r\n    supportedOrientations:          PropTypes.arrayOf(\r\n                                      PropTypes.oneOf([\r\n                                        'portrait',\r\n                                        'portrait-upside-down',\r\n                                        'landscape',\r\n                                        'landscape-left',\r\n                                        'landscape-right',\r\n                                      ]),\r\n                                    ),\r\n    keyboardShouldPersistTaps:      PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\r\n    backdropPressToClose:           PropTypes.bool,\r\n    openButtonContainerAccessible:  PropTypes.bool,\r\n    listItemAccessible:             PropTypes.bool,\r\n    cancelButtonAccessible:         PropTypes.bool,\r\n    scrollViewAccessible:           PropTypes.bool,\r\n    scrollViewAccessibilityLabel:   PropTypes.string,\r\n    cancelButtonAccessibilityLabel: PropTypes.string,\r\n    passThruProps:                  PropTypes.object,\r\n    selectTextPassThruProps:        PropTypes.object,\r\n    optionTextPassThruProps:        PropTypes.object,\r\n    cancelTextPassThruProps:        PropTypes.object,\r\n    scrollViewPassThruProps:        PropTypes.object,\r\n    modalOpenerHitSlop:             PropTypes.object,\r\n    customSelector:                 PropTypes.node,\r\n    selectedKey:                    PropTypes.any,\r\n    enableShortPress:               PropTypes.bool,\r\n    enableLongPress:                PropTypes.bool,\r\n    optionsTestIDPrefix:            PropTypes.string,\r\n};\r\n\r\nconst defaultProps = {\r\n    data:                           [],\r\n    onChange:                       () => {},\r\n    onModalOpen:                    () => {},\r\n    onModalClose:                   () => {},\r\n    keyExtractor:                   (item) => item.key,\r\n    labelExtractor:                 (item) => item.label,\r\n    componentExtractor:             (item) => item.component,\r\n    visible:                        false,\r\n    closeOnChange:                  true,\r\n    initValue:                      'Select me!',\r\n    animationType:                  'slide',\r\n    style:                          {},\r\n    selectStyle:                    {},\r\n    selectTextStyle:                {},\r\n    optionStyle:                    {},\r\n    optionTextStyle:                {},\r\n    optionContainerStyle:           {},\r\n    sectionStyle:                   {},\r\n    childrenContainerStyle:         {},\r\n    touchableStyle:                 {},\r\n    touchableActiveOpacity:         0.2,\r\n    sectionTextStyle:               {},\r\n    selectedItemTextStyle:          {},\r\n    cancelContainerStyle:           {},\r\n    cancelStyle:                    {},\r\n    cancelTextStyle:                {},\r\n    overlayStyle:                   {},\r\n    initValueTextStyle:             {},\r\n    cancelText:                     'cancel',\r\n    disabled:                       false,\r\n    supportedOrientations:          ['portrait', 'landscape'],\r\n    keyboardShouldPersistTaps:      'always',\r\n    backdropPressToClose:           false,\r\n    openButtonContainerAccessible:  false,\r\n    listItemAccessible:             false,\r\n    cancelButtonAccessible:         false,\r\n    scrollViewAccessible:           false,\r\n    scrollViewAccessibilityLabel:   \"\",\r\n    cancelButtonAccessibilityLabel: \"\",\r\n    passThruProps:                  {},\r\n    selectTextPassThruProps:        {},\r\n    optionTextPassThruProps:        {},\r\n    cancelTextPassThruProps:        {},\r\n    scrollViewPassThruProps:        {},\r\n    modalOpenerHitSlop:             {top: 0, bottom: 0, left: 0, right: 0},\r\n    customSelector:                 undefined,\r\n    selectedKey:                    '',\r\n    enableShortPress:               true,\r\n    enableLongPress:                false,\r\n    optionsTestIDPrefix:            'default',\r\n};\r\n\r\nexport default class ModalSelector extends React.Component {\r\n\r\n    constructor(props) {\r\n        super(props);\r\n        let selectedItem = this.validateSelectedKey(props.selectedKey);\r\n        this.state = {\r\n            modalVisible:  props.visible,\r\n            selected:      selectedItem.label,\r\n            cancelText:    props.cancelText,\r\n            changedItem:   selectedItem.key,\r\n        };\r\n    }\r\n\r\n    componentDidUpdate(prevProps, prevState) {\r\n        let newState = {};\r\n        let doUpdate = false;\r\n        if (prevProps.initValue !== this.props.initValue) {\r\n            newState.selected = this.props.initValue;\r\n            doUpdate = true;\r\n        }\r\n        if (prevProps.visible !== this.props.visible) {\r\n            newState.modalVisible = this.props.visible;\r\n            doUpdate = true;\r\n        }\r\n        if (prevProps.selectedKey !== this.props.selectedKey || prevProps.data !== this.props.data) {\r\n            let selectedItem = this.validateSelectedKey(this.props.selectedKey);\r\n            newState.selected = selectedItem.label;\r\n            newState.changedItem = selectedItem.key;\r\n            doUpdate = true;\r\n        }\r\n        if (doUpdate) {\r\n            this.setState(newState);\r\n        }\r\n    }\r\n\r\n    validateSelectedKey = (key) => {\r\n        let selectedItem = this.props.data.filter((item) => this.props.keyExtractor(item) === key);\r\n        let selectedLabel = selectedItem.length > 0 ? this.props.labelExtractor(selectedItem[0]) : this.props.initValue;\r\n        let selectedKey = selectedItem.length > 0 ? key : undefined;\r\n        return {label: selectedLabel, key: selectedKey}\r\n    }\r\n\r\n    onChange = (item) => {\r\n        this.props.onChange(item);\r\n        this.setState({ selected: this.props.labelExtractor(item), changedItem: item }, () => {\r\n          if (this.props.closeOnChange)\r\n            this.close(item);\r\n        });\r\n    }\r\n\r\n    getSelectedItem() {\r\n      return this.state.changedItem;\r\n    }\r\n\r\n    close = (item) => {\r\n        this.props.onModalClose(item);\r\n        this.setState({\r\n            modalVisible: false,\r\n        });\r\n    }\r\n\r\n    open = (params = {}) => {\r\n        if (!params.longPress && !this.props.enableShortPress) {\r\n          return;\r\n        }\r\n        if (params.longPress && !this.props.enableLongPress) {\r\n          return;\r\n        }\r\n        this.props.onModalOpen(params);\r\n        this.setState({\r\n            modalVisible: true,\r\n            changedItem:  undefined,\r\n        });\r\n    }\r\n\r\n    renderSection = (section) => {\r\n        const optionComponent = this.props.componentExtractor(section);\r\n        let component = optionComponent || (\r\n          <Text style={[styles.sectionTextStyle,this.props.sectionTextStyle]}>{this.props.labelExtractor(section)}</Text>\r\n        );\r\n\r\n        return (\r\n            <View key={this.props.keyExtractor(section)} style={[styles.sectionStyle,this.props.sectionStyle]}>\r\n                {component}\r\n            </View>\r\n        );\r\n    }\r\n\r\n    renderOption = (option, isLastItem, isFirstItem) => {\r\n        const optionComponent = this.props.componentExtractor(option);\r\n        const optionLabel = this.props.labelExtractor(option);\r\n        const isSelectedItem = optionLabel === this.state.selected;\r\n\r\n        let component = optionComponent || (\r\n          <Text style={[styles.optionTextStyle,this.props.optionTextStyle,isSelectedItem && this.props.selectedItemTextStyle]} {...this.props.optionTextPassThruProps}>\r\n              {optionLabel}\r\n          </Text>\r\n        );\r\n\r\n        return (\r\n            <TouchableOpacity\r\n              key={this.props.keyExtractor(option)}\r\n              testID={option.testID || this.props.optionsTestIDPrefix + '-' + optionLabel}\r\n              onPress={() => this.onChange(option)}\r\n              activeOpacity={this.props.touchableActiveOpacity}\r\n              accessible={this.props.listItemAccessible}\r\n              accessibilityLabel={option.accessibilityLabel || undefined}\r\n              importantForAccessibility={isFirstItem ? 'yes' : 'no'}\r\n              {...this.props.passThruProps}\r\n            >\r\n                <View style={[styles.optionStyle, this.props.optionStyle, isLastItem && {borderBottomWidth: 0}]}>\r\n                  {component}\r\n                </View>\r\n            </TouchableOpacity>);\r\n    }\r\n\r\n    renderOptionList = () => {\r\n        const {\r\n            data,\r\n            backdropPressToClose,\r\n            scrollViewPassThruProps,\r\n            overlayStyle,\r\n            optionContainerStyle,\r\n            keyboardShouldPersistTaps,\r\n            scrollViewAccessible,\r\n            scrollViewAccessibilityLabel,\r\n            cancelContainerStyle,\r\n            touchableActiveOpacity,\r\n            cancelButtonAccessible,\r\n            cancelButtonAccessibilityLabel,\r\n            cancelStyle,\r\n            cancelTextStyle,\r\n            cancelText,\r\n        } = this.props;\r\n\r\n        let options = data.map((item, index) => {\r\n            if (item.section) {\r\n                return this.renderSection(item);\r\n            }\r\n            return this.renderOption(item, index === data.length - 1, index === 0);\r\n        });\r\n\r\n        let Overlay = View;\r\n        let overlayProps = {\r\n            style: {flex:1}\r\n        };\r\n        // Some RN versions have a bug here, so making the property opt-in works around this problem\r\n        if (backdropPressToClose) {\r\n          Overlay = TouchableWithoutFeedback;\r\n          overlayProps = {\r\n              key: `modalSelector${componentIndex++}`,\r\n              accessible: false,\r\n              onPress: this.close\r\n          };\r\n        }\r\n\r\n        const optionsContainerStyle = {paddingHorizontal: 10};\r\n        if (scrollViewPassThruProps && scrollViewPassThruProps.horizontal) {\r\n          optionsContainerStyle.flexDirection = 'row';\r\n        }\r\n\r\n        return (\r\n            <Overlay {...overlayProps}>\r\n                <View style={[styles.overlayStyle, overlayStyle]}>\r\n                    <View style={[styles.optionContainer, optionContainerStyle]}>\r\n                        <ScrollView\r\n                            keyboardShouldPersistTaps={keyboardShouldPersistTaps}\r\n                            accessible={scrollViewAccessible}\r\n                            accessibilityLabel={scrollViewAccessibilityLabel}\r\n                            {...scrollViewPassThruProps}\r\n                        >\r\n                            <View style={optionsContainerStyle}>\r\n                                {options}\r\n                            </View>\r\n                        </ScrollView>\r\n                    </View>\r\n                    <View style={[styles.cancelContainer, cancelContainerStyle]}>\r\n                        <TouchableOpacity onPress={this.close} activeOpacity={touchableActiveOpacity} accessible={cancelButtonAccessible} accessibilityLabel={cancelButtonAccessibilityLabel}>\r\n                            <View style={[styles.cancelStyle, cancelStyle]}>\r\n                                <Text style={[styles.cancelTextStyle,cancelTextStyle]} {...this.props.cancelTextPassThruProps}>{cancelText}</Text>\r\n                            </View>\r\n                        </TouchableOpacity>\r\n                    </View>\r\n                </View>\r\n            </Overlay>);\r\n    }\r\n\r\n    renderChildren = () => {\r\n\r\n        if(this.props.children) {\r\n            return this.props.children;\r\n        }\r\n        let initSelectStyle = this.props.initValue === this.state.selected ?\r\n            [styles.initValueTextStyle, this.props.initValueTextStyle] : [styles.selectTextStyle, this.props.selectTextStyle];\r\n        return (\r\n            <View style={[styles.selectStyle, this.props.selectStyle]}>\r\n                <Text style={initSelectStyle} {...this.props.selectTextPassThruProps}>{this.state.selected}</Text>\r\n            </View>\r\n        );\r\n    }\r\n\r\n    render() {\r\n\r\n        const dp = (\r\n            <Modal\r\n                transparent={true}\r\n                ref={element => this.model = element}\r\n                supportedOrientations={this.props.supportedOrientations}\r\n                visible={this.state.modalVisible}\r\n                onRequestClose={this.close}\r\n                animationType={this.props.animationType}\r\n                onDismiss={() => this.state.changedItem && this.props.onChange(this.state.changedItem)}\r\n            >\r\n                {this.renderOptionList()}\r\n            </Modal>\r\n        );\r\n\r\n        return (\r\n            <View style={this.props.style} {...this.props.passThruProps}>\r\n                {dp}\r\n                {this.props.customSelector ?\r\n                    this.props.customSelector\r\n                    :\r\n                    <TouchableOpacity\r\n                        hitSlop={this.props.modalOpenerHitSlop}\r\n                        activeOpacity={this.props.touchableActiveOpacity}\r\n                        style={this.props.touchableStyle}\r\n                        onPress={this.open}\r\n                        onLongPress={() => this.open({longPress: true})}\r\n                        disabled={this.props.disabled}\r\n                        accessible={this.props.openButtonContainerAccessible}\r\n                    >\r\n                        <View style={this.props.childrenContainerStyle} pointerEvents=\"none\">\r\n                            {this.renderChildren()}\r\n                        </View>\r\n                    </TouchableOpacity>\r\n                }\r\n            </View>\r\n        );\r\n    }\r\n}\r\n\r\nModalSelector.propTypes = propTypes;\r\nModalSelector.defaultProps = defaultProps;\r\n"]},"metadata":{},"sourceType":"module"}