intelicoreact 1.0.10 → 1.0.12

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.
@@ -325,7 +325,7 @@ var Input = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
325
325
  }));
326
326
  }, [formatedValue, type]);
327
327
  return /*#__PURE__*/_react.default.createElement("div", {
328
- className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap_disabled", disabled)),
328
+ className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap--disabled", disabled)),
329
329
  onMouseEnter: function onMouseEnter() {
330
330
  return setOnInputHover(true);
331
331
  },
@@ -24,7 +24,7 @@
24
24
  filter: drop-shadow(0px 0px 4px rgba(93, 120, 255, 0.5));
25
25
  }
26
26
 
27
- &_disabled {
27
+ &--disabled {
28
28
  background: #f7f8fa;
29
29
  opacity: 0.5;
30
30
  border-color: #a6acb1;
@@ -98,8 +98,8 @@ function InputMask2() {
98
98
  _ref$returnMaskedValu = _ref.returnMaskedValue,
99
99
  returnMaskedValue = _ref$returnMaskedValu === void 0 ? false : _ref$returnMaskedValu,
100
100
  name = _ref.name,
101
- testId = _ref.testId,
102
- disabled = _ref.disabled;
101
+ disabled = _ref.disabled,
102
+ testId = _ref.testId;
103
103
 
104
104
  var errors = _objectSpread(_objectSpread({}, _config.DEFAULT_ERRORS), customErrors);
105
105
 
@@ -416,7 +416,7 @@ function InputMask2() {
416
416
  };
417
417
 
418
418
  var onKeyDown = function onKeyDown(e) {
419
- var _getCharByIndex2, _getCharByIndex3, _getCharByIndex5;
419
+ var _getCharByIndex2, _getCharByIndex4;
420
420
 
421
421
  onKeyDownProp === null || onKeyDownProp === void 0 ? void 0 : onKeyDownProp(e);
422
422
  var keyCode = e.keyCode;
@@ -427,19 +427,14 @@ function InputMask2() {
427
427
  return;
428
428
  }
429
429
 
430
- if (keyCode === 39 && (_getCharByIndex2 = getCharByIndex(cursor)) !== null && _getCharByIndex2 !== void 0 && _getCharByIndex2.isSpecialSymbol) {
431
- setCursor(cursor);
432
- return;
433
- }
434
-
435
- if (keyCode !== 8 && keyCode !== 37 && (_getCharByIndex3 = getCharByIndex(cursor)) !== null && _getCharByIndex3 !== void 0 && _getCharByIndex3.isSpecialSymbol) {
430
+ if (keyCode !== 8 && keyCode !== 37 && (_getCharByIndex2 = getCharByIndex(cursor)) !== null && _getCharByIndex2 !== void 0 && _getCharByIndex2.isSpecialSymbol) {
436
431
  if (keyCode === 46) {
437
432
  e.preventDefault();
438
433
  e.stopPropagation();
439
434
  }
440
435
 
441
- while ((_getCharByIndex4 = getCharByIndex(cursor)) !== null && _getCharByIndex4 !== void 0 && _getCharByIndex4.isSpecialSymbol && cursor <= maxEditableIndex) {
442
- var _getCharByIndex4;
436
+ while ((_getCharByIndex3 = getCharByIndex(cursor)) !== null && _getCharByIndex3 !== void 0 && _getCharByIndex3.isSpecialSymbol && cursor <= maxEditableIndex) {
437
+ var _getCharByIndex3;
443
438
 
444
439
  ++cursor;
445
440
  }
@@ -448,12 +443,12 @@ function InputMask2() {
448
443
  return;
449
444
  }
450
445
 
451
- if (keyCode === 8 && (_getCharByIndex5 = getCharByIndex(cursor - 1)) !== null && _getCharByIndex5 !== void 0 && _getCharByIndex5.isSpecialSymbol) {
446
+ if (keyCode === 8 && (_getCharByIndex4 = getCharByIndex(cursor - 1)) !== null && _getCharByIndex4 !== void 0 && _getCharByIndex4.isSpecialSymbol) {
452
447
  e.preventDefault();
453
448
  e.stopPropagation();
454
449
 
455
- while ((_getCharByIndex6 = getCharByIndex(cursor - 1)) !== null && _getCharByIndex6 !== void 0 && _getCharByIndex6.isSpecialSymbol && cursor > 0) {
456
- var _getCharByIndex6;
450
+ while ((_getCharByIndex5 = getCharByIndex(cursor - 1)) !== null && _getCharByIndex5 !== void 0 && _getCharByIndex5.isSpecialSymbol && cursor > 0) {
451
+ var _getCharByIndex5;
457
452
 
458
453
  --cursor;
459
454
  }
@@ -486,8 +481,6 @@ function InputMask2() {
486
481
  };
487
482
 
488
483
  var _onFocus = function onFocus(e) {
489
- var cursor = e.target.selectionStart;
490
- setCursorPos(cursor);
491
484
  setFocused(true);
492
485
  onFocusProp();
493
486
  };
@@ -500,10 +493,6 @@ function InputMask2() {
500
493
  var onClick = function onClick(e) {
501
494
  var cursor = e.target.selectionStart;
502
495
  if (cursor >= maxEditableIndex) setCursor(maxEditableIndex);
503
- };
504
-
505
- var handleChange = function handleChange(e) {
506
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
507
496
  }; // GENERAL EVENT HANDLERS | END //
508
497
  /// --- OBSERVERS ---///
509
498
  // Render Mask
@@ -529,7 +518,7 @@ function InputMask2() {
529
518
  setMaskRendered(true);
530
519
  }, [maskPattern]);
531
520
  (0, _react.useEffect)(function () {
532
- if (!(!isMaskRendered || isInitValue || value === getInputValue() && value !== '' && isInitValue)) {
521
+ if (isMaskRendered && !isInitValue || value === '' && value !== getInputValue()) {
533
522
  setValue(value);
534
523
  setIsInitValue(true);
535
524
  }
@@ -632,7 +621,7 @@ function InputMask2() {
632
621
  className: "input-mask_input ".concat(className),
633
622
  ref: inputRef,
634
623
  value: inputValue,
635
- onChange: handleChange,
624
+ onChange: onChange,
636
625
  onKeyDown: onKeyDown,
637
626
  onKeyUp: onKeyUp,
638
627
  onBlur: onBlur,
@@ -317,7 +317,7 @@ var NumericInput = function NumericInput(_ref) {
317
317
 
318
318
  return /*#__PURE__*/_react.default.createElement("div", {
319
319
  ref: wrapRef,
320
- className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap_disabled", disabled))
320
+ className: (0, _classnames.default)("input__wrap", (0, _defineProperty2.default)({}, "input__wrap_focus", isFocused), (0, _defineProperty2.default)({}, "input__wrap_error", error || isToHighlightError), (0, _defineProperty2.default)({}, "input__wrap--disabled", disabled))
321
321
  }, renderInput(), icon, withDelete && /*#__PURE__*/_react.default.createElement("span", {
322
322
  className: (0, _classnames.default)("input__close", {
323
323
  hidden: !inputValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [