tenjin-ui-kit 0.2.179 → 0.2.180
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.
|
@@ -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", "loading"];
|
|
13
|
+
var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading"];
|
|
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; }
|
|
@@ -28,6 +28,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
28
|
// import { Input } from "tenjin-ui-kit";
|
|
29
29
|
|
|
30
30
|
var SimpleSelect = function SimpleSelect(_ref) {
|
|
31
|
+
var _isClearOption;
|
|
31
32
|
var options = _ref.options,
|
|
32
33
|
errorMessage = _ref.errorMessage,
|
|
33
34
|
error = _ref.error,
|
|
@@ -37,10 +38,11 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
37
38
|
isRequired = _ref.isRequired,
|
|
38
39
|
helperText = _ref.helperText,
|
|
39
40
|
isSearch = _ref.isSearch,
|
|
41
|
+
isClearOption = _ref.isClearOption,
|
|
40
42
|
loading = _ref.loading,
|
|
41
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
44
|
isSearch = true; //by default
|
|
43
|
-
|
|
45
|
+
isClearOption = (_isClearOption = isClearOption) !== null && _isClearOption !== void 0 ? _isClearOption : true;
|
|
44
46
|
var _useState = (0, _react.useState)(""),
|
|
45
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
48
|
searchText = _useState2[0],
|
|
@@ -145,7 +147,7 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
145
147
|
e.stopPropagation();
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
|
-
}), !loading && /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
150
|
+
}), isClearOption && !loading && /*#__PURE__*/_react.default.createElement(_material.MenuItem, {
|
|
149
151
|
value: ""
|
|
150
152
|
}, /*#__PURE__*/_react.default.createElement("em", {
|
|
151
153
|
style: {
|