d94a27597e57a9abff03fb55a760de26.json 6.86 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf3=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var _react=_interopRequireDefault(require(\"react\"));var _TextInput=_interopRequireDefault(require(\"react-native-web/dist/exports/TextInput\"));var _default=function _default(Navigator,navigatorConfig){var _class,_temp;return _temp=_class=function(_React$Component){(0,_inherits2.default)(KeyboardAwareNavigator,_React$Component);function KeyboardAwareNavigator(){var _getPrototypeOf2;var _this;(0,_classCallCheck2.default)(this,KeyboardAwareNavigator);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=(0,_possibleConstructorReturn2.default)(this,(_getPrototypeOf2=(0,_getPrototypeOf3.default)(KeyboardAwareNavigator)).call.apply(_getPrototypeOf2,[this].concat(args)));_this._previouslyFocusedTextInput=null;_this._handleGestureBegin=function(){_this._previouslyFocusedTextInput=_TextInput.default.State.currentlyFocusedField();if(_this._previouslyFocusedTextInput){_TextInput.default.State.blurTextInput(_this._previouslyFocusedTextInput);}_this.props.onGestureBegin&&_this.props.onGestureBegin();};_this._handleGestureCanceled=function(){if(_this._previouslyFocusedTextInput){_TextInput.default.State.focusTextInput(_this._previouslyFocusedTextInput);}_this.props.onGestureCanceled&&_this.props.onGestureCanceled();};_this._handleGestureEnd=function(){_this._previouslyFocusedTextInput=null;_this.props.onGestureFinish&&_this.props.onGestureFinish();};_this._handleTransitionStart=function(transitionProps,prevTransitionProps){if(transitionProps.index!==prevTransitionProps.index){var currentField=_TextInput.default.State.currentlyFocusedField();if(currentField){_TextInput.default.State.blurTextInput(currentField);}}var onTransitionStart=_this.props.onTransitionStart||navigatorConfig.onTransitionStart;onTransitionStart&&onTransitionStart(transitionProps,prevTransitionProps);};return _this;}(0,_createClass2.default)(KeyboardAwareNavigator,[{key:\"render\",value:function render(){return _react.default.createElement(Navigator,(0,_extends2.default)({},this.props,{onGestureBegin:this._handleGestureBegin,onGestureCanceled:this._handleGestureCanceled,onGestureEnd:this._handleGestureEnd,onTransitionStart:this._handleTransitionStart}));}}]);return KeyboardAwareNavigator;}(_react.default.Component),_class.router=Navigator.router,_class.navigationOptions=Navigator.navigationOptions,_temp;};exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/@react-navigation/native/dist/createKeyboardAwareNavigator.js"],"names":["Navigator","navigatorConfig","_previouslyFocusedTextInput","_handleGestureBegin","TextInput","State","currentlyFocusedField","blurTextInput","props","onGestureBegin","_handleGestureCanceled","focusTextInput","onGestureCanceled","_handleGestureEnd","onGestureFinish","_handleTransitionStart","transitionProps","prevTransitionProps","index","currentField","onTransitionStart","React","Component","router","navigationOptions"],"mappings":"6sBAAA,oD,uGAGgB,kBAACA,SAAD,CAAYC,eAAZ,whBAGdC,2BAHc,CAGgB,IAHhB,OASdC,mBATc,CASQ,UAAM,CAC1B,MAAKD,2BAAL,CAAmCE,mBAAUC,KAAV,CAAgBC,qBAAhB,EAAnC,CACA,GAAI,MAAKJ,2BAAT,CAAsC,CACpCE,mBAAUC,KAAV,CAAgBE,aAAhB,CAA8B,MAAKL,2BAAnC,EACD,CACD,MAAKM,KAAL,CAAWC,cAAX,EAA6B,MAAKD,KAAL,CAAWC,cAAX,EAA7B,CACD,CAfa,OAiBdC,sBAjBc,CAiBW,UAAM,CAC7B,GAAI,MAAKR,2BAAT,CAAsC,CACpCE,mBAAUC,KAAV,CAAgBM,cAAhB,CAA+B,MAAKT,2BAApC,EACD,CACD,MAAKM,KAAL,CAAWI,iBAAX,EAAgC,MAAKJ,KAAL,CAAWI,iBAAX,EAAhC,CACD,CAtBa,OAwBdC,iBAxBc,CAwBM,UAAM,CACxB,MAAKX,2BAAL,CAAmC,IAAnC,CACA,MAAKM,KAAL,CAAWM,eAAX,EAA8B,MAAKN,KAAL,CAAWM,eAAX,EAA9B,CACD,CA3Ba,OA6BdC,sBA7Bc,CA6BW,SAACC,eAAD,CAAkBC,mBAAlB,CAA0C,CAIjE,GAAID,eAAe,CAACE,KAAhB,GAA0BD,mBAAmB,CAACC,KAAlD,CAAyD,CACvD,GAAMC,CAAAA,YAAY,CAAGf,mBAAUC,KAAV,CAAgBC,qBAAhB,EAArB,CACA,GAAIa,YAAJ,CAAkB,CAChBf,mBAAUC,KAAV,CAAgBE,aAAhB,CAA8BY,YAA9B,EACD,CACF,CAED,GAAMC,CAAAA,iBAAiB,CAAG,MAAKZ,KAAL,CAAWY,iBAAX,EAAgCnB,eAAe,CAACmB,iBAA1E,CACAA,iBAAiB,EAAIA,iBAAiB,CAACJ,eAAD,CAAkBC,mBAAlB,CAAtC,CACD,CA1Ca,sGAKL,CACP,MAAO,8BAAC,SAAD,0BAAe,KAAKT,KAApB,EAA2B,cAAc,CAAE,KAAKL,mBAAhD,CAAqE,iBAAiB,CAAE,KAAKO,sBAA7F,CAAqH,YAAY,CAAE,KAAKG,iBAAxI,CAA2J,iBAAiB,CAAE,KAAKE,sBAAnL,GAAP,CACD,CAPa,oCAAqEM,eAAMC,SAA3E,SACPC,MADO,CACEvB,SAAS,CAACuB,MADZ,QAEPC,iBAFO,CAEaxB,SAAS,CAACwB,iBAFvB,Q","sourcesContent":["import React from 'react';\nimport { TextInput } from 'react-native';\n\nexport default ((Navigator, navigatorConfig) => class KeyboardAwareNavigator extends React.Component {\n  static router = Navigator.router;\n  static navigationOptions = Navigator.navigationOptions;\n  _previouslyFocusedTextInput = null;\n\n  render() {\n    return <Navigator {...this.props} onGestureBegin={this._handleGestureBegin} onGestureCanceled={this._handleGestureCanceled} onGestureEnd={this._handleGestureEnd} onTransitionStart={this._handleTransitionStart} />;\n  }\n\n  _handleGestureBegin = () => {\n    this._previouslyFocusedTextInput = TextInput.State.currentlyFocusedField();\n    if (this._previouslyFocusedTextInput) {\n      TextInput.State.blurTextInput(this._previouslyFocusedTextInput);\n    }\n    this.props.onGestureBegin && this.props.onGestureBegin();\n  };\n\n  _handleGestureCanceled = () => {\n    if (this._previouslyFocusedTextInput) {\n      TextInput.State.focusTextInput(this._previouslyFocusedTextInput);\n    }\n    this.props.onGestureCanceled && this.props.onGestureCanceled();\n  };\n\n  _handleGestureEnd = () => {\n    this._previouslyFocusedTextInput = null;\n    this.props.onGestureFinish && this.props.onGestureFinish();\n  };\n\n  _handleTransitionStart = (transitionProps, prevTransitionProps) => {\n    // TODO: We should not even have received the transition start event\n    // in the case where the index did not change, I believe. We\n    // should revisit this after 2.0 release.\n    if (transitionProps.index !== prevTransitionProps.index) {\n      const currentField = TextInput.State.currentlyFocusedField();\n      if (currentField) {\n        TextInput.State.blurTextInput(currentField);\n      }\n    }\n\n    const onTransitionStart = this.props.onTransitionStart || navigatorConfig.onTransitionStart;\n    onTransitionStart && onTransitionStart(transitionProps, prevTransitionProps);\n  };\n});"]},"metadata":{},"sourceType":"script"}