intelicoreact 1.3.26 → 1.3.27
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.
|
@@ -119,7 +119,7 @@ const TagsDropdown = _ref => {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
const getMarkupForElement = item => {
|
|
122
|
-
var _title$toString;
|
|
122
|
+
var _title$toString, _item$customMobileIco;
|
|
123
123
|
const {
|
|
124
124
|
description
|
|
125
125
|
} = item;
|
|
@@ -160,12 +160,12 @@ const TagsDropdown = _ref => {
|
|
|
160
160
|
className: (0, _classnames.default)("".concat(RC, "__list-item-title"))
|
|
161
161
|
}, hightlightSearchValue(title)), description && /*#__PURE__*/_react.default.createElement("span", {
|
|
162
162
|
className: (0, _classnames.default)("".concat(RC, "__list-item-description"))
|
|
163
|
-
}, description)), isMobile && /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
163
|
+
}, description)), isMobile ? (_item$customMobileIco = item === null || item === void 0 ? void 0 : item.customMobileIcon) !== null && _item$customMobileIco !== void 0 ? _item$customMobileIco : /*#__PURE__*/_react.default.createElement(_CheckboxInput.default, {
|
|
164
164
|
value: chosenOptions === null || chosenOptions === void 0 ? void 0 : chosenOptions.some(value => value === item.value),
|
|
165
165
|
onChange: v => {
|
|
166
166
|
onChangeHandler(item);
|
|
167
167
|
}
|
|
168
|
-
}));
|
|
168
|
+
}) : "");
|
|
169
169
|
};
|
|
170
170
|
const prepareOptions = options => {
|
|
171
171
|
return options === null || options === void 0 ? void 0 : options.map(option => option !== null && option !== void 0 && option.groupName ? option === null || option === void 0 ? void 0 : option.list : option).flat();
|
|
@@ -199,8 +199,8 @@ const TagsDropdown = _ref => {
|
|
|
199
199
|
if (isMobile ? closeOnRemoveAllMobile : closeOnRemoveAll) setIsOpen(false);
|
|
200
200
|
};
|
|
201
201
|
const getParentNode = () => {
|
|
202
|
-
var _document$querySelect;
|
|
203
|
-
return (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app");
|
|
202
|
+
var _ref6, _document$querySelect;
|
|
203
|
+
return (_ref6 = (_document$querySelect = document.querySelector("div#root")) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector("div#app")) !== null && _ref6 !== void 0 ? _ref6 : document.querySelector("div#storybook-root");
|
|
204
204
|
};
|
|
205
205
|
const initListContainer = () => {
|
|
206
206
|
const dropdownList = document.createElement("div");
|
|
@@ -212,6 +212,7 @@ const TagsDropdown = _ref => {
|
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
if (isMobile) {
|
|
215
|
+
var _getParentNode;
|
|
215
216
|
try {
|
|
216
217
|
var _document$getElementB;
|
|
217
218
|
(_document$getElementB = document.getElementById("mlw-".concat(dropdownId))) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
|
@@ -219,10 +220,11 @@ const TagsDropdown = _ref => {
|
|
|
219
220
|
const dropdownMobileListWrapper = document.createElement("div");
|
|
220
221
|
dropdownMobileListWrapper.classList.add("tags-dropdown-mobile");
|
|
221
222
|
dropdownMobileListWrapper.setAttribute("id", "mlw-".concat(dropdownId));
|
|
222
|
-
dropdownMobileListWrapper.append(dropdownList);
|
|
223
|
-
getParentNode().append(dropdownMobileListWrapper);
|
|
223
|
+
dropdownMobileListWrapper === null || dropdownMobileListWrapper === void 0 || dropdownMobileListWrapper.append(dropdownList);
|
|
224
|
+
(_getParentNode = getParentNode()) === null || _getParentNode === void 0 || _getParentNode.append(dropdownMobileListWrapper);
|
|
224
225
|
} else {
|
|
225
|
-
|
|
226
|
+
var _getParentNode2;
|
|
227
|
+
(_getParentNode2 = getParentNode()) === null || _getParentNode2 === void 0 || _getParentNode2.append(dropdownList);
|
|
226
228
|
}
|
|
227
229
|
};
|
|
228
230
|
const getListContainer = () => {
|
|
@@ -363,17 +365,17 @@ const TagsDropdown = _ref => {
|
|
|
363
365
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
364
366
|
className: "".concat(RC, "-group__name")
|
|
365
367
|
}, option.groupName), (_option$list2 = option.list) === null || _option$list2 === void 0 ? void 0 : _option$list2.map(item => getMarkupForElement(item))) : getMarkupForElement(option);
|
|
366
|
-
}), ((_filteredOptions$filt = filteredOptions.filter(
|
|
368
|
+
}), ((_filteredOptions$filt = filteredOptions.filter(_ref7 => {
|
|
367
369
|
let {
|
|
368
370
|
value
|
|
369
|
-
} =
|
|
371
|
+
} = _ref7;
|
|
370
372
|
return value !== "open_modal";
|
|
371
373
|
})) === null || _filteredOptions$filt === void 0 ? void 0 : _filteredOptions$filt.length) === 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
372
374
|
className: "".concat(RC, "__no-options")
|
|
373
|
-
}, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(
|
|
375
|
+
}, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(_ref8 => {
|
|
374
376
|
let {
|
|
375
377
|
value
|
|
376
|
-
} =
|
|
378
|
+
} = _ref8;
|
|
377
379
|
return value !== "open_modal";
|
|
378
380
|
})) === null || _filteredOptions$filt2 === void 0 ? void 0 : _filteredOptions$filt2.length) > 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
379
381
|
className: (0, _classnames.default)("".concat(RC, "__footer"), {
|
|
@@ -478,10 +480,10 @@ const TagsDropdown = _ref => {
|
|
|
478
480
|
className: (0, _classnames.default)("".concat(RC, "__trigger"), {
|
|
479
481
|
"tags-dropdown__error": error
|
|
480
482
|
}),
|
|
481
|
-
onClick:
|
|
483
|
+
onClick: _ref9 => {
|
|
482
484
|
let {
|
|
483
485
|
target
|
|
484
|
-
} =
|
|
486
|
+
} = _ref9;
|
|
485
487
|
if ((target === null || target === void 0 ? void 0 : target.tagName) === "INPUT") setIsOpen(true);else if (isTargetInParent(target)) {
|
|
486
488
|
setIsOpen(isOpen => !isOpen);
|
|
487
489
|
}
|