tenjin-ui-kit 0.3.27 → 0.3.28
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.
|
@@ -24,7 +24,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
24
24
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
25
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
26
|
var GroupedSelect = function GroupedSelect(_ref) {
|
|
27
|
-
var _options$find;
|
|
27
|
+
var _options$find, _Object$entries;
|
|
28
28
|
var options = _ref.options,
|
|
29
29
|
onChange = _ref.onChange,
|
|
30
30
|
propValue = _ref.value,
|
|
@@ -47,10 +47,11 @@ var GroupedSelect = function GroupedSelect(_ref) {
|
|
|
47
47
|
var groupOptionsByPageTitle = function groupOptionsByPageTitle(options) {
|
|
48
48
|
var grouped = {};
|
|
49
49
|
options.forEach(function (option) {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
var _grouped$option$pageT;
|
|
51
|
+
if (!grouped[option === null || option === void 0 ? void 0 : option.pageTitle]) {
|
|
52
|
+
grouped[option === null || option === void 0 ? void 0 : option.pageTitle] = [];
|
|
52
53
|
}
|
|
53
|
-
grouped[option.pageTitle].push(option);
|
|
54
|
+
(_grouped$option$pageT = grouped[option === null || option === void 0 ? void 0 : option.pageTitle]) === null || _grouped$option$pageT === void 0 ? void 0 : _grouped$option$pageT.push(option);
|
|
54
55
|
});
|
|
55
56
|
return grouped;
|
|
56
57
|
};
|
|
@@ -58,7 +59,8 @@ var GroupedSelect = function GroupedSelect(_ref) {
|
|
|
58
59
|
setSearchTerm(event.target.value);
|
|
59
60
|
};
|
|
60
61
|
var filteredOptions = options.filter(function (option) {
|
|
61
|
-
|
|
62
|
+
var _option$label, _option$pageTitle;
|
|
63
|
+
return (option === null || option === void 0 ? void 0 : (_option$label = option.label) === null || _option$label === void 0 ? void 0 : _option$label.includes(searchTerm)) || (option === null || option === void 0 ? void 0 : (_option$pageTitle = option.pageTitle) === null || _option$pageTitle === void 0 ? void 0 : _option$pageTitle.includes(searchTerm));
|
|
62
64
|
});
|
|
63
65
|
var groupedOptions = groupOptionsByPageTitle(filteredOptions);
|
|
64
66
|
var toggleDropdown = function toggleDropdown() {
|
|
@@ -103,8 +105,8 @@ var GroupedSelect = function GroupedSelect(_ref) {
|
|
|
103
105
|
style: {
|
|
104
106
|
flexGrow: 1
|
|
105
107
|
}
|
|
106
|
-
}, value ? (_options$find = options.find(function (opt) {
|
|
107
|
-
return opt.value === value;
|
|
108
|
+
}, value ? options === null || options === void 0 ? void 0 : (_options$find = options.find(function (opt) {
|
|
109
|
+
return (opt === null || opt === void 0 ? void 0 : opt.value) === value;
|
|
108
110
|
})) === null || _options$find === void 0 ? void 0 : _options$find.label : "Select Option"), /*#__PURE__*/React.createElement("div", null, isDropdownOpen ? /*#__PURE__*/React.createElement(_fa.FaCaretUp, null) : /*#__PURE__*/React.createElement(_fa.FaCaretDown, null)))), isDropdownOpen && /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/React.createElement("div", {
|
|
109
111
|
style: {
|
|
110
112
|
position: "absolute",
|
|
@@ -139,7 +141,7 @@ var GroupedSelect = function GroupedSelect(_ref) {
|
|
|
139
141
|
border: "1px solid #949494",
|
|
140
142
|
borderRadius: "4px"
|
|
141
143
|
}
|
|
142
|
-
}), Object.entries(groupedOptions).map(function (_ref2) {
|
|
144
|
+
}), (_Object$entries = Object.entries(groupedOptions)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(function (_ref2) {
|
|
143
145
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
144
146
|
pageTitle = _ref3[0],
|
|
145
147
|
options = _ref3[1];
|
|
@@ -151,7 +153,7 @@ var GroupedSelect = function GroupedSelect(_ref) {
|
|
|
151
153
|
backgroundColor: "#f5f5f5"
|
|
152
154
|
},
|
|
153
155
|
semibold: true
|
|
154
|
-
}, pageTitle), options.map(function (option) {
|
|
156
|
+
}, pageTitle !== null && pageTitle !== void 0 ? pageTitle : "N/A"), options.map(function (option) {
|
|
155
157
|
return /*#__PURE__*/React.createElement("div", {
|
|
156
158
|
key: option.value,
|
|
157
159
|
onClick: function onClick() {
|