react-intl-number-input 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -21
- package/dist/index.d.ts +14 -0
- package/dist/index.js +66 -78
- package/jest.config.cjs +6 -0
- package/jest.setup.js +1 -0
- package/package.json +68 -57
package/README.md
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
|
-
# react-intl-number-input
|
|
2
|
-
A React component for masked and formatted number input.
|
|
3
|
-
|
|
4
|
-
[Demo](https://nandorip.github.io/react-intl-number-input/example/dist/)
|
|
5
|
-
|
|
6
|
-
##
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
# react-intl-number-input
|
|
2
|
+
A React component for masked and formatted number input.
|
|
3
|
+
|
|
4
|
+
[Demo](https://nandorip.github.io/react-intl-number-input/example/dist/)
|
|
5
|
+
|
|
6
|
+
## Requirements
|
|
7
|
+
|
|
8
|
+
- Node.js 18+ (recommended: latest LTS)
|
|
9
|
+
- React / ReactDOM: `>=16.8.0 <20`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm install react-intl-number-input
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Development
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm install
|
|
21
|
+
npm start
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Open `http://localhost:3001`.
|
|
25
|
+
|
|
26
|
+
## Scripts
|
|
27
|
+
|
|
28
|
+
- `npm start`: runs webpack dev server
|
|
29
|
+
- `npm run build`: builds the demo bundle in `example/dist`
|
|
30
|
+
- `npm run transpile`: transpiles library source from `src` to `dist`
|
|
31
|
+
- `npm test`: runs unit tests with Jest
|
|
32
|
+
- `npm run publish-demo`: builds and deploys demo to GitHub Pages
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
import React from 'react'
|
|
38
|
+
import IntlNumberInput from 'react-intl-number-input';
|
|
18
39
|
|
|
19
40
|
class App extends React.Component {
|
|
20
41
|
constructor(props) {
|
|
@@ -48,10 +69,26 @@ class App extends React.Component {
|
|
|
48
69
|
</div>
|
|
49
70
|
);
|
|
50
71
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
React 18+:
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
import { createRoot } from 'react-dom/client';
|
|
80
|
+
|
|
81
|
+
const root = createRoot(document.getElementById("root"));
|
|
82
|
+
root.render(<App />);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
React 16/17:
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
import ReactDOM from 'react-dom';
|
|
89
|
+
|
|
90
|
+
ReactDOM.render(<App />, document.getElementById("root"));
|
|
91
|
+
```
|
|
55
92
|
|
|
56
93
|
## Properties
|
|
57
94
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface IntlNumberInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
locale?: string;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
suffix?: string;
|
|
7
|
+
precision?: number;
|
|
8
|
+
value?: number | string;
|
|
9
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>, value: number, maskedValue: string) => void;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const IntlNumberInput: React.ForwardRefExoticComponent<IntlNumberInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
|
|
14
|
+
export default IntlNumberInput;
|
package/dist/index.js
CHANGED
|
@@ -1,140 +1,135 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
17
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
20
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
23
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
24
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
25
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
28
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
29
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
30
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
31
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
32
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
33
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
34
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
35
|
+
var IntlNumberInput = /*#__PURE__*/function (_Component) {
|
|
32
36
|
function IntlNumberInput(props) {
|
|
37
|
+
var _this;
|
|
33
38
|
_classCallCheck(this, IntlNumberInput);
|
|
34
|
-
|
|
35
|
-
var _this = _possibleConstructorReturn(this, (IntlNumberInput.__proto__ || Object.getPrototypeOf(IntlNumberInput)).call(this, props));
|
|
36
|
-
|
|
39
|
+
_this = _callSuper(this, IntlNumberInput, [props]);
|
|
37
40
|
_this.state = {
|
|
38
41
|
maskedValue: '0',
|
|
39
42
|
value: 0
|
|
40
43
|
};
|
|
41
44
|
return _this;
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
_createClass(IntlNumberInput, [{
|
|
45
|
-
key:
|
|
46
|
+
_inherits(IntlNumberInput, _Component);
|
|
47
|
+
return _createClass(IntlNumberInput, [{
|
|
48
|
+
key: "componentDidMount",
|
|
46
49
|
value: function componentDidMount() {
|
|
47
50
|
this.setMaskedValue(this.props.value);
|
|
48
51
|
}
|
|
49
52
|
}, {
|
|
50
|
-
key:
|
|
53
|
+
key: "componentDidUpdate",
|
|
51
54
|
value: function componentDidUpdate(prevProps) {
|
|
52
55
|
if (prevProps.value !== this.props.value) {
|
|
53
56
|
this.setMaskedValue(this.props.value);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}, {
|
|
57
|
-
key:
|
|
60
|
+
key: "setMaskedValue",
|
|
58
61
|
value: function setMaskedValue() {
|
|
59
62
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
60
|
-
|
|
61
63
|
this.setState({
|
|
62
64
|
maskedValue: this.formatNumber(value)
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
}, {
|
|
66
|
-
key:
|
|
68
|
+
key: "getMaskedValue",
|
|
67
69
|
value: function getMaskedValue() {
|
|
68
70
|
return this.state.maskedValue;
|
|
69
71
|
}
|
|
70
72
|
}, {
|
|
71
|
-
key:
|
|
73
|
+
key: "getValue",
|
|
72
74
|
value: function getValue() {
|
|
73
75
|
return this.state.value;
|
|
74
76
|
}
|
|
75
77
|
}, {
|
|
76
|
-
key:
|
|
78
|
+
key: "getPrecisionValue",
|
|
77
79
|
value: function getPrecisionValue(precision) {
|
|
78
80
|
return Math.pow(10, precision);
|
|
79
81
|
}
|
|
80
82
|
}, {
|
|
81
|
-
key:
|
|
83
|
+
key: "getNumberValue",
|
|
82
84
|
value: function getNumberValue(strValue) {
|
|
83
85
|
var numberValue = Number(strValue.replace(/[^0-9]/g, ''));
|
|
84
|
-
|
|
85
86
|
return numberValue / this.getPrecisionValue(this.props.precision);
|
|
86
87
|
}
|
|
87
88
|
}, {
|
|
88
|
-
key:
|
|
89
|
+
key: "formatNumber",
|
|
89
90
|
value: function formatNumber() {
|
|
90
91
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
91
|
-
|
|
92
92
|
var numberValue = value;
|
|
93
93
|
if (typeof numberValue === 'string') {
|
|
94
94
|
numberValue = this.getNumberValue(numberValue);
|
|
95
95
|
}
|
|
96
|
-
|
|
97
96
|
var formattedNumber = new Intl.NumberFormat(this.props.locale, {
|
|
98
97
|
style: 'decimal',
|
|
99
98
|
minimumFractionDigits: this.props.precision,
|
|
100
99
|
maximumFractionDigits: this.props.precision
|
|
101
100
|
}).format(numberValue);
|
|
102
|
-
|
|
103
|
-
return '' + this.props.prefix + formattedNumber + this.props.suffix;
|
|
101
|
+
return "".concat(this.props.prefix).concat(formattedNumber).concat(this.props.suffix);
|
|
104
102
|
}
|
|
105
103
|
}, {
|
|
106
|
-
key:
|
|
104
|
+
key: "updateValues",
|
|
107
105
|
value: function updateValues(event) {
|
|
108
106
|
var value = this.getNumberValue(event.target.value);
|
|
109
107
|
var maskedValue = this.formatNumber(value);
|
|
110
|
-
|
|
111
108
|
return [value, maskedValue];
|
|
112
109
|
}
|
|
113
110
|
}, {
|
|
114
|
-
key:
|
|
111
|
+
key: "handleChange",
|
|
115
112
|
value: function handleChange(event) {
|
|
116
113
|
var _this2 = this;
|
|
117
|
-
|
|
118
114
|
event.preventDefault();
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
maskedValue = _updateValues2[1];
|
|
124
|
-
|
|
115
|
+
var _this$updateValues = this.updateValues(event),
|
|
116
|
+
_this$updateValues2 = _slicedToArray(_this$updateValues, 2),
|
|
117
|
+
value = _this$updateValues2[0],
|
|
118
|
+
maskedValue = _this$updateValues2[1];
|
|
125
119
|
event.persist();
|
|
126
|
-
|
|
127
120
|
if (this.props.onChange && maskedValue) {
|
|
128
|
-
this.setState({
|
|
121
|
+
this.setState({
|
|
122
|
+
value: value,
|
|
123
|
+
maskedValue: maskedValue
|
|
124
|
+
}, function () {
|
|
129
125
|
_this2.props.onChange(event, value, maskedValue);
|
|
130
126
|
});
|
|
131
127
|
}
|
|
132
128
|
}
|
|
133
129
|
}, {
|
|
134
|
-
key:
|
|
130
|
+
key: "customProps",
|
|
135
131
|
value: function customProps() {
|
|
136
|
-
var customProps =
|
|
137
|
-
|
|
132
|
+
var customProps = _objectSpread({}, this.props);
|
|
138
133
|
delete customProps.locale;
|
|
139
134
|
delete customProps.prefix;
|
|
140
135
|
delete customProps.suffix;
|
|
@@ -142,15 +137,13 @@ var IntlNumberInput = function (_Component) {
|
|
|
142
137
|
delete customProps.autoFocus;
|
|
143
138
|
delete customProps.value;
|
|
144
139
|
delete customProps.onChange;
|
|
145
|
-
|
|
146
140
|
return customProps;
|
|
147
141
|
}
|
|
148
142
|
}, {
|
|
149
|
-
key:
|
|
143
|
+
key: "render",
|
|
150
144
|
value: function render() {
|
|
151
145
|
var _this3 = this;
|
|
152
|
-
|
|
153
|
-
return _react2.default.createElement('input', _extends({
|
|
146
|
+
return /*#__PURE__*/_react["default"].createElement("input", _extends({
|
|
154
147
|
value: this.state.maskedValue,
|
|
155
148
|
disabled: this.props.disabled,
|
|
156
149
|
onChange: function onChange(e) {
|
|
@@ -159,25 +152,20 @@ var IntlNumberInput = function (_Component) {
|
|
|
159
152
|
}, this.customProps()));
|
|
160
153
|
}
|
|
161
154
|
}]);
|
|
162
|
-
|
|
163
|
-
return IntlNumberInput;
|
|
164
155
|
}(_react.Component);
|
|
165
|
-
|
|
166
156
|
IntlNumberInput.propTypes = {
|
|
167
|
-
locale:
|
|
168
|
-
prefix:
|
|
169
|
-
suffix:
|
|
170
|
-
precision:
|
|
171
|
-
value:
|
|
172
|
-
disabled:
|
|
173
|
-
onChange:
|
|
157
|
+
locale: _propTypes["default"].string.isRequired,
|
|
158
|
+
prefix: _propTypes["default"].string.isRequired,
|
|
159
|
+
suffix: _propTypes["default"].string.isRequired,
|
|
160
|
+
precision: _propTypes["default"].number.isRequired,
|
|
161
|
+
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
162
|
+
disabled: _propTypes["default"].bool,
|
|
163
|
+
onChange: _propTypes["default"].func
|
|
174
164
|
};
|
|
175
|
-
|
|
176
165
|
IntlNumberInput.defaultProps = {
|
|
177
166
|
locale: 'en-US',
|
|
178
167
|
prefix: '',
|
|
179
168
|
suffix: '',
|
|
180
169
|
precision: 2
|
|
181
170
|
};
|
|
182
|
-
|
|
183
|
-
exports.default = IntlNumberInput;
|
|
171
|
+
var _default = exports["default"] = IntlNumberInput;
|
package/jest.config.cjs
ADDED
package/jest.setup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
package/package.json
CHANGED
|
@@ -1,57 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-intl-number-input",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A React component for masked and formatted number input.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "
|
|
8
|
-
"start": "webpack
|
|
9
|
-
"transpile": "babel src -d dist --copy-files",
|
|
10
|
-
"prepublishOnly": "npm run transpile",
|
|
11
|
-
"build": "webpack --mode production",
|
|
12
|
-
"deploy": "gh-pages -d example/dist",
|
|
13
|
-
"publish-demo": "npm run build && npm run deploy"
|
|
14
|
-
},
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/nandorip/react-intl-number-input.git"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"react",
|
|
21
|
-
"react-component",
|
|
22
|
-
"javascript",
|
|
23
|
-
"mask",
|
|
24
|
-
"currency",
|
|
25
|
-
"money",
|
|
26
|
-
"number",
|
|
27
|
-
"intl",
|
|
28
|
-
"input"
|
|
29
|
-
],
|
|
30
|
-
"author": "Fernando Pires Reherman <nandorip@live.com>",
|
|
31
|
-
"license": "MIT",
|
|
32
|
-
"bugs": {
|
|
33
|
-
"url": "https://github.com/nandorip/react-intl-number-input/issues"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/nandorip/react-intl-number-input#readme",
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"react": "
|
|
38
|
-
"react-dom": "
|
|
39
|
-
},
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"babel
|
|
45
|
-
"babel
|
|
46
|
-
"babel-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"react": "^16.
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"webpack-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "react-intl-number-input",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "A React component for masked and formatted number input.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "jest --runInBand",
|
|
8
|
+
"start": "webpack serve --mode development",
|
|
9
|
+
"transpile": "babel src -d dist --copy-files --no-copy-ignored --ignore \"**/*.test.jsx\"",
|
|
10
|
+
"prepublishOnly": "npm run transpile",
|
|
11
|
+
"build": "webpack --mode production",
|
|
12
|
+
"deploy": "gh-pages -d example/dist",
|
|
13
|
+
"publish-demo": "npm run build && npm run deploy"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/nandorip/react-intl-number-input.git"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"react",
|
|
21
|
+
"react-component",
|
|
22
|
+
"javascript",
|
|
23
|
+
"mask",
|
|
24
|
+
"currency",
|
|
25
|
+
"money",
|
|
26
|
+
"number",
|
|
27
|
+
"intl",
|
|
28
|
+
"input"
|
|
29
|
+
],
|
|
30
|
+
"author": "Fernando Pires Reherman <nandorip@live.com>",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/nandorip/react-intl-number-input/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/nandorip/react-intl-number-input#readme",
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": ">=16.8.0 <20",
|
|
38
|
+
"react-dom": ">=16.8.0 <20"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"prop-types": "^15.8.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@babel/cli": "^7.27.2",
|
|
45
|
+
"@babel/core": "^7.27.4",
|
|
46
|
+
"@babel/plugin-transform-object-rest-spread": "^7.28.4",
|
|
47
|
+
"@babel/preset-env": "^7.29.5",
|
|
48
|
+
"@babel/preset-react": "^7.27.1",
|
|
49
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
50
|
+
"@testing-library/react": "^16.3.0",
|
|
51
|
+
"babel-jest": "^30.2.0",
|
|
52
|
+
"babel-loader": "^10.0.0",
|
|
53
|
+
"gh-pages": "^6.3.0",
|
|
54
|
+
"html-webpack-plugin": "^5.6.4",
|
|
55
|
+
"jest": "^30.2.0",
|
|
56
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
57
|
+
"react": "^19.2.0",
|
|
58
|
+
"react-dom": "^19.2.0",
|
|
59
|
+
"webpack": "^5.101.3",
|
|
60
|
+
"webpack-cli": "^6.0.1",
|
|
61
|
+
"webpack-dev-server": "^5.2.4"
|
|
62
|
+
},
|
|
63
|
+
"overrides": {
|
|
64
|
+
"fast-uri": "^3.1.1",
|
|
65
|
+
"follow-redirects": "^1.16.0",
|
|
66
|
+
"uuid": "^11.1.1"
|
|
67
|
+
}
|
|
68
|
+
}
|