Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-country-region-selector

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-country-region-selector - npm Package Compare versions

Comparing version 1.2.3 to 1.3.0

4

examples/src/examples.js

@@ -23,7 +23,7 @@ import React from 'react';

value={this.getCountryValue(0)}
onChange={(val) => this.selectCountry(0, val)}/>
onChange={(val) => this.selectCountry(0, val)} />
<RegionDropdown
country={this.getCountryValue(0)}
value={this.getRegionValue(0)}
onChange={(val) => this.selectRegion(0, val)}/>
onChange={(val) => this.selectRegion(0, val)} />
</div>

@@ -30,0 +30,0 @@ );

@@ -95,2 +95,3 @@ 'use strict';

var _onChange = _props3.onChange;
var _onBlur = _props3.onBlur;
var disabled = _props3.disabled;

@@ -104,2 +105,5 @@

},
onBlur: function onBlur(e) {
return _onBlur(e);
},
disabled: disabled

@@ -134,2 +138,3 @@ };

onChange: _propTypes2['default'].func,
onBlur: _propTypes2['default'].func,
labelType: _propTypes2['default'].oneOf([C.DISPLAY_TYPE_FULL, C.DISPLAY_TYPE_SHORT]),

@@ -149,2 +154,3 @@ valueType: _propTypes2['default'].oneOf([C.DISPLAY_TYPE_FULL, C.DISPLAY_TYPE_SHORT]),

onChange: function onChange() {},
onBlur: function onBlur() {},
labelType: C.DISPLAY_TYPE_FULL,

@@ -201,3 +207,3 @@ valueType: C.DISPLAY_TYPE_FULL,

// in a valid country
if (!regions) {
if (!regions || regions.length === 0) {
console.error('Error. Unknown country passed: ' + country + '. If you\'re passing a country shortcode, be sure to include countryValueType="short" on the RegionDropdown');

@@ -273,2 +279,3 @@ return [];

var _onChange2 = _props6.onChange;
var _onBlur2 = _props6.onBlur;
var id = _props6.id;

@@ -287,2 +294,5 @@ var name = _props6.name;

},
onBlur: function onBlur(e) {
return _onBlur2(e);
},
disabled: isDisabled

@@ -319,2 +329,3 @@ };

onChange: _propTypes2['default'].func,
onBlur: _propTypes2['default'].func,
labelType: _propTypes2['default'].string,

@@ -335,2 +346,3 @@ valueType: _propTypes2['default'].string,

onChange: function onChange() {},
onBlur: function onBlur() {},
countryValueType: C.DISPLAY_TYPE_FULL,

@@ -337,0 +349,0 @@ labelType: C.DISPLAY_TYPE_FULL,

{
"name": "react-country-region-selector",
"version": "1.2.3",
"version": "1.3.0",
"description": "CountryDropdown and RegionDropdown React components for your forms.",

@@ -5,0 +5,0 @@ "main": "lib/rcrs.js",

@@ -197,2 +197,3 @@ # React-Country-Region-Selector

| onChange | Yes | `-` | `function` | Callback that gets called when the user selects a country. Use this to store the value in whatever store you're using (or just the parent component state). |
| onBlur | No | `-` | `function` | Callback that gets called when the user blurs off the country field. |
| name | No | `"rcrs-country"` | `string` | The name attribute of the generated select box. |

@@ -216,2 +217,3 @@ | id | No | `""` | `string` | The ID of the generated select box. Not added by default. |

| onChange | Yes | - | `function` | Callback that gets called when the user selects a region. Use this to store the value in whatever store you're using (or just the parent component state). |
| onBlur | No | - | `function` | Callback that gets called when the user blurs off the region field. |
| name | No | `"rcrs-region"` | `string` | The name attribute of the generated select box. |

@@ -240,2 +242,3 @@ | id | No | `""` | `string` | The ID of the generated select box. Not added by default. |

### Gulp commands

@@ -257,2 +260,3 @@

- `1.3.0` - Mar 20, 2018. Bug fix for invalid country, [@n-david](https://github.com/n-david)! onBlur event added.
- `1.2.3` - Nov 7, 2017. Country data updates. React moved to peer dependency, thanks [@iamdey](https://github.com/iamdey)!

@@ -259,0 +263,0 @@ - `1.2.2` - Oct 4, 2017 - Update to pass event on change. Thanks [@robertnealan](https://github.com/robertnealan)!

@@ -44,3 +44,3 @@ import React from 'react';

render () {
const { name, id, classes, value, onChange, disabled } = this.props;
const { name, id, classes, value, onChange, onBlur, disabled } = this.props;
const attrs = {

@@ -50,2 +50,3 @@ name,

onChange: (e) => onChange(e.target.value, e),
onBlur: (e) => onBlur(e),
disabled

@@ -76,2 +77,3 @@ };

onChange: PropTypes.func,
onBlur: PropTypes.func,
labelType: PropTypes.oneOf([C.DISPLAY_TYPE_FULL, C.DISPLAY_TYPE_SHORT]),

@@ -91,2 +93,3 @@ valueType: PropTypes.oneOf([C.DISPLAY_TYPE_FULL, C.DISPLAY_TYPE_SHORT]),

onChange: () => {},
onBlur: () => {},
labelType: C.DISPLAY_TYPE_FULL,

@@ -135,3 +138,3 @@ valueType: C.DISPLAY_TYPE_FULL,

// in a valid country
if (!regions) {
if (!regions || regions.length === 0) {
console.error('Error. Unknown country passed: ' + country + '. If you\'re passing a country shortcode, be sure to include countryValueType="short" on the RegionDropdown');

@@ -169,3 +172,3 @@ return [];

render () {
const { value, country, onChange, id, name, classes, disabled, disableWhenEmpty } = this.props;
const { value, country, onChange, onBlur, id, name, classes, disabled, disableWhenEmpty } = this.props;
const isDisabled = disabled || (disableWhenEmpty && country == '');

@@ -176,2 +179,3 @@ const attrs = {

onChange: (e) => onChange(e.target.value, e),
onBlur: (e) => onBlur(e),
disabled: isDisabled

@@ -204,2 +208,3 @@ };

onChange: PropTypes.func,
onBlur: PropTypes.func,
labelType: PropTypes.string,

@@ -220,2 +225,3 @@ valueType: PropTypes.string,

onChange: () => {},
onBlur: () => {},
countryValueType: C.DISPLAY_TYPE_FULL,

@@ -222,0 +228,0 @@ labelType: C.DISPLAY_TYPE_FULL,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc