intelicoreact 0.1.96 → 0.1.99
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.
|
@@ -222,7 +222,7 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
222
222
|
(0, _react.useEffect)(function () {
|
|
223
223
|
if (inputValue !== value) setIsFocused(true);
|
|
224
224
|
setInputValueFormated(isPriceInput ? isFocused ? (0, _fieldValueFormatters.formatToRemoveComa)(inputValue) : (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue) : inputValue);
|
|
225
|
-
setIntMemoVal(
|
|
225
|
+
setIntMemoVal((0, _fieldValueFormatters.formatToRemoveComa)(inputValue));
|
|
226
226
|
if (typeof onChange === 'function') onChange(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toString());
|
|
227
227
|
}, [inputValue]); //On Integer Value Change
|
|
228
228
|
|
|
@@ -281,7 +281,7 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
281
281
|
} : {});
|
|
282
282
|
|
|
283
283
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, uniProps, {
|
|
284
|
-
value: value,
|
|
284
|
+
value: (0, _fieldValueFormatters.formatToAddBitDepthPoints)((0, _fieldValueFormatters.formatToRemoveComa)(value)),
|
|
285
285
|
ref: inputRef,
|
|
286
286
|
type: "text"
|
|
287
287
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.filterNumeric = exports.filterPhone = exports.filterToLimitLength = exports.filterFloat = exports.formatNumberValueToMask = exports.formatToCutOffDotAtTheEnd = exports.
|
|
8
|
+
exports.filterNumeric = exports.filterPhone = exports.filterToLimitLength = exports.filterFloat = exports.formatNumberValueToMask = exports.formatToCutOffDotAtTheEnd = exports.formatToOnlyASCIICodeText = exports.formatToLetters = exports.formatToTwoDigitAfterDot = exports.formatToPriceInputAndDollarSymbol = exports.formatToAddBitDepthPoints = exports.formatToRemoveComa = exports.formatDollarSign = exports.formatOnlyNumbers = void 0;
|
|
9
9
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
|
|
@@ -28,6 +28,12 @@ var formatDollarSign = function formatDollarSign(inputValue) {
|
|
|
28
28
|
|
|
29
29
|
exports.formatDollarSign = formatDollarSign;
|
|
30
30
|
|
|
31
|
+
var formatToRemoveComa = function formatToRemoveComa(value) {
|
|
32
|
+
return (value ? value.toString() : '').toString().replace(/,/g, '');
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.formatToRemoveComa = formatToRemoveComa;
|
|
36
|
+
|
|
31
37
|
var formatToAddBitDepthPoints = function formatToAddBitDepthPoints(inputValue) {
|
|
32
38
|
var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
33
39
|
var value = !!inputValue ? inputValue.toString() : ''; //содержит ли value точку
|
|
@@ -36,7 +42,7 @@ var formatToAddBitDepthPoints = function formatToAddBitDepthPoints(inputValue) {
|
|
|
36
42
|
|
|
37
43
|
var valueBeforeDot = isFraction ? value.slice(0, value.indexOf('.')) : value; //расстановка запятых после каждой 3й цифры с конца
|
|
38
44
|
|
|
39
|
-
var intPart = valueBeforeDot.split('').reverse().reduce(function (acc, item, idx) {
|
|
45
|
+
var intPart = formatToRemoveComa(valueBeforeDot).split('').reverse().reduce(function (acc, item, idx) {
|
|
40
46
|
return idx % step === 0 && idx !== 0 ? [].concat((0, _toConsumableArray2.default)(acc), [',', item]) : [].concat((0, _toConsumableArray2.default)(acc), [item]);
|
|
41
47
|
}, []).reverse().join('');
|
|
42
48
|
return isFraction ? intPart + value.slice(value.indexOf('.')) : intPart;
|
|
@@ -81,12 +87,6 @@ var formatToOnlyASCIICodeText = function formatToOnlyASCIICodeText(text) {
|
|
|
81
87
|
|
|
82
88
|
exports.formatToOnlyASCIICodeText = formatToOnlyASCIICodeText;
|
|
83
89
|
|
|
84
|
-
var formatToRemoveComa = function formatToRemoveComa(value) {
|
|
85
|
-
return (!!value ? value.toString() : '').toString().replace(/\,/g, '');
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
exports.formatToRemoveComa = formatToRemoveComa;
|
|
89
|
-
|
|
90
90
|
var formatToCutOffDotAtTheEnd = function formatToCutOffDotAtTheEnd(inputValue) {
|
|
91
91
|
var value = !!inputValue ? inputValue.toString() : '';
|
|
92
92
|
return value.toString().slice(-1) === '.' ? value.slice(0, -1) : value;
|