intelicoreact 0.1.97 → 0.2.0

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.
@@ -189,10 +189,10 @@ var NumericInput = function NumericInput(_ref) {
189
189
  if (onKeyUp) onKeyUp(e.keyCode, e.target.value);
190
190
  },
191
191
  decrement: function decrement(e) {
192
- handle.change(+intMemoVal.toString().replace(/,/g, '') - +numStep);
192
+ handle.change(+intMemoVal - +numStep);
193
193
  },
194
194
  increment: function increment(e) {
195
- handle.change(+intMemoVal.toString().replace(/,/g, '') + +numStep);
195
+ handle.change(+intMemoVal + +numStep);
196
196
  }
197
197
  }; //Check Outside Click
198
198
 
@@ -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(parseInt(inputValue));
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", {
@@ -82,6 +82,7 @@ var TieredCheckboxes = function TieredCheckboxes(_ref) {
82
82
  }, /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
83
83
  label: child.label,
84
84
  value: child.value,
85
+ disabled: child === null || child === void 0 ? void 0 : child.disabled,
85
86
  onChange: function onChange(value) {
86
87
  return handle.changeChild(value, child.key, parent.key);
87
88
  }
@@ -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.formatToRemoveComa = exports.formatToOnlyASCIICodeText = exports.formatToLetters = exports.formatToTwoDigitAfterDot = exports.formatToPriceInputAndDollarSymbol = exports.formatToAddBitDepthPoints = exports.formatDollarSign = exports.formatOnlyNumbers = void 0;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.1.97",
3
+ "version": "0.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [