intelicoreact 0.3.46 → 0.3.49

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.
@@ -377,15 +377,21 @@ function InputMask2() {
377
377
  };
378
378
 
379
379
  var getClearInnerValueAsString = function getClearInnerValueAsString() {
380
- return innerValue.reduce(function (result, _ref9, i, arr) {
381
- var char = _ref9.char,
382
- maskChar = _ref9.maskChar,
383
- isSpecialSymbol = _ref9.isSpecialSymbol,
384
- isCharSymbol = _ref9.isCharSymbol;
385
- if (char !== maskChar && char !== '' || !isSpecialSymbol || isCharSymbol) result += char; // || isCharSymbol
380
+ var _getInputValue, _getInputValue$split;
386
381
 
387
- return result;
388
- }, '');
382
+ var symbolsInfo = innerValue === null || innerValue === void 0 ? void 0 : innerValue.map(function (_ref9) {
383
+ var isSpecialSymbol = _ref9.isSpecialSymbol,
384
+ isCharSymbol = _ref9.isCharSymbol;
385
+ return {
386
+ isSpecialSymbol: isSpecialSymbol,
387
+ isCharSymbol: isCharSymbol
388
+ };
389
+ });
390
+ var clearValue = (_getInputValue = getInputValue()) === null || _getInputValue === void 0 ? void 0 : (_getInputValue$split = _getInputValue.split('')) === null || _getInputValue$split === void 0 ? void 0 : _getInputValue$split.reduce(function (resultStr, symbol, i) {
391
+ if (!symbolsInfo[i].isSpecialSymbol || symbolsInfo[i].isCharSymbol) resultStr += symbol;
392
+ return resultStr;
393
+ }, "");
394
+ return clearValue;
389
395
  };
390
396
 
391
397
  var getInputValue = function getInputValue() {
@@ -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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.3.46",
3
+ "version": "0.3.49",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [