react-imask
Advanced tools
Comparing version 5.1.7 to 5.1.8
@@ -33,40 +33,2 @@ (function (global, factory) { | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
if (i % 2) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
var ownKeys = Object.keys(source); | ||
if (typeof Object.getOwnPropertySymbols === 'function') { | ||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(source, sym).enumerable; | ||
})); | ||
} | ||
ownKeys.forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(arguments[i])); | ||
} | ||
} | ||
return target; | ||
} | ||
function _inherits(subClass, superClass) { | ||
@@ -264,3 +226,3 @@ if (typeof superClass !== "function" && superClass !== null) { | ||
value: function render() { | ||
return React.createElement(ComposedComponent, _objectSpread2({}, this._extractNonMaskProps(this.props), { | ||
return React.createElement(ComposedComponent, Object.assign({}, this._extractNonMaskProps(this.props), { | ||
defaultValue: this.props.value, | ||
@@ -273,3 +235,3 @@ inputRef: this._inputRef | ||
value: function initMask() { | ||
var maskOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._extractMaskOptionsFromProps(_objectSpread2({}, this.props)); | ||
var maskOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._extractMaskOptionsFromProps(Object.assign({}, this.props)); | ||
this.maskRef = new IMask(this.element, maskOptions).on('accept', this._onAccept.bind(this)).on('complete', this._onComplete.bind(this)); | ||
@@ -289,3 +251,3 @@ this.maskValue = this.props.value; | ||
value: function _extractMaskOptionsFromProps(props) { | ||
props = _objectSpread2({}, props); // keep only mask options props | ||
props = Object.assign({}, props); // keep only mask options props | ||
@@ -302,3 +264,3 @@ Object.keys(props).filter(function (prop) { | ||
value: function _extractNonMaskProps(props) { | ||
props = _objectSpread2({}, props); | ||
props = Object.assign({}, props); | ||
MASK_PROPS_NAMES.forEach(function (maskProp) { | ||
@@ -345,3 +307,3 @@ delete props[maskProp]; | ||
return React.createElement('input', _objectSpread2({}, props, { | ||
return React.createElement('input', Object.assign({}, props, { | ||
ref: inputRef | ||
@@ -348,0 +310,0 @@ })); |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "5.1.7", | ||
"version": "5.1.8", | ||
"homepage": "https://unmanner.github.io/imaskjs/", | ||
@@ -21,3 +21,3 @@ "description": "React input mask", | ||
"dependencies": { | ||
"imask": "^5.1.7", | ||
"imask": "^5.1.8", | ||
"prop-types": "^15.7.2" | ||
@@ -31,3 +31,3 @@ }, | ||
}, | ||
"gitHead": "df5348e6aa3314341d20690f85f0e5b2ba70b92b" | ||
"gitHead": "3ff84bfbbb99d369dd2e41bf4b6fed421a458e2d" | ||
} |
@@ -7,2 +7,6 @@ # React IMask Plugin | ||
<a href="https://opencollective.com/imask/donate" target="_blank"> | ||
<img src="https://opencollective.com/imask/donate/button.png?color=blue" width=300 /> | ||
</a> | ||
## Install | ||
@@ -19,3 +23,3 @@ `npm install react-imask` | ||
value="123" | ||
unmask="true" // true|false|'typed' | ||
unmask={true} // true|false|'typed' | ||
onAccept={ | ||
@@ -52,3 +56,3 @@ // depending on prop above first argument is | ||
<MaskedStyledInput | ||
mask=Number | ||
mask={Number} | ||
radix="." | ||
@@ -55,0 +59,0 @@ onAccept={(value, mask) => console.log(value)} |
Sorry, the diff of this file is not supported yet
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
71
27378
274
Updatedimask@^5.1.8