tenjin-ui-kit 0.3.11 → 0.3.13
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.
|
@@ -214,7 +214,20 @@ var ProjectTopbar = function ProjectTopbar(_ref) {
|
|
|
214
214
|
style: {
|
|
215
215
|
fontWeight: "600"
|
|
216
216
|
}
|
|
217
|
-
}, "Administration")), /*#__PURE__*/_react.default.createElement(
|
|
217
|
+
}, "Administration")), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
218
|
+
variant: "text",
|
|
219
|
+
startIcon: /*#__PURE__*/_react.default.createElement(_reactFeather.HelpCircle, {
|
|
220
|
+
size: "1rem"
|
|
221
|
+
}),
|
|
222
|
+
onClick: function onClick() {
|
|
223
|
+
window.open("/docs", "_blank");
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_text.default, {
|
|
226
|
+
variant: "subtitle1",
|
|
227
|
+
style: {
|
|
228
|
+
fontWeight: "600"
|
|
229
|
+
}
|
|
230
|
+
}, "Help")), /*#__PURE__*/_react.default.createElement(_system.Box, {
|
|
218
231
|
sx: {
|
|
219
232
|
marginLeft: theme.spacing(1)
|
|
220
233
|
}
|
|
@@ -10,7 +10,7 @@ var _material = require("@mui/material");
|
|
|
10
10
|
var _text = _interopRequireDefault(require("../text"));
|
|
11
11
|
var _Search = _interopRequireDefault(require("@mui/icons-material/Search"));
|
|
12
12
|
var _iconsMaterial = require("@mui/icons-material");
|
|
13
|
-
var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading", "isSort"];
|
|
13
|
+
var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading", "isSort", "placeholder"];
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -42,6 +42,7 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
42
42
|
isClearOption = _ref.isClearOption,
|
|
43
43
|
loading = _ref.loading,
|
|
44
44
|
isSort = _ref.isSort,
|
|
45
|
+
placeholder = _ref.placeholder,
|
|
45
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
47
|
isSort = (_isSort = isSort) !== null && _isSort !== void 0 ? _isSort : true; //by default true
|
|
47
48
|
isSearch = (_isSearch = isSearch) !== null && _isSearch !== void 0 ? _isSearch : true; //by default true
|
|
@@ -154,6 +155,21 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
154
155
|
color: "red"
|
|
155
156
|
}
|
|
156
157
|
}, " * ") : "")), /*#__PURE__*/_react.default.createElement(_material.Select, _extends({}, rest, {
|
|
158
|
+
displayEmpty: true // To display the placeholder
|
|
159
|
+
,
|
|
160
|
+
renderValue: function renderValue(selected) {
|
|
161
|
+
if (!selected) {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
163
|
+
style: {
|
|
164
|
+
color: "#acacac"
|
|
165
|
+
}
|
|
166
|
+
}, placeholder || "Select an option");
|
|
167
|
+
}
|
|
168
|
+
var selectedOption = options === null || options === void 0 ? void 0 : options.find(function (option) {
|
|
169
|
+
return (option === null || option === void 0 ? void 0 : option.value) === selected;
|
|
170
|
+
});
|
|
171
|
+
return selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label;
|
|
172
|
+
},
|
|
157
173
|
fullWidth: true,
|
|
158
174
|
onClose: function onClose() {
|
|
159
175
|
return setSearchText("");
|