intelicoreact 0.2.56 → 0.2.59

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.
@@ -45,6 +45,8 @@ var InputCalendar = function InputCalendar(_ref) {
45
45
  mask = _ref$mask === void 0 ? '99/99/9999' : _ref$mask,
46
46
  isListTop = _ref.isListTop,
47
47
  disabled = _ref.disabled,
48
+ _ref$disabledFormatte = _ref.disabledFormattedMaxDate,
49
+ disabledFormattedMaxDate = _ref$disabledFormatte === void 0 ? false : _ref$disabledFormatte,
48
50
  _ref$onKeyDown = _ref.onKeyDown,
49
51
  onKeyDownProp = _ref$onKeyDown === void 0 ? function (e) {} : _ref$onKeyDown,
50
52
  _ref$onKeyUp = _ref.onKeyUp,
@@ -96,7 +98,8 @@ var InputCalendar = function InputCalendar(_ref) {
96
98
  var _inputRef$current;
97
99
 
98
100
  var value = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
99
- if ((0, _momentTimezone.default)(value, format).format(format) === 'Invalid date') onChange(formattedMaxDate !== null && formattedMaxDate !== void 0 ? formattedMaxDate : '');else if ((0, _momentTimezone.default)(value, format).startOf('day').isBefore(momentMinDate, 'days')) onChange(formattedMinDate);else if ((0, _momentTimezone.default)(value, format).endOf('day').isAfter(momentMaxDate, 'days')) onChange(formattedMaxDate);else onChange((0, _momentTimezone.default)(value, format).format(format));
101
+ var isSettedMaxDate = !disabledFormattedMaxDate && value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).format(format) === 'Invalid date';
102
+ if (isSettedMaxDate) onChange(formattedMaxDate !== null && formattedMaxDate !== void 0 ? formattedMaxDate : '');else if (value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).startOf('day').isBefore(momentMinDate, 'days')) onChange(formattedMinDate);else if (value && typeof isOpened === 'boolean' && (0, _momentTimezone.default)(value, format).endOf('day').isAfter(momentMaxDate, 'days')) onChange(formattedMaxDate);else if (value) onChange((0, _momentTimezone.default)(value, format).format(format));
100
103
  };
101
104
 
102
105
  var onKeyDown = function onKeyDown(e) {
@@ -30,6 +30,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
30
30
  var RC = 'user-contacts';
31
31
 
32
32
  var UserContacts = function UserContacts(props) {
33
+ var _mainRef$current;
34
+
33
35
  var _ref = props || {},
34
36
  email = _ref.email,
35
37
  phone = _ref.phone,
@@ -92,14 +94,14 @@ var UserContacts = function UserContacts(props) {
92
94
  }
93
95
  };
94
96
 
95
- (0, _react.useLayoutEffect)(function () {
97
+ (0, _react.useLayoutEffect)(checkWidth, [isRunTask]);
98
+ (0, _react.useEffect)(function () {
96
99
  setIsRunTask({});
97
100
  return function () {
98
101
  setIsUseEmailIcon(false);
99
102
  setIsUsePhoneIcon(false);
100
103
  };
101
- }, [email, phone, isSalesContact, isSalesContact, isDisputeContact, isAccountingContact, +maxWidth]);
102
- (0, _react.useLayoutEffect)(checkWidth, [isRunTask]);
104
+ }, [email, phone, isSalesContact, isSalesContact, isDisputeContact, isAccountingContact, +maxWidth, mainRef === null || mainRef === void 0 ? void 0 : (_mainRef$current = mainRef.current) === null || _mainRef$current === void 0 ? void 0 : _mainRef$current.clientWidth]);
103
105
  return /*#__PURE__*/_react.default.createElement("div", {
104
106
  ref: mainRef,
105
107
  className: (0, _classnames.default)('j4', RC, className)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "0.2.56",
3
+ "version": "0.2.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [