react-contact-number-input
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13169
190
62