intelicoreact 0.1.77 → 0.1.80

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.
@@ -67,8 +67,6 @@ function InputMask() {
67
67
  isIconLeft = _ref.isIconLeft,
68
68
  isIconRight = _ref.isIconRight,
69
69
  value = _ref.value,
70
- _ref$onChange = _ref.onChange,
71
- onChangeProp = _ref$onChange === void 0 ? function () {} : _ref$onChange,
72
70
  _ref$blinkErrors = _ref.blinkErrors,
73
71
  blinkErrors = _ref$blinkErrors === void 0 ? true : _ref$blinkErrors,
74
72
  _ref$blinkDuration = _ref.blinkDuration,
@@ -82,6 +80,8 @@ function InputMask() {
82
80
  _ref$error = _ref.error,
83
81
  customError = _ref$error === void 0 ? '' : _ref$error,
84
82
  ref = _ref.ref,
83
+ _ref$onChange = _ref.onChange,
84
+ onChangeProp = _ref$onChange === void 0 ? function () {} : _ref$onChange,
85
85
  _ref$onFocus = _ref.onFocus,
86
86
  onFocusProp = _ref$onFocus === void 0 ? function () {} : _ref$onFocus,
87
87
  _ref$onBlur = _ref.onBlur,
@@ -106,6 +106,8 @@ function InputMask() {
106
106
  hintPosition = _ref$hintPosition === void 0 ? 'right' : _ref$hintPosition,
107
107
  _ref$hideMaskOnBlur = _ref.hideMaskOnBlur,
108
108
  hideMaskOnBlur = _ref$hideMaskOnBlur === void 0 ? true : _ref$hideMaskOnBlur,
109
+ _ref$returnMaskedValu = _ref.returnMaskedValue,
110
+ returnMaskedValue = _ref$returnMaskedValu === void 0 ? false : _ref$returnMaskedValu,
109
111
  name = _ref.name;
110
112
 
111
113
  var errors = _objectSpread(_objectSpread({}, _config.DEFAULT_ERRORS), customErrors);
@@ -758,6 +760,8 @@ function InputMask() {
758
760
 
759
761
  var _onKeyDown = /*#__PURE__*/function () {
760
762
  var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(e) {
763
+ var _innerValue$0$ref;
764
+
761
765
  var i,
762
766
  key,
763
767
  ctrlKey,
@@ -779,55 +783,56 @@ function InputMask() {
779
783
 
780
784
  case 3:
781
785
  key = e.key, ctrlKey = e.ctrlKey, altKey = e.altKey;
786
+ e.target = ((_innerValue$0$ref = innerValue[0].ref) === null || _innerValue$0$ref === void 0 ? void 0 : _innerValue$0$ref.current) || e.target;
782
787
  onKeyDownProp(e, i);
783
788
 
784
789
  if (!(_indexConstants.KEYBOARD_SERVICE_KEYS.includes(key) && _config.EXCLUDED_KEYS.includes(key))) {
785
- _context2.next = 7;
790
+ _context2.next = 8;
786
791
  break;
787
792
  }
788
793
 
789
794
  return _context2.abrupt("return", true);
790
795
 
791
- case 7:
796
+ case 8:
792
797
  setError(false);
793
798
  clearErrorMessage();
794
799
 
795
800
  if (!(ctrlKey || altKey)) {
796
- _context2.next = 12;
801
+ _context2.next = 13;
797
802
  break;
798
803
  }
799
804
 
800
805
  if (!_indexConstants.KEYBOARD_SERVICE_KEYS.includes(key)) handleKeyCombinations(e, i);
801
806
  return _context2.abrupt("return", true);
802
807
 
803
- case 12:
808
+ case 13:
804
809
  e.preventDefault();
805
810
  e.stopPropagation();
806
811
 
807
812
  if (!_indexConstants.KEYBOARD_SERVICE_KEYS.includes(key)) {
808
- _context2.next = 18;
813
+ _context2.next = 19;
809
814
  break;
810
815
  }
811
816
 
812
817
  _context2.t0 = handleServiceKeyDown(e, i);
813
- _context2.next = 21;
818
+ _context2.next = 22;
814
819
  break;
815
820
 
816
- case 18:
817
- _context2.next = 20;
821
+ case 19:
822
+ _context2.next = 21;
818
823
  return handleKeyDown(e, i);
819
824
 
820
- case 20:
825
+ case 21:
821
826
  _context2.t0 = _context2.sent;
822
827
 
823
- case 21:
828
+ case 22:
824
829
  handleResult = _context2.t0;
825
830
 
826
831
  if (blinkErrors && !handleResult && i !== null) {
827
832
  setBlinkError(true);
828
833
  }
829
834
 
830
- case 23:
835
+ case 24:
831
836
  case "end":
832
837
  return _context2.stop();
833
838
  }
@@ -1172,9 +1177,11 @@ function InputMask() {
1172
1177
  if (!isMaskRendered) return false;
1173
1178
  setError(false);
1174
1179
  clearErrorMessage();
1175
- onChangeProp(getClearInnerValueAsString(), getInnerValueAsString({
1180
+ var values = [getClearInnerValueAsString(), getInnerValueAsString({
1176
1181
  replaceSpace: true
1177
- }));
1182
+ })];
1183
+ if (returnMaskedValue) values.reverse();
1184
+ onChangeProp.apply(void 0, values);
1178
1185
  }, [innerValue, isMaskRendered]); // Blink Error
1179
1186
 
1180
1187
  (0, _react.useEffect)(function () {
@@ -39,6 +39,7 @@ var Modal = function Modal(_ref) {
39
39
  className = _ref.className,
40
40
  title = _ref.title,
41
41
  variant = _ref.variant,
42
+ onlyTitle = _ref.onlyTitle,
42
43
  mode = _ref.mode,
43
44
  size = _ref.size,
44
45
  confirmBtnClassName = _ref.confirmBtnClassName,
@@ -46,6 +47,8 @@ var Modal = function Modal(_ref) {
46
47
  _ref$confirmBtnVarian = _ref.confirmBtnVariant,
47
48
  confirmBtnVariant = _ref$confirmBtnVarian === void 0 ? 'primary' : _ref$confirmBtnVarian,
48
49
  confirmBtnDisable = _ref.confirmBtnDisable,
50
+ confirmBtnIcon = _ref.confirmBtnIcon,
51
+ isConfirmBtnIconPositionRight = _ref.isConfirmBtnIconPositionRight,
49
52
  noConfirmBtn = _ref.noConfirmBtn,
50
53
  noCloseBtn = _ref.noCloseBtn,
51
54
  noFooter = _ref.noFooter,
@@ -54,13 +57,14 @@ var Modal = function Modal(_ref) {
54
57
  closeBtnText = _ref.closeBtnText,
55
58
  closeBtnVariant = _ref.closeBtnVariant,
56
59
  closeBtnDisable = _ref.closeBtnDisable,
57
- scheme = _ref.scheme,
58
- noCloseOnConfirm = _ref.noCloseOnConfirm,
59
- btnClassNames = _ref.btnClassNames;
60
+ closeBtnIcon = _ref.closeBtnIcon,
61
+ forced = _ref.forced,
62
+ btnClassNames = _ref.btnClassNames,
63
+ isCloseBtnIconPositionRight = _ref.isCloseBtnIconPositionRight;
60
64
  if (!isOpen) return null;
61
65
 
62
66
  var renderModalTitle = function renderModalTitle() {
63
- if (mode && mode !== 'default') return "".concat((mode === null || mode === void 0 ? void 0 : mode[0].toUpperCase()) + (mode === null || mode === void 0 ? void 0 : mode.slice(1)), " ").concat(title);
67
+ if (mode && mode !== 'default' && !onlyTitle) return "".concat(mode[0].toUpperCase() + mode.slice(1), " ").concat(title);
64
68
  return title;
65
69
  };
66
70
 
@@ -92,7 +96,7 @@ var Modal = function Modal(_ref) {
92
96
  className: (0, _classnames.default)('modal__header', (0, _defineProperty2.default)({}, "modal__header-".concat(variant), variant))
93
97
  }, /*#__PURE__*/_react.default.createElement("span", {
94
98
  className: (0, _classnames.default)('modal__header-title', (0, _defineProperty2.default)({}, "modal__header-".concat(variant, "-title"), variant))
95
- }, /*#__PURE__*/_react.default.createElement("span", null, renderModalTitle())), /*#__PURE__*/_react.default.createElement("div", {
99
+ }, /*#__PURE__*/_react.default.createElement("span", null, renderModalTitle())), !forced && /*#__PURE__*/_react.default.createElement("div", {
96
100
  onClick: closeModal,
97
101
  className: (0, _classnames.default)('modal-close-icon-box', {
98
102
  'modal-close-icon-box-primary': variant === 'primary'
@@ -110,7 +114,9 @@ var Modal = function Modal(_ref) {
110
114
  variant: closeBtnVariant || 'dark-outline',
111
115
  onClick: closeModal,
112
116
  label: closeBtnText || 'Cancel',
113
- disabled: closeBtnDisable
117
+ disabled: closeBtnDisable,
118
+ icon: closeBtnIcon,
119
+ isIconRight: isCloseBtnIconPositionRight
114
120
  }), !noConfirmBtn && /*#__PURE__*/_react.default.createElement(_Button.default, {
115
121
  onClick: function onClick() {
116
122
  return handle.confirm();
@@ -118,7 +124,9 @@ var Modal = function Modal(_ref) {
118
124
  label: confirmBtnLabel || (mode === null || mode === void 0 ? void 0 : mode[0].toUpperCase()) + (mode === null || mode === void 0 ? void 0 : mode.slice(1)) || 'Apply',
119
125
  className: (0, _classnames.default)('ml5', confirmBtnClassName, btnClassNames),
120
126
  variant: confirmBtnVariant,
121
- disabled: confirmBtnDisable
127
+ disabled: confirmBtnDisable,
128
+ icon: confirmBtnIcon,
129
+ isIconRight: isConfirmBtnIconPositionRight
122
130
  }))));
123
131
  };
124
132
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.1.77",
4
- "description": "Hide Placeholder if Field Value is Empty | Added possibility to switch to next field by Enter Key Press",
3
+ "version": "0.1.80",
4
+ "description": "hotfix/InputMaskOnChange | Add Possibility To Revert Clear Value and Masked Value in OnChange Callback",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist/*",