tenjin-ui-kit 0.2.194 → 0.2.195
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.
|
@@ -12,7 +12,7 @@ var _styles = require("@mui/material/styles");
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _text = _interopRequireDefault(require("../text"));
|
|
15
|
-
var _excluded = ["label", "id", "fullWidth", "disableAutocomplete", "startIcon", "endIcon", "size", "error", "errorMessage", "isRequired", "isDisabled", "isPastDateDisabled", "readOnly", "helperText"];
|
|
15
|
+
var _excluded = ["label", "id", "fullWidth", "disableAutocomplete", "startIcon", "endIcon", "size", "error", "errorMessage", "isRequired", "isDisabled", "isPastDateDisabled", "readOnly", "helperText", "autoFocus", "onBlurDelay"];
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -37,6 +37,8 @@ var Input = function Input(_ref) {
|
|
|
37
37
|
isPastDateDisabled = _ref.isPastDateDisabled,
|
|
38
38
|
readOnly = _ref.readOnly,
|
|
39
39
|
helperText = _ref.helperText,
|
|
40
|
+
autoFocus = _ref.autoFocus,
|
|
41
|
+
onBlurDelay = _ref.onBlurDelay,
|
|
40
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
43
|
var theme = (0, _styles.useTheme)();
|
|
42
44
|
var minDate = new Date().toISOString().split("T")[0];
|
|
@@ -75,6 +77,12 @@ var Input = function Input(_ref) {
|
|
|
75
77
|
endAdornment: endIcon,
|
|
76
78
|
helperText: errorMessage,
|
|
77
79
|
disabled: isDisabled,
|
|
80
|
+
onBlur: function onBlur(e) {
|
|
81
|
+
setTimeout(function () {
|
|
82
|
+
rest.onBlur(e);
|
|
83
|
+
}, onBlurDelay || 100);
|
|
84
|
+
},
|
|
85
|
+
autoFocus: !!autoFocus ? rest.value ? rest.value : true : false,
|
|
78
86
|
inputProps: _objectSpread({
|
|
79
87
|
readOnly: readOnly ? "readOnly" : null
|
|
80
88
|
}, isPastDateDisabled && {
|
|
@@ -102,6 +110,12 @@ var Input = function Input(_ref) {
|
|
|
102
110
|
endAdornment: endIcon,
|
|
103
111
|
helperText: errorMessage,
|
|
104
112
|
error: true,
|
|
113
|
+
onBlur: function onBlur(e) {
|
|
114
|
+
setTimeout(function () {
|
|
115
|
+
rest.onBlur(e);
|
|
116
|
+
}, onBlurDelay || 100);
|
|
117
|
+
},
|
|
118
|
+
autoFocus: !!autoFocus ? rest.value ? rest.value : true : false,
|
|
105
119
|
inputProps: _objectSpread({
|
|
106
120
|
readOnly: readOnly ? "readOnly" : null
|
|
107
121
|
}, isPastDateDisabled && {
|
|
@@ -124,7 +138,9 @@ Input.propTypes = {
|
|
|
124
138
|
size: _propTypes.default.string,
|
|
125
139
|
isRequired: _propTypes.default.bool,
|
|
126
140
|
isDisabled: _propTypes.default.bool,
|
|
127
|
-
readOnly: _propTypes.default.bool
|
|
141
|
+
readOnly: _propTypes.default.bool,
|
|
142
|
+
// Added readOnly prop type
|
|
143
|
+
autoFocus: _propTypes.default.bool
|
|
128
144
|
};
|
|
129
145
|
var _default = Input;
|
|
130
146
|
exports.default = _default;
|
|
@@ -81,7 +81,10 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
81
81
|
if (isSearch) {
|
|
82
82
|
setNoDataAvailable(filteredOptions.length === 0);
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
var sortedOptions = filteredOptions.sort(function (a, b) {
|
|
85
|
+
return a.label.localeCompare(b.label);
|
|
86
|
+
});
|
|
87
|
+
return sortedOptions.map(function (option) {
|
|
85
88
|
return {
|
|
86
89
|
label: option.label,
|
|
87
90
|
value: option.value
|