intelicoreact 0.3.46 → 0.3.47
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.
|
@@ -136,9 +136,9 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
136
136
|
}) : e; // ToDo - не совсем понятно что проверяется, т.к. при нажатии инкремента/декримента все равно в change приходит число, а не эвент
|
|
137
137
|
// ToDo - боюсь сломать, временно оставляю, выпилить через какое-то время
|
|
138
138
|
// if (inputValue && (decRef.current?.contains?.(e.target) || incRef.current?.contains?.(e.target))) {
|
|
139
|
+
// if (symbolsLimit) inputValue = inputValue.toString().substring(0, +symbolsLimit);
|
|
140
|
+
// if (isPriceInput && inputValue?.length > 0) inputValue = addCommas(inputValue);
|
|
139
141
|
|
|
140
|
-
if (symbolsLimit) inputValue = inputValue.toString().substring(0, +symbolsLimit);
|
|
141
|
-
if (isPriceInput) inputValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue);
|
|
142
142
|
setInputValue(inputValue.toString());
|
|
143
143
|
},
|
|
144
144
|
clear: function clear() {
|
|
@@ -221,7 +221,7 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
221
221
|
|
|
222
222
|
(0, _react.useEffect)(function () {
|
|
223
223
|
if (inputValue !== value) setIsFocused(true);
|
|
224
|
-
setInputValueFormated(isPriceInput ? isFocused ? (0, _fieldValueFormatters.formatToRemoveComa)(inputValue) : (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue) : inputValue);
|
|
224
|
+
setInputValueFormated(isPriceInput && (inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) > 0 ? isFocused ? (0, _fieldValueFormatters.formatToRemoveComa)(inputValue) : (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue) : inputValue);
|
|
225
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
|
|
@@ -277,7 +277,7 @@ var NumericInput = function NumericInput(_ref) {
|
|
|
277
277
|
|
|
278
278
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, uniProps, {
|
|
279
279
|
"data-testid": "input--".concat(testId),
|
|
280
|
-
value: (0, _fieldValueFormatters.formatToAddBitDepthPoints)((0, _fieldValueFormatters.formatToRemoveComa)(value)),
|
|
280
|
+
value: (value === null || value === void 0 ? void 0 : value.length) > 0 ? (0, _fieldValueFormatters.formatToAddBitDepthPoints)((0, _fieldValueFormatters.formatToRemoveComa)(value)) : value,
|
|
281
281
|
ref: inputRef,
|
|
282
282
|
type: "text",
|
|
283
283
|
onFocus: function onFocus() {
|