JSPM

react-native-iran-region-picker

1.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q52035F
  • License MIT

a modal picker(wheel) of Iran province & city & region

Package Exports

  • react-native-iran-region-picker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-iran-region-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-native-iran-region-picker

IOS & Android.

a modal picker(wheel) of Iran province & city & region.

propTypes

isRtl: PropTypes.bool,
isVisible: PropTypes.bool,
isShowArea: PropTypes.bool,
selectedProvince: PropTypes.string,
selectedCity: PropTypes.string,
selectedArea: PropTypes.string,
navBtnColor: PropTypes.string,
animationType: PropTypes.string,
transparent: PropTypes.bool,
onSubmit: PropTypes.func,
onCancel: PropTypes.func,
androidPickerHeight: PropTypes.number   

Install

npm install react-native-iran-region-picker --save

Usage

import IranRegionWheelPicker from 'react-native-iran-region-picker';

// ios
<IranRegionWheelPicker
  onSubmit={(params) => this.setState({ region1: `${params.province},${params.city},${params.area}` })}
  onCancel={() => console.log('cancel')}
>
  <TextInput
    editable={false}
    placeholder="انتخاب منطقه"
    value={this.state.region1}
  />
</IranRegionWheelPicker>

// android
<IranRegionWheelPicker
  onSubmit={(params) => this.setState({ region1: `${params.province},${params.city},${params.area}` })}
  onCancel={() => console.log('cancel')}
>
  <Text
    style={{ backgroundColor: '#FFF', width: 200, paddingVertical: 20, textAlign: 'center', color: 'black' }}
  >{this.state.region1 || 'انتخاب منطقه'}</Text>
</IranRegionWheelPicker>

//Example:index.ios.js/android.ios.js
<IranRegionWheelPicker
  isVisible={this.state.isPickerVisible}
  navBtnColor={'red'}
  selectedProvince={'تهران'}
  selectedCity={'تهران'}
  selectedArea={'تجریش'}
  transparent
  animationType={'fade'}
  onSubmit={this._onPressSubmit.bind(this)}
  onCancel={this._onPressCancel.bind(this)}
  androidPickerHeight={100}
/>

<TouchableOpacity
  onPress={this._onPress2Show.bind(this)}
>
  <Text style={{ color: 'white' }}>{this.state.region2 || 'انتخاب منطقه' }</Text>
</TouchableOpacity>