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

react-contact-number-input

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-contact-number-input - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

10

dist/Phone/index.js

@@ -36,3 +36,3 @@ "use strict";

disabled: props.disabled,
placeholder: "Enter Mobile Number",
placeholder: props.placeholder,
countryCodeEditable: true,

@@ -69,8 +69,12 @@ country: props.countryCode,

handleOnChange: _propTypes["default"].func,
value: _propTypes["default"].string
value: _propTypes["default"].string,
placeholder: _propTypes["default"].string
};
Phone.defaultProps = {
countryCode: 'us'
countryCode: 'us',
disabled: false,
containerClass: '',
placeholder: 'Enter Mobile Number'
};
var _default = Phone;
exports["default"] = _default;

@@ -10,8 +10,12 @@ "use strict";

var _react = _interopRequireWildcard(require("react"));
var _phone = _interopRequireDefault(require("phone"));
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _Phone = _interopRequireDefault(require("../Phone"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

@@ -21,4 +25,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

@@ -40,3 +42,4 @@

disabled = _ref.disabled,
containerClass = _ref.containerClass;
containerClass = _ref.containerClass,
placeholder = _ref.placeholder;

@@ -112,7 +115,15 @@ var _useState = (0, _react.useState)(countryCode || "us"),

countryCode: currentCountryCode,
handleOnChange: handlePhoneOnChange
handleOnChange: handlePhoneOnChange,
placeholder: placeholder
});
};
PhoneInput.propTypes = {
onChange: _propTypes["default"].func,
countryCode: _propTypes["default"].string,
disabled: _propTypes["default"].bool,
containerClass: _propTypes["default"].string,
placeholder: _propTypes["default"].string
};
var _default = PhoneInput;
exports["default"] = _default;
{
"name": "react-contact-number-input",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -14,2 +14,5 @@ "main": "dist/index.js",

},
"keywords": [
"phone","number","contact","international","input","react","js"
],
"author": "vaibhav-systango",

@@ -16,0 +19,0 @@ "license": "MIT",

@@ -21,3 +21,2 @@ <h1 align="center">Welcome to react-contact-number-input 👋</h1>

<!-- ## Show your support

@@ -29,3 +28,36 @@

_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ -->
## Usage
You need to import ReactCountryInput from package react-country-input with the props using below-
Code Example:
```js live=true
import { PhoneInput } from "react-contact-number-input";
<PhoneInput
disabled={disabled}
containerClass={containerClass}
countryCode={currentCountryCode}
onChange={handleOnChange}
placeholder={placeholder}
/>;
```
### Component Props
| Name | Type | Description |
| :------------- | ------- | ----------------------------------------------------------------------------------- |
| onChange | func | _required_, returns the object with the details of the number |
| countryCode | string | _default value= 'us'_, selected country phone code. |
| placeholder | string | _default value= 'Enter Mobile Number'_ ,change the value of phone input placeholder |
| containerClass | string | _default value= ''_ ,change the phone input styling |
| disabled | boolean | _default value= false_ ,handles the input to be disabled or not |
## Notes on Requirements
At least `React@17.0.2` is required due to `hooks` usage in the dependency
## Keywords
phone contact number input react international
phone contact number input react international
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