intelicoreact 1.1.16 → 1.1.18
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.
|
@@ -79,24 +79,19 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
79
79
|
searchValue = _useState4[0],
|
|
80
80
|
setSearchValue = _useState4[1];
|
|
81
81
|
|
|
82
|
-
var _useState5 = (0, _react.useState)(false),
|
|
83
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
84
|
-
isSearching = _useState6[0],
|
|
85
|
-
setIsSearching = _useState6[1];
|
|
86
|
-
|
|
87
82
|
var dropdownRef = (0, _react.useRef)(null);
|
|
88
83
|
var dropdownListRef = (0, _react.useRef)(null);
|
|
89
84
|
var searchInputRef = (0, _react.useRef)(null);
|
|
90
85
|
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
initListHeight =
|
|
94
|
-
setInitListHeight =
|
|
86
|
+
var _useState5 = (0, _react.useState)(null),
|
|
87
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
88
|
+
initListHeight = _useState6[0],
|
|
89
|
+
setInitListHeight = _useState6[1];
|
|
95
90
|
|
|
96
|
-
var
|
|
97
|
-
|
|
98
|
-
isFocusedByClick =
|
|
99
|
-
setIsFocusedByClick =
|
|
91
|
+
var _useState7 = (0, _react.useState)(false),
|
|
92
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
93
|
+
isFocusedByClick = _useState8[0],
|
|
94
|
+
setIsFocusedByClick = _useState8[1];
|
|
100
95
|
|
|
101
96
|
if (!options) return null;
|
|
102
97
|
|
|
@@ -406,13 +401,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
406
401
|
};
|
|
407
402
|
|
|
408
403
|
(0, _react.useEffect)(function () {
|
|
409
|
-
if (isOpen
|
|
404
|
+
if (isOpen) {
|
|
410
405
|
setSearchValue(selectedLabel);
|
|
411
406
|
setTimeout(function () {
|
|
412
407
|
return searchInputRef.current.select();
|
|
413
408
|
}, 1);
|
|
414
409
|
}
|
|
415
|
-
}, [
|
|
410
|
+
}, [isOpen]);
|
|
416
411
|
var postfixText = selectedLabel && ((_filteredOptions$find = filteredOptions.find(function (option) {
|
|
417
412
|
return option.value === value;
|
|
418
413
|
})) === null || _filteredOptions$find === void 0 ? void 0 : _filteredOptions$find.postfix) || null;
|
|
@@ -427,7 +422,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
427
422
|
"data-testid": "dropdown--".concat(testId || '', "--container"),
|
|
428
423
|
className: "".concat(RC, "__trigger input__wrap ").concat(isOpen ? 'input__wrap--focus' : '', " ").concat(!value ? 'placeholder' : '', " ").concat(error ? 'error' : ''),
|
|
429
424
|
onClick: function onClick() {
|
|
430
|
-
return
|
|
425
|
+
return setIsOpen(!isOpen);
|
|
431
426
|
},
|
|
432
427
|
onMouseDown: function onMouseDown() {
|
|
433
428
|
return setIsFocusedByClick(true);
|
|
@@ -440,24 +435,11 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
440
435
|
}, isSearchable ? /*#__PURE__*/_react.default.createElement("input", {
|
|
441
436
|
ref: searchInputRef,
|
|
442
437
|
className: "".concat(RC, "__input"),
|
|
443
|
-
value:
|
|
438
|
+
value: isOpen ? searchValue !== null && searchValue !== void 0 ? searchValue : '' : selectedLabel || '',
|
|
444
439
|
onChange: function onChange(e) {
|
|
445
440
|
return onSearchHandler(e.target.value);
|
|
446
441
|
},
|
|
447
442
|
placeholder: placeholder,
|
|
448
|
-
onFocus: function onFocus(e) {
|
|
449
|
-
if (!isOpen) {
|
|
450
|
-
e.preventDefault();
|
|
451
|
-
e.stopPropagation();
|
|
452
|
-
e.target.blur();
|
|
453
|
-
return;
|
|
454
|
-
} else {
|
|
455
|
-
setIsSearching(true);
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
onBlur: function onBlur() {
|
|
459
|
-
return setIsSearching(false);
|
|
460
|
-
},
|
|
461
443
|
onClick: function onClick() {
|
|
462
444
|
if (!isOpen) setIsOpen(true);
|
|
463
445
|
}
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = exports.renderModalTitle = exports.KEY_CODE = void 0;
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -56,6 +58,8 @@ var Modal = function Modal(_ref2) {
|
|
|
56
58
|
onlyTitle = _ref2.onlyTitle,
|
|
57
59
|
mode = _ref2.mode,
|
|
58
60
|
size = _ref2.size,
|
|
61
|
+
_ref2$atributesForMod = _ref2.atributesForModalBody,
|
|
62
|
+
atributesForModalBody = _ref2$atributesForMod === void 0 ? {} : _ref2$atributesForMod,
|
|
59
63
|
confirmBtnClassName = _ref2.confirmBtnClassName,
|
|
60
64
|
confirmBtnLabel = _ref2.confirmBtnLabel,
|
|
61
65
|
_ref2$confirmBtnVaria = _ref2.confirmBtnVariant,
|
|
@@ -119,11 +123,11 @@ var Modal = function Modal(_ref2) {
|
|
|
119
123
|
mode: mode,
|
|
120
124
|
title: title,
|
|
121
125
|
onlyTitle: onlyTitle
|
|
122
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
126
|
+
}))), /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, atributesForModalBody, {
|
|
123
127
|
className: (0, _classnames.default)('modal__body', {
|
|
124
128
|
'modal__body--no-footer': noFooter
|
|
125
129
|
})
|
|
126
|
-
}, children), !noFooter && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
130
|
+
}), children), !noFooter && /*#__PURE__*/_react.default.createElement(_ModalFooter.default, {
|
|
127
131
|
className: leftContentOfFooter ? 'modal__footer_with-left-content' : ''
|
|
128
132
|
}, leftContentOfFooter, /*#__PURE__*/_react.default.createElement("div", {
|
|
129
133
|
className: "modal__buttons-block"
|