intelicoreact 0.2.59 → 0.2.63
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.
|
@@ -11,10 +11,10 @@ exports.default = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
|
|
14
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
|
|
16
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
15
|
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
17
|
+
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -76,7 +76,27 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
76
76
|
setIsFocusedByClick = _useState6[1];
|
|
77
77
|
|
|
78
78
|
if (!options) return null;
|
|
79
|
-
|
|
79
|
+
|
|
80
|
+
var moveOtherToEnd = function moveOtherToEnd(options) {
|
|
81
|
+
var otherIndex = options === null || options === void 0 ? void 0 : options.findIndex(function (option) {
|
|
82
|
+
return (option === null || option === void 0 ? void 0 : option.value) === 'other';
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
if (otherIndex > -1) {
|
|
86
|
+
var other = options === null || options === void 0 ? void 0 : options.splice(otherIndex, 1);
|
|
87
|
+
options.push.apply(options, (0, _toConsumableArray2.default)(other));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return options;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
var optionsWithOtherAtTheEnd = moveOtherToEnd(options);
|
|
94
|
+
options.map(function (option) {
|
|
95
|
+
if (option.items) {
|
|
96
|
+
return option.items = moveOtherToEnd(option.items);
|
|
97
|
+
} else return option;
|
|
98
|
+
});
|
|
99
|
+
var filteredGroups = optionsWithOtherAtTheEnd.filter(function (item) {
|
|
80
100
|
var _item$items;
|
|
81
101
|
|
|
82
102
|
return (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length;
|
|
@@ -93,7 +113,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
93
113
|
|
|
94
114
|
return ((_item$items2 = item.items) === null || _item$items2 === void 0 ? void 0 : _item$items2.length) > 0;
|
|
95
115
|
});
|
|
96
|
-
var filteredItems =
|
|
116
|
+
var filteredItems = optionsWithOtherAtTheEnd.filter(function (item) {
|
|
97
117
|
var _item$items3;
|
|
98
118
|
|
|
99
119
|
return !((_item$items3 = item.items) !== null && _item$items3 !== void 0 && _item$items3.length);
|
|
@@ -98,8 +98,8 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
98
98
|
var _inputRef$current;
|
|
99
99
|
|
|
100
100
|
var value = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value;
|
|
101
|
-
|
|
102
|
-
if (
|
|
101
|
+
if ((0, _momentTimezone.default)(value, format).format(format) === 'Invalid date' || value.indexOf('_') > -1) value = '';
|
|
102
|
+
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));
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
var onKeyDown = function onKeyDown(e) {
|
|
@@ -119,7 +119,13 @@ var InputCalendar = function InputCalendar(_ref) {
|
|
|
119
119
|
setOpenedByEnter(true);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
if (isValidLenght)
|
|
122
|
+
if (isValidLenght) {
|
|
123
|
+
setIsOpened(false);
|
|
124
|
+
handleBlur();
|
|
125
|
+
} else {
|
|
126
|
+
setIsOpened(true);
|
|
127
|
+
}
|
|
128
|
+
|
|
123
129
|
onKeyUpProp(e);
|
|
124
130
|
};
|
|
125
131
|
|
|
@@ -32,7 +32,9 @@ var KEY_CODE = Object.freeze({
|
|
|
32
32
|
exports.KEY_CODE = KEY_CODE;
|
|
33
33
|
|
|
34
34
|
var Modal = function Modal(_ref) {
|
|
35
|
-
var
|
|
35
|
+
var _ref$index = _ref.index,
|
|
36
|
+
index = _ref$index === void 0 ? 1 : _ref$index,
|
|
37
|
+
isOpen = _ref.isOpen,
|
|
36
38
|
onConfirm = _ref.onConfirm,
|
|
37
39
|
closeModal = _ref.closeModal,
|
|
38
40
|
children = _ref.children,
|
|
@@ -87,6 +89,9 @@ var Modal = function Modal(_ref) {
|
|
|
87
89
|
};
|
|
88
90
|
}, [submitOnEnter]);
|
|
89
91
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
style: {
|
|
93
|
+
zIndex: index
|
|
94
|
+
},
|
|
90
95
|
"data-testid": 'test-modal',
|
|
91
96
|
className: "modal-box j5"
|
|
92
97
|
}, /*#__PURE__*/_react.default.createElement("div", {
|