intelicoreact 0.1.92 → 0.1.93

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.
@@ -72,7 +72,9 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
72
72
  _ref$isNotValidateASC = _ref.isNotValidateASCII,
73
73
  isNotValidateASCII = _ref$isNotValidateASC === void 0 ? false : _ref$isNotValidateASC,
74
74
  _ref$isNumericMobileK = _ref.isNumericMobileKeyboard,
75
- isNumericMobileKeyboard = _ref$isNumericMobileK === void 0 ? false : _ref$isNumericMobileK;
75
+ isNumericMobileKeyboard = _ref$isNumericMobileK === void 0 ? false : _ref$isNumericMobileK,
76
+ _ref$isCropFirstNool = _ref.isCropFirstNool,
77
+ isCropFirstNool = _ref$isCropFirstNool === void 0 ? false : _ref$isCropFirstNool;
76
78
  var DEFAULT_BLINK_TIME = 100; // STATES
77
79
 
78
80
  var _useState = (0, _react.useState)(false),
@@ -120,6 +122,7 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
120
122
 
121
123
  if (!isNotValidateASCII) inputValue = (0, _fieldValueFormatters.formatToOnlyASCIICodeText)(inputValue);
122
124
  if (symbolsLimit && inputValue.length > +symbolsLimit) inputValue = inputValue.substring(0, +symbolsLimit);
125
+ if (isPriceInput && isCropFirstNool) inputValue = inputValue[0] == 0 ? '' : (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
123
126
  if (onlyNumbers && isOnlyString || isOnlyString) inputValue = (0, _fieldValueFormatters.formatToLetters)(inputValue, softStringMode);else if (onlyNumbers) inputValue = (0, _fieldValueFormatters.filterNumeric)(inputValue, onlyNumbers);
124
127
  onChange(inputValue.toString());
125
128
  },
@@ -129,6 +129,7 @@ var NumericInput = function NumericInput(_ref) {
129
129
  var inputValue = e.target ? (0, _fieldValueFormatters.filterNumeric)(e.target.value, {
130
130
  type: 'int'
131
131
  }) : e;
132
+ if (inputValue == '0') inputValue = min || '';
132
133
 
133
134
  if (inputValue && (decRef.current.contains(e.target) || incRef.current.contains(e.target))) {
134
135
  inputValue = parseFloat(inputValue);
@@ -138,10 +139,8 @@ var NumericInput = function NumericInput(_ref) {
138
139
  } else if (max && +max < inputValue) inputValue = max;
139
140
  }
140
141
 
141
- if (symbolsLimit) {
142
- inputValue = inputValue.toString().substring(0, +symbolsLimit);
143
- }
144
-
142
+ if (symbolsLimit) inputValue = inputValue.toString().substring(0, +symbolsLimit);
143
+ if (isPriceInput) inputValue = (0, _fieldValueFormatters.formatToAddBitDepthPoints)(inputValue);
145
144
  setInputValue(inputValue.toString());
146
145
  },
147
146
  clear: function clear() {
@@ -70,7 +70,7 @@ var RangeInputs = function RangeInputs(_ref) {
70
70
  var isValidRange = !!(valueObj !== null && valueObj !== void 0 && valueObj.from && valueObj !== null && valueObj !== void 0 && valueObj.to && +(valueObj === null || valueObj === void 0 ? void 0 : valueObj.from) <= +(valueObj === null || valueObj === void 0 ? void 0 : valueObj.to));
71
71
 
72
72
  var valueFormatter = function valueFormatter(value) {
73
- if (type === 'float') return (0, _fieldValueFormatters.filterFloat)(value);else if (isPrice) return (0, _utils.addBitDepthPoints)(value);else return (0, _fieldValueFormatters.formatOnlyNumbers)(value);
73
+ if (type === 'float') return (0, _fieldValueFormatters.filterFloat)(value);else if (isPrice) return (0, _utils.addBitDepthPoints)(value.replace(/[^\d]/g, ''));else return (0, _fieldValueFormatters.formatOnlyNumbers)(value);
74
74
  };
75
75
 
76
76
  var handleChange = function handleChange(prop, val) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.1.92",
4
- "description": "dollar format ",
3
+ "version": "0.1.93",
4
+ "description": "Input crop first 0 and comma in rengeInputs",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist/*",