react-intl-number-input 0.8.2 → 0.8.3
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/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const react_1 = __importStar(require("react"));
|
|
37
37
|
function sanitizeString(str) {
|
|
38
|
-
return str.replace(/<[^>]*>/g, '');
|
|
38
|
+
return str.replace(/<[^>]*>/g, '').replace(/on\w+\s*=\s*["'][^"']*["']/g, '');
|
|
39
39
|
}
|
|
40
40
|
function resolveLocale(locale) {
|
|
41
41
|
try {
|
|
@@ -84,7 +84,7 @@ const IntlNumberInput = (0, react_1.forwardRef)(function IntlNumberInput({ local
|
|
|
84
84
|
}, []);
|
|
85
85
|
const getNumberValue = (0, react_1.useCallback)((strValue) => {
|
|
86
86
|
const inputValue = String(strValue || '');
|
|
87
|
-
const hasNegativeSign = inputValue.
|
|
87
|
+
const hasNegativeSign = inputValue.startsWith('-');
|
|
88
88
|
const onlyDigits = inputValue.replace(/[^0-9]/g, '');
|
|
89
89
|
if (!onlyDigits) {
|
|
90
90
|
return hasNegativeSign ? -0 : 0;
|