tenjin-ui-kit 0.3.7 → 0.3.8
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", "isClearOption", "loading"];
|
|
13
|
+
var _excluded = ["options", "errorMessage", "error", "fullWidth", "isDisabled", "label", "isRequired", "helperText", "isSearch", "isClearOption", "loading", "isSort"];
|
|
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; }
|
|
@@ -29,7 +29,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
29
29
|
// import { Input } from "tenjin-ui-kit";
|
|
30
30
|
|
|
31
31
|
var SimpleSelect = function SimpleSelect(_ref) {
|
|
32
|
-
var _isSearch, _isClearOption;
|
|
32
|
+
var _isSort, _isSearch, _isClearOption;
|
|
33
33
|
var options = _ref.options,
|
|
34
34
|
errorMessage = _ref.errorMessage,
|
|
35
35
|
error = _ref.error,
|
|
@@ -41,7 +41,9 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
41
41
|
isSearch = _ref.isSearch,
|
|
42
42
|
isClearOption = _ref.isClearOption,
|
|
43
43
|
loading = _ref.loading,
|
|
44
|
+
isSort = _ref.isSort,
|
|
44
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
+
isSort = (_isSort = isSort) !== null && _isSort !== void 0 ? _isSort : true; //by default true
|
|
45
47
|
isSearch = (_isSearch = isSearch) !== null && _isSearch !== void 0 ? _isSearch : true; //by default true
|
|
46
48
|
isClearOption = (_isClearOption = isClearOption) !== null && _isClearOption !== void 0 ? _isClearOption : true; //by default true
|
|
47
49
|
|
|
@@ -110,7 +112,7 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
110
112
|
}
|
|
111
113
|
return "";
|
|
112
114
|
}
|
|
113
|
-
return sortedOptions.map(function (option) {
|
|
115
|
+
return (isSort ? sortedOptions : filteredOptions).map(function (option) {
|
|
114
116
|
return {
|
|
115
117
|
label: option === null || option === void 0 ? void 0 : option.label,
|
|
116
118
|
value: option === null || option === void 0 ? void 0 : option.value
|