intelicoreact 1.4.15 → 1.4.17
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.
|
@@ -13,7 +13,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
const TagListToDropdown = _ref => {
|
|
15
15
|
let {
|
|
16
|
-
options: optionsProp
|
|
16
|
+
options: optionsProp,
|
|
17
17
|
value = [],
|
|
18
18
|
dropdownProps = {},
|
|
19
19
|
listProps = {},
|
|
@@ -58,7 +58,7 @@ const TagListToDropdown = _ref => {
|
|
|
58
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
59
59
|
}, [isEditMode]);
|
|
60
60
|
(0, _react.useEffect)(() => {
|
|
61
|
-
setOptions(optionsProp);
|
|
61
|
+
if (optionsProp) setOptions(optionsProp);
|
|
62
62
|
}, [optionsProp]);
|
|
63
63
|
const renderTagsDropdown = props => {
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement(_TagsDropdown.default, (0, _extends2.default)({}, dropdownProps, {
|
|
@@ -117,7 +117,6 @@ const TagListToDropdown = _ref => {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
};
|
|
120
|
-
if (!value.length) return null;
|
|
121
120
|
return useDropdownCompactMode ? renderCompactMode() : isEditMode ? renderTagsDropdown({
|
|
122
121
|
withActions: true
|
|
123
122
|
}) : renderTagsList();
|
|
@@ -625,7 +625,7 @@ const TagsDropdown = _ref => {
|
|
|
625
625
|
return label.toLowerCase() !== searchValue.toLowerCase();
|
|
626
626
|
}) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
627
627
|
className: (0, _classnames.default)("".concat(RC, "__creatable-helper"))
|
|
628
|
-
}, "Select an option or create one") : null, withCreateLogic
|
|
628
|
+
}, "Select an option or create one") : null, console.log(withCreateLogic, filteredOptions.length), /*#__PURE__*/_react.default.createElement("div", {
|
|
629
629
|
ref: dropdownListRef,
|
|
630
630
|
className: "".concat(RC, "__list ").concat(headerContent || isMobile ? "".concat(RC, "__list--with-header") : "", " ").concat(footerContent ? "".concat(RC, "__list--with-footer") : "")
|
|
631
631
|
}, filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(option => {
|
|
@@ -641,9 +641,9 @@ const TagsDropdown = _ref => {
|
|
|
641
641
|
value
|
|
642
642
|
} = _ref10;
|
|
643
643
|
return value !== "open_modal";
|
|
644
|
-
})) === null || _filteredOptions$filt === void 0 ? void 0 : _filteredOptions$filt.length) === 0 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
644
|
+
})) === null || _filteredOptions$filt === void 0 ? void 0 : _filteredOptions$filt.length) === 0 && (!withCreateLogic || !searchValue) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
645
645
|
className: "".concat(RC, "__no-options")
|
|
646
|
-
}, noOptionsText) : null)
|
|
646
|
+
}, noOptionsText) : null), (footerContent || isMobile) && ((_filteredOptions$filt2 = filteredOptions.filter(_ref11 => {
|
|
647
647
|
let {
|
|
648
648
|
value
|
|
649
649
|
} = _ref11;
|
|
@@ -83,7 +83,7 @@ class RESTAPI extends _ApiBase.default {
|
|
|
83
83
|
getBodyAs
|
|
84
84
|
} = item;
|
|
85
85
|
const finalIsGetBody = 'isGetBody' in item ? item.isGetBody : isGetBody;
|
|
86
|
-
const finalIsGetBodyFirst =
|
|
86
|
+
const finalIsGetBodyFirst = 'isGetBody' in item ? item.isGetBody === 'first' : isGetBodyFirst;
|
|
87
87
|
const checkResponseCallback = finalIsGetBodyFirst ? async (res, mesageOptions) => API_CONTEXT.getResponseBody(await API_CONTEXT.checkResponseCode(res, mesageOptions), getBodyAs) : async (res, mesageOptions) => API_CONTEXT.checkResponseCode(res, mesageOptions);
|
|
88
88
|
const callback = item.callback ? async res => item.callback(await checkResponseCallback(res, mesageOptions)) : async res => checkResponseCallback(res, mesageOptions);
|
|
89
89
|
return finalIsGetBody && !finalIsGetBodyFirst ? async res => API_CONTEXT.getResponseBody(await callback(res), getBodyAs) : callback;
|